-
Notifications
You must be signed in to change notification settings - Fork 31
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
14 changed files
with
134 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
projects/design-angular-kit/src/lib/components/navigation/skiplink/skiplink.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,7 @@ | ||
<it-link class="visually-hidden-focusable" [href]="href" [externalLink]="externalLink"> | ||
<ng-container *ngTemplateOutlet="linkContent"></ng-container> | ||
</it-link> | ||
|
||
<ng-template #linkContent> | ||
<ng-content></ng-content> | ||
</ng-template> |
32 changes: 32 additions & 0 deletions
32
projects/design-angular-kit/src/lib/components/navigation/skiplink/skiplink.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,32 @@ | ||
import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; | ||
import { NgTemplateOutlet } from '@angular/common'; | ||
import { TranslateModule } from '@ngx-translate/core'; | ||
import { inputToBoolean } from '../../../utils/coercion'; | ||
import { ItLinkComponent } from 'projects/design-angular-kit/src/public_api'; | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'it-skiplink', | ||
templateUrl: './skiplink.component.html', | ||
exportAs: 'itSkipLink', | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
imports: [NgTemplateOutlet, TranslateModule, ItLinkComponent], | ||
}) | ||
export class ItSkiplinkComponent { | ||
/** | ||
* The router link action | ||
* | ||
* Commands to pass to Router#createUrlTree. | ||
* - array: commands to pass to Router#createUrlTree. | ||
* - string: shorthand for array of commands with just the string, i.e. ['/route'] | ||
* - null|undefined: Disables the link by removing the href | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
@Input() href: any[] | string | null | undefined; | ||
|
||
/** | ||
* Is an external link (false to not use Angular router link) | ||
* @default false | ||
*/ | ||
@Input({ transform: inputToBoolean }) externalLink?: boolean; | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/app/skiplink/skiplink-example/skiplink-example.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,6 @@ | ||
<h3>Skiplink</h3> | ||
<div class="bd-example"> | ||
<p class="example-section"> | ||
<it-skiplink></it-skiplink> | ||
</p> | ||
</div> |
7 changes: 7 additions & 0 deletions
7
src/app/skiplink/skiplink-example/skiplink-example.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,7 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'it-skiplink-example', | ||
templateUrl: './skiplink-example.component.html', | ||
}) | ||
export class SkiplinkExampleComponent {} |
16 changes: 16 additions & 0 deletions
16
src/app/skiplink/skiplink-examples/skiplink-examples.component.tpl
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,16 @@ | ||
{% from "../../macro.template.njk" import sanitize as sanitize %} | ||
|
||
{% set html %} | ||
{% include "../skiplink-example/skiplink-example.component.html" %} | ||
{% endset %} | ||
|
||
{% set typescript %} | ||
{% include "../skiplink-example/skiplink-example.component.ts" %} | ||
{% endset %} | ||
|
||
|
||
<it-skiplink-example></it-skiplink-example> | ||
|
||
<it-source-display html="{$ sanitize(html) $}" typescript="{$ sanitize(typescript) $}" > | ||
</it-source-display> | ||
|
7 changes: 7 additions & 0 deletions
7
src/app/skiplink/skiplink-examples/skiplink-examples.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,7 @@ | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'it-skiplink-examples', | ||
templateUrl: './skiplink-examples.component.html', | ||
}) | ||
export class SkiplinkExamplesComponent {} |
12 changes: 12 additions & 0 deletions
12
src/app/skiplink/skiplink-index/skiplink-index.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,12 @@ | ||
<h1 class="bd-title">Skiplink</h1> | ||
<p class="bd-lead">Barra di navigazione laterale, include liste di link e liste di link annidate.</p> | ||
<div [innerHTML]="component.description"></div> | ||
<it-tab-container> | ||
<it-tab-item label="Esempi" active="true" class="mt-3"> | ||
<it-skiplink-examples></it-skiplink-examples> | ||
</it-tab-item> | ||
<it-tab-item label="API" class="mt-3"> | ||
<h2>Skiplink</h2> | ||
<it-api-parameters [component]="component"></it-api-parameters> | ||
</it-tab-item> | ||
</it-tab-container> |
14 changes: 14 additions & 0 deletions
14
src/app/skiplink/skiplink-index/skiplink-index.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,14 @@ | ||
import { Component } from '@angular/core'; | ||
import Documentation from '../../../assets/documentation.json'; | ||
|
||
@Component({ | ||
selector: 'it-skiplink-index', | ||
templateUrl: './skiplink-index.component.html', | ||
}) | ||
export class SkiplinkIndexComponent { | ||
component: any; | ||
|
||
constructor() { | ||
this.component = (<any>Documentation).components.find(component => component.name === 'ItSkiplinkComponent'); | ||
} | ||
} |
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,11 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { SkiplinkIndexComponent } from './skiplink-index/skiplink-index.component'; | ||
|
||
const routes: Routes = [{ path: '', component: SkiplinkIndexComponent }]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule], | ||
}) | ||
export class SkiplinkRoutingModule {} |
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,14 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { SkiplinkExampleComponent } from './skiplink-example/skiplink-example.component'; | ||
import { SkiplinkExamplesComponent } from './skiplink-examples/skiplink-examples.component'; | ||
import { SkiplinkIndexComponent } from './skiplink-index/skiplink-index.component'; | ||
|
||
import { SkiplinkRoutingModule } from './skiplink-routing.module'; | ||
import { SharedModule } from '../shared/shared.module'; | ||
|
||
@NgModule({ | ||
declarations: [SkiplinkExampleComponent, SkiplinkExamplesComponent, SkiplinkIndexComponent], | ||
imports: [CommonModule, SharedModule, SkiplinkRoutingModule], | ||
}) | ||
export class SkiplinkModule {} |
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