Skip to content

Commit 346c4c9

Browse files
Merge pull request #15 from RandomSoftwareSL/feature/update-primeng-version-to-19
primeNg v19 and angular 19 migration
2 parents 2ca2539 + 2bc058e commit 346c4c9

13 files changed

+58
-36
lines changed

package.json

+19-18
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,31 @@
1111
"test": "ng test"
1212
},
1313
"dependencies": {
14-
"@angular/animations": "^17.2.3",
15-
"@angular/common": "^17.2.3",
16-
"@angular/compiler": "^17.2.3",
17-
"@angular/core": "^17.2.3",
18-
"@angular/forms": "^17.2.3",
19-
"@angular/platform-browser": "^17.2.3",
20-
"@angular/platform-browser-dynamic": "^17.2.3",
21-
"@angular/router": "^17.2.3",
22-
"primeflex": "^3.3.1",
14+
"@angular/animations": "^19.2.5",
15+
"@angular/common": "^19.2.5",
16+
"@angular/compiler": "^19.2.5",
17+
"@angular/core": "^19.2.5",
18+
"@angular/forms": "^19.2.5",
19+
"@angular/platform-browser": "^19.2.5",
20+
"@angular/platform-browser-dynamic": "^19.2.5",
21+
"@angular/router": "^19.2.5",
22+
"primeflex": "^4.0.0",
2323
"primeicons": "^7.0.0",
24-
"primeng": "17.18.15",
24+
"primeng": "^19.0.10",
25+
"@primeng/themes": "^19.0.10",
2526
"rxjs": "~7.8.1",
26-
"tslib": "^2.3.0",
27-
"zone.js": "^0.14.0"
27+
"tslib": "^2.8.1",
28+
"zone.js": "^0.15.0"
2829
},
2930
"peerDependencies": {
30-
"primeflex": "^3.3.1",
31+
"primeflex": "^4.0.0",
3132
"primeicons": "^7.0.0",
32-
"primeng": "17.18.15"
33+
"primeng": "^19.0.10"
3334
},
3435
"devDependencies": {
35-
"@angular-devkit/build-angular": "^17.2.2",
36-
"@angular/cli": "^17.2.2",
37-
"@angular/compiler-cli": "^17.2.3",
36+
"@angular-devkit/build-angular": "^19.2.6",
37+
"@angular/cli": "^19.2.6",
38+
"@angular/compiler-cli": "^19.2.5",
3839
"@types/jasmine": "~3.10.0",
3940
"jasmine-core": "~4.0.0",
4041
"karma": "~6.3.0",
@@ -43,6 +44,6 @@
4344
"karma-jasmine": "~4.0.0",
4445
"karma-jasmine-html-reporter": "~1.7.0",
4546
"ng-packagr": "^17.3.0",
46-
"typescript": "~5.3.3"
47+
"typescript": "5.5.4"
4748
}
4849
}

projects/consumer/src/app/app.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { BehaviorSubject, map, of } from "rxjs";
1212
selector: "app-root",
1313
templateUrl: "./app.component.html",
1414
styleUrls: ["./app.component.scss"],
15+
standalone: false,
1516
})
1617
export class AppComponent {
1718
title = "consumer";

projects/consumer/src/app/app.module.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import { CommonModule } from "@angular/common";
88
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
99
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
1010
import { TypeHeadInputModule } from "typeHeadInput";
11+
// import { MyPreset } from "projects/type-head-input/src/lib/aura-theme";
12+
import { providePrimeNG } from "primeng/config";
1113

1214
@NgModule({
1315
declarations: [AppComponent],
@@ -20,7 +22,22 @@ import { TypeHeadInputModule } from "typeHeadInput";
2022
FormsModule,
2123
ReactiveFormsModule,
2224
],
23-
providers: [],
25+
providers: [
26+
// note: add the aura token theme file to enable this
27+
// providePrimeNG({
28+
// theme: {
29+
// preset: MyPreset,
30+
// options: {
31+
// prefix: "p",
32+
// darkModeSelector: false || "none",
33+
// cssLayer: {
34+
// name: "primeng",
35+
// order: "primeng",
36+
// },
37+
// },
38+
// },
39+
// }),
40+
],
2441
bootstrap: [AppComponent],
2542
})
2643
export class AppModule {}

projects/consumer/src/styles.scss

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
@import "primeng/resources/themes/tailwind-light/theme.css";
21
@import "primeflex/primeflex.scss";
3-
@import "primeng/resources/primeng.min.css";
42
@import "primeicons/primeicons.css";

projects/type-head-input/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
{
22
"name": "@randomsoftwareltd/type-head-input",
3-
"version": "2.2.2",
3+
"version": "3.0.0",
44
"peerDependencies": {
5-
"@angular/common": "^17.2.3",
6-
"@angular/core": "^17.2.3",
7-
"primeflex": "^3.3.1",
5+
"@angular/common": "^19.2.5",
6+
"@angular/core": "^19.2.5",
7+
"primeflex": "^4.0.0",
88
"primeicons": "^7.0.0",
9-
"primeng": "17.18.15"
9+
"primeng": "^19.0.10",
10+
"@primeng/themes": "^19.0.10"
1011
},
1112
"dependencies": {
12-
"tslib": "^2.3.0"
13+
"tslib": "^2.8.1"
1314
},
1415
"sideEffects": false
1516
}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { Directive, TemplateRef } from "@angular/core";
22

