Skip to content

Commit 45c26d6

Browse files
main <= feature/release v19 (#86)
1 parent c72c3a1 commit 45c26d6

23 files changed

+130
-173
lines changed

.github/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2023 hackingharold
3+
Copyright (c) 2024 hackingharold
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

.github/workflows/on-release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ jobs:
1414
- uses: actions/checkout@v3
1515
- uses: actions/setup-node@v3
1616
with:
17-
node-version: 18
17+
node-version: 20
1818
registry-url: https://registry.npmjs.org/
1919
always-auth: true
2020
token: ${{ secrets.NPM_TOKEN }}
21+
2122
- uses: oven-sh/setup-bun@v1
2223
- run: bun install --frozen-lockfile
2324

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 hackingharold
3+
Copyright (c) 2024 hackingharold
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

bun.lockb

772 Bytes
Binary file not shown.

package.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,42 @@
1414
"lint:material": "ng lint material"
1515
},
1616
"dependencies": {
17-
"@angular/animations": "^18.2.8",
18-
"@angular/cdk": "~18.2.9",
19-
"@angular/common": "^18.2.8",
20-
"@angular/compiler": "^18.2.8",
21-
"@angular/core": "^18.2.8",
22-
"@angular/forms": "^18.2.8",
23-
"@angular/material": "~18.2.9",
24-
"@angular/platform-browser": "^18.2.8",
25-
"@angular/platform-browser-dynamic": "^18.2.8",
26-
"@angular/router": "^18.2.8",
17+
"@angular/animations": "^19.0.0",
18+
"@angular/cdk": "~19.0.0",
19+
"@angular/common": "^19.0.0",
20+
"@angular/compiler": "^19.0.0",
21+
"@angular/core": "^19.0.0",
22+
"@angular/forms": "^19.0.0",
23+
"@angular/material": "~19.0.0",
24+
"@angular/platform-browser": "^19.0.0",
25+
"@angular/platform-browser-dynamic": "^19.0.0",
26+
"@angular/router": "^19.0.0",
2727
"rxjs": "~7.8.1",
28-
"tslib": "^2.8.0",
28+
"tslib": "^2.8.1",
2929
"zone.js": "^0.15.0"
3030
},
3131
"devDependencies": {
32-
"@angular-devkit/build-angular": "^18.2.9",
33-
"@angular-eslint/builder": "^18.4.0",
34-
"@angular-eslint/eslint-plugin": "18.4.0",
35-
"@angular-eslint/eslint-plugin-template": "18.4.0",
36-
"@angular-eslint/schematics": "^18.4.0",
37-
"@angular-eslint/template-parser": "18.4.0",
38-
"@angular/cli": "^18.2.9",
39-
"@angular/compiler-cli": "^18.2.8",
32+
"@angular-devkit/build-angular": "^19.0.1",
33+
"@angular-eslint/builder": "^18.4.1",
34+
"@angular-eslint/eslint-plugin": "18.4.1",
35+
"@angular-eslint/eslint-plugin-template": "18.4.1",
36+
"@angular-eslint/schematics": "^18.4.1",
37+
"@angular-eslint/template-parser": "18.4.1",
38+
"@angular/cli": "^19.0.1",
39+
"@angular/compiler-cli": "^19.0.0",
4040
"@types/jasmine": "~5.1.4",
41-
"@types/node": "^22.7.6",
42-
"@typescript-eslint/eslint-plugin": "^8.10.0",
43-
"@typescript-eslint/parser": "^8.10.0",
41+
"@types/node": "^22.9.1",
42+
"@typescript-eslint/eslint-plugin": "^8.15.0",
43+
"@typescript-eslint/parser": "^8.15.0",
4444
"ajv": "^8.17.1",
45-
"eslint": "^9.12.0",
45+
"eslint": "^9.15.0",
4646
"jasmine-core": "~5.4.0",
4747
"karma": "~6.4.4",
4848
"karma-chrome-launcher": "~3.2.0",
4949
"karma-coverage": "~2.2.1",
5050
"karma-jasmine": "~5.1.0",
5151
"karma-jasmine-html-reporter": "~2.1.0",
52-
"ng-packagr": "^18.2.1",
53-
"typescript": "5.5.4"
52+
"ng-packagr": "^19.0.0",
53+
"typescript": "5.6.3"
5454
}
5555
}

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

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
1+
import { CommonModule } from '@angular/common';
12
import { Component } from '@angular/core';
2-
import { FormControl } from '@angular/forms';
3+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
4+
import { MatChipRow } from '@angular/material/chips';
5+
import { MatError, MatFormField, MatLabel } from '@angular/material/form-field';
6+
import { MatIcon } from '@angular/material/icon';
7+
import { MatInput } from '@angular/material/input';
8+
import { FileInputDirective } from '@ngx-dropzone/cdk';
9+
import { MatDropzone } from '@ngx-dropzone/material';
310

