basesite-shared-grid-lib 15.10.313 → 15.10.315

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.
@@ -984,25 +984,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
984
984
  }], ctorParameters: () => [{ type: i1$1.DatePipe }] });
985
985
 
986
986
  class DropdownRenderer {
987
+ constructor() {
988
+ this.isGrid15 = false;
989
+ }
987
990
  agInit(params) {
988
991
  this.params = params;
989
992
  this.dropDownData = this.params.dropDownData ? this.params.dropDownData.split(',') : [];
993
+ this.isGrid15 = this.params.dropDownData.toLowerCase().includes('create/view dac');
990
994
  }
991
995
  refresh(params) {
992
996
  return false;
993
997
  }
994
998
  onClick($event, index) {
995
- const toolId = this.params.node.data.toolId;
996
- const urls = [
997
- `/home/tool/details/${toolId}/tracker`,
998
- `/home/details/${toolId}`,
999
- `/home/lss/details/${toolId}`,
1000
- `/home/tool/details/${toolId}/dac`
1001
- ];
1002
- if (($event.ctrlKey || $event.metaKey) && urls[index] && index != 4) {
1003
- window.open(urls[index], '_blank');
1004
- $event.stopPropagation();
1005
- return;
999
+ if (this.isGrid15) {
1000
+ const toolId = this.params.node.data.toolId;
1001
+ const urls = [
1002
+ `/home/tool/details/${toolId}/tracker`,
1003
+ `/home/details/${toolId}`,
1004
+ `/home/lss/details/${toolId}`,
1005
+ `/home/tool/details/${toolId}/dac`
1006
+ ];
1007
+ if (($event.ctrlKey || $event.metaKey) &&
1008
+ typeof index === 'number' &&
1009
+ urls[index] &&
1010
+ index != 4) {
1011
+ $event.preventDefault();
1012
+ window.open(urls[index], '_blank');
1013
+ $event.stopPropagation();
1014
+ return;
1015
+ }
1006
1016
  }
1007
1017
  if (this.params.onClick instanceof Function) {
1008
1018
  const params = {
@@ -1027,24 +1037,34 @@ class DropdownRenderer {
1027
1037
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DropdownRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1028
1038
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: DropdownRenderer, isStandalone: false, selector: "lib-dropdown-renderer", ngImport: i0, template: `
1029
1039
  <div class="dropdown">
1030
- <button type="button" class="btn btn-white" data-toggle="dropdown">
1031
- <i class="fa fa-ellipsis-v"></i>
1032
- </button>
1033
- <div class="dropdown-menu">
1034
- <ng-container *ngFor="let data of dropDownData; let i = index">
1035
- <a *ngIf="i !== 4"
1036
- class="dropdown-item"
1037
- [href]="getUrl(i)"
1038
- (click)="onClick($event, i)"
1039
- [innerHTML]="data"
1040
- target="_self"></a>
1041
- <span *ngIf="i == 4"
1042
- class="dropdown-item"
1043
- (click)="onClick($event, i)"
1044
- [innerHTML]="data"></span>
1045
- </ng-container>
1040
+ <button type="button" class="btn btn-white" data-toggle="dropdown">
1041
+ <i class="fa fa-ellipsis-v"></i>
1042
+ </button>
1043
+ <div class="dropdown-menu">
1044
+ <!-- gridId == 15 -->
1045
+ <ng-container *ngIf="isGrid15; else simpleDropdown">
1046
+ <ng-container *ngFor="let data of dropDownData; let i = index">
1047
+ <a *ngIf="i !== 4"
1048
+ class="dropdown-item"
1049
+ [href]="getUrl(i)"
1050
+ (click)="onClick($event, i)"
1051
+ [innerHTML]="data"
1052
+ target="_self"></a>
1053
+ <span *ngIf="i == 4"
1054
+ class="dropdown-item"
1055
+ (click)="onClick($event, i)"
1056
+ [innerHTML]="data"></span>
1057
+ </ng-container>
1058
+ </ng-container>
1059
+ <!-- gridId != 15 -->
1060
+ <ng-template #simpleDropdown>
1061
+ <span *ngFor='let data of dropDownData'
1062
+ class="dropdown-item"
1063
+ (click)="onClick($event)"
1064
+ [innerHTML]="data"></span>
1065
+ </ng-template>
1066
+ </div>
1046
1067
  </div>
1047
- </div>
1048
1068
  `, isInline: true, dependencies: [{ kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
1049
1069
  }
1050
1070
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: DropdownRenderer, decorators: [{
@@ -1053,24 +1073,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImpor
1053
1073
  selector: 'lib-dropdown-renderer',
1054
1074
  template: `
1055
1075
  <div class="dropdown">
1056
- <button type="button" class="btn btn-white" data-toggle="dropdown">
1057
- <i class="fa fa-ellipsis-v"></i>
1058
- </button>
1059
- <div class="dropdown-menu">
1060
- <ng-container *ngFor="let data of dropDownData; let i = index">
1061
- <a *ngIf="i !== 4"
1062
- class="dropdown-item"
1063
- [href]="getUrl(i)"
1064
- (click)="onClick($event, i)"
1065
- [innerHTML]="data"
1066
- target="_self"></a>
1067
- <span *ngIf="i == 4"
1068
- class="dropdown-item"
1069
- (click)="onClick($event, i)"
1070
- [innerHTML]="data"></span>
1071
- </ng-container>
1076
+ <button type="button" class="btn btn-white" data-toggle="dropdown">
1077
+ <i class="fa fa-ellipsis-v"></i>
1078
+ </button>
1079
+ <div class="dropdown-menu">
1080
+ <!-- gridId == 15 -->
1081
+ <ng-container *ngIf="isGrid15; else simpleDropdown">
1082
+ <ng-container *ngFor="let data of dropDownData; let i = index">
1083
+ <a *ngIf="i !== 4"
1084
+ class="dropdown-item"
1085
+ [href]="getUrl(i)"
1086
+ (click)="onClick($event, i)"
1087
+ [innerHTML]="data"
1088
+ target="_self"></a>
1089
+ <span *ngIf="i == 4"
1090
+ class="dropdown-item"
1091
+ (click)="onClick($event, i)"
1092
+ [innerHTML]="data"></span>
1093
+ </ng-container>
1094
+ </ng-container>
1095
+ <!-- gridId != 15 -->
1096
+ <ng-template #simpleDropdown>
1097
+ <span *ngFor='let data of dropDownData'
1098
+ class="dropdown-item"
1099
+ (click)="onClick($event)"
1100
+ [innerHTML]="data"></span>
1101
+ </ng-template>
1102
+ </div>
1072
1103
  </div>
1073
- </div>
1074
1104
  `,
1075
1105
  standalone: false
1076
1106
  }]
@@ -2645,6 +2675,9 @@ class GridLibraryComponent {
2645
2675
  }
2646
2676
  }
2647
2677
  onBtnClick(e) {
2678
+ if (e.event.ctrlKey || e.event.metaKey) {
2679
+ e.event.preventDefault(); // Ignore ctrl/cmd click
2680
+ }
2648
2681
  this.btnClickHandler.emit(e.rowData);
2649
2682
  }
2650
2683
  onSaveGridColumnState(event) {