Skip to content

Commit fb9e21a

Browse files
bogdanhpklskramarov
authored andcommitted
feat(docs): new tooltip docs (#UIM-864)
1 parent 5b30835 commit fb9e21a

23 files changed

+323
-512
lines changed
182 KB
Loading
11.9 KB
Loading

packages/mosaic-examples/mosaic/tooltip/index.ts

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,30 @@ import { A11yModule } from '@angular/cdk/a11y';
22
import { CdkScrollableModule } from '@angular/cdk/scrolling';
33
import { CommonModule } from '@angular/common';
44
import { NgModule } from '@angular/core';
5-
import { FormsModule } from '@angular/forms';
65
import { McButtonModule } from '@ptsecurity/mosaic/button';
7-
import { McCheckboxModule } from '@ptsecurity/mosaic/checkbox';
8-
import { McFormsModule } from '@ptsecurity/mosaic/core';
9-
import { McFormFieldModule } from '@ptsecurity/mosaic/form-field';
10-
import { McIconModule } from '@ptsecurity/mosaic/icon';
11-
import { McInputModule } from '@ptsecurity/mosaic/input';
12-
import { McPopoverModule } from '@ptsecurity/mosaic/popover';
13-
import { McSelectModule } from '@ptsecurity/mosaic/select';
146
import { McToolTipModule } from '@ptsecurity/mosaic/tooltip';
157

8+
import { TooltipExtendedExample } from './tooltip-extended/tooltip-extended-example';
9+
import { TooltipLongExample } from './tooltip-long/tooltip-long-example';
10+
import { TooltipMultipleLinesExample } from './tooltip-multiple-lines/tooltip-multiple-lines-example';
1611
import { TooltipOverviewExample } from './tooltip-overview/tooltip-overview-example';
17-
import { TooltipScrollableExample } from './tooltip-scrollable/tooltip-scrollable-example';
12+
import { TooltipPlacementExample } from './tooltip-placement/tooltip-placement-example';
1813

1914

2015
export {
2116
TooltipOverviewExample,
22-
TooltipScrollableExample
17+
TooltipExtendedExample,
18+
TooltipMultipleLinesExample,
19+
TooltipPlacementExample,
20+
TooltipLongExample
2321
};
2422

2523
const EXAMPLES = [
2624
TooltipOverviewExample,
27-
TooltipScrollableExample
25+
TooltipExtendedExample,
26+
TooltipMultipleLinesExample,
27+
TooltipPlacementExample,
28+
TooltipLongExample
2829
];
2930

3031
@NgModule({
@@ -33,15 +34,7 @@ const EXAMPLES = [
3334
A11yModule,
3435
McButtonModule,
3536
McToolTipModule,
36-
CdkScrollableModule,
37-
FormsModule,
38-
McFormsModule,
39-
McFormFieldModule,
40-
McSelectModule,
41-
McPopoverModule,
42-
McIconModule,
43-
McInputModule,
44-
McCheckboxModule
37+
CdkScrollableModule
4538
],
4639
declarations: EXAMPLES,
4740
exports: EXAMPLES
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.custom-tooltip {
2+
max-width: 485px !important;
3+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<button mc-button
2+
[mcExtendedTooltip]="tooltipContent"
3+
[mcTooltipHeader]="tooltipHeader"
4+
[mcTooltipClass]="'custom-tooltip'">
5+
Кнопка со сложным тултипом
6+
</button>
7+
8+
<ng-template #tooltipContent>
9+
<div>В западной традиции рыбой выступает фрагмент латинского текста из философского трактата Цицерона «О пределах
10+
добра и зла», написанного в 45 году до нашей эры. Впервые этот текст был применен для набора шрифтовых образцов
11+
неизвестным печатником еще в XVI веке.
12+
</div>
13+
</ng-template>
14+
15+
<ng-template #tooltipHeader>
16+
<span>Заголовок</span>
17+
</ng-template>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, ViewEncapsulation } from '@angular/core';
2+
3+
4+
/**
5+
* @title Extended tooltip
6+
*/
7+
@Component({
8+
selector: 'tooltip-extended-example',
9+
templateUrl: 'tooltip-extended-example.html',
10+
styleUrls: ['tooltip-extended-example.css'],
11+
encapsulation: ViewEncapsulation.None
12+
})
13+
export class TooltipExtendedExample {
14+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.long-tooltip {
2+
max-width: none !important;
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<button mc-button
2+
mcTooltip="efa761fe-ee12-4c77-a0fb-8ecc70f4a79b-a53316a9-1180-4283-a86c"
3+
mcTooltipClass="long-tooltip">
4+
Кнопка с длинным тултипом
5+
</button>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { Component, ViewEncapsulation } from '@angular/core';
2+
3+
4+
/**
5+
* @title Long tooltip
6+
*/
7+
@Component({
8+
selector: 'tooltip-long-example',
9+
templateUrl: 'tooltip-long-example.html',
10+
styleUrls: ['tooltip-long-example.css'],
11+
encapsulation: ViewEncapsulation.None
12+
})
13+
export class TooltipLongExample {
14+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/** No CSS for this example */

0 commit comments

Comments
 (0)