-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(docs): add docs for the select component
Co-authored-by: Antonino Bonanno <[email protected]> Co-authored-by: Andrea Stagi <[email protected]>
- Loading branch information
1 parent
4f87263
commit 561091a
Showing
20 changed files
with
305 additions
and
1 deletion.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
src/app/select/select-disabled-example/select-disabled-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,12 @@ | ||
<h3>Select disabilitata</h3> | ||
<div class="bd-example"> | ||
<p class="example-section"> | ||
<it-select | ||
id="disabled-select" | ||
label="Etichetta" | ||
disabled="true" | ||
[options]="selectOptions"> | ||
</it-select> | ||
</p> | ||
</div> | ||
|
Empty file.
31 changes: 31 additions & 0 deletions
31
src/app/select/select-disabled-example/select-disabled-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,31 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
import { SelectControlOption } from 'projects/design-angular-kit/src/public_api'; | ||
|
||
@Component({ | ||
selector: 'it-select-disabled-example', | ||
templateUrl: './select-disabled-example.component.html', | ||
styleUrls: ['./select-disabled-example.component.scss'] | ||
}) | ||
export class SelectDisabledExampleComponent { | ||
selectOptions: Array<SelectControlOption> = [ | ||
{ | ||
selected: true, | ||
value: "", | ||
text: 'Scegli un\'opzione' | ||
}, | ||
{ | ||
value: 1, | ||
text: 'Opzione 1' | ||
}, | ||
{ | ||
value: 2, | ||
text: 'Opzione 2' | ||
}, | ||
{ | ||
value: 3, | ||
text: 'Opzione 3' | ||
} | ||
]; | ||
|
||
constructor(){} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/app/select/select-example/select-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,20 @@ | ||
<h3>Select</h3> | ||
<div class="bd-example"> | ||
<p class="example-section"> | ||
<it-select | ||
id="default-select" | ||
label="Etichetta" | ||
[(ngModel)]="selectedValue" | ||
[options]="selectOptions"> | ||
</it-select> | ||
</p> | ||
|
||
|
||
<h4>Risultato</h4> | ||
|
||
<div class="example-section"> | ||
|
||
<div class="example-selected-value">Valore selezionato: {{selectedValue}}</div> | ||
</div> | ||
</div> | ||
|
Empty file.
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,27 @@ | ||
import { Component } from '@angular/core'; | ||
import { SelectControlOption } from 'projects/design-angular-kit/src/public_api'; | ||
|
||
@Component({ | ||
selector: 'it-select-example', | ||
templateUrl: './select-example.component.html', | ||
styleUrls: ['./select-example.component.scss'] | ||
}) | ||
export class SelectExampleComponent { | ||
selectedValue: number = 1; | ||
selectOptions: Array<SelectControlOption> = [ | ||
{ | ||
value: 1, | ||
text: 'Opzione 1' | ||
}, | ||
{ | ||
value: 2, | ||
text: 'Opzione 2' | ||
}, | ||
{ | ||
value: 3, | ||
text: 'Opzione 3' | ||
} | ||
]; | ||
|
||
constructor(){} | ||
} |
Empty file.
48 changes: 48 additions & 0 deletions
48
src/app/select/select-examples/select-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,48 @@ | ||
{% from "../../macro.template.njk" import sanitize as sanitize %} | ||
|
||
{% set html %} | ||
{% include "../select-example/select-example.component.html" %} | ||
{% endset %} | ||
|
||
{% set typescript %} | ||
{% include "../select-example/select-example.component.ts" %} | ||
{% endset %} | ||
|
||
|
||
<it-select-example></it-select-example> | ||
|
||
<it-source-display html="{$ sanitize(html) $}" typescript="{$ sanitize(typescript) $}" > | ||
</it-source-display> | ||
|
||
|
||
|
||
|
||
|
||
{% set disabledHtml %} | ||
{% include "../select-disabled-example/select-disabled-example.component.html" %} | ||
{% endset %} | ||
|
||
{% set disabledTypescript %} | ||
{% include "../select-disabled-example/select-disabled-example.component.ts" %} | ||
{% endset %} | ||
|
||
<it-select-disabled-example></it-select-disabled-example> | ||
|
||
<it-source-display html="{$ sanitize(disabledHtml) $}" typescript="{$ sanitize(disabledTypescript) $}" > | ||
</it-source-display> | ||
|
||
|
||
|
||
|
||
{% set groupHtml %} | ||
{% include "../select-group-example/select-group-example.component.html" %} | ||
{% endset %} | ||
|
||
{% set groupTypescript %} | ||
{% include "../select-group-example/select-group-example.component.ts" %} | ||
{% endset %} | ||
|
||
<it-select-group-example></it-select-group-example> | ||
|
||
<it-source-display html="{$ sanitize(groupHtml) $}" typescript="{$ sanitize(groupTypescript) $}" > | ||
</it-source-display> |
15 changes: 15 additions & 0 deletions
15
src/app/select/select-examples/select-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,15 @@ | ||
import { Component, OnInit } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'it-select-examples', | ||
templateUrl: './select-examples.component.html', | ||
styleUrls: ['./select-examples.component.scss'] | ||
}) | ||
export class SelectExamplesComponent implements OnInit { | ||
|
||
constructor() { } | ||
|
||
ngOnInit() { | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
src/app/select/select-group-example/select-group-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,20 @@ | ||
<h3>Select con gruppi</h3> | ||
<div class="bd-example"> | ||
<p class="example-section"> | ||
<it-select | ||
id = "group-select" | ||
label="Etichetta" | ||
[(ngModel)]="selectedValue" | ||
[groups]="selectGroups" | ||
[options]="selectOptions"> | ||
</it-select> | ||
</p> | ||
|
||
|
||
<h4>Risultato</h4> | ||
|
||
<div class="example-section"> | ||
<div class="example-selected-value">Valore selezionato: {{selectedValue}}</div> | ||
</div> | ||
</div> | ||
|
Empty file.
49 changes: 49 additions & 0 deletions
49
src/app/select/select-group-example/select-group-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,49 @@ | ||
import { Component } from '@angular/core'; | ||
import { SelectControlGroup, SelectControlOption } from 'projects/design-angular-kit/src/public_api'; | ||
|
||
@Component({ | ||
selector: 'it-select-group-example', | ||
templateUrl: './select-group-example.component.html', | ||
styleUrls: ['./select-group-example.component.scss'] | ||
}) | ||
export class SelectGroupExampleComponent { | ||
selectedValue: number | string = ""; | ||
selectOptions: Array<SelectControlOption> = [ | ||
{ | ||
selected: true, | ||
value: "", | ||
text: 'Scegli un\'opzione' | ||
} | ||
]; | ||
selectGroups: Array<SelectControlGroup> = [ | ||
{ | ||
label: 'Gruppo 1', | ||
options: [ | ||
{ | ||
value: 1, | ||
text: 'Opzione 1' | ||
}, | ||
{ | ||
value: 2, | ||
text: 'Opzione 2' | ||
} | ||
] | ||
}, | ||
{ | ||
label: 'Gruppo 2', | ||
options: [ | ||
{ | ||
value: 3, | ||
text: 'Opzione 3' | ||
}, | ||
{ | ||
value: 4, | ||
text: 'Opzione 4' | ||
} | ||
] | ||
} | ||
|
||
]; | ||
|
||
constructor(){} | ||
} |
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 @@ | ||
<h1 class="bd-title">Select</h1> | ||
<p class="bd-lead">Il classico “menu a tendina”</p> | ||
<div [innerHTML]="component.description"></div> | ||
<it-tab-container> | ||
<it-tab-item id="example" label="Esempi" active="true" class="pt-3"> | ||
<it-select-examples></it-select-examples> | ||
</it-tab-item> | ||
<it-tab-item id="api" label="API" class="pt-3"> | ||
<it-api-parameters [component]="component"></it-api-parameters> | ||
</it-tab-item> | ||
</it-tab-container> |
Empty file.
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 @@ | ||
import { Component } from '@angular/core'; | ||
import Documentation from '../../../assets/documentation.json'; | ||
|
||
@Component({ | ||
selector: 'it-select-index', | ||
templateUrl: './select-index.component.html', | ||
styleUrls: ['./select-index.component.scss'] | ||
}) | ||
export class SelectIndexComponent { | ||
|
||
component: any; | ||
|
||
constructor() { | ||
this.component = (<any>Documentation).components.find(component => component.name === 'SelectComponent'); | ||
} | ||
} |
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,13 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { Routes, RouterModule } from '@angular/router'; | ||
import { SelectIndexComponent } from './select-index/select-index.component'; | ||
|
||
const routes: Routes = [ | ||
{ path: '', component: SelectIndexComponent } | ||
]; | ||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class SelectRoutingModule { } |
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,30 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { CommonModule } from '@angular/common'; | ||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
|
||
import { SharedModule } from '../shared/shared.module'; | ||
import { SelectRoutingModule } from './select-routing.module'; | ||
import { SelectIndexComponent } from './select-index/select-index.component'; | ||
import { SelectExamplesComponent } from './select-examples/select-examples.component'; | ||
import { SelectExampleComponent } from './select-example/select-example.component'; | ||
import { SelectGroupExampleComponent } from './select-group-example/select-group-example.component'; | ||
import { SelectDisabledExampleComponent } from './select-disabled-example/select-disabled-example.component'; | ||
|
||
|
||
@NgModule({ | ||
imports: [ | ||
CommonModule, | ||
ReactiveFormsModule, | ||
FormsModule, | ||
SharedModule, | ||
SelectRoutingModule | ||
], | ||
declarations: [ | ||
SelectIndexComponent, | ||
SelectDisabledExampleComponent, | ||
SelectGroupExampleComponent, | ||
SelectExamplesComponent, | ||
SelectExampleComponent | ||
] | ||
}) | ||
export class SelectModule { } |
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
561091a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
design-angular-kit – ./
design-angular-kit.vercel.app
design-angular-kit-dip-trasformazione-digitale.vercel.app
design-angular-kit-git-main-dip-trasformazione-digitale.vercel.app