module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "/dist/";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 84);
/******/ })
/************************************************************************/
/******/ ({

/***/ 0:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent (
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier, /* server only */
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options = typeof scriptExports === 'function'
    ? scriptExports.options
    : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) { // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
        injectStyles.call(
          this,
          (options.functional ? this.parent : this).$root.$options.shadowRoot
        )
      }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection (h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing
        ? [].concat(existing, hook)
        : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}


/***/ }),

/***/ 19:
/***/ (function(module, exports) {

module.exports = require("@ued_fpi/element-ui/lib/locale");

/***/ }),

/***/ 53:
/***/ (function(module, exports) {

module.exports = require("@ued_fpi/element-ui/lib/virtual-scroller");

/***/ }),

/***/ 84:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./packages/virtual-tree/src/main.vue?vue&type=template&id=da268002&
var render = function () {
  var _vm = this
  var _h = _vm.$createElement
  var _c = _vm._self._c || _h
  return _c(
    "div",
    { staticClass: "el-virtual-tree" },
    [
      _vm.filterData.length > 0
        ? _c("el-virtual-scroller", {
            ref: "virtualScroller",
            attrs: { data: _vm.filterData, ceilSize: _vm.ceilSize },
            scopedSlots: _vm._u([
              {
                key: "default",
                fn: function (scope) {
                  return [
                    _c(
                      "div",
                      {
                        class: [
                          "el-virtual-tree-ceil",
                          _vm.highlightCurrent
                            ? "el-virtual-tree--highlight-current"
                            : "",
                        ],
                      },
                      [
                        _c(
                          "div",
                          {
                            class: [
                              "el-virtual-tree-ceil__content",
                              scope.row.id === _vm.curNodeKey
                                ? "is-current"
                                : "",
                            ],
                            style: {
                              paddingLeft: scope.row.level * _vm.indent + "px",
                            },
                            on: {
                              click: function ($event) {
                                _vm.nodeClick(scope.row, scope.$index)
                              },
                            },
                          },
                          [
                            _c("i", {
                              class: [
                                _vm.iconClass
                                  ? _vm.iconClass
                                  : "el-icon-caret-right",
                                "el-virtual-tree-ceil-icon",
                                scope.row.isLeaf ? "is-leaf" : "",
                                !scope.row.isLeaf && scope.row.expanded
                                  ? "expanded"
                                  : "",
                              ],
                              on: {
                                click: function ($event) {
                                  $event.stopPropagation()
                                  _vm.toggleNodeExpandStatus(
                                    scope.row,
                                    scope.$index
                                  )
                                },
                              },
                            }),
                            _vm.showCheckbox
                              ? _c("el-checkbox", {
                                  attrs: {
                                    disabled: scope.row.disabled,
                                    indeterminate:
                                      !_vm.checkStrictly &&
                                      scope.row.indeterminate,
                                  },
                                  on: {
                                    change: function ($event) {
                                      _vm.handleNodeCheckChange(
                                        scope.row,
                                        scope.$index
                                      )
                                    },
                                  },
                                  nativeOn: {
                                    click: function ($event) {
                                      $event.stopPropagation()
                                    },
                                  },
                                  model: {
                                    value: scope.row.checked,
                                    callback: function ($$v) {
                                      _vm.$set(scope.row, "checked", $$v)
                                    },
                                    expression: "scope.row.checked",
                                  },
                                })
                              : _vm._e(),
                            _c("node-content", { attrs: { node: scope.row } }),
                          ],
                          1
                        ),
                      ]
                    ),
                  ]
                },
              },
            ]),
          })
        : _c("div", { staticClass: "el-virtual-tree__empty-block" }, [
            _c("span", { staticClass: "el-virtual-tree__empty-text" }, [
              _vm._v(_vm._s(_vm.emptyText)),
            ]),
          ]),
    ],
    1
  )
}
var staticRenderFns = []
render._withStripped = true


// CONCATENATED MODULE: ./packages/virtual-tree/src/main.vue?vue&type=template&id=da268002&

// EXTERNAL MODULE: external "@ued_fpi/element-ui/lib/virtual-scroller"
var virtual_scroller_ = __webpack_require__(53);
var virtual_scroller_default = /*#__PURE__*/__webpack_require__.n(virtual_scroller_);

// CONCATENATED MODULE: ./packages/virtual-tree/utils/node.js
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

