upgrade to angular 18, migrate material

This commit is contained in:
_Bastler 2024-11-27 21:16:09 +01:00
parent ba61cc4469
commit a200fa7f7c
5 changed files with 5601 additions and 4057 deletions

View File

@ -73,19 +73,19 @@
"serve": { "serve": {
"builder": "@angular-devkit/build-angular:dev-server", "builder": "@angular-devkit/build-angular:dev-server",
"options": { "options": {
"browserTarget": "we-bstly-angular:build", "buildTarget": "we-bstly-angular:build",
"port": 4202 "port": 4202
}, },
"configurations": { "configurations": {
"production": { "production": {
"browserTarget": "we-bstly-angular:build:production" "buildTarget": "we-bstly-angular:build:production"
} }
} }
}, },
"extract-i18n": { "extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n", "builder": "@angular-devkit/build-angular:extract-i18n",
"options": { "options": {
"browserTarget": "we-bstly-angular:build" "buildTarget": "we-bstly-angular:build"
} }
}, },
"test": { "test": {
@ -119,7 +119,6 @@
} }
} }
}}, }},
"defaultProject": "we-bstly-angular",
"cli": { "cli": {
"analytics": false "analytics": false
} }

9524
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "we-bstly-angular", "name": "we-bstly-angular",
"version": "3.0.6", "version": "3.1.0",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve", "start": "ng serve",
@ -11,45 +11,45 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^17.3.1", "@angular/animations": "^18.2.13",
"@angular/cdk": "^17.3.1", "@angular/cdk": "^18.2.13",
"@angular/common": "^17.3.1", "@angular/common": "^18.2.13",
"@angular/compiler": "^17.3.1", "@angular/compiler": "^18.2.13",
"@angular/core": "^17.3.1", "@angular/core": "^18.2.13",
"@angular/forms": "^17.3.1", "@angular/forms": "^18.2.13",
"@angular/material": "^17.3.1", "@angular/material": "^18.2.13",
"@angular/material-moment-adapter": "^17.3.1", "@angular/material-moment-adapter": "^18.2.13",
"@angular/platform-browser": "^17.3.1", "@angular/platform-browser": "^18.2.13",
"@angular/platform-browser-dynamic": "^17.3.1", "@angular/platform-browser-dynamic": "^18.2.13",
"@angular/router": "^17.3.1", "@angular/router": "^18.2.13",
"moment": "^2.30.1", "moment": "^2.30.1",
"ng-qrcode": "^17.0.0", "ng-qrcode": "^18.0.0",
"openpgp": "^5.11.1", "openpgp": "^6.0.1",
"qr-scanner": "^1.4.2", "qr-scanner": "^1.4.2",
"rxjs": "~7.8.1", "rxjs": "~7.8.1",
"tslib": "^2.6.2", "tslib": "^2.8.1",
"unique-names-generator": "^4.7.1", "unique-names-generator": "^4.7.1",
"zone.js": "~0.14.4" "zone.js": "~0.14.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "^17.3.2", "@angular-devkit/build-angular": "^18.2.12",
"@angular/cli": "^17.3.2", "@angular/cli": "^18.2.12",
"@angular/compiler-cli": "^17.3.1", "@angular/compiler-cli": "^18.2.13",
"@angular/localize": "^17.3.1", "@angular/localize": "^18.2.13",
"@types/jasmine": "^5.1.4", "@types/jasmine": "^5.1.4",
"@types/jasminewd2": "^2.0.13", "@types/jasminewd2": "^2.0.13",
"@types/node": "^20.11.30", "@types/node": "^22.10.0",
"@types/openpgp": "^4.4.22", "@types/openpgp": "^4.4.22",
"jasmine-core": "~5.1.2", "jasmine-core": "~5.4.0",
"jasmine-spec-reporter": "~7.0.0", "jasmine-spec-reporter": "~7.0.0",
"karma": "^6.4.3", "karma": "^6.4.4",
"karma-chrome-launcher": "~3.2.0", "karma-chrome-launcher": "~3.2.0",
"karma-coverage-istanbul-reporter": "~3.0.3", "karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~5.1.0", "karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "^2.1.0", "karma-jasmine-html-reporter": "^2.1.0",
"protractor": "~7.0.0", "protractor": "~7.0.0",
"ts-node": "~10.9.2", "ts-node": "~10.9.2",
"tslint": "~6.1.0", "tslint": "~6.1.3",
"typescript": "~5.4.3" "typescript": "~5.5.4"
} }
} }

