-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path36-es2015.0aac3a8c78ca457669f6.js
1 lines (1 loc) · 16.4 KB
/
36-es2015.0aac3a8c78ca457669f6.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{FvrZ:function(e,t,n){"use strict";n.d(t,"a",function(){return g}),n.d(t,"b",function(){return N}),n.d(t,"c",function(){return x}),n.d(t,"d",function(){return T}),n.d(t,"e",function(){return j}),n.d(t,"f",function(){return v}),n.d(t,"g",function(){return m}),n.d(t,"h",function(){return C}),n.d(t,"i",function(){return D}),n.d(t,"j",function(){return _}),n.d(t,"k",function(){return f});var s=n("0EQZ"),i=n("7+OI"),r=n("XNiG"),c=n("2Vo4"),d=n("LRne"),a=n("IzEk"),o=n("pLZG"),l=n("1G5W"),h=n("fXoL"),u=n("8LU1"),p=n("cH1L");class b{constructor(){this.expansionModel=new s.c(!0)}toggle(e){this.expansionModel.toggle(this._trackByValue(e))}expand(e){this.expansionModel.select(this._trackByValue(e))}collapse(e){this.expansionModel.deselect(this._trackByValue(e))}isExpanded(e){return this.expansionModel.isSelected(this._trackByValue(e))}toggleDescendants(e){this.expansionModel.isSelected(this._trackByValue(e))?this.collapseDescendants(e):this.expandDescendants(e)}collapseAll(){this.expansionModel.clear()}expandDescendants(e){let t=[e];t.push(...this.getDescendants(e)),this.expansionModel.select(...t.map(e=>this._trackByValue(e)))}collapseDescendants(e){let t=[e];t.push(...this.getDescendants(e)),this.expansionModel.deselect(...t.map(e=>this._trackByValue(e)))}_trackByValue(e){return this.trackBy?this.trackBy(e):e}}class _ extends b{constructor(e,t,n){super(),this.getLevel=e,this.isExpandable=t,this.options=n,this.options&&(this.trackBy=this.options.trackBy)}getDescendants(e){const t=[];for(let n=this.dataNodes.indexOf(e)+1;n<this.dataNodes.length&&this.getLevel(e)<this.getLevel(this.dataNodes[n]);n++)t.push(this.dataNodes[n]);return t}expandAll(){this.expansionModel.select(...this.dataNodes.map(e=>this._trackByValue(e)))}}class f extends b{constructor(e,t){super(),this.getChildren=e,this.options=t,this.options&&(this.trackBy=this.options.trackBy)}expandAll(){this.expansionModel.clear();const e=this.dataNodes.reduce((e,t)=>[...e,...this.getDescendants(t),t],[]);this.expansionModel.select(...e.map(e=>this._trackByValue(e)))}getDescendants(e){const t=[];return this._getDescendants(t,e),t.splice(1)}_getDescendants(e,t){e.push(t);const n=this.getChildren(t);Array.isArray(n)?n.forEach(t=>this._getDescendants(e,t)):Object(i.a)(n)&&n.pipe(Object(a.a)(1),Object(o.a)(Boolean)).subscribe(t=>{for(const n of t)this._getDescendants(e,n)})}}const g=new h.x("CDK_TREE_NODE_OUTLET_NODE");let m=(()=>{class e{constructor(e,t){this.viewContainer=e,this._node=t}}return e.\u0275fac=function(t){return new(t||e)(h.Yb(h.ab),h.Yb(g,8))},e.\u0275dir=h.Tb({type:e,selectors:[["","cdkTreeNodeOutlet",""]]}),e})();class O{constructor(e){this.$implicit=e}}let v=(()=>{class e{constructor(e){this.template=e}}return e.\u0275fac=function(t){return new(t||e)(h.Yb(h.V))},e.\u0275dir=h.Tb({type:e,selectors:[["","cdkTreeNodeDef",""]],inputs:{when:["cdkTreeNodeDefWhen","when"]}}),e})(),x=(()=>{class e{constructor(e,t){this._differs=e,this._changeDetectorRef=t,this._onDestroy=new r.a,this._levels=new Map,this.viewChange=new c.a({start:0,end:Number.MAX_VALUE})}get dataSource(){return this._dataSource}set dataSource(e){this._dataSource!==e&&this._switchDataSource(e)}ngOnInit(){this._dataDiffer=this._differs.find([]).create(this.trackBy)}ngOnDestroy(){this._nodeOutlet.viewContainer.clear(),this.viewChange.complete(),this._onDestroy.next(),this._onDestroy.complete(),this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null)}ngAfterContentChecked(){const e=this._nodeDefs.filter(e=>!e.when);this._defaultNodeDef=e[0],this.dataSource&&this._nodeDefs&&!this._dataSubscription&&this._observeRenderChanges()}_switchDataSource(e){this._dataSource&&"function"==typeof this._dataSource.disconnect&&this.dataSource.disconnect(this),this._dataSubscription&&(this._dataSubscription.unsubscribe(),this._dataSubscription=null),e||this._nodeOutlet.viewContainer.clear(),this._dataSource=e,this._nodeDefs&&this._observeRenderChanges()}_observeRenderChanges(){let e;Object(s.h)(this._dataSource)?e=this._dataSource.connect(this):Object(i.a)(this._dataSource)?e=this._dataSource:Array.isArray(this._dataSource)&&(e=Object(d.a)(this._dataSource)),e&&(this._dataSubscription=e.pipe(Object(l.a)(this._onDestroy)).subscribe(e=>this.renderNodeChanges(e)))}renderNodeChanges(e,t=this._dataDiffer,n=this._nodeOutlet.viewContainer,s){const i=t.diff(e);i&&(i.forEachOperation((t,i,r)=>{if(null==t.previousIndex)this.insertNode(e[r],r,n,s);else if(null==r)n.remove(i),this._levels.delete(t.item);else{const e=n.get(i);n.move(e,r)}}),this._changeDetectorRef.detectChanges())}_getNodeDef(e,t){return 1===this._nodeDefs.length?this._nodeDefs.first:this._nodeDefs.find(n=>n.when&&n.when(t,e))||this._defaultNodeDef}insertNode(e,t,n,s){const i=this._getNodeDef(e,t),r=new O(e);r.level=this.treeControl.getLevel?this.treeControl.getLevel(e):void 0!==s&&this._levels.has(s)?this._levels.get(s)+1:0,this._levels.set(e,r.level),(n||this._nodeOutlet.viewContainer).createEmbeddedView(i.template,r,t),j.mostRecentTreeNode&&(j.mostRecentTreeNode.data=e)}}return e.\u0275fac=function(t){return new(t||e)(h.Yb(h.A),h.Yb(h.i))},e.\u0275cmp=h.Sb({type:e,selectors:[["cdk-tree"]],contentQueries:function(e,t,n){if(1&e&&h.Rb(n,v,!0),2&e){let e;h.Bc(e=h.mc())&&(t._nodeDefs=e)}},viewQuery:function(e,t){if(1&e&&h.Mc(m,!0),2&e){let e;h.Bc(e=h.mc())&&(t._nodeOutlet=e.first)}},hostAttrs:["role","tree",1,"cdk-tree"],inputs:{dataSource:"dataSource",treeControl:"treeControl",trackBy:"trackBy"},exportAs:["cdkTree"],decls:1,vars:0,consts:[["cdkTreeNodeOutlet",""]],template:function(e,t){1&e&&h.ac(0,0)},directives:[m],encapsulation:2}),e})(),j=(()=>{class e{constructor(t,n){this._elementRef=t,this._tree=n,this._destroyed=new r.a,this._dataChanges=new r.a,e.mostRecentTreeNode=this,this._elementRef.nativeElement.classList.add("cdk-tree-node"),this.role="treeitem"}get role(){return"treeitem"}set role(e){this._elementRef.nativeElement.setAttribute("role",e)}get data(){return this._data}set data(e){e!==this._data&&(this._data=e,this._setRoleFromData(),this._dataChanges.next())}get isExpanded(){return this._tree.treeControl.isExpanded(this._data)}_setExpanded(e){this._isAriaExpanded=e,this._elementRef.nativeElement.setAttribute("aria-expanded",""+e)}get level(){return this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._data):this._parentNodeAriaLevel}ngOnInit(){this._parentNodeAriaLevel=function(e){let t=e.parentElement;for(;t&&!k(t);)t=t.parentElement;return t?t.classList.contains("cdk-nested-tree-node")?Object(u.f)(t.getAttribute("aria-level")):0:-1}(this._elementRef.nativeElement),this._elementRef.nativeElement.setAttribute("aria-level",""+(this.level+1))}ngDoCheck(){this.isExpanded!=this._isAriaExpanded&&this._setExpanded(this.isExpanded)}ngOnDestroy(){e.mostRecentTreeNode===this&&(e.mostRecentTreeNode=null),this._dataChanges.complete(),this._destroyed.next(),this._destroyed.complete()}focus(){this._elementRef.nativeElement.focus()}_setRoleFromData(){this.role="treeitem"}}return e.\u0275fac=function(t){return new(t||e)(h.Yb(h.p),h.Yb(x))},e.\u0275dir=h.Tb({type:e,selectors:[["cdk-tree-node"]],inputs:{role:"role"},exportAs:["cdkTreeNode"]}),e.mostRecentTreeNode=null,e})();function k(e){const t=e.classList;return!(!(null==t?void 0:t.contains("cdk-nested-tree-node"))&&!(null==t?void 0:t.contains("cdk-tree")))}let N=(()=>{class e extends j{constructor(e,t,n){super(e,t),this._elementRef=e,this._tree=t,this._differs=n,this._elementRef.nativeElement.classList.add("cdk-nested-tree-node")}ngAfterContentInit(){this._dataDiffer=this._differs.find([]).create(this._tree.trackBy);const e=this._tree.treeControl.getChildren(this.data);Array.isArray(e)?this.updateChildrenNodes(e):Object(i.a)(e)&&e.pipe(Object(l.a)(this._destroyed)).subscribe(e=>this.updateChildrenNodes(e)),this.nodeOutlet.changes.pipe(Object(l.a)(this._destroyed)).subscribe(()=>this.updateChildrenNodes())}ngOnInit(){super.ngOnInit()}ngDoCheck(){super.ngDoCheck()}ngOnDestroy(){this._clear(),super.ngOnDestroy()}updateChildrenNodes(e){const t=this._getNodeOutlet();e&&(this._children=e),t&&this._children?this._tree.renderNodeChanges(this._children,this._dataDiffer,t.viewContainer,this._data):this._dataDiffer.diff([])}_clear(){const e=this._getNodeOutlet();e&&(e.viewContainer.clear(),this._dataDiffer.diff([]))}_getNodeOutlet(){const e=this.nodeOutlet;return e&&e.find(e=>!e._node||e._node===this)}}return e.\u0275fac=function(t){return new(t||e)(h.Yb(h.p),h.Yb(x),h.Yb(h.A))},e.\u0275dir=h.Tb({type:e,selectors:[["cdk-nested-tree-node"]],contentQueries:function(e,t,n){if(1&e&&h.Rb(n,m,!0),2&e){let e;h.Bc(e=h.mc())&&(t.nodeOutlet=e)}},inputs:{role:"role",disabled:"disabled",tabIndex:"tabIndex"},exportAs:["cdkNestedTreeNode"],features:[h.Lb([{provide:j,useExisting:e},{provide:g,useExisting:e}]),h.Jb]}),e})();const y=/([A-Za-z%]+)$/;let C=(()=>{class e{constructor(e,t,n,s){this._treeNode=e,this._tree=t,this._element=n,this._dir=s,this._destroyed=new r.a,this.indentUnits="px",this._indent=40,this._setPadding(),s&&s.change.pipe(Object(l.a)(this._destroyed)).subscribe(()=>this._setPadding(!0)),e._dataChanges.subscribe(()=>this._setPadding())}get level(){return this._level}set level(e){this._setLevelInput(e)}get indent(){return this._indent}set indent(e){this._setIndentInput(e)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}_paddingIndent(){const e=this._treeNode.data&&this._tree.treeControl.getLevel?this._tree.treeControl.getLevel(this._treeNode.data):null,t=null==this._level?e:this._level;return"number"==typeof t?`${t*this._indent}${this.indentUnits}`:null}_setPadding(e=!1){const t=this._paddingIndent();if(t!==this._currentPadding||e){const e=this._element.nativeElement,n=this._dir&&"rtl"===this._dir.value?"paddingRight":"paddingLeft",s="paddingLeft"===n?"paddingRight":"paddingLeft";e.style[n]=t||"",e.style[s]="",this._currentPadding=t}}_setLevelInput(e){this._level=Object(u.f)(e,null),this._setPadding()}_setIndentInput(e){let t=e,n="px";if("string"==typeof e){const s=e.split(y);t=s[0],n=s[1]||n}this.indentUnits=n,this._indent=Object(u.f)(t),this._setPadding()}}return e.\u0275fac=function(t){return new(t||e)(h.Yb(j),h.Yb(x),h.Yb(h.p),h.Yb(p.c,8))},e.\u0275dir=h.Tb({type:e,selectors:[["","cdkTreeNodePadding",""]],inputs:{level:["cdkTreeNodePadding","level"],indent:["cdkTreeNodePaddingIndent","indent"]}}),e})(),D=(()=>{class e{constructor(e,t){this._tree=e,this._treeNode=t,this._recursive=!1}get recursive(){return this._recursive}set recursive(e){this._recursive=Object(u.c)(e)}_toggle(e){this.recursive?this._tree.treeControl.toggleDescendants(this._treeNode.data):this._tree.treeControl.toggle(this._treeNode.data),e.stopPropagation()}}return e.\u0275fac=function(t){return new(t||e)(h.Yb(x),h.Yb(j))},e.\u0275dir=h.Tb({type:e,selectors:[["","cdkTreeNodeToggle",""]],hostBindings:function(e,t){1&e&&h.lc("click",function(e){return t._toggle(e)})},inputs:{recursive:["cdkTreeNodeToggleRecursive","recursive"]}}),e})(),T=(()=>{class e{}return e.\u0275mod=h.Wb({type:e}),e.\u0275inj=h.Vb({factory:function(t){return new(t||e)}}),e})()},tmcM:function(e,t,n){"use strict";n.r(t),n.d(t,"CdkTreeExamplesModule",function(){return f}),n.d(t,"CdkTreeFlatExample",function(){return h}),n.d(t,"CdkTreeNestedExample",function(){return _});var s=n("FvrZ"),i=n("fXoL"),r=n("bTqV"),c=n("NFeN"),d=n("0EQZ");function a(e,t){if(1&e&&(Object(i.ec)(0,"cdk-tree-node",3),Object(i.Zb)(1,"button",4),Object(i.Sc)(2),Object(i.dc)()),2&e){const e=t.$implicit,n=Object(i.pc)();Object(i.Nc)("display",n.shouldRender(e)?"flex":"none"),Object(i.Mb)(2),Object(i.Uc)(" ",e.name," ")}}function o(e,t){if(1&e&&(Object(i.ec)(0,"cdk-tree-node",3),Object(i.ec)(1,"button",5),Object(i.lc)("click",function(){const e=t.$implicit;return e.isExpanded=!e.isExpanded}),Object(i.ec)(2,"mat-icon",6),Object(i.Sc)(3),Object(i.dc)(),Object(i.dc)(),Object(i.Sc)(4),Object(i.dc)()),2&e){const e=t.$implicit,n=Object(i.pc)();Object(i.Nc)("display",n.shouldRender(e)?"flex":"none"),Object(i.Mb)(1),Object(i.Nc)("visibility",e.expandable?"visible":"hidden"),Object(i.Nb)("aria-label","Toggle "+e.name),Object(i.Mb)(2),Object(i.Uc)(" ",n.treeControl.isExpanded(e)?"expand_more":"chevron_right"," "),Object(i.Mb)(1),Object(i.Uc)(" ",e.name," ")}}const l=[{name:"Fruit",expandable:!0,level:0},{name:"Apple",expandable:!1,level:1},{name:"Banana",expandable:!1,level:1},{name:"Fruit loops",expandable:!1,level:1},{name:"Vegetables",expandable:!0,level:0},{name:"Green",expandable:!0,level:1},{name:"Broccoli",expandable:!1,level:2},{name:"Brussels sprouts",expandable:!1,level:2},{name:"Orange",expandable:!0,level:1},{name:"Pumpkins",expandable:!1,level:2},{name:"Carrots",expandable:!1,level:2}];let h=(()=>{class e{constructor(){this.treeControl=new s.j(e=>e.level,e=>e.expandable),this.dataSource=new d.a(l),this.hasChild=(e,t)=>t.expandable}getParentNode(e){for(let t=l.indexOf(e)-1;t>=0;t--)if(l[t].level===e.level-1)return l[t];return null}shouldRender(e){let t=this.getParentNode(e);for(;t;){if(!t.isExpanded)return!1;t=this.getParentNode(t)}return!0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Object(i.Sb)({type:e,selectors:[["cdk-tree-flat-example"]],decls:3,vars:3,consts:[[3,"dataSource","treeControl"],["cdkTreeNodePadding","","class","example-tree-node",3,"display",4,"cdkTreeNodeDef"],["cdkTreeNodePadding","","class","example-tree-node",3,"display",4,"cdkTreeNodeDef","cdkTreeNodeDefWhen"],["cdkTreeNodePadding","",1,"example-tree-node"],["mat-icon-button","","disabled",""],["mat-icon-button","","cdkTreeNodeToggle","",3,"click"],[1,"mat-icon-rtl-mirror"]],template:function(e,t){1&e&&(Object(i.ec)(0,"cdk-tree",0),Object(i.Qc)(1,a,3,3,"cdk-tree-node",1),Object(i.Qc)(2,o,5,7,"cdk-tree-node",2),Object(i.dc)()),2&e&&(Object(i.vc)("dataSource",t.dataSource)("treeControl",t.treeControl),Object(i.Mb)(2),Object(i.vc)("cdkTreeNodeDefWhen",t.hasChild))},directives:[s.c,s.f,s.e,s.h,r.b,s.i,c.a],styles:[".example-tree-node[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n}"]}),e})();function u(e,t){if(1&e&&(Object(i.ec)(0,"cdk-nested-tree-node",3),Object(i.Zb)(1,"button",4),Object(i.Sc)(2),Object(i.dc)()),2&e){const e=t.$implicit;Object(i.Mb)(2),Object(i.Uc)(" ",e.name," ")}}function p(e,t){if(1&e&&(Object(i.ec)(0,"cdk-nested-tree-node",3),Object(i.ec)(1,"button",5),Object(i.ec)(2,"mat-icon",6),Object(i.Sc)(3),Object(i.dc)(),Object(i.dc)(),Object(i.Sc)(4),Object(i.ec)(5,"div"),Object(i.ac)(6,7),Object(i.dc)(),Object(i.dc)()),2&e){const e=t.$implicit,n=Object(i.pc)();Object(i.Mb)(1),Object(i.Nb)("aria-label","Toggle "+e.name),Object(i.Mb)(2),Object(i.Uc)(" ",n.treeControl.isExpanded(e)?"expand_more":"chevron_right"," "),Object(i.Mb)(1),Object(i.Uc)(" ",e.name," "),Object(i.Mb)(1),Object(i.Qb)("example-tree-invisible",!n.treeControl.isExpanded(e))}}const b=[{name:"Fruit",children:[{name:"Apple"},{name:"Banana"},{name:"Fruit loops"}]},{name:"Vegetables",children:[{name:"Green",children:[{name:"Broccoli"},{name:"Brussels sprouts"}]},{name:"Orange",children:[{name:"Pumpkins"},{name:"Carrots"}]}]}];let _=(()=>{class e{constructor(){this.treeControl=new s.k(e=>e.children),this.dataSource=new d.a(b),this.hasChild=(e,t)=>!!t.children&&t.children.length>0}}return e.\u0275fac=function(t){return new(t||e)},e.\u0275cmp=Object(i.Sb)({type:e,selectors:[["cdk-tree-nested-example"]],decls:3,vars:3,consts:[[3,"dataSource","treeControl"],["class","example-tree-node",4,"cdkTreeNodeDef"],["class","example-tree-node",4,"cdkTreeNodeDef","cdkTreeNodeDefWhen"],[1,"example-tree-node"],["mat-icon-button","","disabled",""],["mat-icon-button","","cdkTreeNodeToggle",""],[1,"mat-icon-rtl-mirror"],["cdkTreeNodeOutlet",""]],template:function(e,t){1&e&&(Object(i.ec)(0,"cdk-tree",0),Object(i.Qc)(1,u,3,1,"cdk-nested-tree-node",1),Object(i.Qc)(2,p,7,5,"cdk-nested-tree-node",2),Object(i.dc)()),2&e&&(Object(i.vc)("dataSource",t.dataSource)("treeControl",t.treeControl),Object(i.Mb)(2),Object(i.vc)("cdkTreeNodeDefWhen",t.hasChild))},directives:[s.c,s.f,s.b,r.b,s.i,c.a,s.g],styles:[".example-tree-invisible[_ngcontent-%COMP%] {\n display: none;\n}\n\n.example-tree[_ngcontent-%COMP%] ul[_ngcontent-%COMP%], .example-tree[_ngcontent-%COMP%] li[_ngcontent-%COMP%] {\n margin-top: 0;\n margin-bottom: 0;\n list-style-type: none;\n}\n.example-tree-node[_ngcontent-%COMP%] {\n display: block;\n}\n\n.example-tree-node[_ngcontent-%COMP%] .example-tree-node[_ngcontent-%COMP%] {\n padding-left: 40px;\n}"]}),e})(),f=(()=>{class e{}return e.\u0275mod=Object(i.Wb)({type:e}),e.\u0275inj=Object(i.Vb)({factory:function(t){return new(t||e)},imports:[[s.d,r.c,c.b]]}),e})()}}]);