(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-elementUI~b79e8adf"],{"299c":function(e,t,n){e.exports=function(e){var t={};function n(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(o,r,function(t){return e[t]}.bind(null,r));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=138)}({138:function(e,t,n){"use strict";n.r(t);var o=n(5),r=n.n(o),i=n(19),d=n.n(i),a=n(2),s=n(3),l=n(7),h=n.n(l),c={name:"ElTooltip",mixins:[r.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:"el-tooltip-"+Object(s["generateId"])(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new h.a({data:{node:""},render:function(e){return this.node}}).$mount(),this.debounceClose=d()(200,(function(){return e.handleClosePopper()})))},render:function(e){var t=this;this.popperVM&&(this.popperVM.node=e("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[e("div",{on:{mouseleave:function(){t.setExpectedState(!1),t.debounceClose()},mouseenter:function(){t.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var n=this.getFirstElement();if(!n)return null;var o=n.data=n.data||{};return o.staticClass=this.addTooltipClass(o.staticClass),n},mounted:function(){var e=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",this.tabindex),Object(a["on"])(this.referenceElm,"mouseenter",this.show),Object(a["on"])(this.referenceElm,"mouseleave",this.hide),Object(a["on"])(this.referenceElm,"focus",(function(){if(e.$slots.default&&e.$slots.default.length){var t=e.$slots.default[0].componentInstance;t&&t.focus?t.focus():e.handleFocus()}else e.handleFocus()})),Object(a["on"])(this.referenceElm,"blur",this.handleBlur),Object(a["on"])(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick((function(){e.value&&e.updatePopper()}))},watch:{focusing:function(e){e?Object(a["addClass"])(this.referenceElm,"focusing"):Object(a["removeClass"])(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(e){return e?"el-tooltip "+e.replace("el-tooltip",""):"el-tooltip"},handleShowPopper:function(){var e=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout((function(){e.showPopper=!0}),this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout((function(){e.showPopper=!1}),this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,n=0;n0&&o.lazy&&o.defaultExpandAll&&this.expand(),Array.isArray(this.data)||s(this,this.data),this.data){var d=o.defaultExpandedKeys,a=o.key;a&&d&&-1!==d.indexOf(this.key)&&this.expand(null,o.autoExpandParent),a&&void 0!==o.currentNodeKey&&this.key===o.currentNodeKey&&(o.currentNode=this,o.currentNode.isCurrent=!0),o.lazy&&o._initDefaultCheckedNode(this),this.updateLeafState()}}return e.prototype.setData=function(e){Array.isArray(e)||s(this,e),this.data=e,this.childNodes=[];var t=void 0;t=0===this.level&&this.data instanceof Array?this.data:v(this,"children")||[];for(var n=0,o=t.length;n1&&void 0!==arguments[1])||arguments[1],n=function n(o){for(var r=o.childNodes||[],i=!1,d=0,a=r.length;d-1&&t.splice(n,1);var o=this.childNodes.indexOf(e);o>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(o,1)),this.updateLeafState()},e.prototype.removeChildByData=function(e){for(var t=null,n=0;n0)o.expanded=!0,o=o.parent}n.expanded=!0,e&&e()};this.shouldLoadData()?this.loadData((function(e){e instanceof Array&&(n.checked?n.setChecked(!0,!0):n.store.checkStrictly||y(n),o())})):o()},e.prototype.doCreateChildren=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach((function(e){t.insertChild(d()({data:e},n),void 0,!0)}))},e.prototype.collapse=function(){this.expanded=!1},e.prototype.shouldLoadData=function(){return!0===this.store.lazy&&this.store.load&&!this.loaded},e.prototype.updateLeafState=function(){if(!0!==this.store.lazy||!0===this.loaded||"undefined"===typeof this.isLeafByUser){var e=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}else this.isLeaf=this.isLeafByUser},e.prototype.setChecked=function(e,t,n,o){var r=this;if(this.indeterminate="half"===e,this.checked=!0===e,!this.store.checkStrictly){if(!this.shouldLoadData()||this.store.checkDescendants){var i=p(this.childNodes),d=i.all,a=i.allWithoutDisable;this.isLeaf||d||!a||(this.checked=!1,e=!1);var s=function(){if(t){for(var n=r.childNodes,i=0,d=n.length;i0&&void 0!==arguments[0]&&arguments[0];if(0===this.level)return this.data;var t=this.data;if(!t)return null;var n=this.store.props,o="children";return n&&(o=n.children||"children"),void 0===t[o]&&(t[o]=null),e&&!t[o]&&(t[o]=[]),t[o]},e.prototype.updateChildren=function(){var e=this,t=this.getChildren()||[],n=this.childNodes.map((function(e){return e.data})),o={},r=[];t.forEach((function(e,t){var i=e[a],d=!!i&&Object(c["arrayFindIndex"])(n,(function(e){return e[a]===i}))>=0;d?o[i]={index:t,data:e}:r.push({index:t,data:e})})),this.store.lazy||n.forEach((function(t){o[t[a]]||e.removeChildByData(t)})),r.forEach((function(t){var n=t.index,o=t.data;e.insertChild({data:o},n)})),this.updateLeafState()},e.prototype.loadData=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(n).length)e&&e.call(this);else{this.loading=!0;var o=function(o){t.childNodes=[],t.doCreateChildren(o,n),t.loaded=!0,t.loading=!1,t.updateLeafState(),e&&e.call(t,o)};this.store.load(this,o)}},u(e,[{key:"label",get:function(){return v(this,"label")}},{key:"key",get:function(){var e=this.store.key;return this.data?this.data[e]:null}},{key:"disabled",get:function(){return v(this,"disabled")}},{key:"nextSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return e.childNodes[t+1]}return null}},{key:"previousSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}}]),e}(),m=C,k="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var x=function(){function e(t){var n=this;for(var o in b(this,e),this.currentNode=null,this.currentNodeKey=null,t)t.hasOwnProperty(o)&&(this[o]=t[o]);if(this.nodesMap={},this.root=new m({data:this.data,store:this}),this.lazy&&this.load){var r=this.load;r(this.root,(function(e){n.root.doCreateChildren(e),n._initDefaultCheckedNodes()}))}else this._initDefaultCheckedNodes()}return e.prototype.filter=function(e){var t=this.filterNodeMethod,n=this.lazy,o=function o(r){var i=r.root?r.root.childNodes:r.childNodes;if(i.forEach((function(n){n.visible=t.call(n,e,n.data,n),o(n)})),!r.visible&&i.length){var d=!0;d=!i.some((function(e){return e.visible})),r.root?r.root.visible=!1===d:r.visible=!1===d}e&&(!r.visible||r.isLeaf||n||r.expand())};o(this)},e.prototype.setData=function(e){var t=e!==this.root.data;t?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()},e.prototype.getNode=function(e){if(e instanceof m)return e;var t="object"!==("undefined"===typeof e?"undefined":k(e))?e:l(this.key,e);return this.nodesMap[t]||null},e.prototype.insertBefore=function(e,t){var n=this.getNode(t);n.parent.insertBefore({data:e},n)},e.prototype.insertAfter=function(e,t){var n=this.getNode(t);n.parent.insertAfter({data:e},n)},e.prototype.remove=function(e){var t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))},e.prototype.append=function(e,t){var n=t?this.getNode(t):this.root;n&&n.insertChild({data:e})},e.prototype._initDefaultCheckedNodes=function(){var e=this,t=this.defaultCheckedKeys||[],n=this.nodesMap;t.forEach((function(t){var o=n[t];o&&o.setChecked(!0,!e.checkStrictly)}))},e.prototype._initDefaultCheckedNode=function(e){var t=this.defaultCheckedKeys||[];-1!==t.indexOf(e.key)&&e.setChecked(!0,!this.checkStrictly)},e.prototype.setDefaultCheckedKey=function(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())},e.prototype.registerNode=function(e){var t=this.key;if(t&&e&&e.data){var n=e.key;void 0!==n&&(this.nodesMap[e.key]=e)}},e.prototype.deregisterNode=function(e){var t=this,n=this.key;n&&e&&e.data&&(e.childNodes.forEach((function(e){t.deregisterNode(e)})),delete this.nodesMap[e.key])},e.prototype.getCheckedNodes=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],o=function o(r){var i=r.root?r.root.childNodes:r.childNodes;i.forEach((function(r){(r.checked||t&&r.indeterminate)&&(!e||e&&r.isLeaf)&&n.push(r.data),o(r)}))};return o(this),n},e.prototype.getCheckedKeys=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCheckedNodes(t).map((function(t){return(t||{})[e.key]}))},e.prototype.getHalfCheckedNodes=function(){var e=[],t=function t(n){var o=n.root?n.root.childNodes:n.childNodes;o.forEach((function(n){n.indeterminate&&e.push(n.data),t(n)}))};return t(this),e},e.prototype.getHalfCheckedKeys=function(){var e=this;return this.getHalfCheckedNodes().map((function(t){return(t||{})[e.key]}))},e.prototype._getAllNodes=function(){var e=[],t=this.nodesMap;for(var n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e},e.prototype.updateChildren=function(e,t){var n=this.nodesMap[e];if(n){for(var o=n.childNodes,r=o.length-1;r>=0;r--){var i=o[r];this.remove(i.data)}for(var d=0,a=t.length;d1&&void 0!==arguments[1]&&arguments[1],n=arguments[2],o=this._getAllNodes().sort((function(e,t){return t.level-e.level})),r=Object.create(null),i=Object.keys(n);o.forEach((function(e){return e.setChecked(!1,!1)}));for(var d=0,a=o.length;d-1;if(h){var c=s.parent;while(c&&c.level>0)r[c.data[e]]=!0,c=c.parent;s.isLeaf||this.checkStrictly?s.setChecked(!0,!1):(s.setChecked(!0,!0),t&&function(){s.setChecked(!1,!1);var e=function e(t){var n=t.childNodes;n.forEach((function(t){t.isLeaf||t.setChecked(!1,!1),e(t)}))};e(s)}())}else s.checked&&!r[l]&&s.setChecked(!1,!1)}},e.prototype.setCheckedNodes=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.key,o={};e.forEach((function(e){o[(e||{})[n]]=!0})),this._setCheckedKeys(n,t,o)},e.prototype.setCheckedKeys=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.defaultCheckedKeys=e;var n=this.key,o={};e.forEach((function(e){o[e]=!0})),this._setCheckedKeys(n,t,o)},e.prototype.setDefaultExpandedKeys=function(e){var t=this;e=e||[],this.defaultExpandedKeys=e,e.forEach((function(e){var n=t.getNode(e);n&&n.expand(null,t.autoExpandParent)}))},e.prototype.setChecked=function(e,t,n){var o=this.getNode(e);o&&o.setChecked(!!t,n)},e.prototype.getCurrentNode=function(){return this.currentNode},e.prototype.setCurrentNode=function(e){var t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0},e.prototype.setUserCurrentNode=function(e){var t=e[this.key],n=this.nodesMap[t];this.setCurrentNode(n)},e.prototype.setCurrentNodeKey=function(e){if(null===e||void 0===e)return this.currentNode&&(this.currentNode.isCurrent=!1),void(this.currentNode=null);var t=this.getNode(e);t&&this.setCurrentNode(t)},e}(),N=x,w=function(){var e=this,t=this,n=t.$createElement,o=t._self._c||n;return o("div",{directives:[{name:"show",rawName:"v-show",value:t.node.visible,expression:"node.visible"}],ref:"node",staticClass:"el-tree-node",class:{"is-expanded":t.expanded,"is-current":t.node.isCurrent,"is-hidden":!t.node.visible,"is-focusable":!t.node.disabled,"is-checked":!t.node.disabled&&t.node.checked},attrs:{role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.draggable},on:{click:function(e){return e.stopPropagation(),t.handleClick(e)},contextmenu:function(t){return e.handleContextMenu(t)},dragstart:function(e){return e.stopPropagation(),t.handleDragStart(e)},dragover:function(e){return e.stopPropagation(),t.handleDragOver(e)},dragend:function(e){return e.stopPropagation(),t.handleDragEnd(e)},drop:function(e){return e.stopPropagation(),t.handleDrop(e)}}},[o("div",{staticClass:"el-tree-node__content",style:{"padding-left":(t.node.level-1)*t.tree.indent+"px"}},[o("span",{class:[{"is-leaf":t.node.isLeaf,expanded:!t.node.isLeaf&&t.expanded},"el-tree-node__expand-icon",t.tree.iconClass?t.tree.iconClass:"el-icon-caret-right"],on:{click:function(e){return e.stopPropagation(),t.handleExpandIconClick(e)}}}),t.showCheckbox?o("el-checkbox",{attrs:{indeterminate:t.node.indeterminate,disabled:!!t.node.disabled},on:{change:t.handleCheckChange},nativeOn:{click:function(e){e.stopPropagation()}},model:{value:t.node.checked,callback:function(e){t.$set(t.node,"checked",e)},expression:"node.checked"}}):t._e(),t.node.loading?o("span",{staticClass:"el-tree-node__loading-icon el-icon-loading"}):t._e(),o("node-content",{attrs:{node:t.node}})],1),o("el-collapse-transition",[!t.renderAfterExpand||t.childNodeRendered?o("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"el-tree-node__children",attrs:{role:"group","aria-expanded":t.expanded}},t._l(t.node.childNodes,(function(e){return o("el-tree-node",{key:t.getNodeKey(e),attrs:{"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:e},on:{"node-expand":t.handleChildNodeExpand}})})),1):t._e()])],1)},E=[];w._withStripped=!0;var _=n(28),S=n.n(_),K=n(18),O=n.n(K),D=n(4),$=n.n(D),T={name:"ElTreeNode",componentName:"ElTreeNode",mixins:[$.a],props:{node:{default:function(){return{}}},props:{},renderContent:Function,renderAfterExpand:{type:Boolean,default:!0},showCheckbox:{type:Boolean,default:!1}},components:{ElCollapseTransition:S.a,ElCheckbox:O.a,NodeContent:{props:{node:{required:!0}},render:function(e){var t=this.$parent,n=t.tree,o=this.node,r=o.data,i=o.store;return t.renderContent?t.renderContent.call(t._renderProxy,e,{_self:n.$vnode.context,node:o,data:r,store:i}):n.$scopedSlots.default?n.$scopedSlots.default({node:o,data:r}):e("span",{class:"el-tree-node__label"},[o.label])}}},data:function(){return{tree:null,expanded:!1,childNodeRendered:!1,oldChecked:null,oldIndeterminate:null}},watch:{"node.indeterminate":function(e){this.handleSelectChange(this.node.checked,e)},"node.checked":function(e){this.handleSelectChange(e,this.node.indeterminate)},"node.expanded":function(e){var t=this;this.$nextTick((function(){return t.expanded=e})),e&&(this.childNodeRendered=!0)}},methods:{getNodeKey:function(e){return l(this.tree.nodeKey,e.data)},handleSelectChange:function(e,t){this.oldChecked!==e&&this.oldIndeterminate!==t&&this.tree.$emit("check-change",this.node.data,e,t),this.oldChecked=e,this.indeterminate=t},handleClick:function(){var e=this.tree.store;e.setCurrentNode(this.node),this.tree.$emit("current-change",e.currentNode?e.currentNode.data:null,e.currentNode),this.tree.currentNode=this,this.tree.expandOnClickNode&&this.handleExpandIconClick(),this.tree.checkOnClickNode&&!this.node.disabled&&this.handleCheckChange(null,{target:{checked:!this.node.checked}}),this.tree.$emit("node-click",this.node.data,this.node,this)},handleContextMenu:function(e){this.tree._events["node-contextmenu"]&&this.tree._events["node-contextmenu"].length>0&&(e.stopPropagation(),e.preventDefault()),this.tree.$emit("node-contextmenu",e,this.node.data,this.node,this)},handleExpandIconClick:function(){this.node.isLeaf||(this.expanded?(this.tree.$emit("node-collapse",this.node.data,this.node,this),this.node.collapse()):(this.node.expand(),this.$emit("node-expand",this.node.data,this.node,this)))},handleCheckChange:function(e,t){var n=this;this.node.setChecked(t.target.checked,!this.tree.checkStrictly),this.$nextTick((function(){var e=n.tree.store;n.tree.$emit("check",n.node.data,{checkedNodes:e.getCheckedNodes(),checkedKeys:e.getCheckedKeys(),halfCheckedNodes:e.getHalfCheckedNodes(),halfCheckedKeys:e.getHalfCheckedKeys()})}))},handleChildNodeExpand:function(e,t,n){this.broadcast("ElTreeNode","tree-node-expand",t),this.tree.$emit("node-expand",e,t,n)},handleDragStart:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-start",e,this)},handleDragOver:function(e){this.tree.draggable&&(this.tree.$emit("tree-node-drag-over",e,this),e.preventDefault())},handleDrop:function(e){e.preventDefault()},handleDragEnd:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-end",e,this)}},created:function(){var e=this,t=this.$parent;t.isTree?this.tree=t:this.tree=t.tree;var n=this.tree;n||console.warn("Can not find node's tree.");var o=n.props||{},r=o["children"]||"children";this.$watch("node.data."+r,(function(){e.node.updateChildren()})),this.node.expanded&&(this.expanded=!0,this.childNodeRendered=!0),this.tree.accordion&&this.$on("tree-node-expand",(function(t){e.node!==t&&e.node.collapse()}))}},P=T,A=n(0),B=Object(A["a"])(P,w,E,!1,null,null,null);B.options.__file="packages/tree/src/tree-node.vue";var j=B.exports,I=n(20),M=n(2),L={name:"ElTree",mixins:[$.a],components:{ElTreeNode:j},data:function(){return{store:null,root:null,currentNode:null,treeItems:null,checkboxItems:[],dragState:{showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0}}},props:{data:{type:Array},emptyText:{type:String,default:function(){return Object(I["t"])("el.tree.emptyText")}},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{default:function(){return{children:"children",label:"label",disabled:"disabled"}}},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},iconClass:String},computed:{children:{set:function(e){this.data=e},get:function(){return this.data}},treeItemArray:function(){return Array.prototype.slice.call(this.treeItems)},isEmpty:function(){var e=this.root.childNodes;return!e||0===e.length||e.every((function(e){var t=e.visible;return!t}))}},watch:{defaultCheckedKeys:function(e){this.store.setDefaultCheckedKey(e)},defaultExpandedKeys:function(e){this.store.defaultExpandedKeys=e,this.store.setDefaultExpandedKeys(e)},data:function(e){this.store.setData(e)},checkboxItems:function(e){Array.prototype.forEach.call(e,(function(e){e.setAttribute("tabindex",-1)}))},checkStrictly:function(e){this.store.checkStrictly=e}},methods:{filter:function(e){if(!this.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");this.store.filter(e)},getNodeKey:function(e){return l(this.nodeKey,e.data)},getNodePath:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");var t=this.store.getNode(e);if(!t)return[];var n=[t.data],o=t.parent;while(o&&o!==this.root)n.push(o.data),o=o.parent;return n.reverse()},getCheckedNodes:function(e,t){return this.store.getCheckedNodes(e,t)},getCheckedKeys:function(e){return this.store.getCheckedKeys(e)},getCurrentNode:function(){var e=this.store.getCurrentNode();return e?e.data:null},getCurrentKey:function(){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");var e=this.getCurrentNode();return e?e[this.nodeKey]:null},setCheckedNodes:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");this.store.setCheckedNodes(e,t)},setCheckedKeys:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");this.store.setCheckedKeys(e,t)},setChecked:function(e,t,n){this.store.setChecked(e,t,n)},getHalfCheckedNodes:function(){return this.store.getHalfCheckedNodes()},getHalfCheckedKeys:function(){return this.store.getHalfCheckedKeys()},setCurrentNode:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");this.store.setUserCurrentNode(e)},setCurrentKey:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");this.store.setCurrentNodeKey(e)},getNode:function(e){return this.store.getNode(e)},remove:function(e){this.store.remove(e)},append:function(e,t){this.store.append(e,t)},insertBefore:function(e,t){this.store.insertBefore(e,t)},insertAfter:function(e,t){this.store.insertAfter(e,t)},handleNodeExpand:function(e,t,n){this.broadcast("ElTreeNode","tree-node-expand",t),this.$emit("node-expand",e,t,n)},updateKeyChildren:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");this.store.updateChildren(e,t)},initTabIndex:function(){this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]");var e=this.$el.querySelectorAll(".is-checked[role=treeitem]");e.length?e[0].setAttribute("tabindex",0):this.treeItems[0]&&this.treeItems[0].setAttribute("tabindex",0)},handleKeydown:function(e){var t=e.target;if(-1!==t.className.indexOf("el-tree-node")){var n=e.keyCode;this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]");var o=this.treeItemArray.indexOf(t),r=void 0;[38,40].indexOf(n)>-1&&(e.preventDefault(),r=38===n?0!==o?o-1:0:o-1&&(e.preventDefault(),t.click());var i=t.querySelector('[type="checkbox"]');[13,32].indexOf(n)>-1&&i&&(e.preventDefault(),i.click())}}},created:function(){var e=this;this.isTree=!0,this.store=new N({key:this.nodeKey,data:this.data,lazy:this.lazy,props:this.props,load:this.load,currentNodeKey:this.currentNodeKey,checkStrictly:this.checkStrictly,checkDescendants:this.checkDescendants,defaultCheckedKeys:this.defaultCheckedKeys,defaultExpandedKeys:this.defaultExpandedKeys,autoExpandParent:this.autoExpandParent,defaultExpandAll:this.defaultExpandAll,filterNodeMethod:this.filterNodeMethod}),this.root=this.store.root;var t=this.dragState;this.$on("tree-node-drag-start",(function(n,o){if("function"===typeof e.allowDrag&&!e.allowDrag(o.node))return n.preventDefault(),!1;n.dataTransfer.effectAllowed="move";try{n.dataTransfer.setData("text/plain","")}catch(r){}t.draggingNode=o,e.$emit("node-drag-start",o.node,n)})),this.$on("tree-node-drag-over",(function(n,o){var r=h(n.target,"ElTreeNode"),i=t.dropNode;i&&i!==r&&Object(M["removeClass"])(i.$el,"is-drop-inner");var d=t.draggingNode;if(d&&r){var a=!0,s=!0,l=!0,c=!0;"function"===typeof e.allowDrop&&(a=e.allowDrop(d.node,r.node,"prev"),c=s=e.allowDrop(d.node,r.node,"inner"),l=e.allowDrop(d.node,r.node,"next")),n.dataTransfer.dropEffect=s?"move":"none",(a||s||l)&&i!==r&&(i&&e.$emit("node-drag-leave",d.node,i.node,n),e.$emit("node-drag-enter",d.node,r.node,n)),(a||s||l)&&(t.dropNode=r),r.node.nextSibling===d.node&&(l=!1),r.node.previousSibling===d.node&&(a=!1),r.node.contains(d.node,!1)&&(s=!1),(d.node===r.node||d.node.contains(r.node))&&(a=!1,s=!1,l=!1);var u=r.$el.getBoundingClientRect(),f=e.$el.getBoundingClientRect(),p=void 0,y=a?s?.25:l?.45:1:-1,v=l?s?.75:a?.55:0:1,g=-9999,C=n.clientY-u.top;p=Cu.height*v?"after":s?"inner":"none";var m=r.$el.querySelector(".el-tree-node__expand-icon").getBoundingClientRect(),k=e.$refs.dropIndicator;"before"===p?g=m.top-f.top:"after"===p&&(g=m.bottom-f.top),k.style.top=g+"px",k.style.left=m.right-f.left+"px","inner"===p?Object(M["addClass"])(r.$el,"is-drop-inner"):Object(M["removeClass"])(r.$el,"is-drop-inner"),t.showDropIndicator="before"===p||"after"===p,t.allowDrop=t.showDropIndicator||c,t.dropType=p,e.$emit("node-drag-over",d.node,r.node,n)}})),this.$on("tree-node-drag-end",(function(n){var o=t.draggingNode,r=t.dropType,i=t.dropNode;if(n.preventDefault(),n.dataTransfer.dropEffect="move",o&&i){var d={data:o.node.data};"none"!==r&&o.node.remove(),"before"===r?i.node.parent.insertBefore(d,i.node):"after"===r?i.node.parent.insertAfter(d,i.node):"inner"===r&&i.node.insertChild(d),"none"!==r&&e.store.registerNode(d),Object(M["removeClass"])(i.$el,"is-drop-inner"),e.$emit("node-drag-end",o.node,i.node,r,n),"none"!==r&&e.$emit("node-drop",o.node,i.node,r,n)}o&&!i&&e.$emit("node-drag-end",o.node,null,r,n),t.showDropIndicator=!1,t.draggingNode=null,t.dropNode=null,t.allowDrop=!0}))},mounted:function(){this.initTabIndex(),this.$el.addEventListener("keydown",this.handleKeydown)},updated:function(){this.treeItems=this.$el.querySelectorAll("[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]")}},q=L,F=Object(A["a"])(q,o,r,!1,null,null,null);F.options.__file="packages/tree/src/tree.vue";var z=F.exports;z.install=function(e){e.component(z.name,z)};t["default"]=z},9:function(e,t){e.exports=n("7f4d")}})}}]);