View File

@ -10,22 +10,6 @@
@import './variables.scss'; @import './variables.scss';
// Define the palettes for your theme using the Material Design palettes available in palette.scss
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
// hue. Available color palettes: https://material.io/design/color/
$light-theme: mat.define-light-theme((color: (primary: $light-primary,
accent: $light-accent,
warn: $light-warn,
)));
// Define an alternate dark theme.
$dark-theme: mat.define-dark-theme((color: (primary: $dark-primary,
accent: $light-accent,
warn: $light-warn,
)));
// Include theme styles for core and each component used in your app. // Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component // Alternatively, you can import and @include the theme mixins for each component
// that you are using. // that you are using.
@ -35,8 +19,6 @@ $dark-theme: mat.define-dark-theme((color: (primary: $dark-primary,
@include mat.all-component-colors($dark-theme); @include mat.all-component-colors($dark-theme);
} }
/* You can add global styles to this file, and also import other style files */ /* You can add global styles to this file, and also import other style files */
/* fallback */ /* fallback */
@ -293,6 +275,15 @@ mat-card.accent mat-card-header {
background-color: $accent !important; background-color: $accent !important;
} }
.mat-mdc-list-item-unscoped-content {
display: flex;
align-items: center;
mat-icon {
margin-right: 0.2em;
}
}
table { table {
border: 0; border: 0;

View File

@ -1,19 +1,33 @@
@use '@angular/material' as mat; @use '@angular/material' as mat;
$light-primary: mat.define-palette(mat.$gray-palette, 800); $light-primary: mat.m2-define-palette(mat.$m2-gray-palette, 800);
$light-accent: mat.define-palette(mat.$pink-palette, A200, A100, A400); $light-accent: mat.m2-define-palette(mat.$m2-pink-palette, A200, A100, A400);
$light-warn: mat.define-palette(mat.$red-palette); $light-warn: mat.m2-define-palette(mat.$m2-red-palette);
$primary: mat.get-color-from-palette($light-primary); $dark-primary: mat.m2-define-palette(mat.$m2-grey-palette, 900, 500, 700);
$accent: mat.get-color-from-palette($light-accent); $dark-accent: mat.m2-define-palette(mat.$m2-amber-palette, A200, A100, A400);
$warn: mat.get-color-from-palette($light-warn); $dark-warn: mat.m2-define-palette(mat.$m2-deep-orange-palette);
$dark-primary: mat.define-palette(mat.$grey-palette, 900, 500, 700); // Define the palettes for your theme using the Material Design palettes available in palette.scss
$dark-accent: mat.define-palette(mat.$amber-palette, A200, A100, A400); // (imported above). For each palette, you can optionally specify a default, lighter, and darker
$dark-warn: mat.define-palette(mat.$deep-orange-palette); // hue. Available color palettes: https://material.io/design/color/
$light-theme: mat.m2-define-light-theme((color: (primary: $light-primary,
accent: $light-accent,
warn: $light-warn,
)));
// Define an alternate dark theme.
$dark-theme: mat.m2-define-dark-theme((color: (primary: $dark-primary,
accent: $light-accent,
warn: $light-warn,
)));
$primary: mat.get-theme-color($light-theme, primary, default);
$accent: mat.get-theme-color($light-theme, accent, default);
$warn: mat.get-theme-color($light-theme, warn, default);
.dark-theme { .dark-theme {
$primary: mat.get-color-from-palette($dark-primary); $primary: mat.get-theme-color($dark-theme, primary, default);
$accent: mat.get-color-from-palette($light-accent); $accent: mat.get-theme-color($dark-theme, accent, default);
$warn: mat.get-color-from-palette($light-warn); $warn: mat.get-theme-color($dark-theme, warn, default);
} }