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K5D,OAAOyB,CACT,CAEAC,cACA,WArGW1C,yCAA4B,0BAA5BA,EAA4B2C,UAAA,iCAAAC,OAAA,CAAAxC,MAAA,QAAApB,YAAA,cAAAd,iBAAA,mBAAAC,eAAA,iBAAAC,iBAAA,mBAAA8D,cAAA,gBAAAvD,iBAAA,mBAAA0B,mBAAA,qBAAAC,sBAAA,yBAAAuC,QAAA,CAAAtC,WAAA,aAAAE,SAAA,WAAAC,WAAA,aAAAC,aAAA,gBAAAmC,SAAA,CAAAnG,OAAAoG,MAAA,EAAAC,KAAA,EAAAC,OAAA,i5BAAAC,SAAA,SAAAC,EAAAC,GAAA,EAAAD,GDJzCxG,MAnBA,EAAA0G,EAAA,qBAmBA1G,CAnByC,EAAA2G,EAAA,wBAA1B3G,MAAA,OAAAyG,EAAA/C,oBAmBJ1D,cAAA,OAAAyG,EAAAtD,QAAAmC,qoBCIEjC,CAA4B","names":["i0","_r1","ctx_r1","treeControl","expandAll","collapsed","_r3","collapseAll","EformTreeViewPickerComponent_ng_container_0_button_1_Template","EformTreeViewPickerComponent_ng_container_0_button_2_Template","_r6","node_r5","$implicit","createChild","id","_r7","edit","_r8","delete","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_1_ng_container_8_ng_container_6_Template","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_1_ng_container_8_ng_container_7_Template","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_1_ng_container_8_ng_container_8_Template","menu_r9","showCreateAction","showEditAction","showDeleteAction","_r4","selected","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_1_ng_container_8_Template","_c0","getLevel","_c1","lockSelectedNode","selectedFolderIds","includes","name","microtingUId","showActions","_r10","node_r11","_r12","_r13","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_2_ng_container_10_ng_container_6_Template","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_2_ng_container_10_ng_container_7_Template","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_2_ng_container_10_ng_container_8_Template","menu_r14","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_2_ng_container_10_Template","_c2","isExpanded","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_1_Template","EformTreeViewPickerComponent_mat_tree_1_mat_tree_node_2_Template","folders","hasChild","EformTreeViewPickerComponent","_EformTreeViewPickerComponent","constructor","this","nodes","showCollapseButton","allowSelectingParents","createNode","EventEmitter","editNode","deleteNode","nodeSelected","_transformer","node","level","expandable","children","length","description","createdAt","FlatTreeControl","treeFlattener","MatTreeFlattener","_","MatTreeFlatDataSource","folderId","folder","flatten","find","emit","ngOnChanges","changes","currentValue","data","focusedNodeId","flattenFolders","reverse","findId","i","parentId","array","returnArray","ngOnDestroy","selectors","inputs","outputs","features","decls","vars","consts","template","rf","ctx","EformTreeViewPickerComponent_ng_container_0_Template","EformTreeViewPickerComponent_mat_tree_1_Template"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/common/modules/eform-shared/components/eform-tree-view-picker/eform-tree-view-picker.component.html","./src/app/common/modules/eform-shared/components/eform-tree-view-picker/eform-tree-view-picker.component.ts"],"sourcesContent":["\n \n \n\n\n\n 0}\">\n \n
folder_open\n
\n {{node.name}}\n
\n
({{ node.microtingUId }})\n
\n \n \n \n \n \n \n \n \n \n \n \n \n\n \n
\n\n \n \n \n \n \n ({{ node.microtingUId }})\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n\n","import {\n Component,\n EventEmitter,\n Input,\n OnChanges, OnDestroy,\n Output,\n SimpleChanges,\n} from '@angular/core';\nimport { FolderDto } from 'src/app/common/models/dto/folder.dto';\nimport {FlatTreeControl} from '@angular/cdk/tree';\nimport {MatTreeFlatDataSource, MatTreeFlattener} from '@angular/material/tree';\n\ninterface FlatNode {\n expandable: boolean;\n name: string;\n level: number;\n}\n\n@Component({\n selector: 'app-eform-tree-view-picker',\n templateUrl: './eform-tree-view-picker.component.html',\n styleUrls: ['./eform-tree-view-picker.component.scss'],\n})\nexport class EformTreeViewPickerComponent implements OnChanges, OnDestroy {\n @Input() nodes: FolderDto[] = [];\n @Input() showActions = false;\n @Input() showCreateAction = true;\n @Input() showEditAction = true;\n @Input() showDeleteAction = true;\n @Input() focusedNodeId: number;\n @Input() lockSelectedNode = false;\n @Input() showCollapseButton = true;\n @Input() allowSelectingParents = true;\n @Output() createNode: EventEmitter = new EventEmitter();\n @Output() editNode: EventEmitter = new EventEmitter();\n @Output() deleteNode: EventEmitter = new EventEmitter();\n @Output() nodeSelected: EventEmitter = new EventEmitter<\n FolderDto\n >();\n collapsed = true;\n selectedFolderIds: number[] = [];\n\n private _transformer = (node: FolderDto, level: number) => {\n return {\n expandable: !!node.children && node.children.length > 0,\n name: node.name,\n level: level,\n id: node.id,\n microtingUId: node.microtingUId,\n description: node.description,\n createdAt: node.createdAt,\n };\n };\n\n treeControl = new FlatTreeControl(\n node => node.level,\n node => node.expandable,\n );\n\n treeFlattener = new MatTreeFlattener(\n this._transformer,\n node => node.level,\n node => node.expandable,\n node => node.children,\n );\n\n hasChild = (_: number, node: FlatNode) => node.expandable;\n\n getLevel = (node: FlatNode) => node.level;\n\n folders = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);\n\n delete(folderId: number) {\n const folder = this.flatten(this.nodes).find((node) => node.id === folderId)\n this.deleteNode.emit(folder);\n }\n\n edit(folderId: number) {\n const folder = this.flatten(this.nodes).find((node) => node.id === folderId)\n this.editNode.emit(folder);\n }\n\n createChild(folderId: number) {\n const folder = this.flatten(this.nodes).find((node) => node.id === folderId)\n this.createNode.emit(folder);\n }\n\n selected(folderId: number) {\n if(!this.lockSelectedNode) {\n const folder = this.flatten(this.nodes).find((node) => node.id === folderId);\n this.nodeSelected.emit(folder);\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if(changes && changes.nodes && changes.nodes.currentValue){\n this.folders.data = changes.nodes.currentValue;\n }\n if (changes && changes.focusedNodeId && changes.focusedNodeId.currentValue) {\n this.selectedFolderIds = [];\n const flattenFolders = this.flatten(this.nodes).reverse();\n let findId = changes.focusedNodeId.currentValue;\n for (let i = 0; i < flattenFolders.length; i++) {\n if (flattenFolders[i].id === findId) {\n this.selectedFolderIds = [...this.selectedFolderIds, flattenFolders[i].id];\n findId = flattenFolders[i].parentId;\n }\n }\n }\n }\n\n flatten(array: FolderDto[]) {\n let returnArray = [...array];\n for(let i = 0; i < array.length; i++) {\n if(array[i].children) {\n returnArray = [...returnArray, ...this.flatten(array[i].children)];\n }/* else {\n returnArray = [...returnArray, ...array[i].children];\n }*/\n }\n return returnArray;\n }\n\n ngOnDestroy(): void {\n }\n}\n"],"x_google_ignoreList":[]}