You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
5.2 KiB

(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/ly-tree/ly-tree-node"],{"09f8":function(e,t,n){"use strict";var d;n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return d}));var i=function(){var e=this,t=e.$createElement,n=(e._self._c,e.node.icon&&e.node.icon.length>0?e.node.icon.indexOf("/"):null),d=!e.renderAfterExpand||e.childNodeRendered?e.__map(e.node.childNodesId,(function(t,n){var d=e.__get_orig(t),i=e.getNodeKey(t);return{$orig:d,m0:i}})):null;e.$mp.data=Object.assign({},{$root:{g0:n,l0:d}})},o=[]},"6ae6":function(e,t,n){"use strict";n.r(t);var d=n("09f8"),i=n("e6ca");for(var o in i)"default"!==o&&function(e){n.d(t,e,(function(){return i[e]}))}(o);n("88ea");var c,h=n("f0c5"),r=Object(h["a"])(i["default"],d["b"],d["c"],!1,null,null,null,!1,d["a"],c);t["default"]=r.exports},7494:function(e,t,n){},"88ea":function(e,t,n){"use strict";var d=n("7494"),i=n.n(d);i.a},"9ef69":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var d=n("3bb4"),i=function(){n.e("components/ly-tree/components/ly-checkbox").then(function(){return resolve(n("718e"))}.bind(null,n)).catch(n.oe)},o={name:"LyTreeNode",componentName:"LyTreeNode",components:{lyCheckbox:i},props:{nodeId:[Number,String],renderAfterExpand:{type:Boolean,default:!0},checkOnlyLeaf:{type:Boolean,default:!1},showCheckbox:{type:Boolean,default:!1},showRadio:{type:Boolean,default:!1},indent:Number,iconClass:String},data:function(){return{node:{indeterminate:!1,checked:!1,expanded:!1},expanded:!1,childNodeRendered:!1,oldChecked:null,oldIndeterminate:null,highlightCurrent:!1}},inject:["tree"],computed:{checkboxVisible:function(){return this.checkOnlyLeaf?this.showCheckbox&&this.node.isLeaf:this.showCheckbox},radioVisible:function(){return this.checkOnlyLeaf?this.showRadio&&this.node.isLeaf:this.showRadio}},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){var t=this.tree.store.root.getChildNodes([e])[0];return(0,d.getNodeKey)(this.tree.nodeKey,t.data)},handleSelectChange:function(e,t){if(this.oldChecked!==e&&this.oldIndeterminate!==t){if(this.checkOnlyLeaf&&!this.node.isLeaf)return;if(this.checkboxVisible){var n=this.tree.store._getAllNodes();this.tree.$emit("check-change",{checked:e,indeterminate:t,node:this.node,data:this.node.data,checkedall:n.every((function(e){return e.checked}))})}else this.tree.$emit("radio-change",{checked:e,node:this.node,data:this.node.data,checkedall:!1})}!this.expanded&&this.tree.expandOnCheckNode&&e&&this.handleExpandIconClick(),this.oldChecked=e,this.indeterminate=t},handleClick:function(){this.tree.store.setCurrentNode(this.node),this.tree.$emit("current-change",{node:this.node,data:this.tree.store.currentNode?this.tree.store.currentNode.data:null,currentNode:this.tree.store.currentNode}),this.tree.currentNode=this.node,this.tree.expandOnClickNode&&this.handleExpandIconClick(),this.tree.checkOnClickNode&&!this.node.disabled&&(this.checkboxVisible||this.radioVisible)&&this.handleCheckChange(!this.node.checked),this.tree.$emit("node-click",this.node)},handleExpandIconClick:function(){this.node.isLeaf||(this.expanded?(this.tree.$emit("node-collapse",this.node),this.node.collapse()):(this.node.expand(),this.tree.$emit("node-expand",this.node),this.tree.accordion&&e.$emit("".concat(this.tree.elId,"-tree-node-expand"),this.node)))},handleCheckChange:function(e){var t=this;this.node.disabled||(this.checkboxVisible?this.node.setChecked(e,!(this.tree.checkStrictly||this.checkOnlyLeaf)):this.node.setRadioChecked(e),this.$nextTick((function(){t.tree.$emit("check",{node:t.node,data:t.node.data,checkedNodes:t.tree.store.getCheckedNodes(),checkedKeys:t.tree.store.getCheckedKeys(),halfCheckedNodes:t.tree.store.getHalfCheckedNodes(),halfCheckedKeys:t.tree.store.getHalfCheckedKey
;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
'components/ly-tree/ly-tree-node-create-component',
{
'components/ly-tree/ly-tree-node-create-component':(function(module, exports, __webpack_require__){
__webpack_require__('543d')['createComponent'](__webpack_require__("6ae6"))
})
},
[['components/ly-tree/ly-tree-node-create-component']]
]);