-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
93 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
52 changes: 52 additions & 0 deletions
52
src/app/pipes-documentation/pipes-documentation.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 @@ | ||
<vgr-page> | ||
<vgr-page-header [title]="'Pipes'"> | ||
</vgr-page-header> | ||
|
||
<vgr-page-body> | ||
<!-- Färger --> | ||
<vgr-page-block class="column-layout"> | ||
<h2>Dokumentation för tillgängliga Pipes i komponentkartan</h2> | ||
<p>Det finns ett visst antal olika pipes som man via komponentkartan kan använda sig av, utöver de inbyggda som redan finns i Angular.</p> | ||
<br> | ||
<table class="property-table"> | ||
<tr> | ||
<th>Namn</th> | ||
<th>Beskrivning</th> | ||
<th>Exempel</th> | ||
</tr> | ||
<tr> | ||
<td> | ||
hsaidPipe : string | ||
</td> | ||
<td>Pipe som tar in ett HSA-id (SEZZZZZZZZZZ-E0XXXXXXXXXX60) och returnerar sista delen av HSA-id:t (E0XXXXXXXXXX60)</td> | ||
<td>'SEZZZ-E0XXX60' | hsaidPipe</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
postnummer : string | ||
</td> | ||
<td>Pipe som tar in en sträng (5 siffror) och returnerar ett svenskt postnummer format (ex. XXX XX)</td> | ||
<td>'47700' | postnummer</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
personnummer : string | ||
</td> | ||
<td>Pipe som tar in en sträng (10 eller 12 siffror) och returnerar ett svenskt personnummer format (ex. YYYYMMDD-XXXX)</td> | ||
<td>'191212121212' | personnummer</td> | ||
</tr> | ||
<tr> | ||
<td> | ||
komponentkartanCurrency : number | ||
</td> | ||
<td>Pipe som tar in ett nummer och returnerar detta med decimaltecken (default 2 decimaler, ex 12,00)</td> | ||
<td>12 | komponentkartanCurrency</td> | ||
</tr> | ||
</table> | ||
<br> | ||
<h2>Exempel</h2> | ||
<section [innerHTML]="pipesPageStructure" vgrHighlightCode> | ||
</section> | ||
</vgr-page-block> | ||
</vgr-page-body> | ||
</vgr-page> |
23 changes: 23 additions & 0 deletions
23
src/app/pipes-documentation/pipes-documentation.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,23 @@ | ||
import { Component } from '@angular/core'; | ||
import { HtmlEncodeService } from '../html-encode.service'; | ||
|
||
@Component({ | ||
selector: 'app-pipes-documentation', | ||
templateUrl: './pipes-documentation.component.html', | ||
styleUrls: ['./pipes.documentation.component.scss'] | ||
}) | ||
export class PipesDocumentationComponent { | ||
|
||
pipesPageStructure: string; | ||
pipesPage = `<div>{{ 120 | komponentkartanCurrency }}</div> // Output 120,00 | ||
<div>{{ 'SEZZZZZZZZZZ-E0XXXXXXXXXX60' | hsaidPipe }}</div> // Output E0XXXXXXXXXX60 | ||
<div>{{ '47700' | postnummer }}</div> // Output 477 00 | ||
<div>{{ '191212121212' | personnummer }}</div> // Output 19121212-1212`; | ||
constructor(private htmlEncoder: HtmlEncodeService) { | ||
this.pipesPageStructure = htmlEncoder.prepareHighlightedSection(this.pipesPage); | ||
} | ||
|
||
|
||
|
||
|
||
} |
4 changes: 4 additions & 0 deletions
4
src/app/pipes-documentation/pipes.documentation.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,4 @@ | ||
ul { | ||
list-style-type: disc; | ||
list-style-position: inside; | ||
} |
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