Skip to content

Commit fa2259e

Browse files
author
Oliver Strik
committed
feat: update to angular 15
1 parent 30acbfe commit fa2259e

File tree

13 files changed

+2442
-12162
lines changed

13 files changed

+2442
-12162
lines changed

package-lock.json

Lines changed: 0 additions & 10491 deletions
This file was deleted.

package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@
1515
},
1616
"private": true,
1717
"dependencies": {
18-
"@angular/animations": "^14.2.8",
19-
"@angular/cdk": "^14.2.6",
20-
"@angular/common": "^14.2.8",
21-
"@angular/compiler": "^14.2.8",
22-
"@angular/core": "^14.2.8",
23-
"@angular/forms": "^14.2.8",
24-
"@angular/material": "^14.2.6",
25-
"@angular/platform-browser": "^14.2.8",
26-
"@angular/platform-browser-dynamic": "^14.2.8",
27-
"@angular/router": "^14.2.8",
18+
"@angular/animations": "^15.2.9",
19+
"@angular/cdk": "^15.2.9",
20+
"@angular/common": "^15.2.9",
21+
"@angular/compiler": "^15.2.9",
22+
"@angular/core": "^15.2.9",
23+
"@angular/forms": "^15.2.9",
24+
"@angular/material": "^15.2.9",
25+
"@angular/platform-browser": "^15.2.9",
26+
"@angular/platform-browser-dynamic": "^15.2.9",
27+
"@angular/router": "^15.2.9",
28+
"@dustfoundation/ngx-sortablejs": "^15.0.0",
2829
"@ng-select/ng-select": "^9.0.2",
2930
"date-fns": "^2.29.3",
3031
"lodash-es": "^4.17.21",
@@ -36,13 +37,13 @@
3637
"zone.js": "~0.11.4"
3738
},
3839
"devDependencies": {
39-
"@angular-devkit/build-angular": "^14.2.7",
40-
"@angular/cli": "^14.2.7",
41-
"@angular/compiler-cli": "^14.2.8",
40+
"@angular-devkit/build-angular": "^15.2.8",
41+
"@angular/cli": "^15.2.8",
42+
"@angular/compiler-cli": "^15.2.9",
4243
"@types/jasmine": "~3.6.0",
4344
"@types/jasminewd2": "~2.0.3",
44-
"@types/node": "^12.11.1",
4545
"@types/lodash-es": "^4.17.6",
46+
"@types/node": "^12.11.1",
4647
"codelyzer": "^6.0.2",
4748
"jasmine-core": "~3.10.1",
4849
"jasmine-spec-reporter": "~5.0.0",
@@ -51,10 +52,10 @@
5152
"karma-coverage-istanbul-reporter": "~3.0.2",
5253
"karma-jasmine": "~4.0.0",
5354
"karma-jasmine-html-reporter": "^1.5.0",
54-
"ng-packagr": "^14.2.2",
55+
"ng-packagr": "^15.2.2",
5556
"protractor": "~7.0.0",
5657
"ts-node": "~8.3.0",
5758
"tslint": "~6.1.0",
58-
"typescript": "~4.6.4"
59+
"typescript": "~4.9.5"
5960
}
6061
}

projects/demo/.browserslistrc

Lines changed: 0 additions & 18 deletions
This file was deleted.

projects/demo/src/test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,10 @@ import {
77
platformBrowserDynamicTesting
88
} from '@angular/platform-browser-dynamic/testing';
99

10-
declare const require: {
11-
context(path: string, deep?: boolean, filter?: RegExp): {
12-
keys(): string[];
13-
<T>(id: string): T;
14-
};
15-
};
16-
1710
// First, initialize the Angular testing environment.
1811
getTestBed().initTestEnvironment(
1912
BrowserDynamicTestingModule,
2013
platformBrowserDynamicTesting(), {
2114
teardown: { destroyAfterEach: false }
2215
}
2316
);
24-
// Then we find all the tests.
25-
const context = require.context('./', true, /\.spec\.ts$/);
26-
// And load the modules.
27-
context.keys().map(context);

