-
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.
Co-authored-by: mino89 <pierdomenicoreitano@gmail.com> Co-authored-by: Cristian <borelli.developer@gmail.com>
- Loading branch information
1 parent
2a13c42
commit d030d59
Showing
41 changed files
with
766 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"repoId": "55c39ea7-0cdf-49f3-82f3-9b5e961c11c1", | ||
"lastSync": 0 | ||
} |
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
3 changes: 3 additions & 0 deletions
3
...ar-kit/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown-item.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,3 @@ | ||
<ng-template> | ||
<ng-content></ng-content> | ||
</ng-template> |
23 changes: 23 additions & 0 deletions
23
...angular-kit/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.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,23 @@ | ||
<it-dropdown id="dropdown" class="dropdown"> | ||
<a button role="button" class="" aria-pressed="false"> | ||
<ng-content select="[it-avatar-dropdown-toggle]"></ng-content> | ||
</a> | ||
<ng-container list class="dropdown-menu"> | ||
<li it-dropdown-item *ngFor="let item of items"> | ||
<a *ngIf="item.link; else nolink" | ||
[routerLink]="item.link" | ||
class="dropdown-item list-item" | ||
title="item.title" | ||
accesskey="item.accesskey" | ||
tabindex="item.tabindex" | ||
> | ||
<ng-template *ngTemplateOutlet="item._implicitContent"></ng-template> | ||
</a> | ||
<ng-template #nolink> | ||
<div class="dropdown-item list-item"> | ||
<ng-template *ngTemplateOutlet="item._implicitContent"></ng-template> | ||
</div> | ||
</ng-template> | ||
</li> | ||
</ng-container> | ||
</it-dropdown> |
17 changes: 17 additions & 0 deletions
17
...angular-kit/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.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,17 @@ | ||
// made because of bug with before triangle that goes up | ||
.link-list-wrapper{ | ||
z-index: 2; | ||
position: relative; | ||
} | ||
|
||
a { | ||
cursor: pointer; | ||
} | ||
|
||
:host ::ng-deep .dropdown-toggle { | ||
width: 100%; | ||
height: 100%; | ||
.icon { | ||
display: none; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ular-kit/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.component.spec.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,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ItAvatarDropdownComponent } from './avatar-dropdown.component'; | ||
import { tb_base } from '../../../../../test'; | ||
|
||
describe('ItAvatarDropdownComponent', () => { | ||
let component: ItAvatarDropdownComponent; | ||
let fixture: ComponentFixture<ItAvatarDropdownComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule(tb_base) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ItAvatarDropdownComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
44 changes: 44 additions & 0 deletions
44
...n-angular-kit/src/lib/components/core/avatar/avatar-dropdown/avatar-dropdown.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,44 @@ | ||
import { Component, ViewChild, TemplateRef, ContentChildren, QueryList, Input, ViewEncapsulation } from '@angular/core'; | ||
import { ItDropdownModule } from '../../dropdown/dropdown.module'; | ||
import { NgForOf, NgIf, NgTemplateOutlet } from '@angular/common'; | ||
|
||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'it-avatar-dropdown-item', | ||
templateUrl: './avatar-dropdown-item.component.html', | ||
styleUrls: ['./avatar-dropdown.component.scss'], | ||
imports: [NgForOf, NgIf, NgTemplateOutlet] | ||
}) | ||
export class ItAvatarDropdownItemComponent{ | ||
@ViewChild(TemplateRef, {static: true}) _implicitContent!: TemplateRef<any> | ||
/** | ||
* Indica il link che possiamo passare all'elemento | ||
*/ | ||
@Input() link?: string | any[] | null | undefined; | ||
/** | ||
* Permette di utilizzare l'attributo html title | ||
*/ | ||
@Input() title?: string | ||
/** | ||
* Permette di utilizzare l'attributo html accesskey | ||
*/ | ||
@Input() accesskey?: string | ||
/** | ||
* Permette di utilizzare l'attributo html tabindex | ||
*/ | ||
@Input() tabindex?: number | ||
} | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'it-avatar-dropdown', | ||
templateUrl: './avatar-dropdown.component.html', | ||
styleUrls: ['./avatar-dropdown.component.scss'], | ||
host: { 'class': 'avatar avatar-dropdown' }, | ||
imports: [ItDropdownModule, NgTemplateOutlet, NgForOf, NgIf] | ||
}) | ||
export class ItAvatarDropdownComponent{ | ||
constructor() { } | ||
@ContentChildren(ItAvatarDropdownItemComponent) items! : QueryList<ItAvatarDropdownItemComponent> | ||
} |
3 changes: 3 additions & 0 deletions
3
...-angular-kit/src/lib/components/core/avatar/avatar-group/avatar-group-item.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,3 @@ | ||
<ng-template> | ||
<ng-content></ng-content> | ||
</ng-template> |
5 changes: 5 additions & 0 deletions
5
...esign-angular-kit/src/lib/components/core/avatar/avatar-group/avatar-group.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,5 @@ | ||
<ul class="avatar-group-stacked"> | ||
<li *ngFor="let avatar of avatars"> | ||
<ng-container *ngTemplateOutlet="avatar._implicitContent"></ng-container> | ||
</li> | ||
</ul> |
41 changes: 41 additions & 0 deletions
41
...gn-angular-kit/src/lib/components/core/avatar/avatar-group/avatar-group.component.spec.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,41 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { ItAvatarGroupComponent, ItAvatarGroupItemComponent } from './avatar-group.component'; | ||
import { tb_base } from '../../../../../test'; | ||
|
||
describe('ItAvatarGroupComponent', () => { | ||
let component: ItAvatarGroupComponent; | ||
let fixture: ComponentFixture<ItAvatarGroupComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule(tb_base) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ItAvatarGroupComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); | ||
|
||
|
||
describe('ItAvatarGroupItemComponent', () => { | ||
let component: ItAvatarGroupItemComponent; | ||
let fixture: ComponentFixture<ItAvatarGroupItemComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule(tb_base) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(ItAvatarGroupItemComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
28 changes: 28 additions & 0 deletions
28
.../design-angular-kit/src/lib/components/core/avatar/avatar-group/avatar-group.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,28 @@ | ||
import { Component, ContentChildren, QueryList, TemplateRef, ViewChild } from '@angular/core'; | ||
import { NgForOf, NgTemplateOutlet } from '@angular/common'; | ||
|
||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'it-avatar-item', | ||
templateUrl: './avatar-group-item.component.html', | ||
}) | ||
export class ItAvatarGroupItemComponent { | ||
constructor(){} | ||
@ViewChild(TemplateRef, { static: true }) _implicitContent!: TemplateRef<any>; | ||
|
||
} | ||
|
||
@Component({ | ||
standalone: true, | ||
selector: 'it-avatar-group', | ||
templateUrl: './avatar-group.component.html', | ||
host:{ | ||
'[class.link-list-wrapper]': 'linkList' | ||
}, | ||
imports: [NgForOf, NgTemplateOutlet] | ||
}) | ||
export class ItAvatarGroupComponent { | ||
constructor() {} | ||
@ContentChildren(ItAvatarGroupItemComponent) avatars!: QueryList<ItAvatarGroupItemComponent>; | ||
} |
76 changes: 76 additions & 0 deletions
76
projects/design-angular-kit/src/lib/components/core/avatar/avatar.directive.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,76 @@ | ||
import { ColorsEnum } from '../../../enums/colors.enums'; | ||
import { SizesEnum } from '../../../enums/sizes.enum'; | ||
import { Directive, HostBinding, Input } from "@angular/core"; | ||
|
||
@Directive({ | ||
standalone: true, | ||
selector: '[itAvatar]', | ||
exportAs: 'itAvatar' | ||
}) | ||
export class ItAvatarDirective { | ||
/** | ||
* Indica il colore dell'avatar. Può assumere i valori: | ||
* <ul> | ||
* <li> primary | ||
* <li> secondary | ||
* <li> green | ||
* <li> orange | ||
* <li> red | ||
* </ul> | ||
*/ | ||
@Input() | ||
get color(): string | undefined { | ||
return this._color | ||
} | ||
set color(value: string | undefined) { | ||
const colorsKey = value as keyof typeof ColorsEnum; | ||
if (ColorsEnum[colorsKey]){ | ||
this._color = ColorsEnum[colorsKey] | ||
}else{ | ||
this._color = undefined; | ||
} | ||
} | ||
private _color?: ColorsEnum; | ||
/** | ||
* Indica la grandezza dell'avatar. Può assumere i valori: | ||
* <ul> | ||
* <li> xs | ||
* <li> sm | ||
* <li> lg | ||
* <li> xl | ||
* <li> xxl | ||
* </ul> | ||
*/ | ||
@Input() | ||
get size(): SizesEnum | undefined { | ||
return this._size | ||
} | ||
set size(value: string | undefined) { | ||
const sizesKey = value as keyof typeof SizesEnum; | ||
if (SizesEnum[sizesKey]) { | ||
this._size = SizesEnum[sizesKey]; | ||
} | ||
else { | ||
this._size = undefined | ||
} | ||
} | ||
|
||
private _size?: SizesEnum; | ||
|
||
@HostBinding('class') | ||
get hostClasses(): string { | ||
let cssClass = 'avatar' | ||
|
||
if (this.size) { | ||
cssClass += ` ${this.size}` | ||
} | ||
|
||
if (this.color) { | ||
cssClass += ` avatar-${this.color}` | ||
} | ||
|
||
return cssClass | ||
} | ||
|
||
|
||
} |
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,10 @@ | ||
export enum ColorsEnum { | ||
primary = "primary", | ||
secondary = "secondary", | ||
success = "success", | ||
danger = "danger", | ||
warning = "warning", | ||
green = "green", | ||
orange = "orange", | ||
red = "red" | ||
} |
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 @@ | ||
export enum SizesEnum{ | ||
xs = 'size-xs', | ||
sm = 'size-sm', | ||
lg = 'size-lg', | ||
xl = 'size-xl', | ||
xxl = 'size-xxl', | ||
} |
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
23 changes: 23 additions & 0 deletions
23
src/app/avatar/avatar-example-colors/avatar-example-colors.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,23 @@ | ||
<h3>Colori Avatar</h3> | ||
<div class="d-flex align-items-center justify-content-around flex-wrap flex-sm-nowrap bd-example"> | ||
<div itAvatar size="lg" color="primary"> | ||
<p aria-hidden="true">MR</p> | ||
<span class="visually-hidden">Mario Rossi</span> | ||
</div> | ||
<div itAvatar size="lg" color="secondary"> | ||
<p aria-hidden="true">MR</p> | ||
<span class="visually-hidden">Mario Rossi</span> | ||
</div> | ||
<div itAvatar size="lg" color="green"> | ||
<p aria-hidden="true">MR</p> | ||
<span class="visually-hidden">Mario Rossi</span> | ||
</div> | ||
<div itAvatar size="lg" color="orange"> | ||
<p aria-hidden="true">MR</p> | ||
<span class="visually-hidden">Mario Rossi</span> | ||
</div> | ||
<div itAvatar size="lg" color="red"> | ||
<p aria-hidden="true">MR</p> | ||
<span class="visually-hidden">Mario Rossi</span> | ||
</div> | ||
</div> |
Empty file.
23 changes: 23 additions & 0 deletions
23
src/app/avatar/avatar-example-colors/avatar-example-colors.component.spec.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 { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { AvatarExampleColorsComponent } from './avatar-example-colors.component'; | ||
|
||
describe('AvatarExampleColorsComponent', () => { | ||
let component: AvatarExampleColorsComponent; | ||
let fixture: ComponentFixture<AvatarExampleColorsComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ AvatarExampleColorsComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(AvatarExampleColorsComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.
d030d59
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-git-main-dip-trasformazione-digitale.vercel.app
design-angular-kit.vercel.app
design-angular-kit-dip-trasformazione-digitale.vercel.app