Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

Commit 317449b

Browse files
committed
split up operator components
1 parent f365292 commit 317449b

21 files changed

+199
-127
lines changed

src/app/operators/_operator-theme.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ $link-color: #2196F3;
2525
}
2626
}
2727

28+
.section-list {
29+
padding: 1px;
30+
list-style-type: none;
31+
margin-top: 0;
32+
33+
li {
34+
padding-bottom: 5px;
35+
&:last-child {
36+
padding-bottom: 0;
37+
}
38+
}
39+
}
40+
2841
a {
2942
text-decoration: none;
3043
color: $link-color;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<h2> Additional Resources </h2>
2+
<ul class="section-list">
3+
<li>
4+
<a [href]="sourceUrl" target="_blank"> Source Code </a>
5+
</li>
6+
<li *ngFor="let resource of additionalResources">
7+
<a [href]="resource.url" target="_blank"> {{ resource.name }} </a>
8+
</li>
9+
</ul>

src/app/operators/components/additional-resources/additional-resources.component.scss

Whitespace-only changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { Component, Input } from '@angular/core';
2+
import { OperatorReference } from '../../../../operator-docs';
3+
4+
@Component({
5+
selector: 'app-additional-resources',
6+
templateUrl: './additional-resources.component.html',
7+
styleUrls: ['./additional-resources.component.scss']
8+
})
9+
export class AdditionalResourcesComponent {
10+
@Input() additionalResources: OperatorReference[];
11+
@Input() sourceUrl: string;
12+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="marble-wrapper mat-elevation-z2">
2+
<img class="marble-diagram" [src]="url" *ngIf="url"/>
3+
</div>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
@import '../../../../styles/media-helpers';
2+
3+
.marble-wrapper {
4+
background-color: white;
5+
text-align: center;
6+
}
7+
8+
.marble-diagram {
9+
max-width: 640px;
10+
11+
@media #{$mat-sm-down} {
12+
max-width: 100%;
13+
}
14+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component, Input } from '@angular/core';
2+
import { OperatorParameters } from '../../../../operator-docs';
3+
4+
@Component({
5+
selector: 'app-marble-diagram',
6+
templateUrl: './marble-diagram.component.html',
7+
styleUrls: ['./marble-diagram.component.scss']
8+
})
9+
export class MarbleDiagramComponent {
10+
@Input() url: string;
11+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<h2 class="examples-header"> Examples </h2>
2+
<div
3+
class="code-example"
4+
*ngFor="let example of operatorExamples"
5+
appHighlightJs>
6+
<h3 [innerHTML]="example.name"></h3>
7+
<div class="code-block mat-elevation-z2">
8+
<button mat-icon-button [matMenuTriggerFor]="menu" class="menu-button">
9+
<mat-icon>more_vert</mat-icon>
10+
</button>
11+
<mat-menu #menu="matMenu">
12+
<a
13+
mat-menu-item
14+
[href]="link.url"
15+
target="_blank"
16+
*ngFor="let link of example.externalLinks">
17+
{{link.platform}}
18+
</a>
19+
</mat-menu>
20+
<pre [innerHTML]="example.code"></pre>
21+
</div>
22+
</div>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
.examples-header {
2+
margin: 32px 0 16px;
3+
}
4+
5+
.code-block {
6+
position: relative;
7+
}
8+
9+
.menu-button {
10+
position: absolute;
11+
right: 0;
12+
top: 0;
13+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Component, Input } from '@angular/core';
2+
import { OperatorExample } from '../../../../operator-docs';
3+
4+
@Component({
5+
selector: 'app-operator-examples',
6+
templateUrl: './operator-examples.component.html',
7+
styleUrls: ['./operator-examples.component.scss']
8+
})
9+
export class OperatorExamplesComponent {
10+
@Input() operatorExamples: OperatorExample[];
11+
}

0 commit comments

Comments
 (0)