Skip to content

Commit 34e1e1b

Browse files
committed
feat: update angular version
1 parent 70037fa commit 34e1e1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1185
-187
lines changed

.eslintignore

Whitespace-only changes.

.eslintrc.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
root: true,
3+
parser: "@typescript-eslint/parser",
4+
parserOptions: {
5+
tsconfigRootDir: __dirname,
6+
project: "./tsconfig.eslint.json",
7+
},
8+
plugins: ["@typescript-eslint"],
9+
extends: [
10+
"eslint:recommended",
11+
"plugin:@typescript-eslint/eslint-recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:@typescript-eslint/recommended-requiring-type-checking",
14+
],
15+
rules: {
16+
"@typescript-eslint/no-unsafe-assignment": 0,
17+
"@typescript-eslint/no-unsafe-member-access": 0,
18+
"@typescript-eslint/no-unsafe-call": 0,
19+
"@typescript-eslint/no-unsafe-return": 0,
20+
"@typescript-eslint/no-floating-promises": 0,
21+
"@typescript-eslint/no-explicit-any": 0,
22+
"@typescript-eslint/explicit-module-boundary-types": 0,
23+
"@typescript-eslint/no-empty-function": 0,
24+
"@typescript-eslint/parser": 0,
25+
"@typescript-eslint/unbound-method": 0,
26+
"@typescript-eslint/no-misused-promises": 0,
27+
"@typescript-eslint/restrict-template-expressions": 0,
28+
quotes: [2, "single"]
29+
},
30+
};

package.json

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "miscellaneous",
3-
"version": "3.0.0",
3+
"version": "4.0.0",
44
"author": "craftsjs",
55
"description": "Material alert library for angular",
66
"license": "MIT",
@@ -18,17 +18,17 @@
1818
"private": false,
1919
"dependencies": {
2020
"@angular/animations": "^13.3.7",
21-
"@angular/cdk": "^12.1.1",
21+
"@angular/cdk": "^13.3.7",
2222
"@angular/common": "^13.3.7",
2323
"@angular/compiler": "^13.3.7",
2424
"@angular/core": "^13.3.7",
2525
"@angular/forms": "^13.3.7",
26-
"@angular/material": "^12.1.1",
26+
"@angular/material": "^13.3.7",
2727
"@angular/platform-browser": "^13.3.7",
2828
"@angular/platform-browser-dynamic": "^13.3.7",
2929
"@angular/router": "^13.3.7",
30-
"@ngrx/store": "^12.2.0",
31-
"@ngx-translate/core": "^13.0.0",
30+
"@ngrx/store": "13.2.0",
31+
"@ngx-translate/core": "14.0.0",
3232
"perfect-scrollbar": "^1.5.0",
3333
"rxjs": "~6.6.3",
3434
"scss-bundle": "^3.1.1",
@@ -38,13 +38,21 @@
3838
"devDependencies": {
3939
"@angular-devkit/build-angular": "^13.3.5",
4040
"@angular-devkit/build-ng-packagr": "^0.1000.1",
41+
"@angular-eslint/builder": "13.2.1",
42+
"@angular-eslint/eslint-plugin": "13.2.1",
43+
"@angular-eslint/eslint-plugin-template": "13.2.1",
44+
"@angular-eslint/schematics": "13.2.1",
45+
"@angular-eslint/template-parser": "13.2.1",
4146
"@angular/cli": "^13.3.5",
4247
"@angular/compiler-cli": "^13.3.7",
4348
"@angular/language-service": "^13.3.7",
4449
"@types/jasmine": "~3.5.0",
4550
"@types/jasminewd2": "~2.0.3",
4651
"@types/node": "^12.11.1",
52+
"@typescript-eslint/eslint-plugin": "5.17.0",
53+
"@typescript-eslint/parser": "5.17.0",
4754
"codelyzer": "^5.1.2",
55+
"eslint": "^8.12.0",
4856
"jasmine-core": "~3.5.0",
4957
"jasmine-spec-reporter": "~5.0.0",
5058
"karma": "~6.3.4",
@@ -74,4 +82,4 @@
7482
"modal",
7583
"notifier"
7684
]
77-
}
85+
}