var Node = function () {
  function Node(options) {
    _classCallCheck(this, Node);

    // for (let name in options) {
    //   if (options.hasOwnProperty(name)) {
    //     this[name] = options[name];
    //   }
    // }
    // 节点位移key
    this.id = options.id;
    // 节点自身的数据
    this.data = options.data;
    // 指定节点选择框是否禁用为节点对象的某个属性值
    this.disabled = options.disabled || false;
    // 是否勾选
    this.checked = false;
    // 是否展开
    this.expanded = options.expanded || false;
    // 是否选中
    this.isCurrent = options.isCurrent || false;
    // 节点层级
    this.level = options.level;
    // 是否为叶子节点
    this.isLeaf = options.isLeaf;
    // 父子节点相互关联状态
    this.indeterminate = false;
    // 父节点
    this.parent = options.parent || undefined;
    // 子节点
    this.childNodes = options.childNodes || [];
    // 子节点数量
    this.childNodesSize = this.childNodes.length;
    // 子节点选中的数量
    this.childrenCheckedSize = 0;
    // 节点显示状态
    this.visible = options.visible || false;
  }

  Node.prototype.addChildNodes = function addChildNodes(nodes) {
    this.childNodes = this.childNodes.concat(nodes);
    this.childNodesSize = this.childNodes.length;
  };
  // 设置节点是否为当前选择节点


  Node.prototype.setCurrentStatus = function setCurrentStatus(status) {
    if (status) {
      this.isCurrent = true;
    } else {
      this.isCurrent = false;
    }
  };
  /**
   * 切换节点展开状态
  */


  Node.prototype.toggleExpandStatus = function toggleExpandStatus() {
    return this.setExpandStatus(!this.expanded);
  };
  /**
   * 修改节点的展开状态
   * status: 节点展开状态
  */


  Node.prototype.setExpandStatus = function setExpandStatus(status) {
    // 如果前后状态相同，不处理
    // 如果节点本身是叶子结点，不处理
    if (this.isLeaf) {
      return;
    }

    this.expanded = status;

    if (status) {
      this.visible = true;
      // 由关闭到展开
      // 子节点根据其父节点状态设置是否可见
      for (var _iterator = this.childNodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
        var _ref;

        if (_isArray) {
          if (_i >= _iterator.length) break;
          _ref = _iterator[_i++];
        } else {
          _i = _iterator.next();
          if (_i.done) break;
          _ref = _i.value;
        }

        var item = _ref;

        if (item.parent.expanded && item.parent.visible) {
          item.visible = true;
        }
      }

      // 该节点展开，说明父节点一定是展开的
      if (this.parent) {
        this.parent.setExpandStatus(true);
      }
    } else {
      // 由展开到关闭
      // 所有孙子节点的可见状为false
      // 不需要更新祖先节点展开状态
      for (var _iterator2 = this.childNodes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
        var _ref2;

        if (_isArray2) {
          if (_i2 >= _iterator2.length) break;
          _ref2 = _iterator2[_i2++];
        } else {
          _i2 = _iterator2.next();
          if (_i2.done) break;
          _ref2 = _i2.value;
        }

        var _item = _ref2;

        _item.visible = false;
      }
    }
  };
  /**
   * 切换节点勾选状态
  */


  Node.prototype.toggleCheckedStatus = function toggleCheckedStatus(deep) {
    this.setCheckedStatus(!this.checked, deep);
  };
  /**
   * 设置节点的勾选状态，默认需要更新子节点选中
  */


  Node.prototype.setCheckedStatus = function setCheckedStatus(checked, deep) {
    var size = this.doSetCheckedStatus(checked, deep);
    // 更新父节点的子节点选中数量
    this.updateParnetCheckedSize(checked, size, deep);
  };
  /**
   * 设置节点的选中状态，默认不需要更新子节点选中
  */


  Node.prototype.doSetCheckedStatus = function doSetCheckedStatus(checked) {
    var deep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

    var changeSize = 0;
    // 判断前后状态是否一致
    if (this.checked !== checked) {
      this.checked = checked;
      changeSize++;
    }
    if (deep && this.childNodesSize > 0) {
      var childChangeSize = 0;
      // 修改子节点的选中状态
      for (var _iterator3 = this.childNodes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
        var _ref3;

        if (_isArray3) {
          if (_i3 >= _iterator3.length) break;
          _ref3 = _iterator3[_i3++];
        } else {
          _i3 = _iterator3.next();
          if (_i3.done) break;
          _ref3 = _i3.value;
        }

        var item = _ref3;

        childChangeSize += item.doSetCheckedStatus(checked, deep);
      }
      changeSize += childChangeSize;
      // 改变节点的子节点选中数量
      this.updateChildrenCheckedSize(checked, childChangeSize, deep, false);
    }
    return changeSize;
  };
  /**
   * 子节点选中数量变更
  */


  Node.prototype.updateChildrenCheckedSize = function updateChildrenCheckedSize(checked, size, deep) {
    var changeChecked = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;

    if (checked) {
      this.childrenCheckedSize += size;
    } else {
      this.childrenCheckedSize -= size;
    }
    if (deep) {
      if (changeChecked) {
        this.checked = this.childrenCheckedSize === this.childNodesSize;
      }
      this.indeterminate = this.childrenCheckedSize > 0 && this.childrenCheckedSize < this.childNodesSize;
    } else {
      this.indeterminate = this.childrenCheckedSize > 0 && this.childrenCheckedSize < this.childNodesSize;
    }
  };
  /**
   * 更新父节点的子节点选中数量
  */


  Node.prototype.updateParnetCheckedSize = function updateParnetCheckedSize(checked, size, deep) {
    var parent = this.parent;
    if (!parent) {
      return;
    }
    // 判断前后节点的勾选状态是否改变，
    // 若改变，节点状态变化的数量+1
    var oldChecked = parent.checked;
    parent.updateChildrenCheckedSize(checked, size, deep);
    var newChecked = parent.checked;
    if (newChecked === oldChecked) {
      parent.updateParnetCheckedSize(checked, size, deep);
    } else {
      parent.updateParnetCheckedSize(checked, size + 1, deep);
    }
  };
  /**
   * 获取所有子节点
   * deep: 是否需要孙子节点
  */


  Node.prototype.getChildNodes = function getChildNodes(deep) {
    var nodes = [];
    for (var _iterator4 = this.childNodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
      var _ref4;

      if (_isArray4) {
        if (_i4 >= _iterator4.length) break;
        _ref4 = _iterator4[_i4++];
      } else {
        _i4 = _iterator4.next();
        if (_i4.done) break;
        _ref4 = _i4.value;
      }

      var item = _ref4;

      nodes.push(item);
      if (deep) {
        nodes = nodes.concat(item.getChildNodes(deep));
      }
    }
    return nodes;
  };

  return Node;
}();

