Angular v20

This commit is contained in:
filip.kranjec 2025-08-14 15:01:14 +02:00
parent ff3c70dab6
commit d59395835d
8 changed files with 2412 additions and 2072 deletions

View file

@ -0,0 +1,4 @@
on: [push]
jobs:
steps:
- run: ls

View file

@ -115,5 +115,31 @@
} }
} }
} }
},
"schematics": {
"@schematics/angular:component": {
"type": "component"
},
"@schematics/angular:directive": {
"type": "directive"
},
"@schematics/angular:service": {
"type": "service"
},
"@schematics/angular:guard": {
"typeSeparator": "."
},
"@schematics/angular:interceptor": {
"typeSeparator": "."
},
"@schematics/angular:module": {
"typeSeparator": "."
},
"@schematics/angular:pipe": {
"typeSeparator": "."
},
"@schematics/angular:resolver": {
"typeSeparator": "."
}
} }
} }

4281
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -11,24 +11,24 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^19.2.14", "@angular/animations": "^20.1.7",
"@angular/common": "^19.2.14", "@angular/common": "^20.1.7",
"@angular/compiler": "^19.2.14", "@angular/compiler": "^20.1.7",
"@angular/core": "^19.2.14", "@angular/core": "^20.1.7",
"@angular/forms": "^19.2.14", "@angular/forms": "^20.1.7",
"@angular/platform-browser": "^19.2.14", "@angular/platform-browser": "^20.1.7",
"@angular/platform-browser-dynamic": "^19.2.14", "@angular/platform-browser-dynamic": "^20.1.7",
"@angular/router": "^19.2.14", "@angular/router": "^20.1.7",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"rxjs": "~6.6.7", "rxjs": "~6.6.7",
"tslib": "^1.14.1", "tslib": "^1.14.1",
"zone.js": "~0.15.1" "zone.js": "~0.15.1"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^19.2.15", "@angular-devkit/build-angular": "^20.1.6",
"@angular/cli": "^19.2.15", "@angular/cli": "^20.1.6",
"@angular/compiler-cli": "^19.2.14", "@angular/compiler-cli": "^20.1.7",
"@angular/language-service": "^19.2.14", "@angular/language-service": "^20.1.7",
"@types/jasmine": "~3.3.8", "@types/jasmine": "~3.3.8",
"@types/jasminewd2": "^2.0.8", "@types/jasminewd2": "^2.0.8",
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",

View file

@ -1,33 +1,30 @@
import { Component, EventEmitter, Input, Output} from '@angular/core'; import { Component, EventEmitter, Input, Output } from "@angular/core";
import { DomSanitizer } from '@angular/platform-browser'; import { DomSanitizer } from "@angular/platform-browser";
import { Champion } from '@models/champion';
import { Champion } from "@models/champion";
@Component({ @Component({
selector: 'app-card', selector: "app-card",
templateUrl: './card.component.html', templateUrl: "./card.component.html",
styleUrls: ['./card.component.scss'], styleUrls: ["./card.component.scss"],
standalone: false standalone: false,
}) })
export class CardComponent {
export class CardComponent{
@Input() champion: Champion; @Input() champion: Champion;
@Input() noChampSelected: boolean; @Input() noChampSelected: boolean;
@Output() championClicked = new EventEmitter<Champion>(); @Output() championClicked = new EventEmitter<Champion>();
constructor( constructor(private sanitizer: DomSanitizer) {}
private sanitizer: DomSanitizer,
) {}
/** /**
* Get champion image * Get champion image
* @param name Champion name * @param name Champion name
*/ */
getImage(name) { getImage(name) {
return this.sanitizer.bypassSecurityTrustStyle(`url(${'../../assets/images/champions/' + name + '.png'})`); return this.sanitizer.bypassSecurityTrustStyle(
`url(${"../../assets/images/champions/" + name + ".png"})`,
);
} }
/** /**
@ -37,6 +34,4 @@ export class CardComponent{
selectChampion(champion) { selectChampion(champion) {
this.championClicked.emit(champion); this.championClicked.emit(champion);
} }
} }

View file

@ -1,13 +1,17 @@
<div id="champions"> <div id="champions">
<div id="rolesFilterWrap"> <div id="rolesFilterWrap">
<div class="roleFilter" *ngFor="let role of roles"> @for (role of roles; track role) {
<div class="roleFilter">
<img title="{{role}}" src="../../assets/images/traits/{{role.toLowerCase()}}.png" (click)="selectRole(role)" alt="{{role}}" [ngClass]="{'selectedFilter': checkRoleFilter(role)}"> <img title="{{role}}" src="../../assets/images/traits/{{role.toLowerCase()}}.png" (click)="selectRole(role)" alt="{{role}}" [ngClass]="{'selectedFilter': checkRoleFilter(role)}">
</div> </div>
}
</div> </div>
<div class="champion" *ngFor="let champion of champions"> @for (champion of champions; track champion) {
<div class="champion">
<app-card [champion]='champion' [noChampSelected]='noChampSelected' (championClicked)='selectChampion(champion)'></app-card> <app-card [champion]='champion' [noChampSelected]='noChampSelected' (championClicked)='selectChampion(champion)'></app-card>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div id="filters"> <div id="filters">
@ -24,7 +28,8 @@
<div class="clear"></div> <div class="clear"></div>
<div id="selectedRoles"> <div id="selectedRoles">
<div id="selectedRolesWrap"> <div id="selectedRolesWrap">
<div class="roleSelectedRoles" *ngFor="let role of rolesPool"> @for (role of rolesPool; track role) {
<div class="roleSelectedRoles">
<span>{{rolesCount[role]}}</span> <span>{{rolesCount[role]}}</span>
<img title="{{role}}" src="../../assets/images/traits/{{role.toLowerCase()}}.png" alt="{{role}}" <img title="{{role}}" src="../../assets/images/traits/{{role.toLowerCase()}}.png" alt="{{role}}"
[ngClass]="{ [ngClass]="{
@ -43,14 +48,19 @@
'bonus9': bonusesPool[role] && bonusesPool[role].units === 9 'bonus9': bonusesPool[role] && bonusesPool[role].units === 9
}"> }">
</div> </div>
}
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
<div id="bonuses"> <div id="bonuses">
<p *ngFor="let role of rolesPool"> @for (role of rolesPool; track role) {
<span *ngIf="bonusesPool[role]"> <b>{{bonusesPool[role].role | titlecase}}-{{bonusesPool[role].units}}&nbsp;:</b>&nbsp;{{bonusesPool[role].description}} </span> <p>
@if (bonusesPool[role]) {
<span> <b>{{bonusesPool[role].role | titlecase}}-{{bonusesPool[role].units}}&nbsp;:</b>&nbsp;{{bonusesPool[role].description}} </span>
}
</p> </p>
}
</div> </div>
<div class="clear"></div> <div class="clear"></div>

View file

@ -8,7 +8,7 @@
"declaration": false, "declaration": false,
"experimentalDecorators": true, "experimentalDecorators": true,
"module": "esnext", "module": "esnext",
"moduleResolution": "node", "moduleResolution": "bundler",
"importHelpers": true, "importHelpers": true,
"target": "ES2022", "target": "ES2022",
"typeRoots": [ "typeRoots": [