411
@Component({
512
selector: 'app-root',
13+
imports: [
14+
CommonModule,
15+
ReactiveFormsModule,
16+
MatFormField,
17+
MatLabel,
18+
MatError,
19+
MatInput,
20+
MatChipRow,
21+
MatIcon,
22+
MatDropzone,
23+
FileInputDirective,
24+
],
625
template: `<div class="app-container">
726
<mat-form-field appearance="outline">
827
<mat-label>Drop only .png files!</mat-label>

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

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

projects/app/src/main.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
1+
import { bootstrapApplication } from '@angular/platform-browser';
2+
import { provideAnimations } from '@angular/platform-browser/animations';
3+
import { AppComponent } from './app/app.component';
24

3-
import { AppModule } from './app/app.module';
4-
5-
6-
platformBrowserDynamic().bootstrapModule(AppModule)
7-
.catch(err => console.error(err));
5+
bootstrapApplication(AppComponent, {
6+
providers: [provideAnimations()],
7+
}).catch((e) => console.error(e));

projects/cdk/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
"cdk"
2424
],
2525
"peerDependencies": {
26-
"@angular/common": "^18.0.0",
27-
"@angular/core": "^18.0.0",
28-
"@angular/forms": "^18.0.0",
26+
"@angular/common": "^19.0.0",
27+
"@angular/core": "^19.0.0",
28+
"@angular/forms": "^19.0.0",
2929
"rxjs": "^7.4.0"
3030
}
3131
}

projects/cdk/src/lib/cdk.module.ts

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

projects/cdk/src/lib/dropzone/dropzone.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
33
import { FormControl, ReactiveFormsModule } from '@angular/forms';
44
import { By } from '@angular/platform-browser';
55
import { FileInputDirective, FileInputValidators, FileInputValue } from '../file-input';
6-
import { DropzoneCdkModule } from './../cdk.module';
76
import { DropzoneComponent } from './dropzone.component';
87

98
interface Selectors<T> {
@@ -17,8 +16,7 @@ interface Selectors<T> {
1716
describe('DropzoneComponent', () => {
1817
function configureDropzoneTestingModule<T>(testComponent: Type<T>): Selectors<T> {
1918
const fixture = TestBed.configureTestingModule({
20-
imports: [ReactiveFormsModule, DropzoneCdkModule],
21-
declarations: [testComponent],
19+
imports: [testComponent],
2220
}).createComponent(testComponent);
2321

2422
const element = fixture.debugElement.query(By.directive(DropzoneComponent));
@@ -148,6 +146,7 @@ describe('DropzoneComponent', () => {
148146

149147
@Component({
150148
selector: 'basic-dropzone',
149+
imports: [DropzoneComponent, FileInputDirective],
151150
template: `
152151
<ngx-dropzone>
153152
<input type="file" fileInput />
@@ -158,6 +157,7 @@ class DropzoneBasic {}
158157

159158
@Component({
160159
selector: 'form-control-dropzone',
160+
imports: [ReactiveFormsModule, DropzoneComponent, FileInputDirective],
161161
template: `
162162
<ngx-dropzone>
163163
<input type="file" fileInput [formControl]="fileCtrl" multiple />

projects/cdk/src/lib/dropzone/dropzone.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import { DropzoneService } from './dropzone.service';
2020
@Component({
2121
selector: 'ngx-dropzone',
2222
exportAs: 'dropzone',
23+
imports: [FileInputDirective],
24+
providers: [DropzoneService],
2325
template: `<ng-content></ng-content>`,
2426
host: {
2527
tabindex: '0',

projects/cdk/src/lib/dropzone/dropzone.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Injectable } from '@angular/core';
22
import { nonNullable } from '../coercion';
3-
import { File } from './../file-input';
3+
import { type File } from './../file-input';
44

55
@Injectable({
66
providedIn: 'root',

projects/cdk/src/lib/file-input/accept.service.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { AcceptService } from './accept.service';
44
describe('AcceptService', () => {
55
let service: AcceptService;
66

7+
beforeEach(() => {
8+
TestBed.configureTestingModule({});
9+
service = TestBed.inject(AcceptService);
10+
});
11+
712
/** Returns a simple fake file with given extension and optional type. */
813
const getFile = (ext: string, type?: string) => new File(['...'], `${Date.now()}.${ext}`, { type });
914

@@ -14,11 +19,6 @@ describe('AcceptService', () => {
1419
getFile('pdf', 'application/octet-stream'),
1520
];
1621

17-
beforeEach(() => {
18-
TestBed.configureTestingModule({});
19-
service = TestBed.inject(AcceptService);
20-
});
21-
2222
it('should filter based on file extension', () => {
2323
const files = getFileList();
2424
const accepted = service.accepts(files, '.doc, txt , .pdf,random/MIME');

projects/cdk/src/lib/file-input/file-input.directive.spec.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, DebugElement, Type } from '@angular/core';
22
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
3-
import { FormControl, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
3+
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
44
import { By } from '@angular/platform-browser';
55
import { getArrayValueError, getNonArrayValueError } from './file-input-errors';
66
import { FileInputValue } from './file-input-value';
@@ -24,8 +24,7 @@ const getFileList = (files: File[]): FileList => {
2424
describe('FileInputDirective', () => {
2525
function configureFileInputTestingModule<T>(testComponent: Type<T>): Selectors<T> {
2626
const fixture = TestBed.configureTestingModule({
27-
imports: [FormsModule, ReactiveFormsModule],
28-
declarations: [FileInputDirective, testComponent],
27+
imports: [testComponent],
2928
}).createComponent(testComponent);
3029

3130
const inputElement = fixture.debugElement.query(By.directive(FileInputDirective));
@@ -299,34 +298,40 @@ describe('FileInputDirective', () => {
299298
});
300299

301300
@Component({
301+
imports: [FileInputDirective],
302302
template: `<input fileInput type="file" />`,
303303
})
304304
class FileInputBasic {}
305305

306306
@Component({
307+
imports: [FileInputDirective],
307308
template: `<input fileInput type="file" multiple />`,
308309
})
309310
class FileInputMultiple {}
310311

311312
@Component({
313+
imports: [FileInputDirective],
312314
// This combination is not valid! "Append" should only be used together with "multiple".
313315
template: `<input fileInput type="file" mode="append" />`,
314316
})
315317
class FileInputAppend {}
316318

317319
@Component({
320+
imports: [FileInputDirective],
318321
template: `<input fileInput type="file" multiple mode="append" />`,
319322
})
320323
class FileInputMultipleAppend {}
321324

322325
@Component({
326+
imports: [ReactiveFormsModule, FileInputDirective],
323327
template: `<input fileInput type="file" [formControl]="fileCtrl" />`,
324328
})
325329
class FileInputWithFormControl {
326330
fileCtrl = new FormControl<FileInputValue>(null, [Validators.required]);
327331
}
328332

329333
@Component({
334+
imports: [ReactiveFormsModule, FileInputDirective],
330335
template: `<input fileInput type="file" disabled />`,
331336
})
332337
class FileInputDisabled {}

projects/cdk/src/public-api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Public API Surface of cdk
33
*/
44

5-
export * from './lib/cdk.module';
65
export * from './lib/coercion';
76
export * from './lib/dropzone';
87
export * from './lib/file-input';

projects/material/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
"material"
2424
],
2525
"peerDependencies": {
26-
"@angular/common": "^18.0.0",
27-
"@angular/core": "^18.0.0",
28-
"@angular/forms": "^18.0.0",
29-
"@ngx-dropzone/cdk": "^18.0.0",
26+
"@angular/common": "^19.0.0",
27+
"@angular/core": "^19.0.0",
28+
"@angular/forms": "^19.0.0",
29+
"@ngx-dropzone/cdk": "^19.0.0",
3030
"rxjs": "^7.4.0"
3131
}
3232
}

projects/material/src/lib/mat-dropzone/mat-dropzone.component.spec.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { CommonModule } from '@angular/common';
12
import { Component, DebugElement, Type } from '@angular/core';
23
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
34
import { FormControl, ReactiveFormsModule } from '@angular/forms';
@@ -6,8 +7,7 @@ import { MatError, MatFormFieldModule, MatLabel } from '@angular/material/form-f
67
import { MatIconModule } from '@angular/material/icon';
78
import { By } from '@angular/platform-browser';
89
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
9-
import { DropzoneCdkModule, FileInputDirective, FileInputValidators, FileInputValue } from '@ngx-dropzone/cdk';
10-
import { DropzoneMaterialModule } from '../material.module';
10+
import { FileInputDirective, FileInputValidators, FileInputValue } from '@ngx-dropzone/cdk';
1111
import { MatDropzone } from './mat-dropzone.component';
1212

1313
interface Selectors<T> {
@@ -25,16 +25,7 @@ interface Selectors<T> {
2525
describe('MatDropzone', () => {
2626
function configureDropzoneTestingModule<T>(testComponent: Type<T>): Selectors<T> {
2727
const fixture = TestBed.configureTestingModule({
28-
imports: [
29-
BrowserAnimationsModule,
30-
ReactiveFormsModule,
31-
MatFormFieldModule,
32-
MatIconModule,
33-
MatChipsModule,
34-
DropzoneCdkModule,
35-
DropzoneMaterialModule,
36-
],
37-
declarations: [testComponent],
28+
imports: [CommonModule, BrowserAnimationsModule, testComponent],
3829
}).createComponent(testComponent);
3930

4031
const element = fixture.debugElement.query(By.directive(MatDropzone));
@@ -127,6 +118,7 @@ describe('MatDropzone', () => {
127118

128119
@Component({
129120
selector: 'basic-dropzone',
121+
imports: [MatFormFieldModule, MatDropzone, FileInputDirective],
130122
template: `
131123
<mat-form-field>
132124
<mat-label>Drop it basic!</mat-label>
@@ -140,6 +132,7 @@ class DropzoneBasic {}
140132

141133
@Component({
142134
selector: 'form-control-dropzone',
135+
imports: [ReactiveFormsModule, MatFormFieldModule, MatIconModule, MatChipsModule, MatDropzone, FileInputDirective],
143136
template: `
144137
<mat-form-field>
145138
<ngx-mat-dropzone>

0 commit comments

Comments
 (0)