/* harmony default export */ var utils_node = (Node);
// EXTERNAL MODULE: external "@ued_fpi/element-ui/lib/locale"
var locale_ = __webpack_require__(19);

// CONCATENATED MODULE: ./packages/virtual-tree/utils/props.js



/* harmony default export */ var props = ({
  // 单个节点高度
  nodeHeight: {
    type: Number,
    default: 26
  },
  // 上下滚动冗余量
  redundancy: {
    type: Number,
    default: 10
  },
  /**
   * 以下为elemt-ui tree全部props，
   * 虚拟滚动树根据实际使用情况，不会实现所有props
   */
  data: {
    type: Array
  },
  emptyText: {
    type: String,
    default: function _default() {
      return Object(locale_["t"])('el.tree.emptyText');
    }
  },
  // renderAfterExpand: {
  //     type: Boolean,
  //     default: true,
  // },
  nodeKey: String,
  checkStrictly: Boolean,
  defaultExpandAll: Boolean,
  expandOnClickNode: {
    type: Boolean,
    default: true
  },
  checkOnClickNode: Boolean,
  checkDescendants: {
    type: Boolean,
    default: false
  },
  autoExpandParent: {
    type: Boolean,
    default: true
  },
  defaultCheckedKeys: {
    type: Array,
    default: function _default() {
      return [];
    }
  },
  defaultExpandedKeys: {
    type: Array,
    default: function _default() {
      return [];
    }
  },
  currentNodeKey: [String, Number],
  renderContent: Function,
  showCheckbox: {
    type: Boolean,
    default: false
  },
  draggable: {
    type: Boolean,
    default: false
  },
  allowDrag: Function,
  allowDrop: Function,
  props: {
    default: function _default() {
      return {
        children: 'children',
        label: 'label',
        disabled: 'disabled'
      };
    }
  },
  lazy: {
    type: Boolean,
    default: false
  },
  highlightCurrent: Boolean,
  load: Function,
  filterNodeMethod: Function,
  accordion: Boolean,
  indent: {
    type: Number,
    default: 18
  },
  iconClass: String
});
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./packages/virtual-tree/src/main.vue?vue&type=script&lang=js&
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };

var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//