projects/klippa/ngx-enhancy-forms/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
{
22
"name": "@klippa/ngx-enhancy-forms",
3-
"version": "14.6.2",
3+
"version": "16.6.2",
44
"publishConfig": {
55
"access": "public"
66
},
77
"peerDependencies": {
8-
"@angular/common": ">=10",
9-
"@angular/core": ">=10",
8+
"@angular/common": ">=16",
9+
"@angular/core": ">=16",
1010
"@ng-select/ng-select": ">=9",
1111
"ngx-mat-datefns-date-adapter": ">=10",
1212
"date-fns": ">=2.29",
1313
"lodash-es": ">=4.17",
14-
"ngx-sortablejs": ">=11.1",
14+
"@dustfoundation/ngx-sortablejs": ">=15.0.0",
1515
"sortablejs": ">=1.15"
1616
},
1717
"dependencies": {

projects/klippa/ngx-enhancy-forms/src/lib/elements/sortable-items/sortable-items.component.ts

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,31 @@
1-
import {Component, ContentChild, Input, OnInit, TemplateRef} from '@angular/core';
2-
import {NG_VALUE_ACCESSOR} from '@angular/forms';
3-
import {Options} from 'sortablejs';
4-
import {isValueSet} from '../../util/values';
5-
import {ValueAccessorBase} from '../value-accessor-base/value-accessor-base.component';
1+
import {
2+
Component,
3+
ContentChild,
4+
Input,
5+
OnInit,
6+
TemplateRef,
7+
} from '@angular/core';
8+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
9+
import { Options } from 'sortablejs';
10+
import { isValueSet } from '../../util/values';
11+
import { ValueAccessorBase } from '../value-accessor-base/value-accessor-base.component';
612

713
@Component({
814
selector: 'klp-form-sortable-items',
915
templateUrl: './sortable-items.component.html',
1016
styleUrls: ['./sortable-items.component.scss'],
11-
providers: [{provide: NG_VALUE_ACCESSOR, useExisting: SortableItemsComponent, multi: true}],
17+
providers: [
18+
{
19+
provide: NG_VALUE_ACCESSOR,
20+
useExisting: SortableItemsComponent,
21+
multi: true,
22+
},
23+
],
1224
})
13-
export class SortableItemsComponent extends ValueAccessorBase<Array<any>> implements OnInit {
25+
export class SortableItemsComponent
26+
extends ValueAccessorBase<Array<any>>
27+
implements OnInit
28+
{
1429
@ContentChild(TemplateRef) template;
1530
@Input() sortableItemSize: 'sm' | 'lg' = 'lg';
1631
@Input() useCustomScroll = false;
@@ -21,9 +36,13 @@ export class SortableItemsComponent extends ValueAccessorBase<Array<any>> implem
2136
ngOnInit(): void {
2237
super.ngOnInit();
2338
if (this.useCustomScroll) {
24-
this.sortablejsOptions = {onUpdate: this.itemsOrderChanged, onMove: this.onItemDrag, onEnd: this.onEnd};
39+
this.sortablejsOptions = {
40+
onUpdate: this.itemsOrderChanged,
41+
onMove: this.onItemDrag,
42+
onEnd: this.onEnd,
43+
};
2544
} else {
26-
this.sortablejsOptions = {onUpdate: this.itemsOrderChanged};
45+
this.sortablejsOptions = { onUpdate: this.itemsOrderChanged };
2746
}
2847
}
2948

projects/klippa/ngx-enhancy-forms/src/lib/material.module.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
import { NgModule } from '@angular/core';
44
import { MatDatepickerModule } from '@angular/material/datepicker';
5-
import { MatFormFieldModule } from '@angular/material/form-field';
5+
import { MatLegacyFormFieldModule as MatFormFieldModule } from '@angular/material/legacy-form-field';
66
import { MatNativeDateModule } from '@angular/material/core';
7-
import { MatInputModule } from '@angular/material/input';
8-
import { MatButtonModule } from '@angular/material/button';
7+
import { MatLegacyInputModule as MatInputModule } from '@angular/material/legacy-input';
8+
import { MatLegacyButtonModule as MatButtonModule } from '@angular/material/legacy-button';
99

1010
@NgModule({
1111
imports: [MatDatepickerModule, MatFormFieldModule, MatNativeDateModule, MatInputModule, MatButtonModule],

projects/klippa/ngx-enhancy-forms/src/lib/ngx-enhancy-forms.module.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {FormElementComponent} from './form/form-element/form-element.component';
1818
import {FormErrorComponent} from './form/form-error/form-error.component';
1919
import {FormSubmitButtonComponent} from './form/form-submit-button/form-submit-button.component';
2020
import {FormComponent, SubFormDirective} from './form/form.component';
21-
import {SortablejsModule} from 'ngx-sortablejs';
21+
import { SortablejsModule } from '@dustfoundation/ngx-sortablejs';
2222
import {NgSelectModule} from '@ng-select/ng-select';
2323
import {DatePickerComponent} from './elements/date-picker/date-picker.component';
2424
import {DateTimePickerComponent} from './elements/date-time-picker/date-time-picker.component';
@@ -29,7 +29,6 @@ import {SortableGroupedItemsComponent} from './elements/sortable-grouped-items/s
2929
import {HourMinuteInputComponent} from './elements/hour-minute-input/hour-minute-input.component';
3030
import {RadioComponent} from './elements/radio/radio.component';
3131

32-
3332
@NgModule({
3433
imports: [
3534
CommonModule,
@@ -64,7 +63,7 @@ import {RadioComponent} from './elements/radio/radio.component';
6463
FormComponent,
6564
SubFormDirective,
6665
HourMinuteInputComponent,
67-
RadioComponent
66+
RadioComponent,
6867
],
6968
exports: [
7069
ValueAccessorBase,
@@ -92,8 +91,7 @@ import {RadioComponent} from './elements/radio/radio.component';
9291
FormComponent,
9392
SubFormDirective,
9493
HourMinuteInputComponent,
95-
RadioComponent
96-
]
94+
RadioComponent,
95+
],
9796
})
98-
export class NgxEnhancyFormsModule {
99-
}
97+
export class NgxEnhancyFormsModule {}

projects/klippa/ngx-enhancy-forms/src/lib/util/arrays.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isArray } from 'lodash';
1+
import { isArray } from 'lodash-es';
22
import { isValueSet } from './values';
33

44
export function removeDuplicatesFromArraysWithComparator(comparator: (e1: any, e2: any) => boolean, ...arrays: any[]): any {

projects/klippa/ngx-enhancy-forms/src/test.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,10 @@ import {
88
platformBrowserDynamicTesting
99
} from '@angular/platform-browser-dynamic/testing';
1010

11-
declare const require: {
12-
context(path: string, deep?: boolean, filter?: RegExp): {
13-
keys(): string[];
14-
<T>(id: string): T;
15-
};
16-
};
17-
1811
// First, initialize the Angular testing environment.
1912
getTestBed().initTestEnvironment(
2013
BrowserDynamicTestingModule,
2114
platformBrowserDynamicTesting(), {
2215
teardown: { destroyAfterEach: false }
2316
}
2417
);
25-
// Then we find all the tests.
26-
const context = require.context('./', true, /\.spec\.ts$/);
27-
// And load the modules.
28-
context.keys().map(context);

projects/klippa/ngx-enhancy-forms/tsconfig.lib.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"extends": "../../../tsconfig.json",
44
"compilerOptions": {
55
"outDir": "../../../out-tsc/lib",
6-
"target": "es2020",
76
"declaration": true,
87
"declarationMap": true,
98
"inlineSources": true,

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"experimentalDecorators": true,
1010
"moduleResolution": "node",
1111
"importHelpers": true,
12-
"target": "es2020",
12+
"target": "ES2022",
1313
"module": "es2020",
1414
"lib": [
1515
"es2019",
@@ -20,6 +20,7 @@
2020
"@klippa/ngx-enhancy-forms": [
2121
"projects/klippa/ngx-enhancy-forms/src/public-api.ts"
2222
]
23-
}
23+
},
24+
"useDefineForClassFields": false
2425
}
2526
}

0 commit comments

Comments
 (0)