+
+
+ {{placeholder}}
+
+ {{ dropdownTitle }}
+ 0" [disableRipple]="true" (change)="toggleAllSelection($event)">{{selectAll}}
+
+ 0" class="flex-align-center" [class.optionImage]="customLabel">
+
{{customLabel}}
+
+
+
+
+
{{selectedOption}}
+
+ {{capitalizeFirstLetter(selectedOption)}}
+
-
-
-
+
+
+ {{selectedOption}}
+
+ {{capitalizeFirstLetter(selectedOption)}}
+
+
+
+
+
+
+
{{item.text}}
+
+ {{capitalizeFirstLetter(item.text)}}
+
+
+
+
+
+
+
{{ buttonLabel }}
+
diff --git a/webapp/src/app/shared/dropdown/dropdown.component.ts b/webapp/src/app/shared/dropdown/dropdown.component.ts
index a29ff4e7f3..7f6f45f4d9 100644
--- a/webapp/src/app/shared/dropdown/dropdown.component.ts
+++ b/webapp/src/app/shared/dropdown/dropdown.component.ts
@@ -1,5 +1,7 @@
-import { Component, Input, EventEmitter, Output, OnChanges, SimpleChanges, AfterViewInit } from '@angular/core';
+import { Component, Input, EventEmitter, Output, OnChanges, SimpleChanges, AfterViewInit, OnInit, ChangeDetectorRef, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
+import { MatCheckbox } from '@angular/material/checkbox';
+import { MatSelect } from '@angular/material/select';
@Component({
selector: 'app-dropdown',
@@ -11,27 +13,50 @@ export class DropdownComponent implements OnChanges {
@Input() items = [];
@Input() required = false;
@Input() isDisabled: boolean = false;
+ @Input() disableOptions = false;
@Input() optionImage = false;
@Input() requiredInfo: boolean = false;
- @Input() placeholder: string;
- @Input() selectedItem: string;
+ @Input() placeholder: string = "";
+ @Input() selectedItem: string = "";
@Input() isChipListEnabled: boolean = false;
@Input() selectedList = [];
+ @Input() selectAll: string = "";
+ @Input() showApplyButton = false;
+ @Input() customLabel;
+ @Input() showOriginalText:boolean = false;
+ @Input() isMultiSelect = false;
+ @Input() isButton = false;
+ @Input() buttonLabel;
+ @Input() dropdownTitle;
+ @Input() sortValues = false;
+
@Output() selected = new EventEmitter();
+ @Output() applyClick = new EventEmitter();
+ @Output() optionClicked = new EventEmitter();
@Output() closeEventEmitter = new EventEmitter();
+ @Output() openEventEmitter = new EventEmitter();
+ @ViewChild('selectedAll') selectedAll: MatCheckbox;
+ @ViewChild('matSelectRef') matSelectRef: MatSelect;
+
listControl = new FormControl([]);
itemList = [];
optionList = [];
selectedOption: string = "";
- selectedOptionImage: string;
- applyClick: any;
- constructor() { }
+ selectedOptionImage: string = "";
+ constructor(private cdRef: ChangeDetectorRef) { }
onClose() {
this.closeEventEmitter.emit();
}
+ onOpen(){
+ if(this.selectAll.length > 0)
+ this.selectedAll.checked = this.selectedOption.length == this.optionList.length? true: false;
+
+ this.openEventEmitter.emit();
+ }
+
massageData(list: any, selectedOption: any) {
if (list) {
this.itemList = [];
@@ -77,20 +102,60 @@ export class DropdownComponent implements OnChanges {
}
}
+ ngAfterViewInit(): void {
+ if(this.isChipListEnabled){
+ this.listControl.setValue(this.selectedList);
+ }
+ if(this.selectAll.length > 0) this.selectedAll.checked = this.selectedOption.length == this.optionList.length? true: false;
+ this.cdRef.detectChanges();
+ }
+
ngOnChanges(changes: SimpleChanges): void {
- if(this.selectedList){
+ if(this.isChipListEnabled){
this.listControl.setValue(this.selectedList);
}
+ if(this.sortValues){
+ this.items.sort();
+ this.selectedList?.sort();
+ }
this.massageData(this.items, this.selectedItem);
}
selectedValue(event: any) {
+ if(this.selectAll.length > 0)
+ this.selectedAll.checked = this.selectedOption.length == this.optionList.length? true: false;
this.selected.emit(event);
}
- updateChipsList(e:any){
+ toggleAllSelection(event: any){
+ if(event.checked){
+ this.listControl.setValue(this.items);
+ this.selected.emit(this.items);
+ }
+ else{
+ this.listControl.setValue([]);
+ this.selected.emit([]);
+ }
+ }
+
+ updateChipsList(e:any, shouldCallApply?){
this.listControl.setValue(e);
- this.selected.emit(e);
+ if(shouldCallApply){
+ this.applyClick.emit(this.listControl.value);
+ }else{
+ this.selected.emit(e);
+ }
+ }
+
+ optionClick(e){
+ this.optionClicked.emit(e);
+ }
+
+ updateSingleChip(e: any[]){
+ if(e.length==0){
+ this.selectedOption = "";
+ }
+ this.selected.emit(this.selectedOption);
}
handleSelection(e){
@@ -99,14 +164,27 @@ export class DropdownComponent implements OnChanges {
}
isFirstCharNumber(option:string){
+ if(!option) return "";
return /^\d/.test(option);
}
capitalizeFirstLetter(option: string | unknown[]) {
+ if(this.showOriginalText)
+ return option;
if (typeof option === 'string') {
return option.charAt(0).toUpperCase() + option.slice(1);
}
return option;
}
-}
+ disableOption(option:string){
+ if(!this.selectedList) return false;
+ for(let selectedOption of this.selectedList){
+ if(selectedOption == option && this.selectedOption != option){
+ return true;
+ }
+ }
+ return false;
+ }
+
+}
diff --git a/webapp/src/app/shared/shared.module.ts b/webapp/src/app/shared/shared.module.ts
index a7f5427b88..fa00650ebb 100644
--- a/webapp/src/app/shared/shared.module.ts
+++ b/webapp/src/app/shared/shared.module.ts
@@ -117,9 +117,11 @@ import { TableComponent } from './table/table.component';
import { TitleBurgerHeadComponent } from './title-burger-head/title-burger-head.component';
import { ToastNotificationComponent } from './toast-notification/toast-notification.component';
import { WidgetSectionStarterComponent } from './widget-section-starter/widget-section-starter.component';
+import { MatCheckboxModule } from '@angular/material/checkbox';
@NgModule({
imports: [
+ MatCheckboxModule,
AgGridModule,
CommonModule,
DragDropModule,
diff --git a/webapp/src/app/shared/table/table.component.css b/webapp/src/app/shared/table/table.component.css
index ac39fd5e58..6d5a84db98 100644
--- a/webapp/src/app/shared/table/table.component.css
+++ b/webapp/src/app/shared/table/table.component.css
@@ -1,13 +1,13 @@
.table-container{
height: 100%;
width: 100%;
- background-color: var(--background-white);
border-radius: var(--border-radius);
border: 1px solid var(--border-100);
position: relative;
}
.table-content-container{
+ background-color: var(--background-white);
width: 100%;
height: calc(100% - 70px);
overflow-y: scroll;
@@ -26,6 +26,7 @@
}
.table-header {
+ background-color: var(--background-white);
border-radius: var(--border-radius) var(--border-radius) 0 0;
}
@@ -50,6 +51,7 @@
}
.table-header .header-left{
+ display: none;
height: 40px;
max-width: 543px;
flex: 3;
@@ -74,18 +76,20 @@
}
.table-header .header-right{
- flex: 5;
- padding: 5px;
+ margin-left: auto;
+}
+
+.add-remove-columns-wrapper ::ng-deep .button{
+ padding: 0 16px 0 7px;
+}
+
+.add-remove-columns-wrapper ::ng-deep .dropdown-button-label{
+ font: var(--text-caption);
}
.add-remove-columns-wrapper{
- display: flex;
- align-items: center;
- justify-content: center;
- border: 1px solid var(--border-200);
- padding: 0px 16px;
- font: var(--text-caption);
- color: var(--text-medium-emphasis);
+ width: 115px;
+ padding: 0px 3px
}
.filter-wrapper{
@@ -201,6 +205,15 @@
display: none;
}
+.table-header ::ng-deep .mat-form-field-wrapper{
+ padding-bottom: 0.25em;
+}
+
+::ng-deep .mat-primary .mat-option.mat-selected:not(.mat-option-disabled){
+ color: var(--text-low-emphasis);
+ font: var(--text-body-2);
+}
+
.add-remove-columns-wrapper ::ng-deep .mat-select-value,
.table-header .search-in-columns ::ng-deep .mat-select-value{
display: none;
@@ -237,7 +250,8 @@
cursor: text;
}
-.add-remove-columns-wrapper ::ng-deep .mat-select-arrow {
+.add-remove-columns-wrapper ::ng-deep .mat-select-arrow{
+ margin: 0 0 0 10px;
width: 10px !important;
height: 10px !important;
border: none !important;
@@ -245,6 +259,43 @@
background-repeat: no-repeat;
}
+.filters-button-wrapper ::ng-deep .mat-select-arrow{
+ margin: 6px 0 0 10px;
+ width: 16px !important;
+ height: 16px !important;
+ border: none !important;
+ background-image: url(/assets/icons/plus-black.svg);
+ background-repeat: no-repeat;
+}
+
+/* .filters-button-wrapper{
+ position: absolute;
+ right: 0;
+ top: 0;
+} */
+
+.filters-section{
+ position: relative;
+ background-color: white;
+ padding: 12px 16px;
+ align-items: baseline;
+}
+
+.menu-wrapper ::ng-deep .mat-form-field-infix {
+ border-radius: 4px;
+ background: white;
+ min-width: 280px;
+ height: 40px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.menu-wrapper ::ng-deep .dropdown-wrapper .mat-select,
+.menu-wrapper ::ng-deep .dropdown-wrapper .mat-form-field-label{
+ padding: 6px 12px 5px 12px;
+}
+
:host::ng-deep .mat-option-text{
font: var(--text-body-2) !important;
color: var(--text-high-emphasis) !important;
@@ -311,7 +362,7 @@ tr.mat-row.sm > td {
}
th.mat-header-cell, td.mat-cell, td.mat-footer-cell{
- padding: 0 24px;
+ padding: 0 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
@@ -422,4 +473,9 @@ tr.mat-header-row{
}
.table-cell:hover .copy-icon{
display: block;
+}
+
+.new-filter-wrapper app-dropdown ::ng-deep .button{
+ padding: 0 16px 0px 0px;
+ border: none;
}
\ No newline at end of file
diff --git a/webapp/src/app/shared/table/table.component.html b/webapp/src/app/shared/table/table.component.html
index 4731736680..14eb93f116 100644
--- a/webapp/src/app/shared/table/table.component.html
+++ b/webapp/src/app/shared/table/table.component.html
@@ -1,123 +1,93 @@
-