-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tooltip): Tooltip component (#33)
- Loading branch information
1 parent
8301590
commit 9bfc4f1
Showing
29 changed files
with
1,416 additions
and
16 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { Component, NgModule, ViewEncapsulation } from '@angular/core'; | ||
import { FormsModule } from '@angular/forms'; | ||
import { BrowserModule } from '@angular/platform-browser'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { McButtonModule } from '@ptsecurity/mosaic/button'; | ||
import { McInputModule } from '@ptsecurity/mosaic/input'; | ||
import { McListModule } from '@ptsecurity/mosaic/list'; | ||
import { McRadioModule } from '@ptsecurity/mosaic/radio'; | ||
import { McToolTipModule } from '@ptsecurity/mosaic/tooltip'; | ||
|
||
|
||
/* tslint:disable:no-trailing-whitespace */ | ||
@Component({ | ||
selector: 'app', | ||
styleUrls: ['./styles.css'], | ||
encapsulation: ViewEncapsulation.None, | ||
template: require('./template.html') | ||
}) | ||
export class DemoComponent { | ||
} | ||
|
||
@NgModule({ | ||
declarations: [ | ||
DemoComponent | ||
], | ||
imports: [ | ||
BrowserModule, | ||
FormsModule, | ||
McToolTipModule, | ||
McButtonModule, | ||
McRadioModule, | ||
McListModule, | ||
McInputModule | ||
], | ||
bootstrap: [ | ||
DemoComponent | ||
] | ||
}) | ||
export class DemoModule { | ||
} | ||
|
||
platformBrowserDynamic() | ||
.bootstrapModule(DemoModule) | ||
.catch((error) => console.error(error)); // tslint:disable-line |
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,38 @@ | ||
@import '~@ptsecurity/mosaic-icons/dist/styles/mc-icons'; | ||
@import '../../lib/core/theming/prebuilt/default-theme'; | ||
@import '../../lib/core/visual/prebuilt/default-visual'; | ||
|
||
@include mosaic-visual(); | ||
|
||
body, html { | ||
width: 100%; | ||
height: 100%; | ||
margin: 0px; | ||
} | ||
|
||
app { | ||
height: 100%; | ||
width: 100%; | ||
} | ||
|
||
.container { | ||
flex: 1 1 auto; | ||
height: 100%; | ||
width: 100%; | ||
|
||
&-item { | ||
height: 100%; | ||
} | ||
} | ||
|
||
.mc-button { | ||
min-width: 85px; | ||
text-align: center; | ||
padding: 0; | ||
margin-right: 8px; | ||
margin-bottom: 8px !important; | ||
} | ||
|
||
.custom-pos { | ||
align-self: end; | ||
} |
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,115 @@ | ||
<section class="container flex-100 layout-row layout-align-center-center"> | ||
<div class="flex-60 layout-row layout-align-center-center"> | ||
<div class="flex layout-column layout-align-center-center container-item"> | ||
<span class="mc-title">Focus</span> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="One two three" | ||
mcTitle="Download file" | ||
mcTrigger="hover" | ||
>Simple</button> | ||
<button class="mc-primary" | ||
mc-button | ||
color="primary" | ||
mc-tooltip | ||
mcTitle="Удалить файл" | ||
mcTrigger="focus" | ||
mcPlacement="top">top</button> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="Подсказка может занимать две и более строк" | ||
mcTrigger="focus" | ||
mcPlacement="right" | ||
mcTooltipDisabled>disabled</button> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="PDQL-запрос фильтра содержит ошибки" | ||
mcTrigger="focus" | ||
mcPlacement="left">left</button> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="PDQL-запрос фильтра содержит ошибки. Uncaught SyntaxError: Unexpected string" | ||
mcTrigger="focus" | ||
mcPlacement="bottom">bottom</button> | ||
</div> | ||
<div class="flex layout-column layout-align-center-center container-item"> | ||
<span class="mc-title">Hover</span> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="Показать\Скрыть" | ||
mcPlacement="top">top</button> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="Активировать записи" | ||
mcPlacement="right">right</button> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="PDQL-запрос фильтра содержит ошибки | ||
испральве запрос" | ||
mcPlacement="left">left</button> | ||
<button class="mc-primary" | ||
mc-button | ||
mc-tooltip="Обновить" | ||
mcPlacement="bottom">bottom</button> | ||
</div> | ||
</div> | ||
<div class="flex layout-column layout-align-center-center container-item"> | ||
<div class="flex layout-row layout-align-center-center"> | ||
<mc-radio-group class="flex layout-column layout-align-center-center"> | ||
<mc-radio-button | ||
class="example-radio-button" | ||
value="option_1" | ||
mc-tooltip | ||
mcTitle="Option 1" | ||
mcPlacement="left">Option 1</mc-radio-button> | ||
<mc-radio-button | ||
class="example-radio-button" | ||
value="option_2" | ||
mc-tooltip | ||
mcTitle="Option 2 tooltip" | ||
mcPlacement="left">Option 2</mc-radio-button> | ||
<mc-radio-button | ||
class="example-radio-button" | ||
value="option_3" | ||
mc-tooltip | ||
mcTitle="Last option tooltip placed left" | ||
mcPlacement="left">Option 3</mc-radio-button> | ||
</mc-radio-group> | ||
</div> | ||
<div class="flex layout-row layout-aling-center-center"> | ||
<mc-list-selection | ||
class="mc-no-select" | ||
[(ngModel)]="multipleSelected" | ||
(selectionChange)="onSelectionChange($event)"> | ||
<mc-list-option | ||
value="Disabled" | ||
disabled | ||
mc-tooltip | ||
mcTooltipDisabled | ||
>Disabled</mc-list-option> | ||
<mc-list-option | ||
value="Normal" | ||
mc-tooltip="Item inside list can have a tooltip with a lot of text. | ||
Tooltip for nex element is disabled." | ||
mcPlacement="left">Normal</mc-list-option> | ||
<mc-list-option | ||
value="Hovered" | ||
class="mc-hovered" | ||
mc-tooltip="Not empty" | ||
mcPlacement="right" | ||
mcTooltipDisabled>Hovered</mc-list-option> | ||
<mc-list-option | ||
value="Focused" | ||
class="mc-focused" | ||
mc-tooltip | ||
mcTitle="Focused list item have a tooltip" | ||
mcPlacement="bottom">Focused</mc-list-option> | ||
<mc-list-option | ||
value="Selected" | ||
class="mc-selected" | ||
mc-tooltip="Выбранный элемент списка" | ||
mcPlacement="right">Selected</mc-list-option> | ||
</mc-list-selection> | ||
</div> | ||
</div> | ||
</section> |
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,17 @@ | ||
import { | ||
animate, | ||
state, | ||
style, | ||
transition, | ||
trigger, | ||
AnimationTriggerMetadata, | ||
} from '@angular/animations'; | ||
|
||
|
||
export const fadeAnimation: AnimationTriggerMetadata = trigger('fadeAnimation', [ | ||
state('void', style({ opacity: 0 })), | ||
state('true', style({ opacity: 1 })), | ||
state('false', style({ opacity: 0 })), | ||
transition('* => true', animate('150ms cubic-bezier(0.0, 0.0, 0.2, 1)')), | ||
transition('* => void', animate('150ms cubic-bezier(0.4, 0.0, 1, 1)')), | ||
]); |
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 { fadeAnimation } from './fade-animations'; |
Oops, something went wrong.