projects/craftsjs/alert/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Choose the version corresponding to your Angular version:
1313

1414
| Angular | @craftsjs/alert |
1515
| ------- | --------------- |
16+
| 13 | 4.x |
1617
| 12 | 3.x |
1718
| 11 | 2.x |
1819
| 10 | 1.x |

projects/craftsjs/alert/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"license": "MIT",
77
"homepage": "https://github.com/addapptables/angular-miscellaneous",
88
"peerDependencies": {
9-
"@angular/common": ">= 12.0.0 < 13.0.0",
10-
"@angular/core": ">= 12.0.0 < 13.0.0",
11-
"@angular/material": ">= 12.0.0 < 13.0.0",
12-
"@angular/cdk": ">= 12.0.0 < 13.0.0",
13-
"@angular/animations": ">= 12.0.0 < 13.0.0",
14-
"@ngx-translate/core": ">= 13.0.0 < 16.0.0",
15-
"@craftsjs/core": ">=3.0.0 < 4.0.0"
9+
"@angular/common": ">= 13.0.0 < 14.0.0",
10+
"@angular/core": ">= 13.0.0 < 14.0.0",
11+
"@angular/material": ">= 13.0.0 < 14.0.0",
12+
"@angular/cdk": ">= 13.0.0 < 14.0.0",
13+
"@angular/animations": ">= 13.0.0 < 14.0.0",
14+
"@ngx-translate/core": ">= 14.0.0 < 17.0.0",
15+
"@craftsjs/core": ">=4.0.0 < 5.0.0"
1616
},
1717
"repository": {
1818
"type": "git",

projects/craftsjs/alert/src/lib/components/craftsjs-dialog-alert/components/components.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { AlertSucessComponent } from './alert-success/alert-success.component';
1+
import { AlertSuccessComponent } from './alert-success/alert-success.component';
22
import { AlertEnum } from '../../../models/alert-enum.model';
33
import { AlertInfoComponent } from './alert-info/alert-info.component';
44
import { WarningComponent } from './warning/warning.component';
@@ -7,7 +7,7 @@ import { ErrorComponent } from './error/error.component';
77
export const alertComponents = [
88
{
99
type: AlertEnum.success,
10-
component: AlertSucessComponent
10+
component: AlertSuccessComponent
1111
},
1212
{
1313
type: AlertEnum.info,

projects/craftsjs/alert/src/lib/components/craftsjs-dialog-alert/craftsjs-dialog-alert.component.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Inject,
55
ViewEncapsulation,
66
OnInit,
7-
ComponentFactoryResolver,
87
Injector,
98
InjectionToken,
109
Type,
@@ -17,7 +16,6 @@ import {
1716
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
1817
import { AlertModel } from '../../models/alert.model';
1918
import { alertComponents } from './components/components';
20-
import { PortalInjector } from '@angular/cdk/portal';
2119
import { DynamicDirective } from '@craftsjs/core';
2220

2321
export const CRAFTSJS_ALERT_DATA = new InjectionToken<any>('CraftsjsAlertData');
@@ -37,7 +35,6 @@ export class CraftsjsDialogAlertComponent implements OnInit, AfterViewInit {
3735
constructor(
3836
public dialogRef: MatDialogRef<CraftsjsDialogAlertComponent>,
3937
@Inject(MAT_DIALOG_DATA) public data: AlertModel,
40-
private componentFactoryResolver: ComponentFactoryResolver
4138
) {
4239
}
4340

@@ -63,18 +60,25 @@ export class CraftsjsDialogAlertComponent implements OnInit, AfterViewInit {
6360
if (component instanceof TemplateRef) {
6461
viewContainerRef.createEmbeddedView(component, { $implicit: this.data, dialogRef: this.dialogRef });
6562
} else {
66-
const componentFactory = component && this.componentFactoryResolver.resolveComponentFactory(component);
6763
const injector = this.createInjector(viewContainerRef.injector);
68-
viewContainerRef.createComponent(componentFactory, null, injector);
64+
viewContainerRef.createComponent(component, {
65+
injector: injector
66+
})
6967
}
7068
}
7169

72-
private createInjector(injector: Injector): PortalInjector {
73-
const injectionTokens = new WeakMap<any, any>([
74-
[CRAFTSJS_ALERT_DATA, this.data],
75-
[MatDialogRef, this.dialogRef]
76-
]);
77-
return new PortalInjector(injector, injectionTokens);
70+
private createInjector(injector: Injector) {
71+
return Injector.create({
72+
providers: [{
73+
provide: CRAFTSJS_ALERT_DATA,
74+
useValue: this.data
75+
},
76+
{
77+
provide: MatDialogRef,
78+
useValue: this.dialogRef
79+
}],
80+
parent: injector
81+
})
7882
}
7983

8084
buttonClick(result: string) {

projects/craftsjs/alert/src/lib/components/dialog-alert/dialog-alert.component.ts

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
Inject,
55
ViewEncapsulation,
66
OnInit,
7-
ComponentFactoryResolver,
87
Injector,
98
InjectionToken,
109
Type,
@@ -17,7 +16,6 @@ import {
1716
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
1817
import { AlertModel } from '../../models/alert.model';
1918
import { alertComponents } from './components/components';
20-
import { PortalInjector } from '@angular/cdk/portal';
2119
import { DynamicDirective } from '@craftsjs/core';
2220

2321
export const CRAFTSJS_ALERT_DATA = new InjectionToken<any>('CraftsjsAlertData');
@@ -37,7 +35,6 @@ export class DialogAlertComponent implements OnInit, AfterViewInit {
3735
constructor(
3836
public dialogRef: MatDialogRef<DialogAlertComponent>,
3937
@Inject(MAT_DIALOG_DATA) public data: AlertModel,
40-
private componentFactoryResolver: ComponentFactoryResolver
4138
) {
4239
}
4340

@@ -57,24 +54,31 @@ export class DialogAlertComponent implements OnInit, AfterViewInit {
5754
this.resolveComponent(this.data.customButtonComponent, this.appDynamic.find(x => x.name === 'alert-buttons').viewContainerRef);
5855
}
5956

60-
private resolveComponent(component: Type<{}> | TemplateRef<{}>, viewContainerRef: ViewContainerRef) {
57+
private resolveComponent(component: Type<any> | TemplateRef<any>, viewContainerRef: ViewContainerRef) {
6158
if (!component) { return; }
6259
viewContainerRef.clear();
6360
if (component instanceof TemplateRef) {
6461
viewContainerRef.createEmbeddedView(component, { $implicit: this.data, dialogRef: this.dialogRef });
6562
} else {
66-
const componentFactory = component && this.componentFactoryResolver.resolveComponentFactory(component);
6763
const injector = this.createInjector(viewContainerRef.injector);
68-
viewContainerRef.createComponent(componentFactory, null, injector);
64+
viewContainerRef.createComponent(component, {
65+
injector
66+
});
6967
}
7068
}
7169

72-
private createInjector(injector: Injector): PortalInjector {
73-
const injectionTokens = new WeakMap<any, any>([
74-
[CRAFTSJS_ALERT_DATA, this.data],
75-
[MatDialogRef, this.dialogRef]
76-
]);
77-
return new PortalInjector(injector, injectionTokens);
70+
private createInjector(injector: Injector) {
71+
return Injector.create({
72+
providers: [{
73+
provide: CRAFTSJS_ALERT_DATA,
74+
useValue: this.data
75+
},
76+
{
77+
provide: MatDialogRef,
78+
useValue: this.dialogRef
79+
}],
80+
parent: injector
81+
})
7882
}
7983

8084
buttonClick(result: string) {

projects/craftsjs/alert/src/lib/craftsjs-alert.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { AlertService } from './services/alert.service';
3737
]
3838
})
3939
export class AlertModule {
40-
static forRoot(): ModuleWithProviders {
40+
static forRoot(): ModuleWithProviders<any> {
4141
return {
4242
ngModule: AlertModule,
4343
providers: [

projects/craftsjs/card/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Choose the version corresponding to your Angular version:
1313

1414
Angular | @craftsjs/card
1515
----------- | -------------------
16+
13 | 4.x
1617
12 | 3.x
1718
11 | 2.x
1819
10 | 1.x

0 commit comments

Comments
 (0)