3-
@Directive({ selector: "[appTypeheadInputItemTmp]" })
3+
@Directive({ selector: "[appTypeheadInputItemTmp]", standalone: false })
44
export class NgTypeHeadInputItemTemplateDirective {
55
constructor(public template: TemplateRef<any>) {}
66
}
77

8-
@Directive({ selector: "[appTypeheadInputFilterTmp]" })
8+
@Directive({ selector: "[appTypeheadInputFilterTmp]", standalone: false })
99
export class NgTypeHeadInputFilterTemplateDirective {
1010
constructor(public template: TemplateRef<any>) {}
1111
}
1212

13-
@Directive({ selector: "[appTypeheadInputLoaderTmp]" })
13+
@Directive({ selector: "[appTypeheadInputLoaderTmp]", standalone: false })
1414
export class NgTypeHeadInputLoaderTemplateDirective {
1515
constructor(public template: TemplateRef<any>) {}
1616
}

projects/type-head-input/src/lib/directive/numbers-only.directive.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* tslint:disable:no-unused-variable */
22

3-
import { TestBed, async } from '@angular/core/testing';
3+
import { TestBed } from '@angular/core/testing';
44
import { NumbersOnlyDirective } from './numbers-only.directive';
55

66
describe('Directive: NumbersOnly', () => {

projects/type-head-input/src/lib/directive/numbers-only.directive.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88

99
@Directive({
1010
selector: "[appNumbersOnly]",
11+
standalone: false,
1112
})
1213
export class NumbersOnlyDirective implements OnDestroy {
1314
regexStr = "^[0-9]+$";

projects/type-head-input/src/lib/pipe/form-Control.pipe.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { AbstractControl, UntypedFormControl } from '@angular/forms';
33

44
@Pipe({
55
name: 'formControl',
6+
standalone: false,
67
})
78
export class FormControlPipe implements PipeTransform {
89
transform(value: AbstractControl | null): UntypedFormControl {

projects/type-head-input/src/lib/pipe/value-filter.pipe.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Pipe, PipeTransform } from "@angular/core";
22

33
@Pipe({
44
name: "valueFilter",
5+
standalone: false,
56
})
67
export class ValueFilterPipe implements PipeTransform {
78
transform(

projects/type-head-input/src/lib/type-head-input.component.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
>{{ labelText }}
33
<span *ngIf="showRequiredIndicator" class="text-red-500"> * </span></label
44
>
5-
<p-dropdown
5+
<p-select
66
#select
77
[options]="
88
enableServerSideData
@@ -77,7 +77,7 @@
7777
[ngTemplateOutletContext]="{ selectValue: select.value }"
7878
></ng-container>
7979
</ng-template>
80-
</p-dropdown>
80+
</p-select>
8181

8282
<ng-container *ngIf="control.touched">
8383
<div class="mt-1" *ngFor="let error of control?.errors | keyvalue">

projects/type-head-input/src/lib/type-head-input.component.ts

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { Dropdown, DropdownChangeEvent } from "primeng/dropdown";
3232
selector: "typeHeadInput",
3333
templateUrl: "./type-head-input.component.html",
3434
styleUrls: ["./type-head-input.component.scss"],
35+
standalone: false,
3536
})
3637
export class TypeHeadInputComponent {
3738
@ViewChild("select") select!: Dropdown;

projects/type-head-input/src/lib/type-head-input.module.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
NgTypeHeadInputItemTemplateDirective,
66
NgTypeHeadInputLoaderTemplateDirective,
77
} from "./directive/form-template.directive";
8-
import { DropdownModule } from "primeng/dropdown";
8+
import { SelectModule } from "primeng/select";
99
import { SkeletonModule } from "primeng/skeleton";
1010
import { CommonModule } from "@angular/common";
1111
import { FormsModule, ReactiveFormsModule } from "@angular/forms";
@@ -25,7 +25,7 @@ import { ValueFilterPipe } from "./pipe/value-filter.pipe";
2525
imports: [
2626
CommonModule,
2727
FormsModule,
28-
DropdownModule,
28+
SelectModule,
2929
SkeletonModule,
3030
ReactiveFormsModule,
3131
],
@@ -35,7 +35,7 @@ import { ValueFilterPipe } from "./pipe/value-filter.pipe";
3535
NgTypeHeadInputFilterTemplateDirective,
3636
NgTypeHeadInputLoaderTemplateDirective,
3737
NumbersOnlyDirective,
38-
DropdownModule,
38+
SelectModule,
3939
SkeletonModule,
4040
FormControlPipe,
4141
ValueFilterPipe,

0 commit comments

Comments
 (0)