qms-angular 1.0.58 → 1.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4029,7 +4029,7 @@ class TreeComponent {
4029
4029
  else if (!!node.children &&
4030
4030
  node.children.length &&
4031
4031
  node.children.length === 1 &&
4032
- !node.children[0].name.length &&
4032
+ !node.children[0].name &&
4033
4033
  node.id.toString() === this.areaOfCurrentProcess) {
4034
4034
  checkHasChild = false;
4035
4035
  }
@@ -4077,11 +4077,13 @@ class TreeComponent {
4077
4077
  (changes.selectedData.currentValue.length > 0 ||
4078
4078
  JSON.stringify(changes.selectedData.currentValue) !==
4079
4079
  JSON.stringify(changes.selectedData.previousValue))) {
4080
- this.checkSelected(changes.selectedData.currentValue);
4081
- }
4082
- else {
4083
- for (let i = 0; i < this.treeControl.dataNodes.length; i++) {
4084
- this.checklistSelection.deselect(this.treeControl.dataNodes[i]);
4080
+ if (changes.selectedData.currentValue) {
4081
+ this.checkSelected(changes.selectedData.currentValue);
4082
+ }
4083
+ else {
4084
+ for (let i = 0; i < this.treeControl.dataNodes.length; i++) {
4085
+ this.checklistSelection.deselect(this.treeControl.dataNodes[i]);
4086
+ }
4085
4087
  }
4086
4088
  }
4087
4089
  if (changes.disabledList && JSON.stringify(changes.disabledList.currentValue) !== JSON.stringify(changes.disabledList.previousValue)) {
@@ -4093,7 +4095,7 @@ class TreeComponent {
4093
4095
  }
4094
4096
  }
4095
4097
  ngOnInit() {
4096
- this.initTreeData();
4098
+ // this.initTreeData();
4097
4099
  }
4098
4100
  initTreeData() {
4099
4101
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
@@ -4150,10 +4152,29 @@ class TreeComponent {
4150
4152
  this.checkSelected(selectedData);
4151
4153
  this.checkBoxEvent.emit(selectedData);
4152
4154
  }
4153
- //check disabled list
4154
- this.checkDisabledList();
4155
- // expand to child node
4156
- this.openExpandToChildNode();
4155
+ if (this.parentNodeOnClick) {
4156
+ for (let i = 0; i < this.treeControl.dataNodes.length; i++) {
4157
+ const tree = this.treeControl.dataNodes[i];
4158
+ if (this.parentNodeOnClick.parentId === tree.id || this.parentNodeOnClick.id === tree.id) {
4159
+ this.getParent(tree);
4160
+ }
4161
+ }
4162
+ }
4163
+ }
4164
+ getParent(node) {
4165
+ const { treeControl } = this;
4166
+ const currentLevel = treeControl.getLevel(node);
4167
+ if (currentLevel < 1) {
4168
+ return null;
4169
+ }
4170
+ const index = treeControl.dataNodes.indexOf(node) - 1;
4171
+ for (let i = index; i >= 0; i--) {
4172
+ const currentNode = treeControl.dataNodes[i];
4173
+ if (treeControl.getLevel(currentNode) < currentLevel) {
4174
+ treeControl.expand(currentNode);
4175
+ return currentNode;
4176
+ }
4177
+ }
4157
4178
  }
4158
4179
  openExpandToChildNode() {
4159
4180
  if (this.expandToChildNode.length) {
@@ -4398,7 +4419,9 @@ class TreeComponent {
4398
4419
  }
4399
4420
  }
4400
4421
  });
4401
- this.checkBoxEvent.emit(this.checklistSelection.selected);
4422
+ setTimeout(() => {
4423
+ this.checkBoxEvent.emit(this.checklistSelection.selected);
4424
+ }, 500);
4402
4425
  }
