-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added multiselect Combobox component for Angular SDK (#157)
* Added multiselect Combobox component * removed comment --------- Co-authored-by: mohas22 <[email protected]>
- Loading branch information
Showing
8 changed files
with
719 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...s/angular-sdk-components/src/lib/_components/field/multiselect/multiselect.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<div [formGroup]="formGroup$"> | ||
<mat-form-field class="psdk-full-width" subscriptSizing="dynamic"> | ||
<mat-label>{{ label$ }}</mat-label> | ||
<mat-chip-grid #chipGrid> | ||
<ng-container *ngFor="let select of selectedItems"> | ||
<mat-chip-row (removed)="removeChip(select)"> | ||
{{ select.primary }} | ||
<button matChipRemove> | ||
<mat-icon>cancel</mat-icon> | ||
</button> | ||
</mat-chip-row> | ||
</ng-container> | ||
</mat-chip-grid> | ||
<input | ||
matInput | ||
[placeholder]="placeholder" | ||
[formControl]="fieldControl" | ||
[value]="value$" | ||
[required]="bRequired$" | ||
[matAutocomplete]="auto" | ||
(input)="fieldOnChange($event)" | ||
[matChipInputFor]="chipGrid" | ||
#trigger="matAutocompleteTrigger" | ||
/> | ||
<mat-autocomplete #auto="matAutocomplete"> | ||
<mat-option *ngFor="let item of itemsTree" [value]="item.primary" (click)="optionClicked($event, item, trigger)"> | ||
<mat-checkbox [checked]="item.selected" (click)="optionClicked($event, item, trigger)"> | ||
<span>{{ item.primary }}</span> | ||
</mat-checkbox> | ||
</mat-option> | ||
</mat-autocomplete> | ||
<mat-error *ngIf="fieldControl.invalid">{{ getErrorMessage() }}</mat-error> | ||
</mat-form-field> | ||
</div> |
7 changes: 7 additions & 0 deletions
7
...s/angular-sdk-components/src/lib/_components/field/multiselect/multiselect.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.psdk-full-width { | ||
width: 100%; | ||
} | ||
|
||
::ng-deep .mat-mdc-form-field-infix { | ||
padding-left: 10px; | ||
} |
21 changes: 21 additions & 0 deletions
21
...ngular-sdk-components/src/lib/_components/field/multiselect/multiselect.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MultiselectComponent } from './multiselect.component'; | ||
|
||
describe('MultiselectComponent', () => { | ||
let component: MultiselectComponent; | ||
let fixture: ComponentFixture<MultiselectComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [MultiselectComponent] | ||
}); | ||
fixture = TestBed.createComponent(MultiselectComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.