uppy/examples/angular/src/app/app.component.ts
Prakash cb9673bc1e
uppy 5.0: remove stale plugins (#5834)
This PR removes `@uppy/store-redux` , `@uppy/redux-dev-tools` ,
`@uppy/progress-bar` , `@uppy/drag-drop` , `@uppy/file-input` ,
`@uppy/aws-s3-multipart`

- **Source Removal**  
Removed source Dirs of packages, including all source code, styles,
documentation, and build configurations.

- **Bundle & Exports**  
Removed related exports from `packages/uppy/src/bundle.ts` and
`index.ts`. Cleaned up dependencies from `uppy/package.json`.

- **Framework Cleanup**  
  Removed components and exports from:
  - `@uppy/react`
  - `@uppy/vue`
  - `@uppy/svelte`
  - `@uppy/angular`

- **Dependency Cleanup**  
Removed references across all `package.json`, `peerDependencies`,
`tsconfig.*.json`, and `turbo.json` files.

- **Example Updates**  
  - Updated Angular example and `private/dev/DragDrop.js`
  - Removed deprecated plugin usage
  - Cleaned example dependencies

- **Style Cleanup**  
Removed CSS imports from `packages/uppy/src/style.scss` and
`examples/angular/src/styles.css`. Fixed TypeScript project references.

- **Migration Guide**  
  Updated `.github/MIGRATION.md`
2025-07-28 10:30:50 +02:00

73 lines
1.6 KiB
TypeScript

import { Component, type OnInit } from '@angular/core'
import { Uppy } from '@uppy/core'
import GoogleDrive from '@uppy/google-drive'
import Tus from '@uppy/tus'
import Webcam from '@uppy/webcam'
@Component({
selector: 'app-root',
template: /* html */ `
<h1>Uppy Angular Example!</h1>
<h2>Inline dashboard</h2>
<label>
<input
type="checkbox"
(change)="showInline = $any($event.target)?.checked"
[checked]="showInline"
/>
Show Dashboard
</label>
<uppy-dashboard
[uppy]="uppy"
[props]="dashboardProps"
*ngIf="showInline"
></uppy-dashboard>
<h2>Modal Dashboard</h2>
<div>
<uppy-dashboard-modal
[uppy]="uppy"
[open]="showModal"
[props]="dashboardModalProps"
></uppy-dashboard-modal>
<button (click)="showModal = !showModal">
{{ showModal ? 'Close dashboard' : 'Open dashboard' }}
</button>
</div>
<h2>Progress Bar</h2>
<uppy-progress-bar
[uppy]="uppy"
[props]="{ hideAfterFinish: false }"
></uppy-progress-bar>
`,
styleUrls: [],
})
export class AppComponent implements OnInit {
title = 'angular-example'
showInline = false
showModal = false
dashboardProps = {
plugins: ['Webcam'],
}
dashboardModalProps = {
target: document.body,
onRequestCloseModal: (): void => {
this.showModal = false
},
}
uppy = new Uppy({ debug: true, autoProceed: true })
ngOnInit(): void {
this.uppy
.use(Webcam)
.use(Tus, { endpoint: 'https://tusd.tusdemo.net/files/' })
.use(GoogleDrive, { companionUrl: 'https://companion.uppy.io' })
}
}