Skip to content

Commit e96dc5c

Browse files
committed
feat(docs): popover docs
1 parent 8d3c2a8 commit e96dc5c

31 files changed

+414
-13
lines changed

demo/src/app/app.module.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { DemoDatepickerModule } from './components/datepicker';
2020
import { DemoDropdownModule } from './components/dropdown';
2121
import { DemoModalModule } from './components/modal';
2222
import { DemoPaginationModule } from './components/pagination';
23+
import { DemoPopoverModule } from './components/popover/index';
2324
import { DemoProgressbarModule } from './components/progressbar';
2425
import { DemoRatingModule } from './components/rating';
2526
import { DemoTabsModule } from './components/tabs';
@@ -55,6 +56,7 @@ import { ngdoc } from '../ng-api-doc';
5556
DemoDropdownModule,
5657
DemoModalModule,
5758
DemoPaginationModule,
59+
DemoPopoverModule,
5860
DemoProgressbarModule,
5961
DemoRatingModule,
6062
DemoTabsModule,

demo/src/app/app.routing.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { TabsSectionComponent } from './components/tabs/tabs-section.component';
1414
import { TimepickerSectionComponent } from './components/timepicker/timepicker-section.component';
1515
import { TooltipSectionComponent } from './components/tooltip/tooltip-section.component';
1616
import { TypeaheadSectionComponent } from './components/typeahead/typeahead-section.component';
17+
import { PopoverSectionComponent } from './components/popover/popover-section.component';
1718

1819
export const routes = [
1920
{
@@ -66,6 +67,11 @@ export const routes = [
6667
data: ['Pagination'],
6768
component: PaginationSectionComponent
6869
},
70+
{
71+
path: 'popover',
72+
data: ['Popover'],
73+
component: PopoverSectionComponent
74+
},
6975
{
7076
path: 'progressbar',
7177
data: ['Progressbar'],
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<button type="button" class="btn btn-primary"
2+
popover="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
3+
Live demo
4+
</button>
5+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'demo-popover-basic',
5+
templateUrl: './basic.html'
6+
})
7+
export class DemoPopoverBasicComponent {
8+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<button type="button" class="btn btn-primary"
2+
popover="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
3+
Preconfigured popover
4+
</button>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Component } from '@angular/core';
2+
import { PopoverConfig } from 'ng2-bootstrap';
3+
4+
// such override allows to keep some initial values
5+
6+
export function getAlertConfig(): PopoverConfig {
7+
return Object.assign(new PopoverConfig(), {placement: 'right', container: 'body', triggers: 'focus'});
8+
}
9+
10+
@Component({
11+
selector: 'demo-popover-config',
12+
templateUrl: './config.html',
13+
providers: [{provide: PopoverConfig, useFactory: getAlertConfig}]
14+
})
15+
export class DemoPopoverConfigComponent {
16+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div class="row panel" style="position: relative; overflow: hidden;">
2+
<div class="card panel-body">
3+
<button type="button" class="btn btn-danger"
4+
popover="Vivamus sagittis lacus vel augue laoreet rutrum faucibus.">
5+
Default popover
6+
</button>
7+
<button type="button" class="btn btn-success"
8+
popover="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
9+
container="body">
10+
Popover appended to body
11+
</button>
12+
</div>
13+
</div>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'demo-popover-container',
5+
templateUrl: './container.html'
6+
})
7+
export class DemoPopoverContainerComponent {
8+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<button type="button" class="btn btn-success"
2+
popover="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."
3+
popoverTitle="Dismissible popover"
4+
triggers="focus">
5+
Dismissible popover
6+
</button>
7+
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component } from '@angular/core';
2+
3+
@Component({
4+
selector: 'demo-popover-dismiss',
5+
templateUrl: './dismiss.html'
6+
})
7+
export class DemoPopoverDismissComponent {
8+
}

0 commit comments

Comments
 (0)