Support Angular 19 (#5709) (#5715)

Co-authored-by: Murderlon <merlijn@soverin.net>
This commit is contained in:
Arnaud Flaesch 2025-04-09 12:22:11 +02:00 committed by GitHub
parent 5de5687f98
commit 27492bca8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 4858 additions and 254 deletions

View file

@ -10,24 +10,24 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^18.0.0",
"@angular/common": "^18.0.0",
"@angular/compiler": "^18.0.0",
"@angular/core": "^18.0.0",
"@angular/forms": "^18.0.0",
"@angular/platform-browser": "^18.0.0",
"@angular/platform-browser-dynamic": "^18.0.0",
"@angular/router": "^18.0.0",
"@angular/animations": "^19.0.0",
"@angular/common": "^19.0.0",
"@angular/compiler": "^19.0.0",
"@angular/core": "^19.0.0",
"@angular/forms": "^19.0.0",
"@angular/platform-browser": "^19.0.0",
"@angular/platform-browser-dynamic": "^19.0.0",
"@angular/router": "^19.0.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.3"
"zone.js": "~0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.0.2",
"@angular-eslint/eslint-plugin": "18.0.1",
"@angular-eslint/eslint-plugin-template": "18.0.1",
"@angular/cli": "^18.0.2",
"@angular/compiler-cli": "^18.0.0",
"@angular-devkit/build-angular": "^19.0.0",
"@angular-eslint/eslint-plugin": "^18.0.1",
"@angular-eslint/eslint-plugin-template": "^18.0.1",
"@angular/cli": "^19.0.0",
"@angular/compiler-cli": "^19.0.0",
"@types/jasmine": "~5.1.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
@ -37,7 +37,7 @@
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"ng-packagr": "^18.0.0",
"typescript": "~5.4"
"ng-packagr": "^19.0.0",
"typescript": "^5.6"
}
}

View file

