-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Multiple tooltips on a single element page
- Loading branch information
1 parent
910f95b
commit 092ac37
Showing
9 changed files
with
149 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
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
22 changes: 22 additions & 0 deletions
22
...ngx-tippy-demo/src/app/pages/multiple-tooltips/_tests/multiple-tooltips.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,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MultipleTooltipsComponent } from '../multiple-tooltips.component'; | ||
|
||
describe('MultipleTooltipsComponent', () => { | ||
let component: MultipleTooltipsComponent; | ||
let fixture: ComponentFixture<MultipleTooltipsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [MultipleTooltipsComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(MultipleTooltipsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
1 change: 1 addition & 0 deletions
1
projects/ngx-tippy-demo/src/app/pages/multiple-tooltips/index.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 @@ | ||
export { MultipleTooltipsComponent } from './multiple-tooltips.component'; |
52 changes: 52 additions & 0 deletions
52
projects/ngx-tippy-demo/src/app/pages/multiple-tooltips/multiple-tooltips.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,52 @@ | ||
<div class="multiple"> | ||
|
||
<h1 class="tui-text_h3">Multiple tooltips on a single element</h1> | ||
|
||
<p class="tui-text_body-m-2"> | ||
For multiple tooltips on a single element - use nest elements with <em>ngxTippy</em> directive: | ||
</p> | ||
|
||
<t-demo-code | ||
*tuiLet="snippets.multiple as s" | ||
[snippet]="s.snippet" | ||
[languages]="s.languages" | ||
></t-demo-code> | ||
|
||
<t-demo> | ||
<div | ||
ngxTippy="Left tooltip content" | ||
[tippyProps]="{ | ||
placement: 'left', | ||
delay: [50, 100], | ||
animation: 'shift-toward' | ||
}" | ||
> | ||
<div | ||
ngxTippy="Right tooltip content" | ||
[tippyProps]="{ | ||
placement: 'right', | ||
delay: [100, 150], | ||
animation: 'shift-toward' | ||
}" | ||
> | ||
<button | ||
ngxTippy="Top tooltip content" | ||
class="tui-button" | ||
size="m" | ||
tuiButton | ||
type="button" | ||
appearance="primary" | ||
[tippyProps]="{ | ||
placement: 'top', | ||
delay: [200, 250], | ||
animation: 'shift-toward' | ||
}" | ||
> | ||
Button | ||
</button> | ||
</div> | ||
</div> | ||
</t-demo> | ||
|
||
|
||
</div> |
3 changes: 3 additions & 0 deletions
3
projects/ngx-tippy-demo/src/app/pages/multiple-tooltips/multiple-tooltips.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,3 @@ | ||
.tui-text_h3 { | ||
margin-top: 0; | ||
} |
16 changes: 16 additions & 0 deletions
16
projects/ngx-tippy-demo/src/app/pages/multiple-tooltips/multiple-tooltips.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,16 @@ | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; | ||
import { SNIPPETS } from './snippets'; | ||
|
||
@Component({ | ||
selector: 'app-multiple-tooltips', | ||
templateUrl: './multiple-tooltips.component.html', | ||
styleUrls: ['./multiple-tooltips.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class MultipleTooltipsComponent implements OnInit { | ||
public readonly snippets = SNIPPETS; | ||
|
||
constructor() {} | ||
|
||
ngOnInit(): void {} | ||
} |
37 changes: 37 additions & 0 deletions
37
projects/ngx-tippy-demo/src/app/pages/multiple-tooltips/snippets.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,37 @@ | ||
const MULTIPLE_TEMPLATE = ` | ||
<div | ||
ngxTippy="Left tooltip content" | ||
[tippyProps]="{ | ||
placement: 'left', | ||
delay: [50, 100], | ||
animation: 'shift-toward' | ||
}" | ||
> | ||
<div | ||
ngxTippy="Right tooltip content" | ||
[tippyProps]="{ | ||
placement: 'right', | ||
delay: [100, 150], | ||
animation: 'shift-toward' | ||
}" | ||
> | ||
<button | ||
ngxTippy="Top tooltip content" | ||
[tippyProps]="{ | ||
placement: 'top', | ||
delay: [200, 250], | ||
animation: 'shift-toward' | ||
}" | ||
> | ||
Button | ||
</button> | ||
</div> | ||
</div> | ||
`; | ||
|
||
export const SNIPPETS = { | ||
multiple: { | ||
snippet: MULTIPLE_TEMPLATE, | ||
languages: ['html'], | ||
}, | ||
}; |