From 0f9928a79f2b3480821d8d805960b1e90c7463a3 Mon Sep 17 00:00:00 2001 From: ChuChencheng Date: Wed, 15 Apr 2020 18:18:03 +0800 Subject: [PATCH] doc: Update demo --- docs/index.html | 2 +- docs/js/{main.647a3555.js => main.a980790b.js} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename docs/js/{main.647a3555.js => main.a980790b.js} (68%) diff --git a/docs/index.html b/docs/index.html index 301f968..e7a3086 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -ctree
\ No newline at end of file +ctree
\ No newline at end of file diff --git a/docs/js/main.647a3555.js b/docs/js/main.a980790b.js similarity index 68% rename from docs/js/main.647a3555.js rename to docs/js/main.a980790b.js index b8783f2..920ed4e 100644 --- a/docs/js/main.647a3555.js +++ b/docs/js/main.a980790b.js @@ -1 +1 @@ -(function(e){function t(t){for(var a,s,o=t[0],l=t[1],c=t[2],h=0,u=[];h1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var r in d(this,e),this._keyField=a,this._remote=i,this._level=0,this.checked=!1,this.selected=!1,this.indeterminate=!1,this.disabled=!1,this.expand=!1,this.visible=!0,this._filterVisible=!0,this._parent=null,this.children=[],this.isLeaf=!1,this._loading=!1,this._loaded=!1,t)-1===p.indexOf(r)&&(this[r]=t[r]);null==this[a]&&(this[a]=Math.random().toString(36).substring(2)),this._parent=n,this._parent&&(this._level=this._parent._level+1),this.visible=null===this._parent||this._parent.expand&&this._parent.visible,Array.isArray(t.children)&&this.setChildren(t.children),this.children.length&&(this._loaded=!0),this._remote||(this.isLeaf=!this.children.length)}return u(e,[{key:"setChildren",value:function(t){var n=this;this.children=t.map((function(t){return new e(Object.assign({},t),n,n._keyField,n._remote)}))}}]),e}();(function(e){e["none"]="none",e["parents"]="parents",e["children"]="children"})(f||(f={}));var g,b,y,m=["setData","setChecked","setCheckedKeys","checkAll","clearChecked","setSelected","clearSelected","setExpand","setExpandKeys","setExpandAll","getCheckedNodes","getCheckedKeys","getIndeterminateNodes","getSelectedNode","getSelectedKey","getExpandNodes","getExpandKeys","getCurrentVisibleNodes","getNode","getTreeData","getFlatData","getNodesCount","insertBefore","insertAfter","append","prepend","remove","filter","showCheckedNodes","loadRootNodes","scrollTo"],k=["clearKeyword","getKeyword","search"];function _(e){return _="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},_(e)}function C(e){return x(e)||w(e)||S()}function S(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function w(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function x(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(var i in this.data=e.map((function(e){return new v(e,null,t.options.keyField,!!t.options.load)})),this.mapData)delete this.mapData[i];this.currentSelectedKey=null,this.flatData=this.flattenData(this.data),this.setUnloadCheckedKeys(a||[]),n&&(this.currentSelectedKey=null,this.setUnloadSelectedKey(n)),this.emit("visible-data-change"),this.emit("set-data")}},{key:"setChecked",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=this.mapData[e];if(!r)return this.setUnloadChecked(e,t,n,a);r.disabled||r.checked&&t||(r.checked||r.indeterminate||t)&&(this.options.cascade?(this.checkNodeDownward(r,t,i),this.checkNodeUpward(r)):r.checked=t,n&&(r.checked?this.emit("check",r):this.emit("uncheck",r)),this.triggerCheckedChange(n,a))}},{key:"setUnloadChecked",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.findIndex(e,this.unloadCheckedKeys);t?-1===i&&this.unloadCheckedKeys.push(e):-1!==i&&this.unloadCheckedKeys.splice(i,1),this.triggerCheckedChange(n,a)}},{key:"setCheckedKeys",value:function(e,t){var n=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e.forEach((function(e){n.setChecked(e,t,!1,!1)})),this.triggerCheckedChange(a,i)}},{key:"checkAll",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.options.cascade){var a=function t(n){n.forEach((function(n){n.disabled?t(n.children):e.setChecked(n[e.options.keyField],!0,!1,!1)}))};a(this.data)}else for(var i=this.flatData.length,r=0;r0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=this.getCheckedNodes();a.forEach((function(t){e.setChecked(t[e.options.keyField],!1,!1,!1)})),this.unloadCheckedKeys=[],this.triggerCheckedChange(t,n)}},{key:"triggerCheckedChange",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&this.emit("checked-change",this.getCheckedNodes(),this.getCheckedKeys()),t&&this.emit("render-data-change")}},{key:"setSelected",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.mapData[e];if(!i)return this.setUnloadSelected(e,t,n,a);i.disabled||i.selected!==t&&(e===this.currentSelectedKey?t||(i.selected=t,this.currentSelectedKey=null):t&&(null===this.currentSelectedKey?(i.selected=t,this.currentSelectedKey=i[this.options.keyField]):(this.mapData[this.currentSelectedKey]&&(this.mapData[this.currentSelectedKey].selected=!1),i.selected=t,this.currentSelectedKey=i[this.options.keyField])),n&&(i.selected?this.emit("select",i):this.emit("unselect",i),this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey())),a&&this.emit("render-data-change"))}},{key:"setUnloadSelected",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t?(this.currentSelectedKey&&this.setSelected(this.currentSelectedKey,!1,!1,!1),this.unloadSelectedKey=e):this.unloadSelectedKey===e&&(this.unloadSelectedKey=null),n&&this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey()),a&&this.emit("render-data-change")}},{key:"clearSelected",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.currentSelectedKey&&this.mapData[this.currentSelectedKey]?this.setSelected(this.currentSelectedKey,!1,e,t):null!==this.unloadSelectedKey&&(this.unloadSelectedKey=null,e&&this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey()),t&&this.emit("render-data-change"))}},{key:"setExpand",value:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.mapData[e];if(s&&(a||!s.isLeaf)&&s.expand!==t){if(!s.isLeaf){if("function"===typeof this.options.load){if(!s._loaded&&!s._loading&&t)return s._loading=!0,r&&this.emit("visible-data-change"),void new Promise((function(e,t){var a=n.options.load;a(s,e,t)})).then((function(e){if(Array.isArray(e)){var a,i=n.findIndex(s);if(-1===i)return;s._loaded=!0,s.expand=t,s.setChildren(e);var r=n.getCheckedKeys(),o=n.flattenData(s.children,null===n.getSelectedKey);(a=n.flatData).splice.apply(a,[i+1,0].concat(C(o))),n.setUnloadCheckedKeys(r),null!==n.unloadSelectedKey&&n.setUnloadSelectedKey(n.unloadSelectedKey),n.emit("set-data")}})).catch((function(e){var t=e;e instanceof Error||(t=new Error(e)),console.error(t)})).then((function(){s._loading=!1,i&&n.emit("expand",s),r&&n.emit("visible-data-change")}));if(s._loading)return}s.expand=t;var o=C(s.children);while(o.length)o[0].expand&&o[0].children.length&&o.push.apply(o,C(o[0].children)),!1===o[0]._filterVisible?o[0].visible=!1:o[0].visible=null===o[0]._parent||o[0]._parent.expand&&o[0]._parent.visible,o.shift();i&&this.emit("expand",s),r&&this.emit("visible-data-change")}a&&s._parent&&t&&this.setExpand(s._parent[this.options.keyField],t,a,!1,r)}}},{key:"setExpandKeys",value:function(e,t){var n=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e.forEach((function(e){n.setExpand(e,t,!1,!1,!1)})),a&&this.emit("visible-data-change")}},{key:"setExpandAll",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.flatData.forEach((function(n){t.options.load&&!n._loaded||t.setExpand(n[t.options.keyField],e,!1,!1,!1)})),n&&this.emit("visible-data-change")}},{key:"getCheckedNodes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.ignoreMode;if(e===f.children){var t=[],n=function e(n){n.forEach((function(n){n.checked?t.push(n):!n.isLeaf&&n.indeterminate&&e(n.children)}))};return n(this.data),t}return this.flatData.filter((function(t){return e===f.parents?t.checked&&t.isLeaf:t.checked}))}},{key:"getCheckedKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.ignoreMode;return this.getCheckedNodes(t).map((function(t){return t[e.options.keyField]})).concat(this.unloadCheckedKeys)}},{key:"getIndeterminateNodes",value:function(){return this.flatData.filter((function(e){return e.indeterminate}))}},{key:"getSelectedNode",value:function(){return null===this.currentSelectedKey?null:this.mapData[this.currentSelectedKey]||null}},{key:"getSelectedKey",value:function(){return this.currentSelectedKey||this.unloadSelectedKey||null}},{key:"getUnloadCheckedKeys",value:function(){return this.unloadCheckedKeys}},{key:"getExpandNodes",value:function(){return this.flatData.filter((function(e){return!e.isLeaf&&e.expand}))}},{key:"getExpandKeys",value:function(){var e=this;return this.getExpandNodes().map((function(t){return t[e.options.keyField]}))}},{key:"getNode",value:function(e){return this.mapData[e]||null}},{key:"insertBefore",value:function(e,t){var n=this.getInsertedNode(e,t);if(!n)return null;this.remove(n[this.options.keyField],!1);var a=this.mapData[t],i=a._parent,r=this.findIndex(t,i&&i.children),s=this.findIndex(t),o=i?-1:this.findIndex(t,this.data);return this.insertIntoStore(n,i,r,s,o),this.emit("visible-data-change"),n}},{key:"insertAfter",value:function(e,t){var n=this.getInsertedNode(e,t);if(!n)return null;this.remove(n[this.options.keyField],!1);for(var a=this.mapData[t],i=a._parent,r=this.findIndex(t,i&&i.children)+1,s=this.flatData.length,o=this.findIndex(t),l=o+1,c=o+1;c<=s;c++){if(c===s){l=c;break}if(this.flatData[c]._level<=a._level){l=c;break}}var d=i?-1:this.findIndex(t,this.data)+1;return this.insertIntoStore(n,i,r,l,d),this.emit("visible-data-change"),n}},{key:"append",value:function(e,t){var n=this.mapData[t];if(!n.isLeaf){var a=n.children.length;return this.insertAfter(e,n.children[a-1][this.options.keyField])}var i=this.getInsertedNode(e,t,!0);if(!i)return null;this.remove(i[this.options.keyField],!1);var r=this.findIndex(t)+1;return this.insertIntoStore(i,n,0,r),this.emit("visible-data-change"),i}},{key:"prepend",value:function(e,t){var n=this.mapData[t];if(!n.isLeaf)return this.insertBefore(e,n.children[0][this.options.keyField]);var a=this.getInsertedNode(e,t,!0);if(!a)return null;this.remove(a[this.options.keyField],!1);var i=this.findIndex(t)+1;return this.insertIntoStore(a,n,0,i),this.emit("visible-data-change"),a}},{key:"remove",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=this.mapData[e];if(!a)return null;var i=this.findIndex(a);if(-1===i)return null;for(var r=1,s=this.flatData.length,o=i+1;oa._level))break;r++}this.flatData.splice(i,r);var l=function e(n){var a=t.mapData[n];delete t.mapData[n],a.children.forEach((function(n){return e(n[t.options.keyField])}))};if(l(e),!a._parent){var c=this.findIndex(a,this.data);c>-1&&this.data.splice(c,1)}if(a._parent){var d=this.findIndex(a,a._parent.children);-1!==d&&a._parent.children.splice(d,1),a._parent.isLeaf=!a._parent.children.length,a._parent.isLeaf&&(a._parent.expand=!1,a._parent.indeterminate=!1),this.updateMovingNodeStatus(a)}return n&&this.emit("visible-data-change"),a}},{key:"getInsertedNode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.mapData[t];if(!a)return null;var i=n?a:a._parent;if(e instanceof v)return e[this.options.keyField]===t?null:e;if("object"===_(e)){if(e[this.options.keyField]===t)return null;var r=this.mapData[e[this.options.keyField]];return r||new v(e,i,this.options.keyField,!!this.options.load)}return this.mapData[e]&&e!==t?this.mapData[e]:null}},{key:"insertIntoStore",value:function(e,t,n,a,i){var r;if(-1!==a){-1!==n&&t&&t.children.splice(n,0,e),e._parent=t,t?(t.isLeaf=!1,this.setExpand(t[this.options.keyField],!0,!1,!1,!1)):"number"===typeof i&&i>-1&&this.data.splice(i,0,e);var s=this.flattenData([e]);e._level=t?t._level+1:0,s.forEach((function(e){return e._level=e._parent?e._parent._level+1:0})),(r=this.flatData).splice.apply(r,[a,0].concat(C(s))),this.updateMovingNodeStatus(e)}}},{key:"updateMovingNodeStatus",value:function(e){this.checkNodeUpward(e),this.triggerCheckedChange(),e.selected&&this.setSelected(e[this.options.keyField],!0)}},{key:"filter",value:function(e,t){var n=this,a=[];this.flatData.forEach((function(n){n._filterVisible=n._parent&&n._parent._filterVisible||t(e,n),n.visible=n._filterVisible,n._filterVisible&&a.push(n)})),a.forEach((function(e){var t=[],a=e._parent;while(a)t.unshift(a),a=a._parent;t.forEach((function(e){e._filterVisible=!0,e.visible=(null===e._parent||e._parent.expand&&e._parent.visible)&&e._filterVisible,n.options.expandOnFilter&&n.setExpand(e[n.options.keyField],!0,!1,!1,!1)})),e.visible=null===e._parent||e._parent.expand&&e._parent.visible})),this.emit("visible-data-change")}},{key:"setUnloadCheckedKeys",value:function(e){this.unloadCheckedKeys=e;for(var t=e.concat(),n=this.unloadCheckedKeys.length,a=n-1;a>=0;a--){var i=this.unloadCheckedKeys[a];this.mapData[i]&&(this.setChecked(i,!0,!1,!1),this.unloadCheckedKeys.splice(a,1))}var r=this.getCheckedKeys();r.length===t.length&&r.every((function(e){return t.some((function(t){return t===e}))}))||this.emit("checked-change",this.getCheckedNodes(),r)}},{key:"setUnloadSelectedKey",value:function(e){var t=this.getSelectedKey();this.mapData[e]?(this.setSelected(e,!0,!1),this.unloadSelectedKey=null):(this.currentSelectedKey&&this.setSelected(this.currentSelectedKey,!1,!1),this.unloadSelectedKey=e);var n=this.getSelectedKey();n!==t&&this.emit("selected-change",this.getSelectedNode(),n)}},{key:"flattenData",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=e.length,i=0;i2&&void 0!==arguments[2]&&arguments[2];if(e.children.forEach((function(e){n.checkNodeDownward(e,t,a)})),e.isLeaf||this.options.load&&!e.children.length){if(!e.disabled){if(a&&!this.options.filteredNodeCheckable&&!e._filterVisible)return;e.checked=t,e.indeterminate=!1}}else this.checkParentNode(e)}},{key:"checkNodeUpward",value:function(e){var t=e._parent;while(t)this.checkParentNode(t),t=t._parent}},{key:"checkParentNode",value:function(e){var t=e.children.length;if(t){for(var n=!1,a=!1,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:this.flatData;if(null!==t)for(var n=e instanceof v?e[this.options.keyField]:e,a=t.length,i=0;i-1&&this.listenersMap[e].splice(n,1)}else this.listenersMap[e]=[]}},{key:"emit",value:function(e){if(this.listenersMap[e]){for(var t=this.listenersMap[e].length,n=arguments.length,a=new Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1]&&arguments[1];this.dragoverBefore=!1,this.dragoverBody=!1,this.dragoverAfter=!1,t||(e===y.before?this.dragoverBefore=!0:e===y.body?this.dragoverBody=!0:e===y.after&&(this.dragoverAfter=!0))},handleDragStart:function(e){e.dataTransfer&&e.dataTransfer.setData("node",JSON.stringify(this.data)),this.data.expand&&this.handleExpand(),this.$emit("node-dragstart",this.fullData,e)},handleDragEnter:function(e){e.preventDefault();var t=this.getHoverPart(e);this.resetDragoverFlags(t),this.$emit("node-dragenter",this.fullData,e,t)},handleDragOver:function(e){e.preventDefault();var t=this.getHoverPart(e);this.resetDragoverFlags(t),this.$emit("node-dragover",this.fullData,e,t)},handleDragLeave:function(e){var t=this.getHoverPart(e);this.resetDragoverFlags(t,!0),this.$emit("node-dragleave",this.fullData,e,t)},handleDrop:function(e){var t=this.getHoverPart(e);this.resetDragoverFlags(t,!0),this.$emit("node-drop",this.fullData,e,t)}}}),H=V,U=Object(P["a"])(H,K,$,!1,null,null,null),W=U.exports;function G(e){return q(e)||X(e)||Y()}function Y(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function X(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function q(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t2&&void 0!==arguments[2])||arguments[2];this.nonReactive.store.setExpand(e,t,n)},setExpandKeys:function(e,t){this.nonReactive.store.setExpandKeys(e,t)},setExpandAll:function(e){this.nonReactive.store.setExpandAll(e)},getCheckedNodes:function(e){return e=e||this.ignoreMode,this.nonReactive.store.getCheckedNodes(e)},getCheckedKeys:function(e){return e=e||this.ignoreMode,this.nonReactive.store.getCheckedKeys(e)},getIndeterminateNodes:function(){return this.nonReactive.store.getIndeterminateNodes()},getSelectedNode:function(){return this.nonReactive.store.getSelectedNode()},getSelectedKey:function(){return this.nonReactive.store.getSelectedKey()},getExpandNodes:function(){return this.nonReactive.store.getExpandNodes()},getExpandKeys:function(){return this.nonReactive.store.getExpandKeys()},getCurrentVisibleNodes:function(){return this.nonReactive.store.flatData.filter((function(e){return e._filterVisible}))},getNode:function(e){return this.nonReactive.store.getNode(e)},getTreeData:function(){return this.nonReactive.store.data},getFlatData:function(){return this.nonReactive.store.flatData},getNodesCount:function(){return this.nonReactive.store.flatData.length},insertBefore:function(e,t){return this.nonReactive.store.insertBefore(e,t)},insertAfter:function(e,t){return this.nonReactive.store.insertAfter(e,t)},append:function(e,t){return this.nonReactive.store.append(e,t)},prepend:function(e,t){return this.nonReactive.store.prepend(e,t)},remove:function(e){return this.nonReactive.store.remove(e)},filter:function(e,t){var n=this,a=function(e,t){var a=t[n.titleField];return!(null==a||!a.toString)&&a.toString().toLowerCase().indexOf(e.toLowerCase())>-1};t=t||this.filterMethod||a,this.nonReactive.store.filter(e,t)},showCheckedNodes:function(e){var t=this;if(this.checkable){e=null==e?this.showUnloadCheckedNodes:e;var n=this.nonReactive.store.getCheckedNodes();if(this.nonReactive.store.filter("",(function(e,t){return t.checked})),e){var a=this.nonReactive.store.getUnloadCheckedKeys();if(a.length){var i,r=a.map((function(e){var a,i=t.unloadDataList.concat(n),r=e;return i.some((function(n){return n[t.keyField]===e&&null!=n[t.titleField]&&(r=n[t.titleField],!0)})),new v((a={},J(a,t.keyField,e),J(a,t.titleField,r),J(a,"checked",!0),J(a,"isLeaf",!0),a),null,t.keyField,!!t.load)}));this.unloadCheckedNodes=r,(i=this.nonReactive.blockNodes).push.apply(i,G(r)),this.updateBlockData(),this.updateRender()}}}},loadRootNodes:function(){var e=this;return this.isRootLoading=!0,new Promise((function(t,n){e.load(null,t,n)})).then((function(t){Array.isArray(t)&&e.setData(t)})).catch((function(){})).then((function(){e.isRootLoading=!1}))},scrollTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.top,n=this.nonReactive.store.mapData[e];if(n&&n.visible){for(var a=-1,i=0;i-1}))}},handleNodeCheck:function(e){(this.cascade||!this.enableLeafOnly||e.isLeaf)&&this.nonReactive.store.setChecked(e[this.keyField],!e.indeterminate&&!e.checked,!0,!0,!0)},handleNodeSelect:function(e){this.enableLeafOnly&&!e.isLeaf||this.nonReactive.store.setSelected(e[this.keyField],!e.selected)},handleNodeExpand:function(e){this.nonReactive.store.setExpand(e[this.keyField],!e.expand)},handleNodeDrop:function(e,t,n){if(this.droppable&&t.dataTransfer)try{var a=JSON.parse(t.dataTransfer.getData("node")),i=a[this.keyField],r=e[this.keyField],s=this.beforeDropMethod(i,r,n);if(s){if(i===r)return;n===y.before?this.nonReactive.store.insertBefore(i,r):n===y.body||!e.isLeaf&&e.expand?this.nonReactive.store.prepend(i,r):n===y.after&&this.nonReactive.store.insertAfter(i,r),this.$emit("node-drop",e,t,n,this.getNode(i))}}catch(o){throw new Error(o)}},emitCheckableInput:function(e,t){if(this.checkable){var n=t;Array.isArray(this.value)||(n=n.join(this.separator)),Array.isArray(n)?this.valueCache=n.concat():this.valueCache=n,this.$emit("input",n)}},emitSelectableInput:function(e,t){if(this.selectable&&!this.checkable){var n=t||"";this.valueCache=n,this.$emit("input",n)}},attachStoreEvents:function(){for(var e in this.$listeners)if(Q.indexOf(e)>-1){var t=e;this.nonReactive.store.on(t,this.$listeners[e])}},resetSpaceHeights:function(){this.topSpaceHeight=0,this.bottomSpaceHeight=0,this.$refs.scrollArea.scrollTop=0},updateBlockNodes:function(){this.nonReactive.blockNodes=this.nonReactive.store.flatData.filter((function(e){return e.visible})),this.updateBlockData(),this.updateRender()},updateBlockData:function(){this.blockLength=this.nonReactive.blockNodes.length,this.blockAreaHeight=this.nodeMinHeight*this.blockLength},updateRender:function(){this.updateRenderAmount(),this.updateRenderNodes()},updateRenderAmount:function(){var e=this.$refs.scrollArea.clientHeight;this.renderAmount=Math.max(this.renderNodeAmount,Math.ceil(e/this.nodeMinHeight)+this.bufferNodeAmount)},updateRenderNodes:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.blockLength>this.renderAmount){var t=this.$refs.scrollArea.scrollTop,n=Math.floor(t/this.nodeMinHeight);this.renderStart=Math.floor(n/this.bufferNodeAmount)*this.bufferNodeAmount}else this.renderStart=0;e&&this.renderAmountCache===this.renderAmount&&this.renderStartCache===this.renderStart||(this.renderNodes=this.nonReactive.blockNodes.slice(this.renderStart,this.renderStart+this.renderAmount).map((function(e){return Object.assign({},e,{_parent:null,children:[]})})),this.topSpaceHeight=this.renderStart*this.nodeMinHeight,this.bottomSpaceHeight=this.blockAreaHeight-(this.topSpaceHeight+this.renderNodes.length*this.nodeMinHeight))},handleTreeScroll:function(){this.debounceTimer&&window.cancelAnimationFrame(this.debounceTimer),this.renderAmountCache=this.renderAmount,this.renderStartCache=this.renderStart,this.debounceTimer=window.requestAnimationFrame(this.updateRenderNodes.bind(this,!0))}},created:function(){var e=this,t=this.keyField,n=this.ignoreMode,a=this.filteredNodeCheckable,i=this.cascade,r=this.defaultExpandAll,s=this.load,o=this.expandOnFilter;this.nonReactive={store:new O({keyField:t,ignoreMode:n,filteredNodeCheckable:a,cascade:i,defaultExpandAll:r,load:s,expandOnFilter:o}),blockNodes:[]},this.nonReactive.store.on("visible-data-change",this.updateBlockNodes),this.nonReactive.store.on("render-data-change",this.updateRender),this.nonReactive.store.on("checked-change",(function(t,n){e.emitCheckableInput(t,n),e.updateUnloadStatus()})),this.nonReactive.store.on("selected-change",this.emitSelectableInput),this.attachStoreEvents()},mounted:function(){this.data.length?(this.setData(this.data),this.defaultExpandedKeys.length&&this.nonReactive.store.setExpandKeys(this.defaultExpandedKeys,!0)):"function"===typeof this.load&&this.autoLoad&&this.loadRootNodes();var e=this.$refs.iframe;e.contentWindow&&e.contentWindow.addEventListener("resize",this.updateRender)},beforeDestroy:function(){var e=this.$refs.iframe;e.contentWindow&&e.contentWindow.removeEventListener("resize",this.updateRender)},watch:{value:function(e){if(this.checkable){if(ee(e,this.valueCache))return;var t=[];Array.isArray(e)?t=e.concat():"string"===typeof e&&(t=""===e?[]:e.split(this.separator)),this.nonReactive.store.clearChecked(!1,!1),this.nonReactive.store.setCheckedKeys(t,!0)}else if(this.selectable){if(e===this.valueCache)return;var n=this.nonReactive.store.getSelectedKey();""!==e&&null!=e?this.nonReactive.store.setSelected(e,!0):""!==e&&null!=e||!n||this.nonReactive.store.setSelected(n,!1)}},data:{deep:!0,handler:function(e){this.setData(e)}},expandedKeys:function(){this.updateExpandedKeys()},$listeners:function(){this.attachStoreEvents()}}}),ne=te,ae=Object(P["a"])(ne,l,c,!1,null,null,null),ie=ae.exports,re=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperCls},[n("div",{class:e.searchCls},[e.showCheckAll&&e.checkable?n("div",{class:e.checkAllWrapperCls},[n("div",{class:e.checkboxCls,on:{click:e.handleCheckAll}})]):e._e(),n("div",{class:e.inputWrapperCls},[e._t("search-input",[n("input",{directives:[{name:"model",rawName:"v-model",value:e.keyword,expression:"keyword"}],class:e.inputCls,attrs:{type:"text",placeholder:e.searchPlaceholder,disabled:e.searchDisabled},domProps:{value:e.keyword},on:{input:[function(t){t.target.composing||(e.keyword=t.target.value)},e.handleSearch]}})])],2),n("div",{class:e.actionWrapperCls},[e.showCheckedButton&&e.checkable?n("span",{class:e.checkedButtonCls,on:{click:e.handleShowChecked}},[e._v("\n "+e._s(e.checkedButtonText)+"\n ")]):e._e(),e._t("actions")],2)]),n("div",{class:e.treeWrapperCls},[n("CTree",e._g(e._b({ref:"tree",attrs:{value:e.value},on:{input:e.updateCheckedCount,"set-data":e.handleSetData,"checked-change":e.updateCheckAllStatus},scopedSlots:e._u([e._l(e.$scopedSlots,(function(t,n){return{key:n,fn:function(t){return[e._t(n,null,null,t)]}}}))],null,!0)},"CTree",e.$attrs,!1),e.$listeners))],1),e.showFooter&&e.checkable?n("div",{class:e.footerCls},[e._t("footer",[n("span",{staticStyle:{float:"right"}},[e._v("已选 "+e._s(e.checkedCount)+" 个")])])],2):e._e()])},se=[];function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function le(e){for(var t=1;t-1){var n=ue;n[t]=function(){for(var e=arguments.length,n=new Array(e),a=0;a0&&n.length-1){var n=Ke;n[t]=function(){for(var e=arguments.length,n=new Array(e),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.treeDepth,n=void 0===t?5:t,a=e.nodesPerLevel,i=e.sameIdTitle,r=void 0!==i&&i,s=e.inOrder,o=void 0!==s&&s,l=e.forceString,c=void 0!==l&&l,d=[],h=0,u=0,f=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(i>=n))for(var s=a||Math.floor(100*Math.random()),l=0;l0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0},e))},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return Ve({treeDepth:1,nodesPerLevel:e,inOrder:!0})},We={name:"Feature",components:{CTree:Be},data:function(){var e=He().data;e[0].selected=!0;var t=He().data;return t[0].expand=!0,t[1].children[0].disabled=!0,{basicUsage:He().data,orderData:He({inOrder:!0}).data,selectable:e,selectableValue:"",showCheckable:!0,checkable:t,checkableValue:[t[0].id],checkableIgnoreMode:"none",checkableCascade:!0,both:He().data,bothValue:[],remoteShow:!1,remoteLoad:function(e,t,n){setTimeout((function(){t(Ue(e?2:5).data)}),1e3)}}}},Ge=We,Ye=(n("826c"),Object(P["a"])(Ge,s,o,!1,null,"01d42e0f",null)),Xe=Ye.exports,qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("div",{staticClass:"tree"},[n("CTree",{ref:"tree",attrs:{data:e.treeData,checkable:"",selectable:""}})],1),n("div",{staticClass:"control"},[e._m(0),n("div",{staticClass:"controls"},[n("label",[e._v("节点深度:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.params.treeDepth,expression:"params.treeDepth"}],attrs:{type:"number"},domProps:{value:e.params.treeDepth},on:{input:function(t){t.target.composing||e.$set(e.params,"treeDepth",t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("每层节点个数:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.params.nodesPerLevel,expression:"params.nodesPerLevel"}],attrs:{type:"number"},domProps:{value:e.params.nodesPerLevel},on:{input:function(t){t.target.composing||e.$set(e.params,"nodesPerLevel",t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("总节点个数:")]),e._v("\n "+e._s(e.nodeTotal)+"\n ")]),n("div",{staticClass:"controls"},[n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleGenerate}},[e._v("生成树节点数据")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("1w")}}},[e._v("1w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("10w")}}},[e._v("10w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("20w")}}},[e._v("20w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("30w")}}},[e._v("30w 节点")])]),n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleSetData}},[e._v("设置树数据")])]),n("div",{staticClass:"actions"},[e.isTreeSet?n("span",{staticStyle:{color:"green"}},[e._v("树数据已设置")]):n("span",{staticStyle:{color:"red"}},[e._v("树数据已生成")])])]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动节点id:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.scrollKey,expression:"scrollKey"}],attrs:{type:"text"},domProps:{value:e.scrollKey},on:{input:function(t){t.target.composing||(e.scrollKey=t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动垂直位置:")]),n("select",{directives:[{name:"model",rawName:"v-model",value:e.scrollVerticalOption,expression:"scrollVerticalOption"}],on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.scrollVerticalOption=t.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"top"}},[e._v("top")]),n("option",{attrs:{value:"center"}},[e._v("center")]),n("option",{attrs:{value:"bottom"}},[e._v("bottom")])])]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动垂直偏移值:")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:e.scrollValue,expression:"scrollValue",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:e.scrollValue},on:{input:function(t){t.target.composing||(e.scrollValue=e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),n("div",{staticClass:"controls"},[n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleScrollToNode}},[e._v("滚动到此节点")])])])])])},Je=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"desc-block"},[n("p",[e._v("说明:在 Chrome 下表现良好")]),n("p",[e._v("在火狐浏览器下,因为其异步滚动策略 (scroll-linked) ,在快速滚动时会导致内容空白。")]),n("p",[e._v("另:浏览器元素/文档是有最大高度限制的,过多数据会导致显示不正常(Chrome 下 100 万条可以正常显示,但是在火狐或 Edge 则不行)")])])}],ze={"1w":{treeDepth:2,nodesPerLevel:100},"10w":{treeDepth:2,nodesPerLevel:320},"20w":{treeDepth:2,nodesPerLevel:450},"30w":{treeDepth:2,nodesPerLevel:550}},Qe=[],Ze={name:"Performance",components:{CTree:Be},data:function(){return{cache:[],isTreeSet:!1,params:{treeDepth:2,nodesPerLevel:5},nodeTotal:0,treeData:[],scrollKey:"",scrollVerticalOption:"top",scrollValue:0}},methods:{handleGenerate:function(){var e=Ve(Object.assign({},this.params,{inOrder:!0,sameIdTitle:!0,forceString:!0}));Qe=e.data,this.nodeTotal=e.total,this.isTreeSet=!1},handleGenerateTotal:function(e){Object.assign(this.params,ze[e]),this.handleGenerate()},handleSetData:function(){this.$refs.tree.setData(Qe.concat()),this.isTreeSet=!0},handleScrollToNode:function(){this.$refs.tree.scrollTo(this.scrollKey,this.scrollValue||this.scrollVerticalOption)}},created:function(){this.handleGenerate()}},et=Ze,tt=(n("2bc9"),Object(P["a"])(et,qe,Je,!1,null,"f597b4c8",null)),nt=tt.exports,at=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("CTree",{attrs:{data:e.basicUsage,loading:e.loading}}),n("button",{on:{click:e.handleToggle}},[e._v("Toggle Loading")])],1)},it=[],rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0},e))},st={name:"Loading",components:{CTree:Be},data:function(){return{basicUsage:rt().data,loading:!1}},methods:{handleToggle:function(){this.loading=!this.loading}}},ot=st,lt=Object(P["a"])(ot,at,it,!1,null,null,null),ct=lt.exports,dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CTreeSearch",{attrs:{data:e.data,checkable:"",expandOnFilter:!1},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")]),n("template",{slot:"actions"},[n("span",{staticStyle:{"margin-left":"5px"}},[e._v("折叠")]),n("span",{staticStyle:{"margin-left":"5px"}},[e._v("展开")]),n("span",{staticStyle:{"margin-left":"5px"}},[e._v("slot 按钮")])])],2)},ht=[],ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},ft={name:"Search",components:{CTreeSearch:me},data:function(){return{data:ut().data,value:"2"}}},pt=ft,vt=Object(P["a"])(pt,dt,ht,!1,null,null,null),gt=vt.exports,bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"100%"}},[n("CTreeSearch",{attrs:{load:e.load,"search-remote":"",checkable:""},on:{search:e.handleSearch},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)},yt=[],mt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},kt={name:"Search",components:{CTreeSearch:me},data:function(){var e=this;return{times:[3,2,5],index:0,load:function(t,n){setTimeout((function(){var t=mt({nodesPerLevel:e.times[e.index]}).data;n(t)}),10)},value:["93","124"]}},methods:{handleSearch:function(){this.index++,this.index>=this.times.length&&(this.index=0)}}},_t=kt,Ct=Object(P["a"])(_t,bt,yt,!1,null,null,null),St=(Ct.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"100%"}},[n("CTreeSearch",{attrs:{data:e.data,checkable:"","search-method":e.searchMethod},on:{search:e.handleSearch},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),wt=[],xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Dt={name:"Search",components:{CTreeSearch:me},data:function(){return{data:[],times:[3,2,5],index:0,value:["93","124"]}},methods:{searchMethod:function(e){var t=this;return new Promise((function(e){setTimeout((function(){t.data=xt({nodesPerLevel:t.times[t.index]}).data,e()}),10)}))},handleSearch:function(){this.index++,this.index>=this.times.length&&(this.index=0)}}},At=Dt,Nt=Object(P["a"])(At,St,wt,!1,null,null,null),Tt=(Nt.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"","drop-placeholder":"请选择",placement:e.placement,"dropdown-min-width":300,"dropdown-width-fixed":""},on:{"checked-change":e.handleCheckedChange},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),Ot=[],Kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},$t={name:"Drop",components:{CTreeDrop:Ie},data:function(){var e=Kt().data;return{data:e,value:"2",placement:"bottom-start"}},methods:{handleCheckedChange:function(){console.log("checked-change")}}},Et=$t,Rt=Object(P["a"])(Et,Tt,Ot,!1,null,null,null),Lt=Rt.exports,Ft=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"",cascade:!1,loading:e.loading,"drop-placeholder":"请选择","dropdown-min-width":300},on:{"checked-change":e.handleCheckedChange},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n "),n("button",{on:{click:e.handleChangeValue}},[e._v("Change Value")])],1)},Pt=[],jt=[{id:"p1-id",title:"c(lL%8",checked:!1,children:[{id:"c1-1-id",title:"c1-1",children:[]},{id:"c1-2-id",title:"c1-2",checked:!1,children:[]}]},{id:"p2-id",title:"KfQrp",checked:!1,children:[{id:"c2-1-id",title:"c2-1",checked:!1,children:[]},{id:"c2-2-id",title:"c1-2",checked:!1,children:[{id:"c2-2-1-id",title:"c1-2-1",checked:!1,children:[]}]}]}],It={name:"DropRemote",components:{CTreeDrop:Ie},data:function(){return{data:[],value:"",loading:!1}},created:function(){this.handleSetData()},methods:{handleChangeValue:function(){var e=this;setTimeout((function(){e.value="c1-1-id,c1-2-id"}),100)},handleCheckedChange:function(e){console.log("rrr checked change",e)},handleSetData:function(){var e=this;this.loading=!0,setTimeout((function(){e.data=jt,e.$nextTick((function(){e.value="c1-1-id,c1-2-id",e.loading=!1}))}),2e3)}}},Bt=It,Mt=Object(P["a"])(Bt,Ft,Pt,!1,null,null,null),Vt=(Mt.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("CTree",{attrs:{data:e.data,checkable:"",draggable:"",droppable:""},on:{"node-drop":e.handleDrop},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),Ht=[],Ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Wt={name:"Drag",components:{CTree:Be},data:function(){var e=Ut().data;return{data:e,value:["0"]}},methods:{handleDrop:function(){console.log("node drop")}}},Gt=Wt,Yt=Object(P["a"])(Gt,Vt,Ht,!1,null,null,null),Xt=Yt.exports,qt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"","drop-placeholder":"请选择","dropdown-min-width":300,"dropdown-width-fixed":""},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)},Jt=[],zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Qt=zt().data,Zt={name:"DropDataChange",components:{CTreeDrop:Ie},data:function(){return{data:[],value:"2"}},watch:{value:{handler:function(e){var t=this;setTimeout((function(){t.data=Qt}),3e3)},immediate:!0}}},en=Zt,tn=Object(P["a"])(en,qt,Jt,!1,null,null,null),nn=(tn.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CTree",{ref:"tree",attrs:{data:e.treeData,render:e.renderTree}})}),an=[],rn={name:"InsertRenderTree",components:{CTree:Be},data:function(){return{treeData:[{}]}},methods:{renderTree:function(e,t){return e("div",[e("input",{attrs:{type:"text"}}),e("button",{on:{click:this.handleAdd.bind(this,t)}},["Add sibling"]),e("button",{on:{click:this.handleAddChild.bind(this,t)}},["Add child"]),e("button",{on:{click:this.handleDelete.bind(this,t)}},["Remove"])])},handleAdd:function(e){this.$refs.tree.insertAfter({},e.id)},handleAddChild:function(e){this.$refs.tree.append({},e.id)},handleDelete:function(e){this.$refs.tree.remove(e.id)}}},sn=rn,on=Object(P["a"])(sn,nn,an,!1,null,null,null),ln=on.exports,cn={Feature:Xe,Performance:nt,Loading:ct,Search:gt,Drop:Lt,Drag:Xt,InsertRenderTree:ln},dn={name:"App",components:cn,data:function(){var e=Object.keys(cn);return{currentTab:e[0],tabList:e}}},hn=dn,un=(n("925e"),Object(P["a"])(hn,i,r,!1,null,"6c2a65d2",null)),fn=un.exports;n("eeb1");a["a"].config.productionTip=!1,new a["a"]({render:function(e){return e(fn)}}).$mount("#app")},e2ab:function(e,t,n){},eeb1:function(e,t,n){}}); \ No newline at end of file +(function(e){function t(t){for(var a,s,o=t[0],l=t[1],c=t[2],h=0,u=[];h1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"id",i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];for(var r in d(this,e),this._keyField=a,this._remote=i,this._level=0,this.checked=!1,this.selected=!1,this.indeterminate=!1,this.disabled=!1,this.expand=!1,this.visible=!0,this._filterVisible=!0,this._parent=null,this.children=[],this.isLeaf=!1,this._loading=!1,this._loaded=!1,t)-1===p.indexOf(r)&&(this[r]=t[r]);null==this[a]&&(this[a]=Math.random().toString(36).substring(2)),this._parent=n,this._parent&&(this._level=this._parent._level+1),this.visible=null===this._parent||this._parent.expand&&this._parent.visible,Array.isArray(t.children)&&this.setChildren(t.children),this.children.length&&(this._loaded=!0),this._remote||(this.isLeaf=!this.children.length)}return u(e,[{key:"setChildren",value:function(t){var n=this;this.children=t.map((function(t){return new e(Object.assign({},t),n,n._keyField,n._remote)}))}}]),e}();(function(e){e["none"]="none",e["parents"]="parents",e["children"]="children"})(f||(f={}));var g,b,y,k=["setData","setChecked","setCheckedKeys","checkAll","clearChecked","setSelected","clearSelected","setExpand","setExpandKeys","setExpandAll","getCheckedNodes","getCheckedKeys","getIndeterminateNodes","getSelectedNode","getSelectedKey","getExpandNodes","getExpandKeys","getCurrentVisibleNodes","getNode","getTreeData","getFlatData","getNodesCount","insertBefore","insertAfter","append","prepend","remove","filter","showCheckedNodes","loadRootNodes","scrollTo"],m=["clearKeyword","getKeyword","search"];function _(e){return _="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},_(e)}function C(e){return x(e)||w(e)||S()}function S(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function w(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function x(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;for(var i in this.data=e.map((function(e){return new v(e,null,t.options.keyField,!!t.options.load)})),this.mapData)delete this.mapData[i];this.currentSelectedKey=null,this.flatData=this.flattenData(this.data),this.setUnloadCheckedKeys(a||[]),n&&(this.currentSelectedKey=null,this.setUnloadSelectedKey(n)),this.emit("visible-data-change"),this.emit("set-data")}},{key:"setChecked",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=this.mapData[e];if(!r)return this.setUnloadChecked(e,t,n,a);r.disabled||r.checked&&t||(r.checked||r.indeterminate||t)&&(this.options.cascade?(this.checkNodeDownward(r,t,i),this.checkNodeUpward(r)):r.checked=t,n&&(r.checked?this.emit("check",r):this.emit("uncheck",r)),this.triggerCheckedChange(n,a))}},{key:"setUnloadChecked",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.findIndex(e,this.unloadCheckedKeys);t?-1===i&&this.unloadCheckedKeys.push(e):-1!==i&&this.unloadCheckedKeys.splice(i,1),this.triggerCheckedChange(n,a)}},{key:"setCheckedKeys",value:function(e,t){var n=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];e.forEach((function(e){n.setChecked(e,t,!1,!1)})),this.triggerCheckedChange(a,i)}},{key:"checkAll",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(this.options.cascade){var a=function t(n){n.forEach((function(n){n.disabled?t(n.children):e.setChecked(n[e.options.keyField],!0,!1,!1)}))};a(this.data)}else for(var i=this.flatData.length,r=0;r0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=this.getCheckedNodes();a.forEach((function(t){e.setChecked(t[e.options.keyField],!1,!1,!1)})),this.unloadCheckedKeys=[],this.triggerCheckedChange(t,n)}},{key:"triggerCheckedChange",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];e&&this.emit("checked-change",this.getCheckedNodes(),this.getCheckedKeys()),t&&this.emit("render-data-change")}},{key:"setSelected",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this.mapData[e];if(!i)return this.setUnloadSelected(e,t,n,a);i.disabled||i.selected!==t&&(e===this.currentSelectedKey?t||(i.selected=t,this.currentSelectedKey=null):t&&(null===this.currentSelectedKey?(i.selected=t,this.currentSelectedKey=i[this.options.keyField]):(this.mapData[this.currentSelectedKey]&&(this.mapData[this.currentSelectedKey].selected=!1),i.selected=t,this.currentSelectedKey=i[this.options.keyField])),n&&(i.selected?this.emit("select",i):this.emit("unselect",i),this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey())),a&&this.emit("render-data-change"))}},{key:"setUnloadSelected",value:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];t?(this.currentSelectedKey&&this.setSelected(this.currentSelectedKey,!1,!1,!1),this.unloadSelectedKey=e):this.unloadSelectedKey===e&&(this.unloadSelectedKey=null),n&&this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey()),a&&this.emit("render-data-change")}},{key:"clearSelected",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.currentSelectedKey&&this.mapData[this.currentSelectedKey]?this.setSelected(this.currentSelectedKey,!1,e,t):null!==this.unloadSelectedKey&&(this.unloadSelectedKey=null,e&&this.emit("selected-change",this.getSelectedNode(),this.getSelectedKey()),t&&this.emit("render-data-change"))}},{key:"setExpand",value:function(e,t){var n=this,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.mapData[e];if(s&&(a||!s.isLeaf)&&s.expand!==t){if(!s.isLeaf){if("function"===typeof this.options.load){if(!s._loaded&&!s._loading&&t)return s._loading=!0,r&&this.emit("visible-data-change"),void new Promise((function(e,t){var a=n.options.load;a(s,e,t)})).then((function(e){if(Array.isArray(e)){var a,i=n.findIndex(s);if(-1===i)return;s._loaded=!0,s.expand=t,s.setChildren(e);var r=n.getCheckedKeys(),o=n.flattenData(s.children,null===n.getSelectedKey);(a=n.flatData).splice.apply(a,[i+1,0].concat(C(o))),n.setUnloadCheckedKeys(r),null!==n.unloadSelectedKey&&n.setUnloadSelectedKey(n.unloadSelectedKey),n.emit("set-data")}})).catch((function(e){var t=e;e instanceof Error||(t=new Error(e)),console.error(t)})).then((function(){s._loading=!1,i&&n.emit("expand",s),r&&n.emit("visible-data-change")}));if(s._loading)return}s.expand=t;var o=C(s.children);while(o.length)o[0].expand&&o[0].children.length&&o.push.apply(o,C(o[0].children)),!1===o[0]._filterVisible?o[0].visible=!1:o[0].visible=null===o[0]._parent||o[0]._parent.expand&&o[0]._parent.visible,o.shift();i&&this.emit("expand",s),r&&this.emit("visible-data-change")}a&&s._parent&&t&&this.setExpand(s._parent[this.options.keyField],t,a,!1,r)}}},{key:"setExpandKeys",value:function(e,t){var n=this,a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];e.forEach((function(e){n.setExpand(e,t,!1,!1,!1)})),a&&this.emit("visible-data-change")}},{key:"setExpandAll",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.flatData.forEach((function(n){t.options.load&&!n._loaded||t.setExpand(n[t.options.keyField],e,!1,!1,!1)})),n&&this.emit("visible-data-change")}},{key:"getCheckedNodes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.ignoreMode;if(e===f.children){var t=[],n=function e(n){n.forEach((function(n){n.checked?t.push(n):!n.isLeaf&&n.indeterminate&&e(n.children)}))};return n(this.data),t}return this.flatData.filter((function(t){return e===f.parents?t.checked&&t.isLeaf:t.checked}))}},{key:"getCheckedKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.ignoreMode;return this.getCheckedNodes(t).map((function(t){return t[e.options.keyField]})).concat(this.unloadCheckedKeys)}},{key:"getIndeterminateNodes",value:function(){return this.flatData.filter((function(e){return e.indeterminate}))}},{key:"getSelectedNode",value:function(){return null===this.currentSelectedKey?null:this.mapData[this.currentSelectedKey]||null}},{key:"getSelectedKey",value:function(){return this.currentSelectedKey||this.unloadSelectedKey||null}},{key:"getUnloadCheckedKeys",value:function(){return this.unloadCheckedKeys}},{key:"getExpandNodes",value:function(){return this.flatData.filter((function(e){return!e.isLeaf&&e.expand}))}},{key:"getExpandKeys",value:function(){var e=this;return this.getExpandNodes().map((function(t){return t[e.options.keyField]}))}},{key:"getNode",value:function(e){return this.mapData[e]||null}},{key:"insertBefore",value:function(e,t){var n=this.getInsertedNode(e,t);if(!n)return null;this.remove(n[this.options.keyField],!1);var a=this.mapData[t],i=a._parent,r=this.findIndex(t,i&&i.children),s=this.findIndex(t),o=i?-1:this.findIndex(t,this.data);return this.insertIntoStore(n,i,r,s,o),this.emit("visible-data-change"),n}},{key:"insertAfter",value:function(e,t){var n=this.getInsertedNode(e,t);if(!n)return null;this.remove(n[this.options.keyField],!1);for(var a=this.mapData[t],i=a._parent,r=this.findIndex(t,i&&i.children)+1,s=this.flatData.length,o=this.findIndex(t),l=o+1,c=o+1;c<=s;c++){if(c===s){l=c;break}if(this.flatData[c]._level<=a._level){l=c;break}}var d=i?-1:this.findIndex(t,this.data)+1;return this.insertIntoStore(n,i,r,l,d),this.emit("visible-data-change"),n}},{key:"append",value:function(e,t){var n=this.mapData[t];if(!n.isLeaf){var a=n.children.length;return this.insertAfter(e,n.children[a-1][this.options.keyField])}var i=this.getInsertedNode(e,t,!0);if(!i)return null;this.remove(i[this.options.keyField],!1);var r=this.findIndex(t)+1;return this.insertIntoStore(i,n,0,r),this.emit("visible-data-change"),i}},{key:"prepend",value:function(e,t){var n=this.mapData[t];if(!n.isLeaf)return this.insertBefore(e,n.children[0][this.options.keyField]);var a=this.getInsertedNode(e,t,!0);if(!a)return null;this.remove(a[this.options.keyField],!1);var i=this.findIndex(t)+1;return this.insertIntoStore(a,n,0,i),this.emit("visible-data-change"),a}},{key:"remove",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=this.mapData[e];if(!a)return null;var i=this.findIndex(a);if(-1===i)return null;for(var r=1,s=this.flatData.length,o=i+1;oa._level))break;r++}this.flatData.splice(i,r);var l=function e(n){var a=t.mapData[n];delete t.mapData[n],a.children.forEach((function(n){return e(n[t.options.keyField])}))};if(l(e),!a._parent){var c=this.findIndex(a,this.data);c>-1&&this.data.splice(c,1)}if(a._parent){var d=this.findIndex(a,a._parent.children);-1!==d&&a._parent.children.splice(d,1),a._parent.isLeaf=!a._parent.children.length,a._parent.isLeaf&&(a._parent.expand=!1,a._parent.indeterminate=!1),this.updateMovingNodeStatus(a)}return n&&this.emit("visible-data-change"),a}},{key:"getInsertedNode",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=this.mapData[t];if(!a)return null;var i=n?a:a._parent;if(e instanceof v)return e[this.options.keyField]===t?null:e;if("object"===_(e)){if(e[this.options.keyField]===t)return null;var r=this.mapData[e[this.options.keyField]];return r||new v(e,i,this.options.keyField,!!this.options.load)}return this.mapData[e]&&e!==t?this.mapData[e]:null}},{key:"insertIntoStore",value:function(e,t,n,a,i){var r;if(-1!==a){-1!==n&&t&&t.children.splice(n,0,e),e._parent=t,t?(t.isLeaf=!1,this.setExpand(t[this.options.keyField],!0,!1,!1,!1)):"number"===typeof i&&i>-1&&this.data.splice(i,0,e);var s=this.flattenData([e]);e._level=t?t._level+1:0,s.forEach((function(e){return e._level=e._parent?e._parent._level+1:0})),(r=this.flatData).splice.apply(r,[a,0].concat(C(s))),this.updateMovingNodeStatus(e)}}},{key:"updateMovingNodeStatus",value:function(e){this.checkNodeUpward(e),this.triggerCheckedChange(),e.selected&&this.setSelected(e[this.options.keyField],!0)}},{key:"filter",value:function(e,t){var n=this,a=[];this.flatData.forEach((function(n){n._filterVisible=n._parent&&n._parent._filterVisible||t(e,n),n.visible=n._filterVisible,n._filterVisible&&a.push(n)})),a.forEach((function(e){var t=[],a=e._parent;while(a)t.unshift(a),a=a._parent;t.forEach((function(e){e._filterVisible=!0,e.visible=(null===e._parent||e._parent.expand&&e._parent.visible)&&e._filterVisible,n.options.expandOnFilter&&n.setExpand(e[n.options.keyField],!0,!1,!1,!1)})),e.visible=null===e._parent||e._parent.expand&&e._parent.visible})),this.emit("visible-data-change")}},{key:"setUnloadCheckedKeys",value:function(e){this.unloadCheckedKeys=e;for(var t=e.concat(),n=this.unloadCheckedKeys.length,a=n-1;a>=0;a--){var i=this.unloadCheckedKeys[a];this.mapData[i]&&(this.setChecked(i,!0,!1,!1),this.unloadCheckedKeys.splice(a,1))}var r=this.getCheckedKeys();r.length===t.length&&r.every((function(e){return t.some((function(t){return t===e}))}))||this.emit("checked-change",this.getCheckedNodes(),r)}},{key:"setUnloadSelectedKey",value:function(e){var t=this.getSelectedKey();this.mapData[e]?(this.setSelected(e,!0,!1),this.unloadSelectedKey=null):(this.currentSelectedKey&&this.setSelected(this.currentSelectedKey,!1,!1),this.unloadSelectedKey=e);var n=this.getSelectedKey();n!==t&&this.emit("selected-change",this.getSelectedNode(),n)}},{key:"flattenData",value:function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=e.length,i=0;i2&&void 0!==arguments[2]&&arguments[2];if(e.children.forEach((function(e){n.checkNodeDownward(e,t,a)})),e.isLeaf||this.options.load&&!e.children.length){if(!e.disabled){if(a&&!this.options.filteredNodeCheckable&&!e._filterVisible)return;e.checked=t,e.indeterminate=!1}}else this.checkParentNode(e)}},{key:"checkNodeUpward",value:function(e){var t=e._parent;while(t)this.checkParentNode(t),t=t._parent}},{key:"checkParentNode",value:function(e){var t=e.children.length;if(t){for(var n=!1,a=!1,i=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:this.flatData;if(null!==t)for(var n=e instanceof v?e[this.options.keyField]:e,a=t.length,i=0;i-1&&this.listenersMap[e].splice(n,1)}else this.listenersMap[e]=[]}},{key:"emit",value:function(e){if(this.listenersMap[e]){for(var t=this.listenersMap[e].length,n=arguments.length,a=new Array(n>1?n-1:0),i=1;i1&&void 0!==arguments[1]&&arguments[1];this.dragoverBefore=!1,this.dragoverBody=!1,this.dragoverAfter=!1,t||(e===y.before?this.dragoverBefore=!0:e===y.body?this.dragoverBody=!0:e===y.after&&(this.dragoverAfter=!0))},handleDragStart:function(e){e.dataTransfer&&e.dataTransfer.setData("node",JSON.stringify(this.data)),this.data.expand&&this.handleExpand(),this.$emit("node-dragstart",this.fullData,e)},handleDragEnter:function(e){e.preventDefault();var t=this.getHoverPart(e);this.resetDragoverFlags(t),this.$emit("node-dragenter",this.fullData,e,t)},handleDragOver:function(e){e.preventDefault();var t=this.getHoverPart(e);this.resetDragoverFlags(t),this.$emit("node-dragover",this.fullData,e,t)},handleDragLeave:function(e){var t=this.getHoverPart(e);this.resetDragoverFlags(t,!0),this.$emit("node-dragleave",this.fullData,e,t)},handleDrop:function(e){var t=this.getHoverPart(e);this.resetDragoverFlags(t,!0),this.$emit("node-drop",this.fullData,e,t)}}}),H=V,U=Object(F["a"])(H,K,$,!1,null,null,null),W=U.exports;function G(e){return q(e)||X(e)||Y()}function Y(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function X(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function q(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t2&&void 0!==arguments[2])||arguments[2];this.nonReactive.store.setExpand(e,t,n)},setExpandKeys:function(e,t){this.nonReactive.store.setExpandKeys(e,t)},setExpandAll:function(e){this.nonReactive.store.setExpandAll(e)},getCheckedNodes:function(e){return e=e||this.ignoreMode,this.nonReactive.store.getCheckedNodes(e)},getCheckedKeys:function(e){return e=e||this.ignoreMode,this.nonReactive.store.getCheckedKeys(e)},getIndeterminateNodes:function(){return this.nonReactive.store.getIndeterminateNodes()},getSelectedNode:function(){return this.nonReactive.store.getSelectedNode()},getSelectedKey:function(){return this.nonReactive.store.getSelectedKey()},getExpandNodes:function(){return this.nonReactive.store.getExpandNodes()},getExpandKeys:function(){return this.nonReactive.store.getExpandKeys()},getCurrentVisibleNodes:function(){return this.nonReactive.store.flatData.filter((function(e){return e._filterVisible}))},getNode:function(e){return this.nonReactive.store.getNode(e)},getTreeData:function(){return this.nonReactive.store.data},getFlatData:function(){return this.nonReactive.store.flatData},getNodesCount:function(){return this.nonReactive.store.flatData.length},insertBefore:function(e,t){return this.nonReactive.store.insertBefore(e,t)},insertAfter:function(e,t){return this.nonReactive.store.insertAfter(e,t)},append:function(e,t){return this.nonReactive.store.append(e,t)},prepend:function(e,t){return this.nonReactive.store.prepend(e,t)},remove:function(e){return this.nonReactive.store.remove(e)},filter:function(e,t){var n=this,a=function(e,t){var a=t[n.titleField];return!(null==a||!a.toString)&&a.toString().toLowerCase().indexOf(e.toLowerCase())>-1};t=t||this.filterMethod||a,this.nonReactive.store.filter(e,t)},showCheckedNodes:function(e){var t=this;if(this.checkable){e=null==e?this.showUnloadCheckedNodes:e;var n=this.nonReactive.store.getCheckedNodes();if(this.nonReactive.store.filter("",(function(e,t){return t.checked})),e){var a=this.nonReactive.store.getUnloadCheckedKeys();if(a.length){var i,r=a.map((function(e){var a,i=t.unloadDataList.concat(n),r=e;return i.some((function(n){return n[t.keyField]===e&&null!=n[t.titleField]&&(r=n[t.titleField],!0)})),new v((a={},J(a,t.keyField,e),J(a,t.titleField,r),J(a,"checked",!0),J(a,"isLeaf",!0),a),null,t.keyField,!!t.load)}));this.unloadCheckedNodes=r,(i=this.nonReactive.blockNodes).push.apply(i,G(r)),this.updateBlockData(),this.updateRender()}}}},loadRootNodes:function(){var e=this;return this.isRootLoading=!0,new Promise((function(t,n){e.load(null,t,n)})).then((function(t){Array.isArray(t)&&e.setData(t)})).catch((function(){})).then((function(){e.isRootLoading=!1}))},scrollTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.top,n=this.nonReactive.store.mapData[e];if(n&&n.visible){for(var a=-1,i=0;i-1}))}},handleNodeCheck:function(e){(this.cascade||!this.enableLeafOnly||e.isLeaf)&&this.nonReactive.store.setChecked(e[this.keyField],!e.indeterminate&&!e.checked,!0,!0,!0)},handleNodeSelect:function(e){this.enableLeafOnly&&!e.isLeaf||this.nonReactive.store.setSelected(e[this.keyField],!e.selected)},handleNodeExpand:function(e){this.nonReactive.store.setExpand(e[this.keyField],!e.expand)},handleNodeDrop:function(e,t,n){if(this.droppable&&t.dataTransfer)try{var a=JSON.parse(t.dataTransfer.getData("node")),i=a[this.keyField],r=e[this.keyField],s=this.beforeDropMethod(i,r,n);if(s){if(i===r)return;n===y.before?this.nonReactive.store.insertBefore(i,r):n===y.body||!e.isLeaf&&e.expand?this.nonReactive.store.prepend(i,r):n===y.after&&this.nonReactive.store.insertAfter(i,r),this.$emit("node-drop",e,t,n,this.getNode(i))}}catch(o){throw new Error(o)}},emitCheckableInput:function(e,t){if(this.checkable){var n=t;Array.isArray(this.value)||(n=n.join(this.separator)),Array.isArray(n)?this.valueCache=n.concat():this.valueCache=n,this.$emit("input",n)}},emitSelectableInput:function(e,t){if(this.selectable&&!this.checkable){var n=t||"";this.valueCache=n,this.$emit("input",n)}},attachStoreEvents:function(){for(var e in this.$listeners)if(Q.indexOf(e)>-1){var t=e;this.nonReactive.store.on(t,this.$listeners[e])}},resetSpaceHeights:function(){this.topSpaceHeight=0,this.bottomSpaceHeight=0,this.$refs.scrollArea.scrollTop=0},updateBlockNodes:function(){this.nonReactive.blockNodes=this.nonReactive.store.flatData.filter((function(e){return e.visible})),this.updateBlockData(),this.updateRender()},updateBlockData:function(){this.blockLength=this.nonReactive.blockNodes.length,this.blockAreaHeight=this.nodeMinHeight*this.blockLength},updateRender:function(){this.updateRenderAmount(),this.updateRenderNodes()},updateRenderAmount:function(){var e=this.$refs.scrollArea.clientHeight;this.renderAmount=Math.max(this.renderNodeAmount,Math.ceil(e/this.nodeMinHeight)+this.bufferNodeAmount)},updateRenderNodes:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.blockLength>this.renderAmount){var t=this.$refs.scrollArea.scrollTop,n=Math.floor(t/this.nodeMinHeight);this.renderStart=Math.floor(n/this.bufferNodeAmount)*this.bufferNodeAmount}else this.renderStart=0;e&&this.renderAmountCache===this.renderAmount&&this.renderStartCache===this.renderStart||(this.renderNodes=this.nonReactive.blockNodes.slice(this.renderStart,this.renderStart+this.renderAmount).map((function(e){return Object.assign({},e,{_parent:null,children:[]})})),this.topSpaceHeight=this.renderStart*this.nodeMinHeight,this.bottomSpaceHeight=this.blockAreaHeight-(this.topSpaceHeight+this.renderNodes.length*this.nodeMinHeight))},handleTreeScroll:function(){this.debounceTimer&&window.cancelAnimationFrame(this.debounceTimer),this.renderAmountCache=this.renderAmount,this.renderStartCache=this.renderStart,this.debounceTimer=window.requestAnimationFrame(this.updateRenderNodes.bind(this,!0))}},created:function(){var e=this,t=this.keyField,n=this.ignoreMode,a=this.filteredNodeCheckable,i=this.cascade,r=this.defaultExpandAll,s=this.load,o=this.expandOnFilter;this.nonReactive={store:new O({keyField:t,ignoreMode:n,filteredNodeCheckable:a,cascade:i,defaultExpandAll:r,load:s,expandOnFilter:o}),blockNodes:[]},this.nonReactive.store.on("visible-data-change",this.updateBlockNodes),this.nonReactive.store.on("render-data-change",this.updateRender),this.nonReactive.store.on("checked-change",(function(t,n){e.emitCheckableInput(t,n),e.updateUnloadStatus()})),this.nonReactive.store.on("selected-change",this.emitSelectableInput),this.attachStoreEvents()},mounted:function(){this.data.length?(this.setData(this.data),this.defaultExpandedKeys.length&&this.nonReactive.store.setExpandKeys(this.defaultExpandedKeys,!0)):"function"===typeof this.load&&this.autoLoad&&this.loadRootNodes();var e=this.$refs.iframe;e.contentWindow&&e.contentWindow.addEventListener("resize",this.updateRender)},beforeDestroy:function(){var e=this.$refs.iframe;e.contentWindow&&e.contentWindow.removeEventListener("resize",this.updateRender)},watch:{value:function(e){if(this.checkable){if(ee(e,this.valueCache))return;var t=[];Array.isArray(e)?t=e.concat():"string"===typeof e&&(t=""===e?[]:e.split(this.separator)),this.nonReactive.store.clearChecked(!1,!1),this.nonReactive.store.setCheckedKeys(t,!0)}else if(this.selectable){if(e===this.valueCache)return;var n=this.nonReactive.store.getSelectedKey();""!==e&&null!=e?this.nonReactive.store.setSelected(e,!0):""!==e&&null!=e||!n||this.nonReactive.store.setSelected(n,!1)}},data:{deep:!0,handler:function(e){this.setData(e)}},expandedKeys:function(){this.updateExpandedKeys()},$listeners:function(){this.attachStoreEvents()}}}),ne=te,ae=Object(F["a"])(ne,l,c,!1,null,null,null),ie=ae.exports,re=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:e.wrapperCls},[n("div",{class:e.searchCls},[e.showCheckAll&&e.checkable?n("div",{class:e.checkAllWrapperCls},[n("div",{class:e.checkboxCls,on:{click:e.handleCheckAll}})]):e._e(),n("div",{class:e.inputWrapperCls},[e._t("search-input",[n("input",{directives:[{name:"model",rawName:"v-model",value:e.keyword,expression:"keyword"}],class:e.inputCls,attrs:{type:"text",placeholder:e.searchPlaceholder,disabled:e.searchDisabled},domProps:{value:e.keyword},on:{input:[function(t){t.target.composing||(e.keyword=t.target.value)},e.handleSearch]}})])],2),n("div",{class:e.actionWrapperCls},[e.showCheckedButton&&e.checkable?n("span",{class:e.checkedButtonCls,on:{click:e.handleShowChecked}},[e._v("\n "+e._s(e.checkedButtonText)+"\n ")]):e._e(),e._t("actions")],2)]),n("div",{class:e.treeWrapperCls},[n("CTree",e._g(e._b({ref:"tree",attrs:{value:e.value},on:{input:e.updateCheckedCount,"set-data":e.handleSetData,"checked-change":e.updateCheckAllStatus},scopedSlots:e._u([e._l(e.$scopedSlots,(function(t,n){return{key:n,fn:function(t){return[e._t(n,null,null,t)]}}}))],null,!0)},"CTree",e.$attrs,!1),e.$listeners))],1),e.showFooter&&e.checkable?n("div",{class:e.footerCls},[e._t("footer",[n("span",{staticStyle:{float:"right"}},[e._v("已选 "+e._s(e.checkedCount)+" 个")])])],2):e._e()])},se=[];function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function le(e){for(var t=1;t-1){var n=ue;n[t]=function(){for(var e=arguments.length,n=new Array(e),a=0;a0&&n.length-1){var n=Ke;n[t]=function(){for(var e=arguments.length,n=new Array(e),a=0;a0&&void 0!==arguments[0]?arguments[0]:{},t=e.treeDepth,n=void 0===t?5:t,a=e.nodesPerLevel,i=e.sameIdTitle,r=void 0!==i&&i,s=e.inOrder,o=void 0!==s&&s,l=e.forceString,c=void 0!==l&&l,d=[],h=0,u=0,f=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!(i>=n))for(var s=a||Math.floor(100*Math.random()),l=0;l0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0},e))},Ue=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return Ve({treeDepth:1,nodesPerLevel:e,inOrder:!0})},We={name:"Feature",components:{CTree:Be},data:function(){var e=He().data;e[0].selected=!0;var t=He().data;return t[0].expand=!0,t[1].children[0].disabled=!0,{basicUsage:He().data,orderData:He({inOrder:!0}).data,selectable:e,selectableValue:"",showCheckable:!0,checkable:t,checkableValue:[t[0].id],checkableIgnoreMode:"none",checkableCascade:!0,both:He().data,bothValue:[],remoteShow:!1,remoteLoad:function(e,t,n){setTimeout((function(){t(Ue(e?2:5).data)}),1e3)}}}},Ge=We,Ye=(n("826c"),Object(F["a"])(Ge,s,o,!1,null,"01d42e0f",null)),Xe=Ye.exports,qe=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container"},[n("div",{staticClass:"tree"},[n("CTree",{ref:"tree",attrs:{data:e.treeData,checkable:"",selectable:""}})],1),n("div",{staticClass:"control"},[e._m(0),n("div",{staticClass:"controls"},[n("label",[e._v("节点深度:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.params.treeDepth,expression:"params.treeDepth"}],attrs:{type:"number"},domProps:{value:e.params.treeDepth},on:{input:function(t){t.target.composing||e.$set(e.params,"treeDepth",t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("每层节点个数:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.params.nodesPerLevel,expression:"params.nodesPerLevel"}],attrs:{type:"number"},domProps:{value:e.params.nodesPerLevel},on:{input:function(t){t.target.composing||e.$set(e.params,"nodesPerLevel",t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("总节点个数:")]),e._v("\n "+e._s(e.nodeTotal)+"\n ")]),n("div",{staticClass:"controls"},[n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleGenerate}},[e._v("生成树节点数据")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("1w")}}},[e._v("1w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("10w")}}},[e._v("10w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("20w")}}},[e._v("20w 节点")]),n("button",{on:{click:function(t){return e.handleGenerateTotal("30w")}}},[e._v("30w 节点")])]),n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleSetData}},[e._v("设置树数据")])]),n("div",{staticClass:"actions"},[e.isTreeSet?n("span",{staticStyle:{color:"green"}},[e._v("树数据已设置")]):n("span",{staticStyle:{color:"red"}},[e._v("树数据已生成")])])]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动节点id:")]),n("input",{directives:[{name:"model",rawName:"v-model",value:e.scrollKey,expression:"scrollKey"}],attrs:{type:"text"},domProps:{value:e.scrollKey},on:{input:function(t){t.target.composing||(e.scrollKey=t.target.value)}}})]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动垂直位置:")]),n("select",{directives:[{name:"model",rawName:"v-model",value:e.scrollVerticalOption,expression:"scrollVerticalOption"}],on:{change:function(t){var n=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.scrollVerticalOption=t.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"top"}},[e._v("top")]),n("option",{attrs:{value:"center"}},[e._v("center")]),n("option",{attrs:{value:"bottom"}},[e._v("bottom")])])]),n("div",{staticClass:"controls"},[n("label",[e._v("滚动垂直偏移值:")]),n("input",{directives:[{name:"model",rawName:"v-model.number",value:e.scrollValue,expression:"scrollValue",modifiers:{number:!0}}],attrs:{type:"text"},domProps:{value:e.scrollValue},on:{input:function(t){t.target.composing||(e.scrollValue=e._n(t.target.value))},blur:function(t){return e.$forceUpdate()}}})]),n("div",{staticClass:"controls"},[n("div",{staticClass:"actions"},[n("button",{on:{click:e.handleScrollToNode}},[e._v("滚动到此节点")])])])])])},Je=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"desc-block"},[n("p",[e._v("说明:在 Chrome 下表现良好")]),n("p",[e._v("在火狐浏览器下,因为其异步滚动策略 (scroll-linked) ,在快速滚动时会导致内容空白。")]),n("p",[e._v("另:浏览器元素/文档是有最大高度限制的,过多数据会导致显示不正常(Chrome 下 100 万条可以正常显示,但是在火狐或 Edge 则不行)")])])}],ze={"1w":{treeDepth:2,nodesPerLevel:100},"10w":{treeDepth:2,nodesPerLevel:320},"20w":{treeDepth:2,nodesPerLevel:450},"30w":{treeDepth:2,nodesPerLevel:550}},Qe=[],Ze={name:"Performance",components:{CTree:Be},data:function(){return{cache:[],isTreeSet:!1,params:{treeDepth:2,nodesPerLevel:5},nodeTotal:0,treeData:[],scrollKey:"",scrollVerticalOption:"top",scrollValue:0}},methods:{handleGenerate:function(){var e=Ve(Object.assign({},this.params,{inOrder:!0,sameIdTitle:!0,forceString:!0}));Qe=e.data,this.nodeTotal=e.total,this.isTreeSet=!1},handleGenerateTotal:function(e){Object.assign(this.params,ze[e]),this.handleGenerate()},handleSetData:function(){this.$refs.tree.setData(Qe.concat()),this.isTreeSet=!0},handleScrollToNode:function(){this.$refs.tree.scrollTo(this.scrollKey,this.scrollValue||this.scrollVerticalOption)}},created:function(){this.handleGenerate()}},et=Ze,tt=(n("2bc9"),Object(F["a"])(et,qe,Je,!1,null,"f597b4c8",null)),nt=tt.exports,at=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("CTree",{attrs:{data:e.basicUsage,loading:e.loading}}),n("button",{on:{click:e.handleToggle}},[e._v("Toggle Loading")])],1)},it=[],rt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0},e))},st={name:"Loading",components:{CTree:Be},data:function(){return{basicUsage:rt().data,loading:!1}},methods:{handleToggle:function(){this.loading=!this.loading}}},ot=st,lt=Object(F["a"])(ot,at,it,!1,null,null,null),ct=lt.exports,dt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CTreeSearch",{attrs:{data:e.data,checkable:"",expandOnFilter:!1},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")]),n("template",{slot:"actions"},[n("span",{staticStyle:{"margin-left":"5px"}},[e._v("折叠")]),n("span",{staticStyle:{"margin-left":"5px"}},[e._v("展开")]),n("span",{staticStyle:{"margin-left":"5px"}},[e._v("slot 按钮")])])],2)},ht=[],ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},ft={name:"Search",components:{CTreeSearch:ke},data:function(){return{data:ut().data,value:"2"}}},pt=ft,vt=Object(F["a"])(pt,dt,ht,!1,null,null,null),gt=vt.exports,bt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"100%"}},[n("CTreeSearch",{attrs:{load:e.load,"search-remote":"",checkable:""},on:{search:e.handleSearch},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)},yt=[],kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},mt={name:"Search",components:{CTreeSearch:ke},data:function(){var e=this;return{times:[3,2,5],index:0,load:function(t,n){setTimeout((function(){var t=kt({nodesPerLevel:e.times[e.index]}).data;n(t)}),10)},value:["93","124"]}},methods:{handleSearch:function(){this.index++,this.index>=this.times.length&&(this.index=0)}}},_t=mt,Ct=Object(F["a"])(_t,bt,yt,!1,null,null,null),St=(Ct.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"100%"}},[n("CTreeSearch",{attrs:{data:e.data,checkable:"","search-method":e.searchMethod},on:{search:e.handleSearch},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),wt=[],xt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Dt={name:"Search",components:{CTreeSearch:ke},data:function(){return{data:[],times:[3,2,5],index:0,value:["93","124"]}},methods:{searchMethod:function(e){var t=this;return new Promise((function(e){setTimeout((function(){t.data=xt({nodesPerLevel:t.times[t.index]}).data,e()}),10)}))},handleSearch:function(){this.index++,this.index>=this.times.length&&(this.index=0)}}},At=Dt,Nt=Object(F["a"])(At,St,wt,!1,null,null,null),Tt=(Nt.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticStyle:{width:"200px"}},[n("p",[e._v("自定义展示 slot :")]),n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"","drop-placeholder":"请选择",placement:e.placement,"dropdown-min-width":300,"dropdown-width-fixed":""},on:{"checked-change":e.handleCheckedChange},scopedSlots:e._u([{key:"display",fn:function(t){return[n("div",{staticStyle:{width:"170px","text-overflow":"ellipsis",overflow:"hidden"}},[e._v(e._s(t.checkedNodes.map((function(e){return e.title})).join(",")))])]}}]),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n ")],1),n("div",{staticStyle:{width:"200px"}},[n("p",[e._v("默认:")]),n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"","drop-placeholder":"请选择",placement:e.placement,"dropdown-min-width":300,"dropdown-width-fixed":""},on:{"checked-change":e.handleCheckedChange},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n ")],1)])}),Ot=[],Kt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},$t={name:"Drop",components:{CTreeDrop:Ie},data:function(){var e=Kt().data;return{data:e,value:"2",placement:"bottom-start"}},methods:{handleCheckedChange:function(){console.log("checked-change")}}},Et=$t,Pt=Object(F["a"])(Et,Tt,Ot,!1,null,null,null),Rt=Pt.exports,Lt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"",cascade:!1,loading:e.loading,"drop-placeholder":"请选择","dropdown-min-width":300},on:{"checked-change":e.handleCheckedChange},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n "),n("button",{on:{click:e.handleChangeValue}},[e._v("Change Value")])],1)},Ft=[],jt=[{id:"p1-id",title:"c(lL%8",checked:!1,children:[{id:"c1-1-id",title:"c1-1",children:[]},{id:"c1-2-id",title:"c1-2",checked:!1,children:[]}]},{id:"p2-id",title:"KfQrp",checked:!1,children:[{id:"c2-1-id",title:"c2-1",checked:!1,children:[]},{id:"c2-2-id",title:"c1-2",checked:!1,children:[{id:"c2-2-1-id",title:"c1-2-1",checked:!1,children:[]}]}]}],It={name:"DropRemote",components:{CTreeDrop:Ie},data:function(){return{data:[],value:"",loading:!1}},created:function(){this.handleSetData()},methods:{handleChangeValue:function(){var e=this;setTimeout((function(){e.value="c1-1-id,c1-2-id"}),100)},handleCheckedChange:function(e){console.log("rrr checked change",e)},handleSetData:function(){var e=this;this.loading=!0,setTimeout((function(){e.data=jt,e.$nextTick((function(){e.value="c1-1-id,c1-2-id",e.loading=!1}))}),2e3)}}},Bt=It,Mt=Object(F["a"])(Bt,Lt,Ft,!1,null,null,null),Vt=(Mt.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("CTree",{attrs:{data:e.data,checkable:"",draggable:"",droppable:""},on:{"node-drop":e.handleDrop},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)}),Ht=[],Ut=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Wt={name:"Drag",components:{CTree:Be},data:function(){var e=Ut().data;return{data:e,value:["0"]}},methods:{handleDrop:function(){console.log("node drop")}}},Gt=Wt,Yt=Object(F["a"])(Gt,Vt,Ht,!1,null,null,null),Xt=Yt.exports,qt=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{width:"200px"}},[n("CTreeDrop",{attrs:{data:e.data,checkable:"",clearable:"","drop-placeholder":"请选择","dropdown-min-width":300,"dropdown-width-fixed":""},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},[n("span",{attrs:{slot:"empty"},slot:"empty"},[e._v("slot 传进来的暂无数据")])]),e._v("\n "+e._s(e.value)+"\n")],1)},Jt=[],zt=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Ve(Object.assign({treeDepth:3,nodesPerLevel:5,sameIdTitle:!0,inOrder:!0,forceString:!0},e))},Qt=zt().data,Zt={name:"DropDataChange",components:{CTreeDrop:Ie},data:function(){return{data:[],value:"2"}},watch:{value:{handler:function(e){var t=this;setTimeout((function(){t.data=Qt}),3e3)},immediate:!0}}},en=Zt,tn=Object(F["a"])(en,qt,Jt,!1,null,null,null),nn=(tn.exports,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("CTree",{ref:"tree",attrs:{data:e.treeData,render:e.renderTree}})}),an=[],rn={name:"InsertRenderTree",components:{CTree:Be},data:function(){return{treeData:[{}]}},methods:{renderTree:function(e,t){return e("div",[e("input",{attrs:{type:"text"}}),e("button",{on:{click:this.handleAdd.bind(this,t)}},["Add sibling"]),e("button",{on:{click:this.handleAddChild.bind(this,t)}},["Add child"]),e("button",{on:{click:this.handleDelete.bind(this,t)}},["Remove"])])},handleAdd:function(e){this.$refs.tree.insertAfter({},e.id)},handleAddChild:function(e){this.$refs.tree.append({},e.id)},handleDelete:function(e){this.$refs.tree.remove(e.id)}}},sn=rn,on=Object(F["a"])(sn,nn,an,!1,null,null,null),ln=on.exports,cn={Feature:Xe,Performance:nt,Loading:ct,Search:gt,Drop:Rt,Drag:Xt,InsertRenderTree:ln},dn={name:"App",components:cn,data:function(){var e=Object.keys(cn);return{currentTab:e[0],tabList:e}}},hn=dn,un=(n("925e"),Object(F["a"])(hn,i,r,!1,null,"6c2a65d2",null)),fn=un.exports;n("eeb1");a["a"].config.productionTip=!1,new a["a"]({render:function(e){return e(fn)}}).$mount("#app")},e2ab:function(e,t,n){},eeb1:function(e,t,n){}}); \ No newline at end of file