@ -25,8 +25,8 @@
"tslib": "^2.0.0"
},
"peerDependencies": {
"@angular/common": "^17.0.0 || ^18.0.0",
"@angular/core": "^17.0.0 || ^18.0.0",
"@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0",
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0",
"@uppy/core": "workspace:^",
"@uppy/dashboard": "workspace:^",
"@uppy/drag-drop": "workspace:^",

View file

@ -1,12 +1,4 @@
import {
Component,
ChangeDetectionStrategy,
ElementRef,
Input,
OnDestroy,
OnChanges,
SimpleChanges,
} from '@angular/core';
import { Component, ChangeDetectionStrategy, ElementRef, Input, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';
import Dashboard from '@uppy/dashboard';
import type { DashboardOptions } from '@uppy/dashboard';
import { Uppy } from '@uppy/core';
@ -22,11 +14,16 @@ export class DashboardModalComponent<M extends Meta, B extends Body>
extends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>>
implements OnDestroy, OnChanges
{
el = inject(ElementRef);
@Input() uppy: Uppy<M, B> = new Uppy();
@Input() props: DashboardOptions<M, B> = {};
@Input() open: boolean = false;
constructor(public el: ElementRef) {
/** Inserted by Angular inject() migration for backwards compatibility */
constructor(...args: unknown[]);
constructor() {
super();
}

View file

@ -1,9 +0,0 @@
import { NgModule } from '@angular/core';
import { DashboardModalComponent } from './dashboard-modal.component';
export const COMPONENTS = [DashboardModalComponent];
@NgModule({
declarations: COMPONENTS,
exports: COMPONENTS
})
export class UppyAngularDashboardModalModule { }

View file

@ -1,12 +1,10 @@
import { DashboardModalDemoComponent } from './dashboard-modal-demo.component';
import { moduleMetadata } from '@storybook/angular';
import { UppyAngularDashboardModalModule } from './dashboard-modal.module';
export default {
title: 'Dashboard',
decorators: [
moduleMetadata({
imports: [UppyAngularDashboardModalModule],
declarations: [DashboardModalDemoComponent]
}),
]

View file

@ -1,12 +1,4 @@
import {
Component,
ChangeDetectionStrategy,
ElementRef,
Input,
OnDestroy,
OnChanges,
SimpleChanges,
} from '@angular/core';
import { Component, ChangeDetectionStrategy, ElementRef, Input, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';
import Dashboard from '@uppy/dashboard';
import type { DashboardOptions } from '@uppy/dashboard';
import { Uppy } from '@uppy/core';
@ -22,10 +14,15 @@ export class DashboardComponent<M extends Meta, B extends Body>
extends UppyAngularWrapper<M, B, DashboardOptions<M,B>>
implements OnDestroy, OnChanges
{
el = inject(ElementRef);
@Input() uppy: Uppy<M, B> = new Uppy();
@Input() props: DashboardOptions<M, B> = {};
constructor(public el: ElementRef) {
/** Inserted by Angular inject() migration for backwards compatibility */
constructor(...args: unknown[]);
constructor() {
super();
}

View file

@ -1,9 +0,0 @@
import { NgModule } from '@angular/core';
import { DashboardComponent } from './dashboard.component';
export const COMPONENTS = [DashboardComponent];
@NgModule({
declarations: COMPONENTS,
exports: COMPONENTS
})
export class UppyAngularDashboardModule { }

View file

@ -1,12 +1,10 @@
import { DashboardDemoComponent } from './dashboard-demo.component';
import { moduleMetadata } from '@storybook/angular';
import { UppyAngularDashboardModule} from './dashboard.module';
export default {
title: 'Dashboard',
decorators: [
moduleMetadata({
imports: [UppyAngularDashboardModule],
declarations: [DashboardDemoComponent]
}),
]
@ -14,4 +12,4 @@ export default {
export const Default = () => ({
component: DashboardDemoComponent,
});
});

View file

@ -1,12 +1,4 @@
import {
Component,
ChangeDetectionStrategy,
Input,
OnDestroy,
OnChanges,
SimpleChanges,
ElementRef,
} from '@angular/core';
import { Component, ChangeDetectionStrategy, Input, OnDestroy, OnChanges, SimpleChanges, ElementRef, inject } from '@angular/core';
import { Uppy } from '@uppy/core';
import DragDrop from '@uppy/drag-drop';
import type { DragDropOptions } from '@uppy/drag-drop';
@ -22,10 +14,15 @@ export class DragDropComponent<M extends Meta, B extends Body>
extends UppyAngularWrapper<M, B, DragDropOptions>
implements OnDestroy, OnChanges
{
el = inject(ElementRef);
@Input() uppy: Uppy<M, B> = new Uppy();
@Input() props: DragDropOptions = {};
constructor(public el: ElementRef) {
/** Inserted by Angular inject() migration for backwards compatibility */
constructor(...args: unknown[]);
constructor() {
super();
}

View file

@ -1,9 +0,0 @@
import { NgModule } from '@angular/core';
import { DragDropComponent } from './drag-drop.component';
export const COMPONENTS = [DragDropComponent];
@NgModule({
declarations: COMPONENTS,
exports: COMPONENTS
})
export class UppyAngularDragDropModule { }

View file

@ -1,17 +1,15 @@
import { moduleMetadata } from '@storybook/angular';
import { UppyAngularDragDropModule } from './drag-drop.module';
import { DragDropDemoComponent } from './drag-drop-demo.component';
export default {
title: 'Drag Drop',
decorators: [
moduleMetadata({
imports: [UppyAngularDragDropModule],
declarations: [DragDropDemoComponent]
}),
]
};
export const Default = () => ({
component: DragDropDemoComponent,
});
});

View file

@ -1,9 +1,4 @@
import {
Component,
OnInit,
ChangeDetectionStrategy,
ChangeDetectorRef,
} from '@angular/core';
import { Component, OnInit, ChangeDetectionStrategy, ChangeDetectorRef, inject } from '@angular/core';
import { Uppy } from '@uppy/core';
import Tus from '@uppy/tus';
import type {ProgressBarOptions} from '@uppy/progress-bar';
@ -59,6 +54,8 @@ import { Body, Meta } from '@uppy/utils/lib/UppyFile';
export class ProgressBarDemoComponent<M extends Meta, B extends Body>
implements OnInit
{
private cdr = inject(ChangeDetectorRef);
uppyOne!: Uppy<M, B>;
uppyTwo!: Uppy<M, B>;
fileListOne: { url: string; fileName: string }[] = [];
@ -71,7 +68,10 @@ export class ProgressBarDemoComponent<M extends Meta, B extends Body>
this.uppyTwo.upload();
}
constructor(private cdr: ChangeDetectorRef) {}
/** Inserted by Angular inject() migration for backwards compatibility */
constructor(...args: unknown[]);
constructor() {}
updateFileList =
(target: string) =>

View file

@ -1,12 +1,4 @@
import {
Component,
ChangeDetectionStrategy,
ElementRef,
Input,
OnDestroy,
OnChanges,
SimpleChanges,
} from '@angular/core';
import { Component, ChangeDetectionStrategy, ElementRef, Input, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';
import { Uppy } from '@uppy/core';
import ProgressBar from '@uppy/progress-bar';
import type { ProgressBarOptions } from '@uppy/progress-bar';
@ -22,10 +14,15 @@ export class ProgressBarComponent<M extends Meta, B extends Body>
extends UppyAngularWrapper<M, B, ProgressBarOptions>
implements OnDestroy, OnChanges
{
el = inject(ElementRef);
@Input() uppy: Uppy<M, B> = new Uppy();
@Input() props: ProgressBarOptions = {};
constructor(public el: ElementRef) {
/** Inserted by Angular inject() migration for backwards compatibility */
constructor(...args: unknown[]);
constructor() {
super();
}

View file

@ -1,9 +0,0 @@
import { NgModule } from '@angular/core';
import { ProgressBarComponent } from './progress-bar.component';
export const COMPONENTS = [ProgressBarComponent];
@NgModule({
declarations: COMPONENTS,
exports: COMPONENTS
})
export class UppyAngularProgressBarModule { }

View file

@ -1,14 +1,12 @@
import { moduleMetadata } from '@storybook/angular';
import { UppyAngularProgressBarModule } from './progress-bar.module';
import { ProgressBarDemoComponent } from './progress-bar-demo.component';
import { UppyAngularDragDropModule } from '../drag-drop/drag-drop.module';
import { CommonModule } from '@angular/common';
export default {
title: 'Progress Bar',
decorators: [
moduleMetadata({
imports: [UppyAngularProgressBarModule, UppyAngularDragDropModule, CommonModule],
imports: [CommonModule],
declarations: [ProgressBarDemoComponent]
}),
]
@ -16,4 +14,4 @@ export default {
export const Default = () => ({
component: ProgressBarDemoComponent,
});
});

View file

@ -1,12 +1,4 @@
import {
Component,
ChangeDetectionStrategy,
Input,
ElementRef,
OnDestroy,
OnChanges,
SimpleChanges,
} from '@angular/core';
import { Component, ChangeDetectionStrategy, Input, ElementRef, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';
import { Uppy } from '@uppy/core';
import StatusBar from '@uppy/status-bar';
import type { StatusBarOptions } from '@uppy/status-bar';
@ -22,10 +14,15 @@ export class StatusBarComponent<M extends Meta, B extends Body>
extends UppyAngularWrapper<M, B, StatusBarOptions>
implements OnDestroy, OnChanges
{
el = inject(ElementRef);
@Input() uppy: Uppy<M, B> = new Uppy();
@Input() props: StatusBarOptions = {};
constructor(public el: ElementRef) {
/** Inserted by Angular inject() migration for backwards compatibility */
constructor(...args: unknown[]);
constructor() {
super();
}

View file

@ -1,9 +0,0 @@
import { NgModule } from '@angular/core';
import { StatusBarComponent } from './status-bar.component';
export const COMPONENTS = [StatusBarComponent];
@NgModule({
declarations: COMPONENTS,
exports: COMPONENTS
})
export class UppyAngularStatusBarModule { }

View file

@ -1,12 +1,10 @@
import { StatusBarDemoComponent } from './status-bar-demo.component';
import { moduleMetadata } from '@storybook/angular';
import { UppyAngularStatusBarModule } from './status-bar.module';
export default {
title: 'Status Bar',
decorators: [
moduleMetadata({
imports: [UppyAngularStatusBarModule],
declarations: [StatusBarDemoComponent]
}),
]
@ -14,4 +12,4 @@ export default {
export const Default = () => ({
component: StatusBarDemoComponent,
});
});

View file

@ -2,11 +2,6 @@
* Public API Surface of @uppy/angular
*/
export { UppyAngularDashboardModule } from './lib/components/dashboard/dashboard.module';
export { UppyAngularDashboardModalModule } from './lib/components/dashboard-modal/dashboard-modal.module';
export { UppyAngularProgressBarModule } from './lib/components/progress-bar/progress-bar.module';
export { UppyAngularStatusBarModule } from './lib/components/status-bar/status-bar.module';
export { UppyAngularDragDropModule } from './lib/components/drag-drop/drag-drop.module';
export { StatusBarComponent } from './lib/components/status-bar/status-bar.component';
export { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component';
export { DragDropComponent } from './lib/components/drag-drop/drag-drop.component';

4905
yarn.lock

File diff suppressed because it is too large Load diff