/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'ElVirtualTree',
  props: props,
  data: function data() {
    return {
      flatData: [], // 扁平化数据结构
      filterData: [], // 根据展开的节点和filter筛选后的数据
      curNodeKey: this.currentNodeKey, // 当前选中的节点key
      keyMapping: {}, // 节点key索引 每次初始化flatData都重置keymapping，可认为keyMappinbg中有值，flatData既有对应的节点
      searchMapping: undefined, // 符合检索结果的节点key
      ceilSize: 26 // 单个元素的高度
    };
  },

  computed: {
    mergeProps: function mergeProps() {
      return _extends({
        children: 'children',
        label: 'label',
        disabled: 'disabled'
      }, this.props);
    }
  },
  components: {
    ElVirtualScroller: virtual_scroller_default.a,
    NodeContent: {
      props: {
        node: {
          required: true
        }
      },
      render: function render(h) {
        var parent = this.$parent.$parent.$parent;
        var node = this.node;
        var data = node.data;
        var label = data[parent.props.label];
        return parent.renderContent ? parent.renderContent.call(parent._renderProxy, h, { node: node, data: data }) : h(
          'span',
          { 'class': 'el-virtual-tree-ceil-text' },
          [label]
        );
      }
    }
  },
  watch: {
    data: {
      handler: function handler() {
        this.init();
      },

      deep: true
    },
    // 监听当前选中节点变化
    currentNodeKey: function currentNodeKey() {
      this.curNodeKey = this.currentNodeKey;
      this.setCurrentKey(this.currentNodeKey);
    }
  },
  created: function created() {
    this.init();
  },

  methods: {
    /**
     * 1.将树结构数据扁平化
     * 2.筛选出需要展示的数据
     * 3.设置节点选中状态
     * 3.根据父子节点相互关联，设置节点选中
    */
    init: function init() {
      // 初始化书数据
      if (Array.isArray(this.data)) {
        var data = this.treeDataToFlatData(this.data);
        this.flatData = data;
      } else {
        var _data = this.treeDataToFlatData([this.data]);
        this.flatData = _data;
      }
      // 设置当前节点
      this.setCurrentKey(this.curNodeKey);

      // 设置展开节点
      if (!this.defaultExpandAll) {
        for (var _iterator = this.defaultExpandedKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) {
          var _ref;

          if (_isArray) {
            if (_i >= _iterator.length) break;
            _ref = _iterator[_i++];
          } else {
            _i = _iterator.next();
            if (_i.done) break;
            _ref = _i.value;
          }

          var key = _ref;

          if (this.keyMapping.hasOwnProperty(key)) {
            this.flatData[this.keyMapping[key]].setExpandStatus(true);
          }
        }
      }
      // 设置节点的选中状态
      this.setCheckedKeys(this.defaultCheckedKeys);
      // 筛选需要的数据
      this.getFilterDataByFlatData();
    },

    /**
    * 将树结构数据，转为扁平结构(数组形式)
    */
    treeDataToFlatData: function treeDataToFlatData(data) {
      var _this = this;

      // 每次初始化flatData都重置keymapping
      // 可认为keyMappinbg中有值，flatData既有对应的节点
      this.keyMapping = {};
      var originalIndex = 0;
      // data: 数据
      // parent：父对象
      // level：层级
      var handleNodeData = function handleNodeData(child) {
        var parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
        var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;

        // 扁平化数据
        var fData = [];
        // 当前层级节点
        var directNodes = [];
        for (var _iterator2 = child, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
          var _ref2;

          if (_isArray2) {
            if (_i2 >= _iterator2.length) break;
            _ref2 = _iterator2[_i2++];
          } else {
            _i2 = _iterator2.next();
            if (_i2.done) break;
            _ref2 = _i2.value;
          }

          var item = _ref2;

          var nodeKey = item[_this.nodeKey];
          var children = item[_this.mergeProps.children];
          _this.keyMapping[nodeKey] = originalIndex++;
          var isLeaf = true;
          // 判断是否有子节点,且子节点为数组，且子节点长度大于0
          if (children && Array.isArray(children) && children.length > 0) {
            isLeaf = false;
          }

          var node = new utils_node({
            id: nodeKey,
            label: item[_this.mergeProps.label],
            data: item,
            disabled: item[_this.mergeProps.disabled],
            expanded: _this.defaultExpandAll,
            level: level,
            isLeaf: isLeaf,
            parent: parent,
            visible: _this.defaultExpandAll || !parent // 只有展开全部时或者节点为顶层节点时，默认为可见
          });
          // 所有子节点
          var childNodes = [];
          // 所有直接子节点
          // 是否有子节点
          if (!isLeaf) {
            var cData = handleNodeData(children, node, level + 1);
            childNodes = cData;
          }
          node.addChildNodes(childNodes);
          directNodes.push(node);
          fData.push(node);
          fData = fData.concat(childNodes);
        }
        return fData;
      };

      return handleNodeData(data);
    },


    /**
     * 根据展开的节点,筛选flatData中的数据
     * */
    getFilterDataByFlatData: function getFilterDataByFlatData() {
      var _this2 = this;

      // 如果当前有检索
      if (this.searchMapping) {
        this.filterData = this.flatData.filter(function (item) {
          return item.visible && _this2.searchMapping[item.id];
        });
      } else {
        this.filterData = this.flatData.filter(function (item) {
          return item.visible;
        });
      }
    },

    /**
     * 节点点击事件
     * node：节点信息
     * indx: 节点在data中的索引
    */
    nodeClick: function nodeClick(node, index) {
      // 节点点击，触发以下几个行为
      // 1.将节点置为当前节点
      this.setCurrentNode(node);
      // 2.根据配置expand-on-click-node是否需要展开或者收起节点
      if (this.expandOnClickNode && !node.isLeaf) {
        this.toggleNodeExpandStatus(node, index);
      }
      // 3.根据配置show-checkbox和check-on-click-node以及当前节点未被禁用是否需要选中节点
      if (this.showCheckbox && this.checkOnClickNode && !node.disabled) {
        this.handleNodeCheckChange(node, index, false);
      }
      this.$emit('node-click', node.data, node, this);
    },

    /**
     * 对树节点进行筛选操作
     * 接收一个任意类型的参数，该参数会在 filter-node-method 中作为第一个参数
    */
    filter: function filter(text) {
      if (!this.filterNodeMethod) {
        console.error('缺少filter-node-method方法');
        return;
      }
      if (text) {
        this.searchMapping = {};
        // 遍历所有节点，对于不符合筛选的置为不可见
        for (var _iterator3 = this.flatData, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
          var _ref3;

          if (_isArray3) {
            if (_i3 >= _iterator3.length) break;
            _ref3 = _iterator3[_i3++];
          } else {
            _i3 = _iterator3.next();
            if (_i3.done) break;
            _ref3 = _i3.value;
          }

          var item = _ref3;

          if (this.filterNodeMethod(text, item.data, item)) {
            this.searchMapping[item.id] = true; // item.id已经在init处理过
            // 将其祖先节点加入到searchMapping中
            // 将其祖先节点的展开状态置为true
            var parent = item.parent;
            parent.setExpandStatus(true);
            while (parent && !this.searchMapping[parent.id]) {
              this.searchMapping[parent.id] = true;
              parent = parent.parent;
            }
          }
        }
      } else {
        this.searchMapping = undefined;
      }
      this.getFilterDataByFlatData();
    },

    /**
     * 获取当前被选中节点的 key，使用此方法必须设置 node-key 属性，若没有节点被选中则返回 null
    */
    getCurrentKey: function getCurrentKey() {
      return this.curNodeKey;
    },

    /**
     * 通过 key 设置某个节点的当前选中状态，使用此方法必须设置 node-key 属性
     * (key) 待被选节点的 key，若为 null 则取消当前高亮的节点
    */
    setCurrentKey: function setCurrentKey(key) {
      // key为null
      if (!key) {
        if (this.curNodeKey && this.keyMapping.hasOwnProperty(this.curNodeKey)) {
          // 将上一次的节点位置未选中
          this.flatData[this.keyMapping[this.curNodeKey]].setCurrentStatus(false);
        }
        this.curNodeKey = null;
        return;
      }
      // 如果和之前选中的节点相同，不处理
      if (key !== this.curNodeKey) {
        if (this.curNodeKey && this.keyMapping.hasOwnProperty(this.curNodeKey)) {
          // 将上一次的节点位置未选中
          this.flatData[this.keyMapping[this.curNodeKey]].setCurrentStatus(false);
        }

        // 判断是否包含该节点
        if (this.keyMapping.hasOwnProperty(key)) {
          // 找到对应的节点
          var node = this.flatData[this.keyMapping[key]];
          node.setCurrentStatus(true);
          // 保存新的key值
          this.curNodeKey = key;
          this.$emit('current-change', node.data, node);
        }
      }
    },

    /**
     * 获取当前被选中节点的 data，若没有节点被选中则返回 null
    */
    getCurrentNode: function getCurrentNode() {
      if (this.curNodeKey && this.keyMapping.hasOwnProperty(this.curNodeKey)) {
        return this.flatData[this.keyMapping[this.curNodeKey]];
      }
      return null;
    },

    /**
     * 通过 node 设置某个节点的当前选中状态，使用此方法必须设置 node-key 属性
     * (node) 待被选节点的 node
    */
    setCurrentNode: function setCurrentNode(node) {
      this.setCurrentKey(node.id);
    },

    /**
     * 通过 keys 设置目前勾选的节点，使用此方法必须设置 node-key 属性
     * (keys, leafOnly) 接收两个参数，1. 勾选节点的 key 的数组 2. boolean 类型的参数，若为 true 则仅设置叶子节点的选中状态，默认值为 false
    */
    setCheckedKeys: function setCheckedKeys(keys) {
      var leafOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;

      // 先清除其他节点选中
      // 找到所有顶级节点
      var topNodes = this.flatData.filter(function (item) {
        return !item.parent;
      });
      for (var _iterator4 = topNodes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
        var _ref4;

        if (_isArray4) {
          if (_i4 >= _iterator4.length) break;
          _ref4 = _iterator4[_i4++];
        } else {
          _i4 = _iterator4.next();
          if (_i4.done) break;
          _ref4 = _i4.value;
        }

        var item = _ref4;

        // 清除节点选中
        item.setCheckedStatus(false, true);
      }
      this.setNodeCheckedStatus(keys, true, !this.checkStrictly, leafOnly);
    },

    /**
     * 	若节点可被选择（即 show-checkbox 为 true），则返回目前被选中的节点的 key 所组成的数组
     * (leafOnly) 接收一个 boolean 类型的参数，若为 true 则仅返回被选中的叶子节点的 keys，默认值为 false
    */
    getCheckedKeys: function getCheckedKeys() {
      var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;

      if (!this.showCheckbox) {
        return;
      }
      var keys = [];
      if (leafOnly) {
        for (var _iterator5 = this.flatData, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
          var _ref5;

          if (_isArray5) {
            if (_i5 >= _iterator5.length) break;
            _ref5 = _iterator5[_i5++];
          } else {
            _i5 = _iterator5.next();
            if (_i5.done) break;
            _ref5 = _i5.value;
          }

          var item = _ref5;

          if (item.checked && item.isLeaf) {
            keys.push(item.id);
          }
        }
      } else {
        for (var _iterator6 = this.flatData, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
          var _ref6;

          if (_isArray6) {
            if (_i6 >= _iterator6.length) break;
            _ref6 = _iterator6[_i6++];
          } else {
            _i6 = _iterator6.next();
            if (_i6.done) break;
            _ref6 = _i6.value;
          }

          var _item = _ref6;

          if (_item.checked) {
            keys.push(_item.id); // 这里的id已经处理过，对应nodeKey
          }
        }
      }
      return keys;
    },

    /**
     * 设置目前勾选的节点，使用此方法必须设置 node-key 属性
     * (nodes) 接收勾选节点数据的数组
    */
    setCheckedNodes: function setCheckedNodes(nodes) {
      var _this3 = this;

      var keys = nodes.map(function (item) {
        return item[_this3.nodeKey];
      });
      this.setCheckedKeys(keys);
    },

    /**
     * 	若节点可被选择（即 show-checkbox 为 true），则返回目前被选中的节点所组成的数组
     * (leafOnly, includeHalfChecked) 接收两个 boolean 类型的参数，1. 是否只是叶子节点，默认值为 false 2. 是否包含半选节点，默认值为 false
    */
    getCheckedNodes: function getCheckedNodes() {
      var leafOnly = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var includeHalfChecked = arguments[1];

      if (!this.showCheckbox) {
        return;
      }
      var nodes = void 0;
      if (leafOnly) {
        // 如果只查询叶子节点，不需要考虑是否包含半选节点，因为叶子节点不存在半选
        nodes = this.flatData.filter(function (item) {
          return item.isLeaf && item.checked;
        });
      } else {
        if (includeHalfChecked) {
          // 当父级节点相互不关联时，不存在半选节点
          if (this.checkStrictly) {
            nodes = this.flatData.filter(function (item) {
              return item.checked;
            });
          } else {
            nodes = this.flatData.filter(function (item) {
              return item.checked || item.childrenCheckedSize > 0;
            });
          }
        } else {
          nodes = this.flatData.filter(function (item) {
            return item.checked;
          });
        }
      }
      return nodes;
    },

    /**
     * 	通过 key / data 设置某个节点的勾选状态，使用此方法必须设置 node-key 属性
     * (key/data, checked, deep) 接收三个参数，1. 勾选节点的 key 或者 data 2. boolean 类型，节点是否选中 3. boolean 类型，是否设置子节点 ，默认为 false
    */
    setChecked: function setChecked(data, checked, deep) {
      // 找到节点key
      if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {
        data = data[this.nodeKey];
      }
      // 修改节点状态
      this.setNodeCheckedStatus([data], checked, deep);
    },

    /**
     * node:需要改变的节点
     * checked:节点勾选状态
     * deep:是否设置子节点
    */
    setNodeCheckedStatus: function setNodeCheckedStatus(keys, checked, deep) {
      var leafOnly = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;

      // 记录所有节点的选中状态
      var checkedMapping = {};
      for (var _iterator7 = this.flatData, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
        var _ref7;

        if (_isArray7) {
          if (_i7 >= _iterator7.length) break;
          _ref7 = _iterator7[_i7++];
        } else {
          _i7 = _iterator7.next();
          if (_i7.done) break;
          _ref7 = _i7.value;
        }

        var fItem = _ref7;

        checkedMapping[fItem.id] = fItem.checked;
      }

      if (leafOnly) {
        // 记录非叶子节点，后面需要将其选中去除
        // 不在for循环里去除的原因：如果该节点的子节点也被设置了勾选，
        // 在父子节点相互关联的情况下，该节点会再次被选中
        var nonLeafNodes = [];
        for (var _iterator8 = keys, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
          var _ref8;

          if (_isArray8) {
            if (_i8 >= _iterator8.length) break;
            _ref8 = _iterator8[_i8++];
          } else {
            _i8 = _iterator8.next();
            if (_i8.done) break;
            _ref8 = _i8.value;
          }

          var item = _ref8;

          if (this.keyMapping.hasOwnProperty(item)) {
            var node = this.flatData[this.keyMapping[item]];
            node.setCheckedStatus(checked, deep);
            if (!node.isLeaf) {
              nonLeafNodes.push(node);
            }
          }
        }
        // 移除非叶子节点的选中
        for (var _iterator9 = nonLeafNodes, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
          var _ref9;

          if (_isArray9) {
            if (_i9 >= _iterator9.length) break;
            _ref9 = _iterator9[_i9++];
          } else {
            _i9 = _iterator9.next();
            if (_i9.done) break;
            _ref9 = _i9.value;
          }

          var nonLeafItem = _ref9;

          nonLeafItem.setCheckedStatus(!checked, false);
        }
      } else {
        for (var _iterator10 = keys, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
          var _ref10;

          if (_isArray10) {
            if (_i10 >= _iterator10.length) break;
            _ref10 = _iterator10[_i10++];
          } else {
            _i10 = _iterator10.next();
            if (_i10.done) break;
            _ref10 = _i10.value;
          }

          var _item2 = _ref10;

          if (this.keyMapping.hasOwnProperty(_item2)) {
            this.flatData[this.keyMapping[_item2]].setCheckedStatus(checked, deep);
          }
        }
      }

      // 所有节点新的选中状态，和之前的记录值比对，用于通知节点选中改变
      for (var _iterator11 = this.flatData, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) {
        var _ref11;

        if (_isArray11) {
          if (_i11 >= _iterator11.length) break;
          _ref11 = _iterator11[_i11++];
        } else {
          _i11 = _iterator11.next();
          if (_i11.done) break;
          _ref11 = _i11.value;
        }

        var _item3 = _ref11;

        if (checkedMapping[_item3.id] !== _item3.checked) {
          this.$emit('check-change', _item3.data, _item3, this);
        }
      }
    },

    /**
     * 若节点可被选择（即 show-checkbox 为 true），则返回目前半选中的节点所组成的数组
    */
    getHalfCheckedNodes: function getHalfCheckedNodes() {
      if (!this.showCheckbox) {
        return;
      }
      // 父级节点不相互关联，半选一定为空
      if (this.checkStrictly) {
        return [];
      }
      return this.flatData.filter(function (item) {
        return !item.checked && item.childrenCheckedSize > 0;
      });
    },

    /**
     * 若节点可被选择（即 show-checkbox 为 true），则返回目前半选中的节点的 key 所组成的数组
    */
    getHalfCheckedKeys: function getHalfCheckedKeys() {
      if (!this.showCheckbox) {
        return;
      }
      // 父级节点不相互关联，半选一定为空
      if (this.checkStrictly) {
        return [];
      }
      var keys = [];
      for (var _iterator12 = this.flatData, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) {
        var _ref12;

        if (_isArray12) {
          if (_i12 >= _iterator12.length) break;
          _ref12 = _iterator12[_i12++];
        } else {
          _i12 = _iterator12.next();
          if (_i12.done) break;
          _ref12 = _i12.value;
        }

        var item = _ref12;

        if (!item.checked && item.childrenCheckedSize > 0) {
          keys.push(item.id); // 这里的id已经处理过，对应nodeKey
        }
      }
      return keys;
    },

    /**
     * 展开/收缩子节点
    */
    toggleNodeExpandStatus: function toggleNodeExpandStatus(node, scrollIndex) {
      var expanded = node.expanded;
      // 如果当前处于检索状态，不需要改变子节点的可见状态
      node.toggleExpandStatus();
      if (expanded) {
        this.$emit('node-expand', node.data, node, this);
      } else {
        this.$emit('node-collapse', node.data, node, this);
      }
      // 更新filterData数据
      this.getFilterDataByFlatData();
    },

    /**
     * 根据 data 或者 key 拿到 Tree 组件中的 node
     * (data) 要获得 node 的 key 或者 data
    */
    getNode: function getNode(data) {
      if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') {
        data = data[this.nodeKey];
      }
      if (this.keyMapping.hasOwnProperty(data)) {
        return this.flatData[this.keyMapping[data]];
      }
      return;
    },

    /**
     * 节点勾选状态处理
    */
    handleNodeCheckChange: function handleNodeCheckChange(node, index) {
      var needNegation = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;

      // 因直接点击复选框，会改变node的勾选状态，这里需要先取反，再执行toggle
      // 通过点击节点触发的，不需要
      if (needNegation) {
        node.checked = !node.checked;
      }
      node.toggleCheckedStatus(!this.checkStrictly);
      if (needNegation) {
        var checkedNodes = this.getCheckedNodes();
        var checkedKeys = this.getCheckedKeys();
        var halfCheckedNodes = this.getHalfCheckedNodes();
        var halfCheckedKeys = this.getHalfCheckedKeys();
        this.$emit('check', node.data, {
          checkedNodes: checkedNodes,
          checkedKeys: checkedKeys,
          halfCheckedNodes: halfCheckedNodes,
          halfCheckedKeys: halfCheckedKeys
        });
      }
    },

    /**
     * 获取滚动条距离顶部的高度
    */
    getScrollTop: function getScrollTop() {
      if (!this.$refs.virtualScroller) return;
      return this.$refs.virtualScroller.getScrollTop();
    },

    /**
     * 设置滚动条距离顶部的高度，默认为0
    */
    setScrollTop: function setScrollTop() {
      var distance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;

      if (!this.$refs.virtualScroller) return;
      this.$refs.virtualScroller.setScrollTop(distance);
    },

    /**
     * 获取指定节点距离顶部的高度
    */
    getNodeTop: function getNodeTop(data) {
      if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') data = data[this.nodeKey];
      var nodeIndex = void 0;
      // 找到该节点在可视节点中的索引
      for (var i = 0; i < this.filterData.length; i++) {
        if (this.filterData[i][this.nodeKey] === data) {
          nodeIndex = i;
          break;
        }
      }
      if (typeof nodeIndex !== 'undefined' && this.$refs.virtualScroller) {
        return nodeIndex * this.ceilSize - this.$refs.virtualScroller.getScrollTop();
      }
      return;
    },

    /**
     * 设置指定节点距离顶部的高度(该节点必须可见)
    */
    setNodeTop: function setNodeTop(data) {
      var distance = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;

      if ((typeof data === 'undefined' ? 'undefined' : _typeof(data)) === 'object') data = data[this.nodeKey];
      var nodeIndex = void 0;
      // 找到该节点在可视节点中的索引
      for (var i = 0; i < this.filterData.length; i++) {
        if (this.filterData[i][this.nodeKey] === data) {
          nodeIndex = i;
          break;
        }
      }
      if (typeof nodeIndex !== 'undefined' && this.$refs.virtualScroller) {
        this.$refs.virtualScroller.setScrollTop(nodeIndex * this.ceilSize - Number(distance));
      }
    }
  }
});
// CONCATENATED MODULE: ./packages/virtual-tree/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(0);

// CONCATENATED MODULE: ./packages/virtual-tree/src/main.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* hot reload */
if (false) { var api; }
component.options.__file = "packages/virtual-tree/src/main.vue"
/* harmony default export */ var main = (component.exports);
// CONCATENATED MODULE: ./packages/virtual-tree/index.js


/* istanbul ignore next */
main.install = function (Vue) {
  Vue.component(main.name, main);
};

/* harmony default export */ var virtual_tree = __webpack_exports__["default"] = (main);

/***/ })

/******/ });