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

Commit a43f86d

Browse files
committed
operator formatting update
1 parent acea05d commit a43f86d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+153
-44
lines changed

src/app/operator-docs/combination/combineAll.ts

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
@import '~@angular/material/theming';
2+
3+
$operator-border: #f3f3f3;
4+
$operator-active: #62757f;
5+
$link-color: #2196F3;
6+
7+
@mixin operator-theme($theme) {
8+
$primary: mat-color(map-get($theme, primary));
9+
$accent: mat-color(map-get($theme, accent));
10+
$operator-active-background: rgba($operator-active, .7);
11+
12+
.operator-list {
13+
a {
14+
border-bottom: 1px solid $operator-border;
15+
&.active-operator {
16+
background-color: $operator-active-background;
17+
color: white;
18+
&:hover {
19+
background-color: $operator-active-background;
20+
}
21+
}
22+
&:last-child {
23+
border-bottom: none;
24+
}
25+
}
26+
}
27+
28+
a {
29+
text-decoration: none;
30+
color: $link-color;
31+
}
32+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<mat-toolbar color="primary" class="operator-name">
1+
<mat-toolbar class="operator-name">
22
{{ operatorName }}
33
</mat-toolbar>
4-
<mat-toolbar color="primary" class="signature">
4+
<mat-toolbar class="signature">
55
{{ operatorSignature }}
66
</mat-toolbar>

src/app/operators/components/operator-header/operator-header.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@import '../../operator-theme';
2+
13
.operator-name {
24
font-size:30px;
35
}
@@ -7,6 +9,7 @@
79
}
810

911
mat-toolbar {
10-
background: #62757f !important;
12+
background: $operator-active !important;
13+
color: rgba(255, 255, 255, 0.87);
1114
font-weight: normal;
1215
}

src/app/operators/components/operator/operator.component.html

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,21 @@
44
[id]="operatorName"
55
class="operator-header">
66
</app-operator-header>
7-
<div class="main-operator-container">
8-
<div class="short-description">
9-
{{ shortDescription }}
7+
<section class="main-operator-container mat-typography">
8+
<h3 class="short-description" [innerHTML]="shortDescription"></h3>
9+
<h2> Examples </h2>
10+
<div
11+
class="code-example"
12+
*ngFor="let example of examples"
13+
appHighlightJs>
14+
<h3> {{ example.name }} </h3>
15+
<pre [innerHTML]="example.code"></pre>
1016
</div>
11-
</div>
17+
<h2> Related Operators </h2>
18+
<ul class="related-list">
19+
<li *ngFor="let related of relatedOperators">
20+
<a [href]="'/operators#' + related"> {{ related }} </a>
21+
</li>
22+
</ul>
23+
<h2> Additional References </h2>
24+
</section>
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
1-
21
.main-operator-container {
32
padding: 5px;
43
height: 1000px;
54
display: flex;
65
flex-direction: column;
76
padding: 0 16px;
87
}
8+
9+
.related-list {
10+
padding: 1px;
11+
list-style-type: none;
12+
margin-top: 0;
13+
14+
li {
15+
padding-bottom: 5px;
16+
&:last-child {
17+
padding-bottom: 0;
18+
}
19+
}
20+
21+
22+
}

src/app/operators/components/operator/operator.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Input, OnInit } from '@angular/core';
2-
import { OperatorDoc } from '../../../operator-docs/operator.model';
2+
import { OperatorDoc } from '../../../../operator-docs/operator.model';
33

44
@Component({
55
selector: 'app-operator',
@@ -20,4 +20,12 @@ export class OperatorComponent {
2020
get shortDescription() {
2121
return this.operator.shortDescription;
2222
}
23+
24+
get examples() {
25+
return this.operator.examples || [];
26+
}
27+
28+
get relatedOperators() {
29+
return this.operator.relatedOperators || [];
30+
}
2331
}

src/app/operators/directives/highlight-js.directive.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ export class HighlightJsDirective implements AfterViewChecked {
1414

1515
constructor(
1616
private elementRef: ElementRef,
17-
private zone: NgZone) {}
17+
private zone: NgZone
18+
) {}
1819

1920
ngAfterViewChecked() {
2021
if (!this._done) {
2122
if (this.elementRef.nativeElement.innerHTML && this.elementRef.nativeElement.querySelector) {
22-
const snippets = this.elementRef.nativeElement.querySelectorAll('code');
23+
const snippets = this.elementRef.nativeElement.querySelectorAll('pre');
2324
this.zone.runOutsideAngular(() => {
2425
for (const snippet of snippets) {
2526
hljs.highlightBlock(snippet);

src/app/operators/operators.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<mat-sidenav-container
22
class="operator-container"
33
appOperatorScroll
4-
(activeOperator)="updateUrl($event)">
4+
(activeOperator)="activeOperator = $event">
55
<mat-sidenav
66
mode="side"
77
[opened]="true"
@@ -13,7 +13,7 @@ <h3 mat-subheader class="category-subheader">{{ category }}</h3>
1313
<a mat-list-item
1414
*ngFor="let operator of groupedOperators[category]"
1515
[href]="'/operators#' + operator.name"
16-
[class.active-operator]="(activeOperator$ | async) === operator.name">
16+
[class.active-operator]="activeOperator === operator.name">
1717
{{ operator.name }}
1818
</a>
1919
</mat-nav-list>
Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
$subheader-color: #333;
2-
$operator-border: #f3f3f3;
32

43
:host {
54
flex: 1 1 auto;
@@ -18,19 +17,6 @@ $operator-border: #f3f3f3;
1817
background: $subheader-color;
1918
}
2019

21-
.operator-list {
22-
a {
23-
border-bottom: 1px solid $operator-border;
24-
&.active-operator {
25-
background-color: #f3f3f3;
26-
transition: background-color .3s ease-in-out;
27-
}
28-
&:last-child {
29-
border-bottom: none;
30-
}
31-
}
32-
}
33-
3420
.operator-list-sidenav {
3521
width: 300px;
3622
}

0 commit comments

Comments
 (0)