Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add popover-dropdown component, remove isDateTimePicker from time/calendar component * Add dropdown isOpen control from popover parent component * Rename selector to fd-dropdown-control
- Loading branch information
1 parent
b6824c5
commit 53fbef3
Showing
15 changed files
with
150 additions
and
96 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
5 changes: 2 additions & 3 deletions
5
.../app/documentation/component-docs/dropdown/examples/dropdown-icons-example.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
4 changes: 2 additions & 2 deletions
4
...entation/component-docs/dropdown/examples/dropdown-infinite-scroll-example.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
5 changes: 2 additions & 3 deletions
5
.../app/documentation/component-docs/dropdown/examples/dropdown-state-example.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
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
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
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
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
19 changes: 19 additions & 0 deletions
19
library/src/lib/popover/popover-dropdown/popover-dropdown.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,19 @@ | ||
<div class="fd-dropdown"> | ||
<button | ||
fd-button | ||
class="fd-dropdown__control fd-button" | ||
[ngClass]=" | ||
(btnType ? ' fd-button--' + btnType : '') + | ||
(glyph ? ' sap-icon--' + glyph : '') + | ||
(compact ? ' fd-button--compact' : '') + | ||
(this.disabled ? ' is-disabled' : '') + | ||
(toolbar ? ' fd-button--standard': '') | ||
" | ||
[attr.aria-expanded]="this.disabled ? false : isOpen" | ||
[attr.aria-disabled]="this.disabled" | ||
aria-haspopup="true" | ||
[disabled]="disabled" | ||
> | ||
<ng-content></ng-content> | ||
</button> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
library/src/lib/popover/popover-dropdown/popover-dropdown.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,24 @@ | ||
import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | ||
import { PopoverDropdownComponent } from './popover-dropdown.component'; | ||
|
||
|
||
describe('PopoverControlComponent', () => { | ||
let component: PopoverDropdownComponent; | ||
let fixture: ComponentFixture<PopoverDropdownComponent>; | ||
|
||
beforeEach(async(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [PopoverDropdownComponent] | ||
}).compileComponents(); | ||
})); | ||
|
||
beforeEach(() => { | ||
fixture = TestBed.createComponent(PopoverDropdownComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
50 changes: 50 additions & 0 deletions
50
library/src/lib/popover/popover-dropdown/popover-dropdown.component.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,50 @@ | ||
import { Component, Host, Inject, Input, OnDestroy, ViewEncapsulation } from '@angular/core'; | ||
import { Subscription } from 'rxjs'; | ||
import { PopoverComponent } from '../popover.component'; | ||
/** | ||
* A component used to enforce a certain layout for the popover. With additional styling | ||
* ```html | ||
* <fd-popover> | ||
* <fd-dropdown>Dropdown</fd-dropdown> | ||
* <fd-popover-body>Popover Body</fd-popover-body> | ||
* </fd-popover> | ||
* ``` | ||
*/ | ||
@Component({ | ||
selector: 'fd-dropdown-control', | ||
host: { | ||
class: 'fd-dropdown', | ||
}, | ||
templateUrl: 'popover-dropdown.component.html', | ||
encapsulation: ViewEncapsulation.None, | ||
}) | ||
export class PopoverDropdownComponent { | ||
/** Whether the popover should have an arrow. */ | ||
@Input() | ||
noArrow: boolean = true; | ||
|
||
/** Whether the popover is disabled. */ | ||
@Input() | ||
disabled: boolean = false; | ||
|
||
/** The glyph to display. */ | ||
@Input() | ||
glyph: string; | ||
|
||
/** The btnType to display. */ | ||
@Input() | ||
btnType: string = ''; | ||
|
||
/** Whether the dropdown is in compact format. */ | ||
@Input() | ||
compact: boolean = false; | ||
|
||
/** Whether the dropdown is in a toolbar. */ | ||
@Input() | ||
toolbar: boolean = false; | ||
|
||
/** Whether the dropdown is opened. */ | ||
@Input() | ||
isOpen: boolean = false; | ||
|
||
} |
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
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
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
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