Skip to content

Commit b74626c

Browse files
committed
[Component] Add Popover component
1 parent b3fff83 commit b74626c

File tree

5 files changed

+98
-0
lines changed

5 files changed

+98
-0
lines changed

src/renderer/app/layout/layout.routing.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ const LAYOUT_ROUTES: Routes = [
9494
{
9595
path: 'collapse',
9696
loadChildren: () => import('../pages/component/collapse/collapse.module').then(m => m.CollapseComponentModule)
97+
},
98+
{
99+
path: 'popover',
100+
loadChildren: () => import('../pages/component/popover/popover.module').then(m => m.PopoverComponentModule)
97101
}
98102
]
99103
},

src/renderer/app/layout/navigation/navigation.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@
6565
<li routerLinkActive="navigation__active">
6666
<a [routerLink]="['/component/collapse']"><i class="fa fa-columns"></i> Collapse</a>
6767
</li>
68+
<li routerLinkActive="navigation__active">
69+
<a [routerLink]="['/component/popover']"><i class="fa fa-podcast"></i> Popover</a>
70+
</li>
6871
</ul>
6972
</li>
7073
<li routerLinkActive="navigation__sub--active" class="navigation__sub">
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<section class="content--row">
2+
<header class="content__title">
3+
<h1>Popover</h1>
4+
<small>This template is built using <code>ngx-bootstrap/popover</code> and provides some usage examples</small>
5+
</header>
6+
<div class="card">
7+
<div class="card-body">
8+
<h4 class="card-title">Basic Popover</h4>
9+
<button type="button" class="btn btn-primary" popover="I am content">
10+
Click
11+
</button>
12+
</div>
13+
</div>
14+
<div class="card">
15+
<div class="card-body">
16+
<h4 class="card-title">Position Popover</h4>
17+
<div class="btn-demo">
18+
<button type="button" class="btn btn-primary" popover="I am content" popoverTitle="Left" placement="left">
19+
Left
20+
</button>
21+
<button type="button" class="btn btn-primary" popover="I am content" popoverTitle="Top" placement="top">
22+
Top
23+
</button>
24+
<button type="button" class="btn btn-primary" popover="I am content" popoverTitle="Bottom" placement="bottom">
25+
Bottom
26+
</button>
27+
<button type="button" class="btn btn-primary" popover="I am content" popoverTitle="Right" placement="right">
28+
Right
29+
</button>
30+
</div>
31+
</div>
32+
</div>
33+
<div class="card">
34+
<div class="card-body">
35+
<h4 class="card-title">Triggers Popover</h4>
36+
<button type="button" class="btn btn-primary" popover="I am content" triggers="mouseenter:mouseleave">
37+
Mouse over to me
38+
</button>
39+
</div>
40+
</div>
41+
<div class="card">
42+
<div class="card-body">
43+
<h4 class="card-title">Custom page Popover</h4>
44+
<template #popTemplate>I am a custom page:
45+
<div>
46+
<span class="btn btn-danger">I'm an HTML content</span>
47+
</div>
48+
</template>
49+
<button type="button" class="btn btn-primary" [popover]="popTemplate" triggers="focus">
50+
Click
51+
</button>
52+
</div>
53+
</div>
54+
</section>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Component, OnInit } from '@angular/core';
2+
3+
@Component({
4+
selector: 'app-component-popover',
5+
templateUrl: './popover.component.html'
6+
})
7+
export class PopoverComponent implements OnInit {
8+
constructor() {
9+
}
10+
11+
ngOnInit() {
12+
}
13+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { CommonModule } from '@angular/common';
2+
import { NgModule } from '@angular/core';
3+
import { RouterModule } from '@angular/router';
4+
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
5+
import { PopoverModule } from 'ngx-bootstrap/popover';
6+
import { PopoverComponent } from './popover.component';
7+
8+
const POPOVER_ROUTES = [
9+
{path: '', component: PopoverComponent}
10+
];
11+
12+
@NgModule({
13+
declarations: [
14+
PopoverComponent
15+
],
16+
imports: [
17+
CommonModule,
18+
BsDropdownModule.forRoot(),
19+
PopoverModule.forRoot(),
20+
RouterModule.forChild(POPOVER_ROUTES)
21+
]
22+
})
23+
export class PopoverComponentModule {
24+
}

0 commit comments

Comments
 (0)