Skip to content

Commit 921eb29

Browse files
authored
Merge pull request #2005 from valor-software/alex-migrate-to-angular-18
feat(angular-18): added angular 18 support
2 parents b8bdfb5 + 2be07c2 commit 921eb29

File tree

8 files changed

+40074
-16108
lines changed

8 files changed

+40074
-16108
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@ Thumbs.db
5454
.angular
5555

5656
.nx/cache
57+
.nx/workspace-data

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ changes to start using the library right away.
9494
<table role="table">
9595
<tbody><tr>
9696
<td></td>
97-
<td colspan="6">ng2-chart version</td>
97+
<td colspan="7">ng2-chart version</td>
9898
</tr>
9999

100100
<tr>
@@ -105,6 +105,7 @@ changes to start using the library right away.
105105
<td>v4.x</td>
106106
<td>v5.x</td>
107107
<td>v6.x</td>
108+
<td>v7.x</td>
108109
</tr>
109110

110111
<tr>
@@ -197,6 +198,17 @@ changes to start using the library right away.
197198
<td>✓</td>
198199
</tr>
199200

201+
<tr>
202+
<td>18</td>
203+
<td></td>
204+
<td></td>
205+
<td></td>
206+
<td></td>
207+
<td></td>
208+
<td></td>
209+
<td>✓</td>
210+
</tr>
211+
200212
</tbody></table>
201213

202214
## API

apps/ng2-charts-demo/src/styles.scss

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,41 +6,41 @@
66
@include mat.core();
77

88
// Define a light theme
9-
$light-theme: mat.define-light-theme(
9+
$light-theme: mat.m2-define-light-theme(
1010
(
1111
color: (
12-
primary: mat.define-palette(mat.$deep-purple-palette),
13-
accent: mat.define-palette(mat.$amber-palette),
12+
primary: mat.m2-define-palette(mat.$m2-deep-purple-palette),
13+
accent: mat.m2-define-palette(mat.$m2-amber-palette),
1414
),
1515
// Only include `typography` and `density` in the default dark theme.
16-
typography: mat.define-typography-config(),
16+
typography: mat.m2-define-typography-config(),
1717
density: 0,
1818
)
1919
);
2020

2121
// Define a dark theme
22-
$dark-theme: mat.define-dark-theme(
22+
$dark-theme: mat.m2-define-dark-theme(
2323
(
2424
color: (
25-
primary: mat.define-palette(mat.$deep-purple-palette, 300, 100, 500),
26-
accent: mat.define-palette(mat.$amber-palette),
25+
primary: mat.m2-define-palette(mat.$m2-deep-purple-palette, 300, 100, 500),
26+
accent: mat.m2-define-palette(mat.$m2-amber-palette),
2727
),
2828
)
2929
);
3030

3131
@mixin page-header-color($theme) {
3232
// Get the color config from the theme.
33-
$color-config: mat.get-color-config($theme);
33+
$color-config: mat.m2-get-color-config($theme);
3434

3535
// Get the primary color palette from the color-config.
3636
$primary-palette: map.get($color-config, 'primary');
3737

3838
.bd-pageheader {
39-
color: mat.get-color-from-palette($primary-palette, '500-contrast');
39+
color: mat.m2-get-color-from-palette($primary-palette, '500-contrast');
4040
background-image: linear-gradient(
4141
to bottom,
42-
mat.get-color-from-palette($primary-palette, 700) 0,
43-
mat.get-color-from-palette($primary-palette, 500) 100%
42+
mat.m2-get-color-from-palette($primary-palette, 700) 0,
43+
mat.m2-get-color-from-palette($primary-palette, 500) 100%
4444
);
4545
}
4646
}

libs/ng2-charts-schematics/src/ng-add/steps/add-ng2-charts-provider.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@ const PACKAGE_NAME = 'ng2-charts';
1111
* Patches `app.config.ts` by adding our provider
1212
*/
1313
export function addChartsProviderToMain(options: Schema): Rule {
14+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
15+
// @ts-ignore
1416
return async (host: Tree) => {
1517
const workspace = await getWorkspace(host);
1618
const projectName =
1719
options.project || (workspace.extensions['defaultProject'] as string);
20+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
21+
// @ts-ignore
1822
const project = getProjectFromWorkspace(workspace, options.project);
1923

2024
if (!project) {

libs/ng2-charts/package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"version": "6.0.2",
2+
"version": "7.0.0",
33
"name": "ng2-charts",
44
"description": "Reactive, responsive, beautiful charts for Angular based on Chart.js",
55
"peerDependencies": {
6-
"@angular/platform-browser": ">=17.0.0",
7-
"@angular/common": ">=17.0.0",
8-
"@angular/core": ">=17.0.0",
9-
"@angular/cdk": ">=17.0.0",
6+
"@angular/platform-browser": ">=18.0.0",
7+
"@angular/common": ">=18.0.0",
8+
"@angular/core": ">=18.0.0",
9+
"@angular/cdk": ">=18.0.0",
1010
"chart.js": "^3.4.0 || ^4.0.0",
1111
"rxjs": "^6.5.3 || ^7.4.0"
1212
},

0 commit comments

Comments
 (0)