4403
4426
  todoFolderSelection(nodes) {
4404
4427
  nodes.forEach(node => {
@@ -4659,7 +4682,7 @@ class TreeComponent {
4659
4682
  TreeComponent.decorators = [
4660
4683
  { type: Component, args: [{
4661
4684
  selector: 'qms-tree',
4662
- template: "<mat-tree\r\n [dataSource]=\"dataSource\"\r\n [treeControl]=\"treeControl\"\r\n class=\"tree__container\"\r\n>\r\n <mat-tree-node\r\n class=\"tree-branch\"\r\n *matTreeNodeDef=\"let node\"\r\n matTreeNodeToggle\r\n matTreeNodePadding\r\n >\r\n <!-- form thu 1 - child -->\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n *ngIf=\"node.name && showCheckBox && !onlyCheckBoxForChild && !onlyFolder\"\r\n class=\"checklist-leaf-node\"\r\n [checked]=\"checklistSelection.isSelected(node)\"\r\n (change)=\"todoItemSelectionToggle(node)\"\r\n >\r\n </mat-checkbox>\r\n\r\n <!-- form thu 2 -->\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n *ngIf=\"node.name && showCheckBox && onlyCheckBoxForChild && !onlyFolder\"\r\n class=\"ml-10 checklist-leaf-node\"\r\n [checked]=\"checklistSelection.isSelected(node)\"\r\n (change)=\"todoItemSelectionToggle(node)\"\r\n ></mat-checkbox>\r\n <div\r\n class=\"expand-node\"\r\n *ngIf=\"node.name && !onlyFolder\"\r\n [class.bgSelected]=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n (click)=\"selectNode(node)\"\r\n [id]=\"getNodeId(node)\"\r\n >\r\n <div class=\"expand-node__text\">\r\n <mat-icon\r\n *ngIf=\"displayType === itemIconType.name && !onlyCheckBoxForChild\"\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n >\r\n {{ itemIcon }}\r\n </mat-icon>\r\n\r\n <mat-icon\r\n *ngIf=\"displayType === itemIconType.svg && !onlyCheckBoxForChild\"\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n [svgIcon]=\"itemIconSvg\"\r\n >\r\n </mat-icon>\r\n\r\n <img\r\n *ngIf=\"displayType === itemIconType.path && !onlyCheckBoxForChild\"\r\n class=\"mat-icon\"\r\n [src]=\"itemIconPath\"\r\n />\r\n\r\n <img\r\n *ngIf=\"displayType === itemIconType.base64 && !onlyCheckBoxForChild\"\r\n class=\"mat-icon image-base64\"\r\n [src]=\"getImagePath()\"\r\n />\r\n\r\n <mat-icon\r\n *ngIf=\"displayType === itemIconType.none && !onlyCheckBoxForChild\"\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n [svgIcon]=\"getItemIcon(node)\"\r\n ></mat-icon>\r\n <span class=\"text-node\">{{ node.name }}</span>\r\n </div>\r\n <mat-icon\r\n class=\"icon-check\"\r\n *ngIf=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n >done</mat-icon\r\n >\r\n </div>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding>\r\n <!-- form thu 1 - parent -->\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n *ngIf=\"showCheckBox && !onlyCheckBoxForChild\"\r\n [checked]=\"descendantsAllSelected(node)\"\r\n [indeterminate]=\"descendantsPartiallySelected(node)\"\r\n (change)=\"todoItemSelectionToggle(node)\"\r\n ></mat-checkbox>\r\n <button\r\n class=\"button-boder\"\r\n mat-icon-button\r\n matTreeNodeToggle\r\n [disableRipple]=\"!node.hasChild\"\r\n [attr.aria-label]=\"'toggle ' + node.filename\"\r\n >\r\n <mat-icon\r\n *ngIf=\"openIcon && closeIcon\"\r\n class=\"mat-icon-rtl-mirror\"\r\n [ngStyle]=\"{\r\n color: treeControl.isExpanded(node) ? openIconColor : closeIconColor\r\n }\"\r\n >{{ getNodeIcon(node) }}</mat-icon\r\n >\r\n <mat-icon\r\n *ngIf=\"!openIcon || !closeIcon\"\r\n class=\"mat-icon-rtl-mirror\"\r\n [ngClass]=\"{\r\n 'open-icon': treeControl.isExpanded(node),\r\n 'not-department-icon': moduleId !== dataType.document\r\n }\"\r\n [svgIcon]=\"getNodeIcon(node)\"\r\n >\r\n </mat-icon>\r\n </button>\r\n <span\r\n *ngIf=\"expandOnTitleClick\"\r\n matTreeNodeToggle\r\n class=\"text-node-parent\"\r\n style=\"cursor: pointer\"\r\n (click)=\"onExpandNode(node)\"\r\n [ngStyle]=\"{\r\n color: treeControl.isExpanded(node) ? openIconColor : '#000000'\r\n }\"\r\n >\r\n <span>{{ node.name }}</span>\r\n <mat-icon\r\n class=\"icon-check\"\r\n *ngIf=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n >done</mat-icon\r\n >\r\n </span>\r\n <span\r\n *ngIf=\"!expandOnTitleClick\"\r\n class=\"text-node-parent\"\r\n (click)=\"selectFolderNode(node)\"\r\n style=\"cursor: pointer\"\r\n [id]=\"getNodeId(node)\"\r\n >\r\n <span>{{ node.name }}</span>\r\n <mat-icon\r\n class=\"icon-check\"\r\n *ngIf=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n >done</mat-icon\r\n >\r\n </span>\r\n </mat-tree-node>\r\n</mat-tree>\r\n",
4685
+ template: "<mat-tree\r\n [dataSource]=\"dataSource\"\r\n [treeControl]=\"treeControl\"\r\n class=\"tree__container\"\r\n>\r\n <mat-tree-node\r\n class=\"tree-branch\"\r\n *matTreeNodeDef=\"let node\"\r\n matTreeNodeToggle\r\n matTreeNodePadding\r\n >\r\n <!-- form thu 1 - child -->\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n *ngIf=\"node.name && showCheckBox && !onlyCheckBoxForChild && !onlyFolder\"\r\n class=\"checklist-leaf-node\"\r\n [checked]=\"checklistSelection.isSelected(node)\"\r\n (change)=\"todoItemSelectionToggle(node)\"\r\n >\r\n </mat-checkbox>\r\n\r\n <!-- form thu 2 -->\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n *ngIf=\"node.name && showCheckBox && onlyCheckBoxForChild && !onlyFolder\"\r\n class=\"ml-10 checklist-leaf-node\"\r\n [checked]=\"checklistSelection.isSelected(node)\"\r\n (change)=\"todoItemSelectionToggle(node)\"\r\n ></mat-checkbox>\r\n <div\r\n class=\"expand-node\"\r\n *ngIf=\"node.name && !onlyFolder\"\r\n [class.bgSelected]=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n (click)=\"selectNode(node)\"\r\n [id]=\"getNodeId(node)\"\r\n >\r\n <div class=\"expand-node__text\">\r\n <mat-icon\r\n *ngIf=\"displayType === itemIconType.name && !onlyCheckBoxForChild\"\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n >\r\n {{ itemIcon }}\r\n </mat-icon>\r\n\r\n <mat-icon\r\n *ngIf=\"displayType === itemIconType.svg && !onlyCheckBoxForChild\"\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n [svgIcon]=\"itemIconSvg\"\r\n >\r\n </mat-icon>\r\n\r\n <img\r\n *ngIf=\"displayType === itemIconType.path && !onlyCheckBoxForChild\"\r\n class=\"mat-icon\"\r\n [src]=\"itemIconPath\"\r\n />\r\n\r\n <img\r\n *ngIf=\"displayType === itemIconType.base64 && !onlyCheckBoxForChild\"\r\n class=\"mat-icon image-base64\"\r\n [src]=\"getImagePath()\"\r\n />\r\n\r\n <mat-icon\r\n *ngIf=\"displayType === itemIconType.none && !onlyCheckBoxForChild\"\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n [svgIcon]=\"getItemIcon(node)\"\r\n ></mat-icon>\r\n <span class=\"text-node\">{{ node.name }}</span>\r\n </div>\r\n <mat-icon\r\n class=\"icon-check\"\r\n *ngIf=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n >done</mat-icon\r\n >\r\n </div>\r\n </mat-tree-node>\r\n\r\n <mat-tree-node *matTreeNodeDef=\"let node; when: hasChild\" matTreeNodePadding>\r\n <!-- form thu 1 - parent -->\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n *ngIf=\"node.name && showCheckBox && !onlyCheckBoxForChild\"\r\n [checked]=\"descendantsAllSelected(node)\"\r\n [indeterminate]=\"descendantsPartiallySelected(node)\"\r\n (change)=\"todoItemSelectionToggle(node)\"\r\n ></mat-checkbox>\r\n <button\r\n class=\"button-boder\"\r\n mat-icon-button\r\n matTreeNodeToggle\r\n [disableRipple]=\"!node.hasChild\"\r\n [attr.aria-label]=\"'toggle ' + node.filename\"\r\n *ngIf=\"node.name\"\r\n >\r\n <mat-icon\r\n *ngIf=\"openIcon && closeIcon\"\r\n class=\"mat-icon-rtl-mirror\"\r\n [ngStyle]=\"{\r\n color: treeControl.isExpanded(node) ? openIconColor : closeIconColor\r\n }\"\r\n >{{ getNodeIcon(node) }}</mat-icon\r\n >\r\n <mat-icon\r\n *ngIf=\"!openIcon || !closeIcon\"\r\n class=\"mat-icon-rtl-mirror\"\r\n [ngClass]=\"{\r\n 'open-icon': treeControl.isExpanded(node),\r\n 'not-department-icon': moduleId !== dataType.document\r\n }\"\r\n [svgIcon]=\"getNodeIcon(node)\"\r\n >\r\n </mat-icon>\r\n </button>\r\n <span\r\n *ngIf=\"expandOnTitleClick\"\r\n matTreeNodeToggle\r\n class=\"text-node-parent\"\r\n style=\"cursor: pointer\"\r\n (click)=\"onExpandNode(node)\"\r\n [ngStyle]=\"{\r\n color: treeControl.isExpanded(node) ? openIconColor : '#000000'\r\n }\"\r\n >\r\n <span>{{ node.name }}</span>\r\n <mat-icon\r\n class=\"icon-check\"\r\n *ngIf=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n >done</mat-icon\r\n >\r\n </span>\r\n <span\r\n *ngIf=\"!expandOnTitleClick\"\r\n class=\"text-node-parent\"\r\n (click)=\"selectFolderNode(node)\"\r\n style=\"cursor: pointer\"\r\n [id]=\"getNodeId(node)\"\r\n >\r\n <span>{{ node.name }}</span>\r\n <mat-icon\r\n class=\"icon-check\"\r\n *ngIf=\"treeConfig.selectOne && idCheckIcon == node.id\"\r\n >done</mat-icon\r\n >\r\n </span>\r\n </mat-tree-node>\r\n</mat-tree>\r\n",
4663
4686
  encapsulation: ViewEncapsulation.None,
4664
4687
  styles: ["@font-face{font-family:Open Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/opensans/v20/mem8YaGs126MiZpBA-UFWJ0bbck.woff2) format(\"woff2\");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/opensans/v20/mem8YaGs126MiZpBA-UFUZ0bbck.woff2) format(\"woff2\");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/opensans/v20/mem8YaGs126MiZpBA-UFWZ0bbck.woff2) format(\"woff2\");unicode-range:U+1f??}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/opensans/v20/mem8YaGs126MiZpBA-UFVp0bbck.woff2) format(\"woff2\");unicode-range:U+0370-03ff}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/opensans/v20/mem8YaGs126MiZpBA-UFWp0bbck.woff2) format(\"woff2\");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/opensans/v20/mem8YaGs126MiZpBA-UFW50bbck.woff2) format(\"woff2\");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Open Sans;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/opensans/v20/mem8YaGs126MiZpBA-UFVZ0b.woff2) format(\"woff2\");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}@font-face{font-family:Raleway;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/raleway/v19/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCFPrEHJA.woff2) format(\"woff2\");unicode-range:U+0460-052f,U+1c80-1c88,U+20b4,U+2de0-2dff,U+a640-a69f,U+fe2e-fe2f}@font-face{font-family:Raleway;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/raleway/v19/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCMPrEHJA.woff2) format(\"woff2\");unicode-range:U+0400-045f,U+0490-0491,U+04b0-04b1,U+2116}@font-face{font-family:Raleway;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/raleway/v19/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCHPrEHJA.woff2) format(\"woff2\");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01a0-01a1,U+01af-01b0,U+1ea0-1ef9,U+20ab}@font-face{font-family:Raleway;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/raleway/v19/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCGPrEHJA.woff2) format(\"woff2\");unicode-range:U+0100-024f,U+0259,U+1e??,U+2020,U+20a0-20ab,U+20ad-20cf,U+2113,U+2c60-2c7f,U+a720-a7ff}@font-face{font-family:Raleway;font-style:normal;font-weight:400;font-display:swap;src:url(https://fonts.gstatic.com/s/raleway/v19/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrE.woff2) format(\"woff2\");unicode-range:U+00??,U+0131,U+0152-0153,U+02bb-02bc,U+02c6,U+02da,U+02dc,U+2000-206f,U+2074,U+20ac,U+2122,U+2191,U+2193,U+2212,U+2215,U+feff,U+fffd}.tree__container{font-family:Open Sans;font-style:normal;font-weight:400;font-size:.875rem;line-height:19px;color:#323232}.tree__container .mat-tree-node{color:#000;min-height:0}.tree__container .mat-tree-node .mat-checkbox.qms-group-options{padding:0}.tree__container .mat-tree-node .mat-checkbox.qms-group-options .mat-checkbox-inner-container{margin-right:11px}.tree__container .button{margin-left:6px}.tree__container .button:focus,.tree__container .button:hover{background-color:#009ef2;border-radius:2px;width:auto}.tree__container .button-boder:focus,.tree__container .button:focus{outline:0}.tree__container .button-folder-boder:focus{outline:0}.tree__container .button-folder-boder:focus,.tree__container .button-folder-boder:hover{background-color:#009ef2;border-radius:2px;width:auto}.tree__container .expand-node{margin-left:8px;min-height:32px;justify-content:space-between;width:100%}.tree__container .expand-node,.tree__container .expand-node .expand-node__text{display:flex;align-items:center}.tree__container .expand-node .mat-icon{color:rgba(0,0,0,.6);margin-right:17px;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.tree__container .expand-node .mat-icon svg{display:block;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.tree__container .expand-node.bgSelected .icon-check{color:#1954a9}.tree__container .text-node-parent{width:100%;display:flex;align-items:center;justify-content:space-between;margin-left:10px;cursor:pointer}.tree__container .text-node-parent.active-item{color:#1954a9!important}.tree__container .text-node-parent.bgSelected .icon-check{color:#1954a9}.tree__container .mr-11{margin-right:11px}.tree__container .ml-10{margin-left:10px}.tree__container .tree-branch:hover{background-color:#e5eefb}.tree__container .image-base64{width:20px;height:20px}.tree__container .mat-checkbox.qms-group-options.mat-checkbox-checked{background:transparent!important}::ng-deep .mat-tree .mat-checkbox.qms-group-options{padding:0}::ng-deep .mat-tree .mat-checkbox.qms-group-options.mat-checkbox-checked{background-color:transparent}::ng-deep .mat-tree .mat-checkbox.qms-group-options .mat-checkbox-inner-container{margin-right:0}svg{display:block;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.open-icon.not-department-icon svg path,.open-icon svg path:first-child{fill:#1954a9}"]
4665
4688
  },] }
@@ -4678,6 +4701,7 @@ TreeComponent.propDecorators = {
4678
4701
  disabledList: [{ type: Input }],
4679
4702
  expandOnTitleClick: [{ type: Input }],
4680
4703
  expandToChildNode: [{ type: Input }],
4704
+ parentNodeOnClick: [{ type: Input }],
4681
4705
  selectNodeEvent: [{ type: Output }],
4682
4706
  selectFolderEvent: [{ type: Output }],
4683
4707
  checkBoxEvent: [{ type: Output }],
@@ -4916,6 +4940,9 @@ class SearchRelatedItemsToChecklist {
4916
4940
  class SearchRelatedItemsToRisk {
4917
4941
  }
4918
4942
 
4943
+ class TreeModel {
4944
+ }
4945
+
4919
4946
  class QMSRelatedGlobalService {
4920
4947
  constructor() {
4921
4948
  this.searchRelated = new BehaviorSubject([]);
@@ -4934,6 +4961,9 @@ QMSRelatedGlobalService.decorators = [
4934
4961
  ];
4935
4962
  QMSRelatedGlobalService.ctorParameters = () => [];
4936
4963
 
4964
+ class TreeFlatNode {
4965
+ }
4966
+
4937
4967
  class RelatedPopupComponent {
4938
4968
  constructor(cdRef, translate, dialogRef, globalService, iconRegistry, sanitizer, appIconService, elem, data) {
4939
4969
  this.cdRef = cdRef;
@@ -4977,6 +5007,7 @@ class RelatedPopupComponent {
4977
5007
  this.listChildrenSelectOne = [];
4978
5008
  this.onSearch = new EventEmitter();
4979
5009
  this.onExpandFolder = new EventEmitter();
5010
+ this.parentNodeSelected = new TreeFlatNode();
4980
5011
  this.moduleId = data.moduleId;
4981
5012
  this.moduleName = data.moduleName;
4982
5013
  this.treeData1 = data.treeData1;
@@ -5022,8 +5053,82 @@ class RelatedPopupComponent {
5022
5053
  }
5023
5054
  });
5024
5055
  this.globalService.splitViewValue.pipe(takeUntil(this.ngUnsubscribe)).subscribe((res) => {
5025
- if (res) {
5026
- this.itemInSplitview = res;
5056
+ this.itemInSplitview = res;
5057
+ if (res.length) {
5058
+ let listNodeProcess = [];
5059
+ let listNodeDocs = [];
5060
+ res.forEach(item => {
5061
+ if (item.itemType === DataType$1.process) {
5062
+ let newNodeProcess = new TreeModel();
5063
+ newNodeProcess.childId = item.id;
5064
+ newNodeProcess.childName = item.itemName;
5065
+ newNodeProcess.displayId = +item.itemNumberId;
5066
+ newNodeProcess.parentId = "";
5067
+ newNodeProcess.rootId = item.parentId;
5068
+ newNodeProcess.rootName = item === null || item === void 0 ? void 0 : item.parentName;
5069
+ newNodeProcess.subName = null;
5070
+ newNodeProcess.statusId = item.status;
5071
+ listNodeProcess.push(newNodeProcess);
5072
+ }
5073
+ else {
5074
+ let newNodeDocs = new TreeModel();
5075
+ newNodeDocs.childId = item.id;
5076
+ newNodeDocs.childName = item.itemName;
5077
+ newNodeDocs.displayId = +item.itemNumberId;
5078
+ newNodeDocs.parentId = "";
5079
+ newNodeDocs.rootId = item.parentId;
5080
+ newNodeDocs.rootName = item === null || item === void 0 ? void 0 : item.parentName;
5081
+ newNodeDocs.subName = null;
5082
+ newNodeDocs.statusId = item.status;
5083
+ listNodeDocs.push(newNodeDocs);
5084
+ }
5085
+ });
5086
+ let idsProcess = new Set(this.treeData1.map(d => d.childId));
5087
+ this.treeData1 = [...this.treeData1, ...listNodeProcess.filter(d => !idsProcess.has(d.childId))];
5088
+ let idsDocs = new Set(this.treeData2.map(d => d.childId));
5089
+ this.treeData2 = [...this.treeData2, ...listNodeDocs.filter(d => !idsDocs.has(d.childId))];
5090
+ if (this.checkedNodeList.length) {
5091
+ this.selectedData = [];
5092
+ this.selectedData2 = [];
5093
+ let selectProcess = [];
5094
+ let selectDocument = [];
5095
+ this.checkedNodeList.forEach(x => {
5096
+ if (x.itemType === DataType$1.area || x.itemType === DataType$1.process) {
5097
+ this.treeData1.forEach(item => {
5098
+ if (item.childId && x.id === item.childId || !item.childId && (x.id === item.rootId)) {
5099
+ selectProcess.push({
5100
+ disabled: false,
5101
+ expandable: x.itemType == DataType$1.area ? true : false,
5102
+ hasChild: x.itemType == DataType$1.area ? true : false,
5103
+ id: x.id,
5104
+ level: 0,
5105
+ levelType: undefined,
5106
+ name: x.itemName,
5107
+ parentId: x.parentId
5108
+ });
5109
+ }
5110
+ });
5111
+ }
5112
+ else {
5113
+ this.treeData2.forEach(item => {
5114
+ if (item.childId && x.id === item.childId || !item.childId && (x.id === item.rootId)) {
5115
+ selectDocument.push({
5116
+ disabled: false,
5117
+ expandable: x.itemType == DataType$1.folder ? true : false,
5118
+ hasChild: x.itemType == DataType$1.folder ? true : false,
5119
+ id: x.id,
5120
+ level: 0,
5121
+ levelType: undefined,
5122
+ name: x.itemName,
5123
+ parentId: x.parentId
5124
+ });
5125
+ }
5126
+ });
5127
+ }
5128
+ });
5129
+ this.selectedData = [...this.selectedData, ...selectProcess];
5130
+ this.selectedData2 = [...this.selectedData2, ...selectDocument];
5131
+ }
5027
5132
  }
5028
5133
  });
5029
5134
  this.myControl.valueChanges.pipe(debounceTime(1000)).subscribe((val) => {
@@ -5160,7 +5265,7 @@ class RelatedPopupComponent {
5160
5265
  return related ? related.itemName : undefined;
5161
5266
  }
5162
5267
  selectRelated(item) {
5163
- var _a, _b;
5268
+ var _a, _b, _c, _d, _e, _f, _g, _h;
5164
5269
  if (((_a = this.treeConfig1) === null || _a === void 0 ? void 0 : _a.selectOne) || ((_b = this.treeConfig2) === null || _b === void 0 ? void 0 : _b.selectOne)) {
5165
5270
  this.disabledList = [];
5166
5271
  this.disabledList2 = [];
@@ -5192,6 +5297,78 @@ class RelatedPopupComponent {
5192
5297
  };
5193
5298
  this.dataTrees.toArray()[1].todoItemSelection([treeNode]);
5194
5299
  }
5300
+ else {
5301
+ let newNodeDocs = new TreeModel();
5302
+ newNodeDocs.rootId = (_c = item.breadcumbs[item.breadcumbs.length - 1]) === null || _c === void 0 ? void 0 : _c['id'];
5303
+ newNodeDocs.rootName = (_d = item.breadcumbs[item.breadcumbs.length - 1]) === null || _d === void 0 ? void 0 : _d['name'];
5304
+ newNodeDocs.parentId = '';
5305
+ newNodeDocs.subName = null;
5306
+ newNodeDocs.childId = item.id;
5307
+ newNodeDocs.childName = item.itemName;
5308
+ newNodeDocs.statusId = item === null || item === void 0 ? void 0 : item['itemStatus'];
5309
+ newNodeDocs.displayId = +item.itemNumberId;
5310
+ this.treeData2 = [...this.treeData2, newNodeDocs];
5311
+ let newSelectedDocs = new TreeFlatNode();
5312
+ newSelectedDocs.disabled = false;
5313
+ newSelectedDocs.expandable = false;
5314
+ newSelectedDocs.hasChild = false;
5315
+ newSelectedDocs.id = item.id;
5316
+ newSelectedDocs.level = 0;
5317
+ newSelectedDocs.levelType = undefined;
5318
+ newSelectedDocs.name = item.itemName;
5319
+ newSelectedDocs.parentId = (_e = item.breadcumbs[item.breadcumbs.length - 1]) === null || _e === void 0 ? void 0 : _e['id'];
5320
+ this.selectedData2 = [];
5321
+ this.selectedData = [];
5322
+ let selectProcess = [];
5323
+ let selectDocument = [];
5324
+ if (this.checkedNodeList.length) {
5325
+ this.checkedNodeList.forEach(x => {
5326
+ if (x.itemType === DataType$1.area || x.itemType === DataType$1.process) {
5327
+ this.treeData1.forEach(item => {
5328
+ if (item.childId && x.id === item.childId || !item.childId && (x.id === item.rootId)) {
5329
+ selectProcess.push({
5330
+ disabled: false,
5331
+ expandable: x.itemType == DataType$1.area ? true : false,
5332
+ hasChild: x.itemType == DataType$1.area ? true : false,
5333
+ id: x.id,
5334
+ level: 0,
5335
+ levelType: undefined,
5336
+ name: x.itemName,
5337
+ parentId: x.parentId
5338
+ });
5339
+ }
5340
+ });
5341
+ }
5342
+ else {
5343
+ this.treeData2.forEach(item => {
5344
+ if (item.childId && x.id === item.childId || !item.childId && (x.id === item.rootId)) {
5345
+ selectDocument.push({
5346
+ disabled: false,
5347
+ expandable: x.itemType == DataType$1.folder ? true : false,
5348
+ hasChild: x.itemType == DataType$1.folder ? true : false,
5349
+ id: x.id,
5350
+ level: 0,
5351
+ levelType: undefined,
5352
+ name: x.itemName,
5353
+ parentId: x.parentId
5354
+ });
5355
+ }
5356
+ });
5357
+ }
5358
+ });
5359
+ }
5360
+ this.selectedData = [...this.selectedData, ...selectProcess];
5361
+ this.selectedData2 = [...this.selectedData2, ...selectDocument, newSelectedDocs];
5362
+ setTimeout(() => {
5363
+ const treeNode = {
5364
+ id: newNodeDocs.childId,
5365
+ name: newNodeDocs.childName,
5366
+ children: [],
5367
+ parentId: newNodeDocs.rootId
5368
+ };
5369
+ this.dataTrees.toArray()[1].todoItemSelection([treeNode]);
5370
+ }, 500);
5371
+ }
5195
5372
  }
5196
5373
  else if (item.itemType === this.dataType.folder) {
5197
5374
  position = this.treeData2.findIndex(x => {
@@ -5207,7 +5384,9 @@ class RelatedPopupComponent {
5207
5384
  itemName: item.itemName,
5208
5385
  itemType: typeId,
5209
5386
  itemNumberId: item.itemNumberId,
5210
- levelType: item.levelType
5387
+ levelType: item.levelType,
5388
+ parentId: item.parentId,
5389
+ parentName: item.parentName
5211
5390
  });
5212
5391
  }
5213
5392
  else {
@@ -5252,7 +5431,9 @@ class RelatedPopupComponent {
5252
5431
  itemName: node.rootName,
5253
5432
  itemType: typeId,
5254
5433
  itemNumberId: item.itemNumberId,
5255
- levelType: item.levelType
5434
+ levelType: item.levelType,
5435
+ parentId: item.parentId,
5436
+ parentName: item.parentName
5256
5437
  });
5257
5438
  }
5258
5439
  else {
@@ -5278,7 +5459,7 @@ class RelatedPopupComponent {
5278
5459
  else if (item.itemType === this.dataType.deviation ||
5279
5460
  item.itemType === this.dataType.checklist) {
5280
5461
  position = this.treeData1.findIndex(x => {
5281
- return x.childId.toLowerCase() === item.id.toLowerCase();
5462
+ return x.childId && x.childId.toLowerCase() === item.id.toLowerCase();
5282
5463
  });
5283
5464
  if (position >= 0) {
5284
5465
  node = this.treeData1[position];
@@ -5294,17 +5475,91 @@ class RelatedPopupComponent {
5294
5475
  }
5295
5476
  else {
5296
5477
  position = this.treeData1.findIndex(x => {
5297
- return x.childId.toLowerCase() === item.id.toLowerCase();
5478
+ return x.childId && x.childId.toLowerCase() === item.id.toLowerCase();
5298
5479
  });
5299
- node = this.treeData1[position];
5300
- typeId = this.itemType;
5301
- const treeNode = {
5302
- id: node.childId,
5303
- name: node.childName,
5304
- children: [],
5305
- parentId: node.rootId
5306
- };
5307
- this.dataTrees.toArray()[0].todoItemSelection([treeNode]);
5480
+ if (position >= 0) {
5481
+ node = this.treeData1[position];
5482
+ typeId = this.itemType;
5483
+ const treeNode = {
5484
+ id: node.childId,
5485
+ name: node.childName,
5486
+ children: [],
5487
+ parentId: node.rootId
5488
+ };
5489
+ this.dataTrees.toArray()[0].todoItemSelection([treeNode]);
5490
+ }
5491
+ else {
5492
+ let newNodeProcess = new TreeModel();
5493
+ newNodeProcess.rootId = (_f = item.breadcumbs[item.breadcumbs.length - 1]) === null || _f === void 0 ? void 0 : _f['id'];
5494
+ newNodeProcess.rootName = (_g = item.breadcumbs[item.breadcumbs.length - 1]) === null || _g === void 0 ? void 0 : _g['name'];
5495
+ newNodeProcess.parentId = '';
5496
+ newNodeProcess.subName = null;
5497
+ newNodeProcess.childId = item.id;
5498
+ newNodeProcess.childName = item.itemName;
5499
+ newNodeProcess.statusId = item === null || item === void 0 ? void 0 : item['itemStatus'];
5500
+ newNodeProcess.displayId = +item.itemNumberId;
5501
+ this.treeData1 = [...this.treeData1, newNodeProcess];
5502
+ let newSelectedProcess = new TreeFlatNode();
5503
+ newSelectedProcess.disabled = false;
5504
+ newSelectedProcess.expandable = false;
5505
+ newSelectedProcess.hasChild = false;
5506
+ newSelectedProcess.id = item.id;
5507
+ newSelectedProcess.level = 0;
5508
+ newSelectedProcess.levelType = undefined;
5509
+ newSelectedProcess.name = item.itemName;
5510
+ newSelectedProcess.parentId = (_h = item.breadcumbs[item.breadcumbs.length - 1]) === null || _h === void 0 ? void 0 : _h['id'];
5511
+ this.selectedData = [];
5512
+ this.selectedData2 = [];
5513
+ let selectProcess = [];
5514
+ let selectDocument = [];
5515
+ if (this.checkedNodeList.length) {
5516
+ this.checkedNodeList.forEach(x => {
5517
+ if (x.itemType === DataType$1.area || x.itemType === DataType$1.process) {
5518
+ this.treeData1.forEach(item => {
5519
+ if (item.childId && x.id === item.childId || !item.childId && (x.id === item.rootId)) {
5520
+ selectProcess.push({
5521
+ disabled: false,
5522
+ expandable: x.itemType == DataType$1.area ? true : false,
5523
+ hasChild: x.itemType == DataType$1.area ? true : false,
5524
+ id: x.id,
5525
+ level: 0,
5526
+ levelType: undefined,
5527
+ name: x.itemName,
5528
+ parentId: x.parentId
5529
+ });
5530
+ }
5531
+ });
5532
+ }
5533
+ else {
5534
+ this.treeData2.forEach(item => {
5535
+ if (item.childId && x.id === item.childId || !item.childId && (x.id === item.rootId)) {
5536
+ selectDocument.push({
5537
+ disabled: false,
5538
+ expandable: x.itemType == DataType$1.folder ? true : false,
5539
+ hasChild: x.itemType == DataType$1.folder ? true : false,
5540
+ id: x.id,
5541
+ level: 0,
5542
+ levelType: undefined,
5543
+ name: x.itemName,
5544
+ parentId: x.parentId
5545
+ });
5546
+ }
5547
+ });
5548
+ }
5549
+ });
5550
+ }
5551
+ this.selectedData = [...this.selectedData, ...selectProcess, newSelectedProcess];
5552
+ this.selectedData2 = [...this.selectedData2, ...selectDocument];
5553
+ setTimeout(() => {
5554
+ const treeNode = {
5555
+ id: newNodeProcess.childId,
5556
+ name: newNodeProcess.childName,
5557
+ children: [],
5558
+ parentId: newNodeProcess.rootId
5559
+ };
5560
+ this.dataTrees.toArray()[0].todoItemSelection([treeNode]);
5561
+ }, 500);
5562
+ }
5308
5563
  }
5309
5564
  }
5310
5565
  }
@@ -5339,7 +5594,8 @@ class RelatedPopupComponent {
5339
5594
  itemName: x.name,
5340
5595
  itemType: itemType,
5341
5596
  itemNumberId: item.displayId.toString(),
5342
- parentId: item.rootId
5597
+ parentId: item.rootId,
5598
+ parentName: item.rootName
5343
5599
  });
5344
5600
  });
5345
5601
  }
@@ -5658,18 +5914,20 @@ class RelatedPopupComponent {
5658
5914
  [].forEach.call(itemElement, (el) => {
5659
5915
  el.classList.add('active-item');
5660
5916
  });
5661
- let item = new IRelated();
5662
- item.id = node.id;
5663
- item.itemType = type;
5664
- item.itemName = node.name;
5665
- item.levelType = node.levelType;
5666
- this.selectedFolder = node;
5667
5917
  if (type === this.dataType.folder) {
5668
5918
  this.splitViewTitle = `${this.LANG.MESSAGE.DOCUMENTS_IN.toUpperCase()} "${node.name}"`;
5669
5919
  }
5670
5920
  else if (type === this.dataType.area) {
5671
5921
  this.splitViewTitle = `${this.LANG.MESSAGE.PROCESSES_IN.toUpperCase()} "${node.name}"`;
5672
5922
  }
5923
+ let item = new IRelated();
5924
+ item.id = node.id;
5925
+ item.itemType = type;
5926
+ item.itemName = node.name;
5927
+ item.levelType = node.levelType;
5928
+ this.selectedFolder = node;
5929
+ this.parentNodeSelected = new TreeFlatNode();
5930
+ this.parentNodeSelected = Object.assign({}, node);
5673
5931
  this.onExpandFolder.emit(item);
5674
5932
  }
5675
5933
  }
@@ -5721,7 +5979,7 @@ class RelatedPopupComponent {
5721
5979
  RelatedPopupComponent.decorators = [
5722
5980
  { type: Component, args: [{
5723
5981
  selector: 'qms-related-popup',
5724
- template: "<div id=\"qmslib_related_popup\" class=\"qmslib__related__popup__container\">\r\n <div id=\"qmslib_related_popup_header\">\r\n <span mat-icon-button class=\"button__close\" (click)=\"onCloseClick()\">\r\n <mat-icon mat-icon>close</mat-icon>\r\n </span>\r\n <div id=\"qmslib_related_popup_header_001\" mat-dialog-content>\r\n <span>{{ moduleName | uppercase }}</span>\r\n </div>\r\n </div>\r\n\r\n <div\r\n id=\"qmslib_related_popup_search\"\r\n class=\"input__field\"\r\n (click)=\"showSearchResult()\"\r\n >\r\n <input\r\n #name\r\n type=\"text\"\r\n placeholder=\"{{ LANG.SEARCH }}\"\r\n matInput\r\n [formControl]=\"myControl\"\r\n [matAutocomplete]=\"auto\"\r\n #autoCompleteInputSearch\r\n />\r\n <mat-icon>search</mat-icon>\r\n </div>\r\n\r\n <div class=\"line__divider\"></div>\r\n\r\n <mat-autocomplete\r\n #auto=\"matAutocomplete\"\r\n [displayWith]=\"displayRelated\"\r\n class=\"mat-autocomplete_related-viewport\"\r\n >\r\n <cdk-virtual-scroll-viewport\r\n qms-scrollbar\r\n itemSize=\"10\"\r\n class=\"related-viewport\"\r\n >\r\n <ng-container *ngFor=\"let type of searchOrder\">\r\n <div\r\n class=\"search__module-result\"\r\n *ngIf=\"canShowSearchOption(type.value)\"\r\n >\r\n <span class=\"search__module-title\">{{ getTitle(type.value) }}</span>\r\n <mat-option\r\n class=\"search__option\"\r\n *ngFor=\"let option of getModuleFilteredOptions(type.value)\"\r\n [value]=\"option\"\r\n (click)=\"selectRelated(option)\"\r\n >\r\n <qms-list-item type=\"image-square\">\r\n <mat-icon\r\n leading-icon\r\n type=\"image-square\"\r\n [svgIcon]=\"getNodeIcon(option)\"\r\n ></mat-icon>\r\n <div qms-list-header>\r\n <div\r\n qms-line\r\n type=\"caption\"\r\n qms-tool-tip=\"{{\r\n isEllipsisActive(searchItemResult) ? option.parentName : ''\r\n }}\"\r\n mode=\"dark\"\r\n *ngIf=\"getParentName(option)\"\r\n >\r\n <span #searchItemResult class=\"search__result__parent-name\">\r\n {{ option.parentName }}\r\n </span>\r\n </div>\r\n <div qms-line type=\"subtitle\" class=\"search__option-name\">\r\n {{ option.itemName }}\r\n </div>\r\n <div\r\n class=\"caption\"\r\n *ngIf=\"option.breadcumbs && option.breadcumbs.length\"\r\n >\r\n <qms-breadcrumb\r\n class=\"breadcrumb-containe\"\r\n type=\"table\"\r\n numDisplayItem=\"1\"\r\n [nodes]=\"option.breadcumbs\"\r\n >\r\n </qms-breadcrumb>\r\n </div>\r\n </div>\r\n <div qms-line color=\"default-subtitle\" *ngIf=\"getItemId(option)\">\r\n <span class=\"material-icons-outlined search__description-icon\">\r\n local_offer\r\n </span>\r\n {{ getItemId(option) }}\r\n </div>\r\n </qms-list-item>\r\n </mat-option>\r\n </div>\r\n </ng-container>\r\n </cdk-virtual-scroll-viewport>\r\n </mat-autocomplete>\r\n\r\n <div class=\"row\">\r\n <div\r\n class=\"qms-scrollbar qmslib_related_popup_content\"\r\n [ngClass]=\"{\r\n panel__content_item: checkedNodeList.length,\r\n panel__content: !checkedNodeList.length,\r\n 'col-6': splitView,\r\n 'col-12': !splitView\r\n }\"\r\n >\r\n <mat-expansion-panel\r\n hideToggle\r\n id=\"qmslib_related_popup_common_001\"\r\n [expanded]=\"isCommonExpanded\"\r\n (opened)=\"isCommonExpanded = true\"\r\n (closed)=\"isCommonExpanded = false\"\r\n class=\"panel-tree\"\r\n >\r\n <mat-expansion-panel-header class=\"padding-5\">\r\n <mat-panel-title *ngIf=\"moduleId === module.documentProcess\">\r\n {{ LANG.PROCESSES | uppercase }}\r\n </mat-panel-title>\r\n <mat-panel-title *ngIf=\"moduleId === module.deviation\">\r\n {{ LANG.DEVIATION | uppercase }}\r\n </mat-panel-title>\r\n <mat-panel-title *ngIf=\"moduleId === module.checklist\">\r\n {{ LANG.CHECKLIST | uppercase }}\r\n </mat-panel-title>\r\n <mat-panel-title *ngIf=\"moduleId === module.risk\">\r\n {{ LANG.ASSESSMENT | uppercase }}\r\n </mat-panel-title>\r\n <button qms-btn-icon class=\"related_popup_toggle-btn\">\r\n <mat-icon>\r\n {{\r\n isCommonExpanded ? \"keyboard_arrow_up\" : \"keyboard_arrow_down\"\r\n }}\r\n </mat-icon>\r\n </button>\r\n </mat-expansion-panel-header>\r\n <div id=\"qmslib_related_popup_common_002\">\r\n <qms-tree\r\n [treeData]=\"treeData1\"\r\n [treeConfig]=\"treeConfig1\"\r\n [selectedData]=\"selectedData\"\r\n [selectedRiskData]=\"selectedRiskData\"\r\n [disabledList]=\"disabledList\"\r\n (checkBoxEvent)=\"getCommonCheckedNode($event)\"\r\n (nodeExpandEvent)=\"getChildrenOfFolder($event, dataType.area)\"\r\n (selectNodeEvent)=\"selectNodeTreeEvent($event)\"\r\n (getChildNodeSelectOne)=\"getChildNodeSelectOne($event)\"\r\n [expandOnTitleClick]=\"!splitView\"\r\n ></qms-tree>\r\n </div>\r\n </mat-expansion-panel>\r\n\r\n <div\r\n *ngIf=\"moduleId === module.documentProcess\"\r\n class=\"line__divider\"\r\n ></div>\r\n\r\n <mat-expansion-panel\r\n hideToggle\r\n *ngIf=\"moduleId === module.documentProcess\"\r\n id=\"qmslib_related_popup_document_001\"\r\n [expanded]=\"isDocumentExpanded\"\r\n (opened)=\"isDocumentExpanded = true\"\r\n (closed)=\"isDocumentExpanded = false\"\r\n class=\"panel-tree\"\r\n >\r\n <mat-expansion-panel-header class=\"padding-5\">\r\n <mat-panel-title> {{ LANG.DOCUMENTS | uppercase }} </mat-panel-title>\r\n <button qms-btn-icon class=\"related_popup_toggle-btn\">\r\n <mat-icon>\r\n {{\r\n isDocumentExpanded ? \"keyboard_arrow_up\" : \"keyboard_arrow_down\"\r\n }}\r\n </mat-icon>\r\n </button>\r\n </mat-expansion-panel-header>\r\n <div id=\"qmslib_related_popup_document_002\">\r\n <qms-tree\r\n [treeData]=\"treeData2\"\r\n [treeConfig]=\"treeConfig2\"\r\n [selectedData]=\"selectedData2\"\r\n [disabledList]=\"disabledList2\"\r\n (checkBoxEvent)=\"getDocumentCheckedNode($event)\"\r\n (nodeExpandEvent)=\"getChildrenOfFolder($event, dataType.folder)\"\r\n (selectNodeEvent)=\"selectNodeTreeEvent($event)\"\r\n (getChildNodeSelectOne)=\"getChildNodeSelectOne($event)\"\r\n [expandOnTitleClick]=\"!splitView\"\r\n ></qms-tree>\r\n </div>\r\n </mat-expansion-panel>\r\n </div>\r\n <div\r\n *ngIf=\"splitView\"\r\n class=\"\r\n qms-scrollbar\r\n qmslib-related-popup-splitview qmslib_related_popup_content\r\n col-6\r\n \"\r\n [ngClass]=\"{\r\n panel__content_item: checkedNodeList.length,\r\n panel__content: !checkedNodeList.length\r\n }\"\r\n >\r\n <div class=\"splitview-header\" *ngIf=\"selectedFolder\">\r\n {{ splitViewTitle }}\r\n </div>\r\n <div class=\"expand-node\" *ngFor=\"let node of itemInSplitview\">\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n [checked]=\"isNodeSelected(node)\"\r\n (change)=\"toggleSelectItem(node)\"\r\n ></mat-checkbox>\r\n <mat-icon\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n [svgIcon]=\"getNodeIcon(node)\"\r\n ></mat-icon>\r\n <span class=\"text-node\">{{ node.itemName }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"checkedNodeList.length\" class=\"line__divider\"></div>\r\n\r\n <div *ngIf=\"checkedNodeList.length\" class=\"panel__item qms-scrollbar\">\r\n <div class=\"related__item__inline\" *ngFor=\"let item of checkedNodeList\">\r\n <button\r\n *ngIf=\"item.itemName\"\r\n mat-button\r\n class=\"related__item__content\"\r\n qms-tool-tip=\"{{\r\n isEllipsisActive(itemName) ? getItemChipName(item) : ''\r\n }}\"\r\n mode=\"dark\"\r\n >\r\n <span class=\"related__item__content_name\" #itemName>{{\r\n getItemChipName(item)\r\n }}</span>\r\n <mat-icon\r\n *ngIf=\"!(treeConfig1?.selectOne || treeConfig2?.selectOne)\"\r\n (click)=\"removeCheckedNodeList(item)\"\r\n >cancel</mat-icon\r\n >\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"line__divider\"></div>\r\n\r\n <div class=\"confirm__button__groups\">\r\n <button\r\n *ngIf=\"!checkedNodeList.length\"\r\n qms-btn\r\n style=\"margin-top: 7px\"\r\n (click)=\"onAddClick()\"\r\n >\r\n {{ LANG.ADD }}\r\n </button>\r\n <button\r\n *ngIf=\"checkedNodeList.length\"\r\n qms-btn\r\n style=\"margin-top: 0px\"\r\n (click)=\"onAddClick()\"\r\n >\r\n {{ LANG.ADD }} ({{ checkedNodeList.length }})\r\n </button>\r\n <button\r\n qms-btn-text\r\n [ngStyle]=\"{ 'margin-top': checkedNodeList.length ? '0px' : '7px' }\"\r\n (click)=\"onCloseClick()\"\r\n >\r\n {{ LANG.CANCEL }}\r\n </button>\r\n </div>\r\n</div>\r\n",
5982
+ template: "<div id=\"qmslib_related_popup\" class=\"qmslib__related__popup__container\">\r\n <div id=\"qmslib_related_popup_header\">\r\n <span mat-icon-button class=\"button__close\" (click)=\"onCloseClick()\">\r\n <mat-icon mat-icon>close</mat-icon>\r\n </span>\r\n <div id=\"qmslib_related_popup_header_001\" mat-dialog-content>\r\n <span>{{ moduleName | uppercase }}</span>\r\n </div>\r\n </div>\r\n\r\n <div\r\n id=\"qmslib_related_popup_search\"\r\n class=\"input__field\"\r\n (click)=\"showSearchResult()\"\r\n >\r\n <input\r\n #name\r\n type=\"text\"\r\n placeholder=\"{{ LANG.SEARCH }}\"\r\n matInput\r\n [formControl]=\"myControl\"\r\n [matAutocomplete]=\"auto\"\r\n #autoCompleteInputSearch\r\n />\r\n <mat-icon>search</mat-icon>\r\n </div>\r\n\r\n <div class=\"line__divider\"></div>\r\n\r\n <mat-autocomplete\r\n #auto=\"matAutocomplete\"\r\n [displayWith]=\"displayRelated\"\r\n class=\"mat-autocomplete_related-viewport\"\r\n >\r\n <cdk-virtual-scroll-viewport\r\n qms-scrollbar\r\n itemSize=\"10\"\r\n class=\"related-viewport\"\r\n >\r\n <ng-container *ngFor=\"let type of searchOrder\">\r\n <div\r\n class=\"search__module-result\"\r\n *ngIf=\"canShowSearchOption(type.value)\"\r\n >\r\n <span class=\"search__module-title\">{{ getTitle(type.value) }}</span>\r\n <mat-option\r\n class=\"search__option\"\r\n *ngFor=\"let option of getModuleFilteredOptions(type.value)\"\r\n [value]=\"option\"\r\n (click)=\"selectRelated(option)\"\r\n >\r\n <qms-list-item type=\"image-square\">\r\n <mat-icon\r\n leading-icon\r\n type=\"image-square\"\r\n [svgIcon]=\"getNodeIcon(option)\"\r\n ></mat-icon>\r\n <div qms-list-header>\r\n <div\r\n qms-line\r\n type=\"caption\"\r\n qms-tool-tip=\"{{\r\n isEllipsisActive(searchItemResult) ? option.parentName : ''\r\n }}\"\r\n mode=\"dark\"\r\n *ngIf=\"getParentName(option)\"\r\n >\r\n <span #searchItemResult class=\"search__result__parent-name\">\r\n {{ option.parentName }}\r\n </span>\r\n </div>\r\n <div qms-line type=\"subtitle\" class=\"search__option-name\">\r\n {{ option.itemName }}\r\n </div>\r\n <div\r\n class=\"caption\"\r\n *ngIf=\"option.breadcumbs && option.breadcumbs.length\"\r\n >\r\n <qms-breadcrumb\r\n class=\"breadcrumb-containe\"\r\n type=\"table\"\r\n numDisplayItem=\"1\"\r\n [nodes]=\"option.breadcumbs\"\r\n >\r\n </qms-breadcrumb>\r\n </div>\r\n </div>\r\n <div qms-line color=\"default-subtitle\" *ngIf=\"getItemId(option)\">\r\n <span class=\"material-icons-outlined search__description-icon\">\r\n local_offer\r\n </span>\r\n {{ getItemId(option) }}\r\n </div>\r\n </qms-list-item>\r\n </mat-option>\r\n </div>\r\n </ng-container>\r\n </cdk-virtual-scroll-viewport>\r\n </mat-autocomplete>\r\n\r\n <div class=\"row\">\r\n <div\r\n class=\"qms-scrollbar qmslib_related_popup_content\"\r\n [ngClass]=\"{\r\n panel__content_item: checkedNodeList.length,\r\n panel__content: !checkedNodeList.length,\r\n 'col-6': splitView,\r\n 'col-12': !splitView\r\n }\"\r\n >\r\n <mat-expansion-panel\r\n hideToggle\r\n id=\"qmslib_related_popup_common_001\"\r\n [expanded]=\"isCommonExpanded\"\r\n (opened)=\"isCommonExpanded = true\"\r\n (closed)=\"isCommonExpanded = false\"\r\n class=\"panel-tree\"\r\n >\r\n <mat-expansion-panel-header class=\"padding-5\">\r\n <mat-panel-title *ngIf=\"moduleId === module.documentProcess\">\r\n {{ LANG.PROCESSES | uppercase }}\r\n </mat-panel-title>\r\n <mat-panel-title *ngIf=\"moduleId === module.deviation\">\r\n {{ LANG.DEVIATION | uppercase }}\r\n </mat-panel-title>\r\n <mat-panel-title *ngIf=\"moduleId === module.checklist\">\r\n {{ LANG.CHECKLIST | uppercase }}\r\n </mat-panel-title>\r\n <mat-panel-title *ngIf=\"moduleId === module.risk\">\r\n {{ LANG.ASSESSMENT | uppercase }}\r\n </mat-panel-title>\r\n <button qms-btn-icon class=\"related_popup_toggle-btn\">\r\n <mat-icon>\r\n {{\r\n isCommonExpanded ? \"keyboard_arrow_up\" : \"keyboard_arrow_down\"\r\n }}\r\n </mat-icon>\r\n </button>\r\n </mat-expansion-panel-header>\r\n <div id=\"qmslib_related_popup_common_002\">\r\n <qms-tree\r\n [treeData]=\"treeData1\"\r\n [treeConfig]=\"treeConfig1\"\r\n [selectedData]=\"selectedData\"\r\n [selectedRiskData]=\"selectedRiskData\"\r\n [disabledList]=\"disabledList\"\r\n (checkBoxEvent)=\"getCommonCheckedNode($event)\"\r\n (nodeExpandEvent)=\"getChildrenOfFolder($event, dataType.area)\"\r\n (selectNodeEvent)=\"selectNodeTreeEvent($event)\"\r\n (getChildNodeSelectOne)=\"getChildNodeSelectOne($event)\"\r\n [expandOnTitleClick]=\"!splitView\"\r\n [parentNodeOnClick]=\"parentNodeSelected\"\r\n ></qms-tree>\r\n </div>\r\n </mat-expansion-panel>\r\n\r\n <div\r\n *ngIf=\"moduleId === module.documentProcess\"\r\n class=\"line__divider\"\r\n ></div>\r\n\r\n <mat-expansion-panel\r\n hideToggle\r\n *ngIf=\"moduleId === module.documentProcess\"\r\n id=\"qmslib_related_popup_document_001\"\r\n [expanded]=\"isDocumentExpanded\"\r\n (opened)=\"isDocumentExpanded = true\"\r\n (closed)=\"isDocumentExpanded = false\"\r\n class=\"panel-tree\"\r\n >\r\n <mat-expansion-panel-header class=\"padding-5\">\r\n <mat-panel-title> {{ LANG.DOCUMENTS | uppercase }} </mat-panel-title>\r\n <button qms-btn-icon class=\"related_popup_toggle-btn\">\r\n <mat-icon>\r\n {{\r\n isDocumentExpanded ? \"keyboard_arrow_up\" : \"keyboard_arrow_down\"\r\n }}\r\n </mat-icon>\r\n </button>\r\n </mat-expansion-panel-header>\r\n <div id=\"qmslib_related_popup_document_002\">\r\n <qms-tree\r\n [treeData]=\"treeData2\"\r\n [treeConfig]=\"treeConfig2\"\r\n [selectedData]=\"selectedData2\"\r\n [disabledList]=\"disabledList2\"\r\n (checkBoxEvent)=\"getDocumentCheckedNode($event)\"\r\n (nodeExpandEvent)=\"getChildrenOfFolder($event, dataType.folder)\"\r\n (selectNodeEvent)=\"selectNodeTreeEvent($event)\"\r\n (getChildNodeSelectOne)=\"getChildNodeSelectOne($event)\"\r\n [expandOnTitleClick]=\"!splitView\"\r\n [parentNodeOnClick]=\"parentNodeSelected\"\r\n ></qms-tree>\r\n </div>\r\n </mat-expansion-panel>\r\n </div>\r\n <div\r\n *ngIf=\"splitView\"\r\n class=\"\r\n qms-scrollbar\r\n qmslib-related-popup-splitview qmslib_related_popup_content\r\n col-6\r\n \"\r\n [ngClass]=\"{\r\n panel__content_item: checkedNodeList.length,\r\n panel__content: !checkedNodeList.length\r\n }\"\r\n >\r\n <div class=\"splitview-header\" *ngIf=\"selectedFolder\">\r\n {{ splitViewTitle }}\r\n </div>\r\n <div class=\"expand-node\" *ngFor=\"let node of itemInSplitview\">\r\n <mat-checkbox\r\n qms-group-options\r\n [disabled]=\"node.disabled\"\r\n color=\"default\"\r\n [checked]=\"isNodeSelected(node)\"\r\n (change)=\"toggleSelectItem(node)\"\r\n ></mat-checkbox>\r\n <mat-icon\r\n class=\"mat-icon-rtl-mirror material-icons-outlined\"\r\n [svgIcon]=\"getNodeIcon(node)\"\r\n ></mat-icon>\r\n <span class=\"text-node\">{{ node.itemName }}</span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"checkedNodeList.length\" class=\"line__divider\"></div>\r\n\r\n <div *ngIf=\"checkedNodeList.length\" class=\"panel__item qms-scrollbar\">\r\n <div class=\"related__item__inline\" *ngFor=\"let item of checkedNodeList\">\r\n <button\r\n *ngIf=\"item.itemName\"\r\n mat-button\r\n class=\"related__item__content\"\r\n qms-tool-tip=\"{{\r\n isEllipsisActive(itemName) ? getItemChipName(item) : ''\r\n }}\"\r\n mode=\"dark\"\r\n >\r\n <span class=\"related__item__content_name\" #itemName>{{\r\n getItemChipName(item)\r\n }}</span>\r\n <mat-icon\r\n *ngIf=\"!(treeConfig1?.selectOne || treeConfig2?.selectOne)\"\r\n (click)=\"removeCheckedNodeList(item)\"\r\n >cancel</mat-icon\r\n >\r\n </button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"line__divider\"></div>\r\n\r\n <div class=\"confirm__button__groups\">\r\n <button\r\n *ngIf=\"!checkedNodeList.length\"\r\n qms-btn\r\n style=\"margin-top: 7px\"\r\n (click)=\"onAddClick()\"\r\n >\r\n {{ LANG.ADD }}\r\n </button>\r\n <button\r\n *ngIf=\"checkedNodeList.length\"\r\n qms-btn\r\n style=\"margin-top: 0px\"\r\n (click)=\"onAddClick()\"\r\n >\r\n {{ LANG.ADD }} ({{ checkedNodeList.length }})\r\n </button>\r\n <button\r\n qms-btn-text\r\n [ngStyle]=\"{ 'margin-top': checkedNodeList.length ? '0px' : '7px' }\"\r\n (click)=\"onCloseClick()\"\r\n >\r\n {{ LANG.CANCEL }}\r\n </button>\r\n </div>\r\n</div>\r\n",
5725
5983
  encapsulation: ViewEncapsulation.None,
5726
5984
  styles: [".qms-scrollbar::-webkit-scrollbar{width:12px}.qms-scrollbar::-webkit-scrollbar-track{background:rgba(0,0,0,.12);background-clip:content-box}.qms-scrollbar::-webkit-scrollbar-thumb{background:rgba(0,0,0,.38);border-radius:20px;width:4px;border:4px solid transparent;background-clip:content-box}.qms-scrollbar::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.5);background-clip:content-box;border:4px solid transparent}.qms-scrollbar.none-scroll-bg::-webkit-scrollbar-track{background:transparent;background-clip:content-box}.qms__popup .button__close{float:right;top:-24px;right:-24px;cursor:pointer}.qms__danger button{border:none;color:#fff;padding:0;text-align:center;text-decoration:none;display:inline-block;cursor:pointer;height:20px;width:20px;font-family:Open Sans;font-size:12px;font-weight:600;font-style:normal;line-height:16px}.qms__danger .red{background-color:#9e360f;margin-left:10px}.qms__danger .yellow{background-color:#e4cf53;margin-left:10px;color:#323232}.qms__danger .green{background-color:#00804c;margin-left:10px}.confirm__button__groups{margin-top:11px}.confirm__button__groups button{min-height:36px;width:auto;font-family:Open Sans;font-weight:500;font-size:14px;letter-spacing:1px;line-height:16px;padding-left:15px;padding-right:15px;margin-right:5px;float:right}.confirm__button__groups .confirm{background:#f8f9f9}.confirm__button__groups .confirm:hover{background:#001983;color:#fff}.confirm__button__groups .confirm:disabled{cursor:not-allowed}.confirm__button__groups .cancel{background:#f8f9f9}.confirm__button__groups .cancel:hover{background:#001983;color:#fff}.qmslib__related__popup__container .input__field{display:flex;align-items:center}.qmslib__related__popup__container .input__field input{width:100%;padding:10px;outline:none;border:none;background:#eee}.qmslib__related__popup__container .input__field .mat-icon{margin-left:-30px;cursor:pointer;vertical-align:middle}.qmslib__related__popup__container .line__divider{border-bottom:1px solid #ccc;height:1px;margin-top:10px;min-width:300px;max-width:100%}.qmslib__related__popup__container .button__close{float:right;top:-24px;right:-24px;cursor:pointer}.qmslib__related__popup__container .panel__content{height:450px;overflow:auto;margin-top:12px}.qmslib__related__popup__container .panel__content_item{height:350px;overflow:auto;margin-top:12px}.qmslib__related__popup__container .panel-tree .mat-expansion-panel-body{padding:0 12px 12px}.qmslib__related__popup__container .mat-expansion-panel-header{height:30px;font-size:12px;letter-spacing:1px;font-family:Raleway;font-weight:600;padding:0}.qmslib__related__popup__container .mat-expansion-panel-header .mat-expansion-panel-header-title{align-items:center;margin-left:12px}.qmslib__related__popup__container .mat-expansion-panel-header .related_popup_toggle-btn{width:1.5rem;height:1.5rem;line-height:1.5rem}.qmslib__related__popup__container .mat-expansion-panel:not([class*=mat-elevation-z]){box-shadow:none}.qmslib__related__popup__container .panel__item{height:100px;margin-top:12px;overflow-x:hidden;overflow-y:auto;padding-right:5px;width:100%;max-width:100%;display:flex;flex-wrap:wrap;align-content:flex-start}.qmslib__related__popup__container .panel__item .related__item__inline{max-width:100%}.qmslib__related__popup__container .panel__item .related__item__content{height:32px;line-height:32px;background-color:#e5e5e5;max-width:100%;margin-bottom:5px;margin-left:2.5px;margin-right:2.5px}.qmslib__related__popup__container .panel__item .related__item__content .mat-icon{color:#8e8e8e;font-size:24px}.qmslib__related__popup__container .panel__item .related__item__content span.related__item__content_name{display:inline-block;min-width:calc(100% - 13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:278px}.qmslib__related__popup__container .qmslib-related-popup-splitview{background-color:#fff;border-left:1px solid #ccc;height:450px;overflow-y:auto;margin-top:12px}.qmslib__related__popup__container .qmslib-related-popup-splitview.panel__content{height:450px;overflow:auto;margin-top:12px}.qmslib__related__popup__container .qmslib-related-popup-splitview.panel__content_item{height:350px;overflow:auto;margin-top:12px}.qmslib__related__popup__container .qmslib-related-popup-splitview .splitview-header{height:30px;font-size:12px;letter-spacing:1px;font-family:RALEWAY;font-weight:600;display:flex;align-items:center}.qmslib__related__popup__container .qmslib-related-popup-splitview .mat-checkbox.qms-group-options{padding:0}.qmslib__related__popup__container .qmslib-related-popup-splitview .mat-checkbox.qms-group-options .mat-checkbox-inner-container{margin-right:11px}.qmslib__related__popup__container .qmslib-related-popup-splitview .mat-checkbox.qms-group-options.mat-checkbox-checked{background:transparent!important}.qmslib__related__popup__container .qmslib-related-popup-splitview .expand-node{margin-left:8px;display:flex;align-items:center;min-height:40px}.qmslib__related__popup__container .qmslib-related-popup-splitview .expand-node .mat-icon{color:rgba(0,0,0,.6);margin-right:17px;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}.qmslib__related__popup__container .qmslib-related-popup-splitview .expand-node .mat-icon svg{display:block;min-width:-webkit-fit-content;min-width:-moz-fit-content;min-width:fit-content}cdk-virtual-scroll-viewport{overflow-x:hidden}cdk-virtual-scroll-viewport .search__module-result{margin:1.5rem;padding:0 0 .5rem}cdk-virtual-scroll-viewport .search__module-result .search__module-title{font-size:14px;font-weight:600}cdk-virtual-scroll-viewport .search__module-result .search__option{height:auto;line-height:normal;padding:8px 0;border-bottom:1px solid #e0e0e0}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item.mat-2-line.image-item{height:auto}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content{margin:0;border-bottom:none}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .wrap-image.image-square{width:2.5rem;height:100%;background:transparent;align-self:center;margin-right:0}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .wrap-image.image-square img{width:24px;height:24px}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .material-icons-outlined.leading-icon,cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content mat-icon.leading-icon{padding:4px 0 4px 4px}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .subtitle{font-weight:400}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .caption{overflow:hidden;line-height:normal;white-space:normal;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;padding:0;margin:0}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .caption span.search__result__parent-name{display:inline-block;width:auto;width:calc(100% - 13px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .default-subtitle{color:rgba(0,0,0,.38)}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .search__description-icon{margin-right:0;width:12px;height:12px;font-size:12px}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .qms-list-text{border-bottom:none}cdk-virtual-scroll-viewport .search__module-result .search__option .qms-list-item-content .breadcrumb-containe .qms-breadcrumb-item .mat-icon{font-size:16px!important;padding-bottom:1px}cdk-virtual-scroll-viewport .search__module-result svg{display:block}#qmslib_related_popup_header_001{margin-bottom:20px;padding:0;font-weight:600;font-family:Raleway}.padding-5{padding:5px}.mat-autocomplete_related-viewport{height:100%;max-height:100%!important}.mat-autocomplete_related-viewport .cdk-virtual-scroll-content-wrapper{width:100%}.mat-autocomplete_related-viewport .related-viewport{min-height:10.25rem}"]
5727
5985
  },] }
@@ -6159,12 +6417,6 @@ QMSRelatedModule.decorators = [
6159
6417
  },] }
6160
6418
  ];
6161
6419
 
6162
- class TreeFlatNode {
6163
- }
6164
-
6165
- class TreeModel {
6166
- }
6167
-
6168
6420
  class TreeConfig {
6169
6421
  }
6170
6422