@uppy/angular 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ng-package.json +7 -0
- package/package.json +11 -19
- package/src/lib/components/dashboard/dashboard-demo.component.ts +14 -0
- package/src/lib/components/dashboard/dashboard.component.spec.ts +24 -0
- package/src/lib/components/dashboard/dashboard.component.ts +52 -0
- package/src/lib/components/dashboard/dashboard.stories.ts +15 -0
- package/src/lib/components/dashboard-modal/dashboard-modal-demo.component.ts +17 -0
- package/src/lib/components/dashboard-modal/dashboard-modal.component.spec.ts +24 -0
- package/src/lib/components/dashboard-modal/dashboard-modal.component.ts +66 -0
- package/src/lib/components/dashboard-modal/dashboard-modal.stories.ts +15 -0
- package/src/lib/components/drag-drop/drag-drop-demo.component.ts +14 -0
- package/src/lib/components/drag-drop/drag-drop.component.spec.ts +24 -0
- package/src/lib/components/drag-drop/drag-drop.component.ts +52 -0
- package/src/lib/components/drag-drop/drag-drop.stories.ts +15 -0
- package/src/lib/components/progress-bar/progress-bar-demo.component.ts +100 -0
- package/src/lib/components/progress-bar/progress-bar.component.spec.ts +24 -0
- package/src/lib/components/progress-bar/progress-bar.component.ts +52 -0
- package/src/lib/components/progress-bar/progress-bar.stories.ts +17 -0
- package/src/lib/components/status-bar/status-bar-demo.component.ts +30 -0
- package/src/lib/components/status-bar/status-bar.component.spec.ts +24 -0
- package/src/lib/components/status-bar/status-bar.component.ts +52 -0
- package/src/lib/components/status-bar/status-bar.stories.ts +15 -0
- package/src/lib/utils/wrapper.ts +58 -0
- package/{public-api.d.ts → src/public-api.ts} +9 -5
- package/tsconfig.lib.json +12 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +9 -0
- package/fesm2022/uppy-angular.mjs +0 -225
- package/fesm2022/uppy-angular.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/components/dashboard/dashboard.component.d.ts +0 -18
- package/lib/components/dashboard-modal/dashboard-modal.component.d.ts +0 -20
- package/lib/components/drag-drop/drag-drop.component.d.ts +0 -18
- package/lib/components/progress-bar/progress-bar.component.d.ts +0 -18
- package/lib/components/status-bar/status-bar.component.d.ts +0 -18
- package/lib/utils/wrapper.d.ts +0 -16
package/ng-package.json
ADDED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uppy/angular",
|
|
3
3
|
"description": "Angular component wrappers around Uppy's official UI plugins.",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.1",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://uppy.io",
|
|
7
7
|
"keywords": [
|
|
@@ -18,29 +18,21 @@
|
|
|
18
18
|
"type": "git",
|
|
19
19
|
"url": "git+https://github.com/transloadit/uppy.git"
|
|
20
20
|
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prepublishOnly": "rm -fr * && cp -r ../../../dist/uppy/angular .."
|
|
23
|
+
},
|
|
21
24
|
"dependencies": {
|
|
22
25
|
"tslib": "^2.0.0"
|
|
23
26
|
},
|
|
24
27
|
"peerDependencies": {
|
|
25
28
|
"@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
26
29
|
"@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
27
|
-
"@uppy/core": "^4.
|
|
28
|
-
"@uppy/dashboard": "^4.
|
|
29
|
-
"@uppy/drag-drop": "^4.1
|
|
30
|
-
"@uppy/progress-bar": "^4.
|
|
31
|
-
"@uppy/status-bar": "^4.1
|
|
32
|
-
"@uppy/utils": "^6.1
|
|
30
|
+
"@uppy/core": "^4.5.1",
|
|
31
|
+
"@uppy/dashboard": "^4.4.1",
|
|
32
|
+
"@uppy/drag-drop": "^4.2.1",
|
|
33
|
+
"@uppy/progress-bar": "^4.3.1",
|
|
34
|
+
"@uppy/status-bar": "^4.2.1",
|
|
35
|
+
"@uppy/utils": "^6.2.1"
|
|
33
36
|
},
|
|
34
|
-
"sideEffects": false
|
|
35
|
-
"module": "fesm2022/uppy-angular.mjs",
|
|
36
|
-
"typings": "index.d.ts",
|
|
37
|
-
"exports": {
|
|
38
|
-
"./package.json": {
|
|
39
|
-
"default": "./package.json"
|
|
40
|
-
},
|
|
41
|
-
".": {
|
|
42
|
-
"types": "./index.d.ts",
|
|
43
|
-
"default": "./fesm2022/uppy-angular.mjs"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
37
|
+
"sideEffects": false
|
|
46
38
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
2
|
+
import { Uppy } from "@uppy/core";
|
|
3
|
+
import type * as Dashboard from "@uppy/dashboard";
|
|
4
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "uppy-dashboard-demo",
|
|
8
|
+
template: `<uppy-dashboard [uppy]="uppy" [props]="props"></uppy-dashboard>`,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
})
|
|
11
|
+
export class DashboardDemoComponent<M extends Meta, B extends Body> {
|
|
12
|
+
uppy: Uppy<M, B> = new Uppy({ debug: true, autoProceed: true });
|
|
13
|
+
props?: Dashboard.DashboardOptions<M, B>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, type ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { DashboardComponent } from "./dashboard.component";
|
|
4
|
+
|
|
5
|
+
describe("DashboardComponent", () => {
|
|
6
|
+
let component: DashboardComponent;
|
|
7
|
+
let fixture: ComponentFixture<DashboardComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [DashboardComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(DashboardComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
Input,
|
|
6
|
+
inject,
|
|
7
|
+
type OnChanges,
|
|
8
|
+
type OnDestroy,
|
|
9
|
+
type SimpleChanges,
|
|
10
|
+
} from "@angular/core";
|
|
11
|
+
import { Uppy } from "@uppy/core";
|
|
12
|
+
import type { DashboardOptions } from "@uppy/dashboard";
|
|
13
|
+
import Dashboard from "@uppy/dashboard";
|
|
14
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
15
|
+
import { UppyAngularWrapper } from "../../utils/wrapper";
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: "uppy-dashboard",
|
|
19
|
+
template: "",
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
})
|
|
22
|
+
export class DashboardComponent<M extends Meta, B extends Body>
|
|
23
|
+
extends UppyAngularWrapper<M, B, DashboardOptions<M, B>>
|
|
24
|
+
implements OnDestroy, OnChanges
|
|
25
|
+
{
|
|
26
|
+
el = inject(ElementRef);
|
|
27
|
+
|
|
28
|
+
@Input() uppy: Uppy<M, B> = new Uppy();
|
|
29
|
+
@Input() props: DashboardOptions<M, B> = {};
|
|
30
|
+
|
|
31
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
32
|
+
constructor(...args: unknown[]);
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ngOnInit() {
|
|
39
|
+
this.onMount(
|
|
40
|
+
{ id: "angular:Dashboard", inline: true, target: this.el.nativeElement },
|
|
41
|
+
Dashboard,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
46
|
+
this.handleChanges(changes, Dashboard);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ngOnDestroy(): void {
|
|
50
|
+
this.uninstall();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { moduleMetadata } from "@storybook/angular";
|
|
2
|
+
import { DashboardDemoComponent } from "./dashboard-demo.component";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Dashboard",
|
|
6
|
+
decorators: [
|
|
7
|
+
moduleMetadata({
|
|
8
|
+
declarations: [DashboardDemoComponent],
|
|
9
|
+
}),
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Default = () => ({
|
|
14
|
+
component: DashboardDemoComponent,
|
|
15
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
2
|
+
import { Uppy } from "@uppy/core";
|
|
3
|
+
import type * as Dashboard from "@uppy/dashboard";
|
|
4
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "uppy-dashboard-demo",
|
|
8
|
+
template: `<uppy-dashboard-modal
|
|
9
|
+
[uppy]="uppy"
|
|
10
|
+
[props]="props"
|
|
11
|
+
></uppy-dashboard-modal>`,
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
})
|
|
14
|
+
export class DashboardModalDemoComponent<M extends Meta, B extends Body> {
|
|
15
|
+
uppy: Uppy<M, B> = new Uppy({ debug: true, autoProceed: true });
|
|
16
|
+
props?: Dashboard.DashboardOptions<M, B>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, type ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { DashboardModalComponent } from "./dashboard-modal.component";
|
|
4
|
+
|
|
5
|
+
describe("DashboardComponent", () => {
|
|
6
|
+
let component: DashboardModalComponent;
|
|
7
|
+
let fixture: ComponentFixture<DashboardModalComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [DashboardModalComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(DashboardModalComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
Input,
|
|
6
|
+
inject,
|
|
7
|
+
type OnChanges,
|
|
8
|
+
type OnDestroy,
|
|
9
|
+
type SimpleChanges,
|
|
10
|
+
} from "@angular/core";
|
|
11
|
+
import { Uppy } from "@uppy/core";
|
|
12
|
+
import type { DashboardOptions } from "@uppy/dashboard";
|
|
13
|
+
import Dashboard from "@uppy/dashboard";
|
|
14
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
15
|
+
import { UppyAngularWrapper } from "../../utils/wrapper";
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: "uppy-dashboard-modal",
|
|
19
|
+
template: "",
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
})
|
|
22
|
+
export class DashboardModalComponent<M extends Meta, B extends Body>
|
|
23
|
+
extends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>>
|
|
24
|
+
implements OnDestroy, OnChanges
|
|
25
|
+
{
|
|
26
|
+
el = inject(ElementRef);
|
|
27
|
+
|
|
28
|
+
@Input() uppy: Uppy<M, B> = new Uppy();
|
|
29
|
+
@Input() props: DashboardOptions<M, B> = {};
|
|
30
|
+
@Input() open: boolean = false;
|
|
31
|
+
|
|
32
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
33
|
+
constructor(...args: unknown[]);
|
|
34
|
+
|
|
35
|
+
constructor() {
|
|
36
|
+
super();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
ngOnInit() {
|
|
40
|
+
this.onMount(
|
|
41
|
+
{
|
|
42
|
+
id: "angular:DashboardModal",
|
|
43
|
+
inline: false,
|
|
44
|
+
target: this.el.nativeElement,
|
|
45
|
+
},
|
|
46
|
+
Dashboard,
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
51
|
+
this.handleChanges(changes, Dashboard);
|
|
52
|
+
// Handle dashboard-modal specific changes
|
|
53
|
+
if (changes["open"] && this.open !== changes["open"].previousValue) {
|
|
54
|
+
if (this.open && !changes["open"].previousValue) {
|
|
55
|
+
this.plugin!.openModal();
|
|
56
|
+
}
|
|
57
|
+
if (!this.open && changes["open"].previousValue) {
|
|
58
|
+
this.plugin!.closeModal();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
ngOnDestroy(): void {
|
|
64
|
+
this.uninstall();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { moduleMetadata } from "@storybook/angular";
|
|
2
|
+
import { DashboardModalDemoComponent } from "./dashboard-modal-demo.component";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Dashboard",
|
|
6
|
+
decorators: [
|
|
7
|
+
moduleMetadata({
|
|
8
|
+
declarations: [DashboardModalDemoComponent],
|
|
9
|
+
}),
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Default = () => ({
|
|
14
|
+
component: DashboardModalDemoComponent,
|
|
15
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component } from "@angular/core";
|
|
2
|
+
import { Uppy } from "@uppy/core";
|
|
3
|
+
import type * as DragDrop from "@uppy/drag-drop";
|
|
4
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
5
|
+
|
|
6
|
+
@Component({
|
|
7
|
+
selector: "uppy-drag-drop-demo",
|
|
8
|
+
template: ` <uppy-drag-drop [uppy]="uppy" [props]="props"></uppy-drag-drop> `,
|
|
9
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
10
|
+
})
|
|
11
|
+
export class DragDropDemoComponent<M extends Meta, B extends Body> {
|
|
12
|
+
uppy: Uppy<M, B> = new Uppy({ debug: true, autoProceed: true });
|
|
13
|
+
props: DragDrop.DragDropOptions = {};
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, type ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { DragDropComponent } from "./drag-drop.component";
|
|
4
|
+
|
|
5
|
+
describe("DragDropComponent", () => {
|
|
6
|
+
let component: DragDropComponent;
|
|
7
|
+
let fixture: ComponentFixture<DragDropComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [DragDropComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(DragDropComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
Input,
|
|
6
|
+
inject,
|
|
7
|
+
type OnChanges,
|
|
8
|
+
type OnDestroy,
|
|
9
|
+
type SimpleChanges,
|
|
10
|
+
} from "@angular/core";
|
|
11
|
+
import { Uppy } from "@uppy/core";
|
|
12
|
+
import type { DragDropOptions } from "@uppy/drag-drop";
|
|
13
|
+
import DragDrop from "@uppy/drag-drop";
|
|
14
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
15
|
+
import { UppyAngularWrapper } from "../../utils/wrapper";
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: "uppy-drag-drop",
|
|
19
|
+
template: "",
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
})
|
|
22
|
+
export class DragDropComponent<M extends Meta, B extends Body>
|
|
23
|
+
extends UppyAngularWrapper<M, B, DragDropOptions>
|
|
24
|
+
implements OnDestroy, OnChanges
|
|
25
|
+
{
|
|
26
|
+
el = inject(ElementRef);
|
|
27
|
+
|
|
28
|
+
@Input() uppy: Uppy<M, B> = new Uppy();
|
|
29
|
+
@Input() props: DragDropOptions = {};
|
|
30
|
+
|
|
31
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
32
|
+
constructor(...args: unknown[]);
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ngOnInit() {
|
|
39
|
+
this.onMount(
|
|
40
|
+
{ id: "angular:DragDrop", target: this.el.nativeElement },
|
|
41
|
+
DragDrop,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
46
|
+
this.handleChanges(changes, DragDrop);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ngOnDestroy(): void {
|
|
50
|
+
this.uninstall();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { moduleMetadata } from "@storybook/angular";
|
|
2
|
+
import { DragDropDemoComponent } from "./drag-drop-demo.component";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Drag Drop",
|
|
6
|
+
decorators: [
|
|
7
|
+
moduleMetadata({
|
|
8
|
+
declarations: [DragDropDemoComponent],
|
|
9
|
+
}),
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Default = () => ({
|
|
14
|
+
component: DragDropDemoComponent,
|
|
15
|
+
});
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
ChangeDetectorRef,
|
|
4
|
+
Component,
|
|
5
|
+
inject,
|
|
6
|
+
type OnInit,
|
|
7
|
+
} from "@angular/core";
|
|
8
|
+
import { Uppy } from "@uppy/core";
|
|
9
|
+
import type { ProgressBarOptions } from "@uppy/progress-bar";
|
|
10
|
+
import Tus from "@uppy/tus";
|
|
11
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: "uppy-progress-bar-demo",
|
|
15
|
+
template: `
|
|
16
|
+
<section class="example-one">
|
|
17
|
+
<h5>autoProceed is on</h5>
|
|
18
|
+
|
|
19
|
+
<!-- Target DOM node #1 -->
|
|
20
|
+
<uppy-drag-drop [uppy]="uppyOne"></uppy-drag-drop>
|
|
21
|
+
|
|
22
|
+
<!-- Progress bar #1 -->
|
|
23
|
+
<uppy-progress-bar [uppy]="uppyOne" [props]="props"></uppy-progress-bar>
|
|
24
|
+
|
|
25
|
+
<!-- Uploaded files list #1 -->
|
|
26
|
+
<div class="uploaded-files" *ngIf="fileListOne?.length">
|
|
27
|
+
<h5>Uploaded files:</h5>
|
|
28
|
+
<ol>
|
|
29
|
+
<li *ngFor="let item of fileListOne">
|
|
30
|
+
<a [href]="item.url" target="_blank"> {{ item.fileName }}</a>
|
|
31
|
+
</li>
|
|
32
|
+
</ol>
|
|
33
|
+
</div>
|
|
34
|
+
</section>
|
|
35
|
+
|
|
36
|
+
<section class="example-two">
|
|
37
|
+
<h5>autoProceed is off</h5>
|
|
38
|
+
|
|
39
|
+
<!-- Target DOM node #1 -->
|
|
40
|
+
<uppy-drag-drop [uppy]="uppyTwo"></uppy-drag-drop>
|
|
41
|
+
|
|
42
|
+
<!-- Progress bar #1 -->
|
|
43
|
+
<uppy-progress-bar [uppy]="uppyTwo" [props]="props"></uppy-progress-bar>
|
|
44
|
+
|
|
45
|
+
<button (click)="upload()" class="upload-button">Upload</button>
|
|
46
|
+
|
|
47
|
+
<!-- Uploaded files list #2 -->
|
|
48
|
+
<div class="uploaded-files" *ngIf="fileListTwo?.length">
|
|
49
|
+
<h5>Uploaded files:</h5>
|
|
50
|
+
<ol>
|
|
51
|
+
<li *ngFor="let item of fileListTwo">
|
|
52
|
+
<a [href]="item.url" target="_blank"> {{ item.fileName }}</a>
|
|
53
|
+
</li>
|
|
54
|
+
</ol>
|
|
55
|
+
</div>
|
|
56
|
+
</section>
|
|
57
|
+
`,
|
|
58
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
59
|
+
})
|
|
60
|
+
export class ProgressBarDemoComponent<M extends Meta, B extends Body>
|
|
61
|
+
implements OnInit
|
|
62
|
+
{
|
|
63
|
+
private cdr = inject(ChangeDetectorRef);
|
|
64
|
+
|
|
65
|
+
uppyOne!: Uppy<M, B>;
|
|
66
|
+
uppyTwo!: Uppy<M, B>;
|
|
67
|
+
fileListOne: { url: string; fileName: string }[] = [];
|
|
68
|
+
fileListTwo: { url: string; fileName: string }[] = [];
|
|
69
|
+
props: ProgressBarOptions = {
|
|
70
|
+
hideAfterFinish: false,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
upload(): void {
|
|
74
|
+
this.uppyTwo.upload();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
78
|
+
constructor(...args: unknown[]);
|
|
79
|
+
|
|
80
|
+
constructor() {}
|
|
81
|
+
|
|
82
|
+
updateFileList =
|
|
83
|
+
(target: string) =>
|
|
84
|
+
(file, response): void => {
|
|
85
|
+
this[target] = [
|
|
86
|
+
...this[target],
|
|
87
|
+
{ url: response.uploadURL, fileName: file.name },
|
|
88
|
+
];
|
|
89
|
+
this.cdr.markForCheck();
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
ngOnInit(): void {
|
|
93
|
+
this.uppyOne = new Uppy<M, B>({ debug: true, autoProceed: true })
|
|
94
|
+
.use(Tus, { endpoint: "https://master.tus.io/files/" })
|
|
95
|
+
.on("upload-success", this.updateFileList("fileListOne"));
|
|
96
|
+
this.uppyTwo = new Uppy<M, B>({ debug: true, autoProceed: false })
|
|
97
|
+
.use(Tus, { endpoint: "https://master.tus.io/files/" })
|
|
98
|
+
.on("upload-success", this.updateFileList("fileListTwo"));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, type ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { ProgressBarComponent } from "./progress-bar.component";
|
|
4
|
+
|
|
5
|
+
describe("ProgressBarComponent", () => {
|
|
6
|
+
let component: ProgressBarComponent;
|
|
7
|
+
let fixture: ComponentFixture<ProgressBarComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ProgressBarComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(ProgressBarComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
Input,
|
|
6
|
+
inject,
|
|
7
|
+
type OnChanges,
|
|
8
|
+
type OnDestroy,
|
|
9
|
+
type SimpleChanges,
|
|
10
|
+
} from "@angular/core";
|
|
11
|
+
import { Uppy } from "@uppy/core";
|
|
12
|
+
import type { ProgressBarOptions } from "@uppy/progress-bar";
|
|
13
|
+
import ProgressBar from "@uppy/progress-bar";
|
|
14
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
15
|
+
import { UppyAngularWrapper } from "../../utils/wrapper";
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: "uppy-progress-bar",
|
|
19
|
+
template: "",
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
})
|
|
22
|
+
export class ProgressBarComponent<M extends Meta, B extends Body>
|
|
23
|
+
extends UppyAngularWrapper<M, B, ProgressBarOptions>
|
|
24
|
+
implements OnDestroy, OnChanges
|
|
25
|
+
{
|
|
26
|
+
el = inject(ElementRef);
|
|
27
|
+
|
|
28
|
+
@Input() uppy: Uppy<M, B> = new Uppy();
|
|
29
|
+
@Input() props: ProgressBarOptions = {};
|
|
30
|
+
|
|
31
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
32
|
+
constructor(...args: unknown[]);
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ngOnInit() {
|
|
39
|
+
this.onMount(
|
|
40
|
+
{ id: "angular:ProgressBar", target: this.el.nativeElement },
|
|
41
|
+
ProgressBar,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
46
|
+
this.handleChanges(changes, ProgressBar);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ngOnDestroy(): void {
|
|
50
|
+
this.uninstall();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CommonModule } from "@angular/common";
|
|
2
|
+
import { moduleMetadata } from "@storybook/angular";
|
|
3
|
+
import { ProgressBarDemoComponent } from "./progress-bar-demo.component";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: "Progress Bar",
|
|
7
|
+
decorators: [
|
|
8
|
+
moduleMetadata({
|
|
9
|
+
imports: [CommonModule],
|
|
10
|
+
declarations: [ProgressBarDemoComponent],
|
|
11
|
+
}),
|
|
12
|
+
],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const Default = () => ({
|
|
16
|
+
component: ProgressBarDemoComponent,
|
|
17
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, type OnInit } from "@angular/core";
|
|
2
|
+
import { Uppy } from "@uppy/core";
|
|
3
|
+
import FileInput from "@uppy/file-input";
|
|
4
|
+
import type * as StatusBar from "@uppy/status-bar";
|
|
5
|
+
import Tus from "@uppy/tus";
|
|
6
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: "uppy-status-bar-demo",
|
|
10
|
+
template: `
|
|
11
|
+
<div class="UppyInput"></div>
|
|
12
|
+
<uppy-status-bar [uppy]="uppy" [props]="props"></uppy-status-bar>
|
|
13
|
+
`,
|
|
14
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
})
|
|
16
|
+
export class StatusBarDemoComponent<M extends Meta, B extends Body>
|
|
17
|
+
implements OnInit
|
|
18
|
+
{
|
|
19
|
+
uppy: Uppy<M, B> = new Uppy({ debug: true, autoProceed: true });
|
|
20
|
+
props: StatusBar.StatusBarOptions = {
|
|
21
|
+
hideUploadButton: true,
|
|
22
|
+
hideAfterFinish: false,
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
ngOnInit(): void {
|
|
26
|
+
this.uppy
|
|
27
|
+
.use(FileInput, { target: ".UppyInput", pretty: false })
|
|
28
|
+
.use(Tus, { endpoint: "https://master.tus.io/files/" });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { async, type ComponentFixture, TestBed } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { StatusBarComponent } from "./status-bar.component";
|
|
4
|
+
|
|
5
|
+
describe("StatusBarComponent", () => {
|
|
6
|
+
let component: StatusBarComponent;
|
|
7
|
+
let fixture: ComponentFixture<StatusBarComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [StatusBarComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(StatusBarComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ChangeDetectionStrategy,
|
|
3
|
+
Component,
|
|
4
|
+
ElementRef,
|
|
5
|
+
Input,
|
|
6
|
+
inject,
|
|
7
|
+
type OnChanges,
|
|
8
|
+
type OnDestroy,
|
|
9
|
+
type SimpleChanges,
|
|
10
|
+
} from "@angular/core";
|
|
11
|
+
import { Uppy } from "@uppy/core";
|
|
12
|
+
import type { StatusBarOptions } from "@uppy/status-bar";
|
|
13
|
+
import StatusBar from "@uppy/status-bar";
|
|
14
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
15
|
+
import { UppyAngularWrapper } from "../../utils/wrapper";
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: "uppy-status-bar",
|
|
19
|
+
template: "",
|
|
20
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
21
|
+
})
|
|
22
|
+
export class StatusBarComponent<M extends Meta, B extends Body>
|
|
23
|
+
extends UppyAngularWrapper<M, B, StatusBarOptions>
|
|
24
|
+
implements OnDestroy, OnChanges
|
|
25
|
+
{
|
|
26
|
+
el = inject(ElementRef);
|
|
27
|
+
|
|
28
|
+
@Input() uppy: Uppy<M, B> = new Uppy();
|
|
29
|
+
@Input() props: StatusBarOptions = {};
|
|
30
|
+
|
|
31
|
+
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
32
|
+
constructor(...args: unknown[]);
|
|
33
|
+
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
ngOnInit() {
|
|
39
|
+
this.onMount(
|
|
40
|
+
{ id: "angular:StatusBar", target: this.el.nativeElement },
|
|
41
|
+
StatusBar,
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
46
|
+
this.handleChanges(changes, StatusBar);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
ngOnDestroy(): void {
|
|
50
|
+
this.uninstall();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { moduleMetadata } from "@storybook/angular";
|
|
2
|
+
import { StatusBarDemoComponent } from "./status-bar-demo.component";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Status Bar",
|
|
6
|
+
decorators: [
|
|
7
|
+
moduleMetadata({
|
|
8
|
+
declarations: [StatusBarDemoComponent],
|
|
9
|
+
}),
|
|
10
|
+
],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const Default = () => ({
|
|
14
|
+
component: StatusBarDemoComponent,
|
|
15
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { ElementRef, SimpleChanges } from "@angular/core";
|
|
2
|
+
import type { UIPlugin, UIPluginOptions, Uppy } from "@uppy/core";
|
|
3
|
+
import type { DragDropOptions } from "@uppy/drag-drop";
|
|
4
|
+
import type { ProgressBarOptions } from "@uppy/progress-bar";
|
|
5
|
+
import type { StatusBarOptions } from "@uppy/status-bar";
|
|
6
|
+
import type { Body, Meta } from "@uppy/utils/lib/UppyFile";
|
|
7
|
+
|
|
8
|
+
export abstract class UppyAngularWrapper<
|
|
9
|
+
M extends Meta,
|
|
10
|
+
B extends Body,
|
|
11
|
+
Opts extends UIPluginOptions,
|
|
12
|
+
PluginType extends UIPlugin<Opts, M, B> = UIPlugin<Opts, M, B>,
|
|
13
|
+
> {
|
|
14
|
+
abstract props: DragDropOptions | StatusBarOptions | ProgressBarOptions;
|
|
15
|
+
abstract el: ElementRef;
|
|
16
|
+
abstract uppy: Uppy<M, B>;
|
|
17
|
+
private options: any;
|
|
18
|
+
plugin: PluginType | undefined;
|
|
19
|
+
|
|
20
|
+
onMount(
|
|
21
|
+
defaultOptions: Partial<Opts>,
|
|
22
|
+
plugin: new (uppy: any, opts?: Opts) => UIPlugin<Opts, M, B>,
|
|
23
|
+
) {
|
|
24
|
+
this.options = {
|
|
25
|
+
...defaultOptions,
|
|
26
|
+
...this.props,
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
this.uppy.use(plugin, this.options);
|
|
30
|
+
this.plugin = this.uppy.getPlugin(this.options.id) as PluginType;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
handleChanges(changes: SimpleChanges, plugin: any): void {
|
|
34
|
+
// Without the last part of this conditional, it tries to uninstall before the plugin is mounted
|
|
35
|
+
if (
|
|
36
|
+
changes["uppy"] &&
|
|
37
|
+
this.uppy !== changes["uppy"].previousValue &&
|
|
38
|
+
changes["uppy"].previousValue !== undefined
|
|
39
|
+
) {
|
|
40
|
+
this.uninstall(changes["uppy"].previousValue);
|
|
41
|
+
// @ts-expect-error The options correspond to the plugin, I swear
|
|
42
|
+
this.uppy.use(plugin, this.options);
|
|
43
|
+
}
|
|
44
|
+
this.options = { ...this.options, ...this.props };
|
|
45
|
+
this.plugin = this.uppy.getPlugin(this.options.id) as PluginType;
|
|
46
|
+
if (
|
|
47
|
+
changes["props"] &&
|
|
48
|
+
this.props !== changes["props"].previousValue &&
|
|
49
|
+
changes["props"].previousValue !== undefined
|
|
50
|
+
) {
|
|
51
|
+
this.plugin.setOptions({ ...this.options });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
uninstall(uppy = this.uppy): void {
|
|
56
|
+
uppy.removePlugin(this.plugin!);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export {
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface of @uppy/angular
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export { DashboardComponent } from './lib/components/dashboard/dashboard.component'
|
|
6
|
+
export { DashboardModalComponent } from './lib/components/dashboard-modal/dashboard-modal.component'
|
|
7
|
+
export { DragDropComponent } from './lib/components/drag-drop/drag-drop.component'
|
|
8
|
+
export { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component'
|
|
9
|
+
export { StatusBarComponent } from './lib/components/status-bar/status-bar.component'
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* To learn more about this file see: https://angular.io/config/tsconfig. */
|
|
2
|
+
{
|
|
3
|
+
"extends": "../../../tsconfig.json",
|
|
4
|
+
"compilerOptions": {
|
|
5
|
+
"outDir": "../../../out-tsc/lib",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"types": []
|
|
10
|
+
},
|
|
11
|
+
"exclude": ["**/*.spec.ts"]
|
|
12
|
+
}
|
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, ElementRef, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { Uppy } from '@uppy/core';
|
|
4
|
-
import StatusBar from '@uppy/status-bar';
|
|
5
|
-
import ProgressBar from '@uppy/progress-bar';
|
|
6
|
-
import DragDrop from '@uppy/drag-drop';
|
|
7
|
-
import Dashboard from '@uppy/dashboard';
|
|
8
|
-
|
|
9
|
-
class UppyAngularWrapper {
|
|
10
|
-
onMount(defaultOptions, plugin) {
|
|
11
|
-
this.options = {
|
|
12
|
-
...defaultOptions,
|
|
13
|
-
...this.props,
|
|
14
|
-
};
|
|
15
|
-
this.uppy.use(plugin, this.options);
|
|
16
|
-
this.plugin = this.uppy.getPlugin(this.options.id);
|
|
17
|
-
}
|
|
18
|
-
handleChanges(changes, plugin) {
|
|
19
|
-
// Without the last part of this conditional, it tries to uninstall before the plugin is mounted
|
|
20
|
-
if (changes['uppy'] &&
|
|
21
|
-
this.uppy !== changes['uppy'].previousValue &&
|
|
22
|
-
changes['uppy'].previousValue !== undefined) {
|
|
23
|
-
this.uninstall(changes['uppy'].previousValue);
|
|
24
|
-
// @ts-expect-error The options correspond to the plugin, I swear
|
|
25
|
-
this.uppy.use(plugin, this.options);
|
|
26
|
-
}
|
|
27
|
-
this.options = { ...this.options, ...this.props };
|
|
28
|
-
this.plugin = this.uppy.getPlugin(this.options.id);
|
|
29
|
-
if (changes['props'] &&
|
|
30
|
-
this.props !== changes['props'].previousValue &&
|
|
31
|
-
changes['props'].previousValue !== undefined) {
|
|
32
|
-
this.plugin.setOptions({ ...this.options });
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
uninstall(uppy = this.uppy) {
|
|
36
|
-
uppy.removePlugin(this.plugin);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
class StatusBarComponent extends UppyAngularWrapper {
|
|
41
|
-
constructor() {
|
|
42
|
-
super();
|
|
43
|
-
this.el = inject(ElementRef);
|
|
44
|
-
this.uppy = new Uppy();
|
|
45
|
-
this.props = {};
|
|
46
|
-
}
|
|
47
|
-
ngOnInit() {
|
|
48
|
-
this.onMount({ id: 'angular:StatusBar', target: this.el.nativeElement }, StatusBar);
|
|
49
|
-
}
|
|
50
|
-
ngOnChanges(changes) {
|
|
51
|
-
this.handleChanges(changes, StatusBar);
|
|
52
|
-
}
|
|
53
|
-
ngOnDestroy() {
|
|
54
|
-
this.uninstall();
|
|
55
|
-
}
|
|
56
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: StatusBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
57
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: StatusBarComponent, isStandalone: true, selector: "uppy-status-bar", inputs: { uppy: "uppy", props: "props" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
58
|
-
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: StatusBarComponent, decorators: [{
|
|
60
|
-
type: Component,
|
|
61
|
-
args: [{
|
|
62
|
-
selector: 'uppy-status-bar',
|
|
63
|
-
template: '',
|
|
64
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
65
|
-
}]
|
|
66
|
-
}], ctorParameters: () => [], propDecorators: { uppy: [{
|
|
67
|
-
type: Input
|
|
68
|
-
}], props: [{
|
|
69
|
-
type: Input
|
|
70
|
-
}] } });
|
|
71
|
-
|
|
72
|
-
class ProgressBarComponent extends UppyAngularWrapper {
|
|
73
|
-
constructor() {
|
|
74
|
-
super();
|
|
75
|
-
this.el = inject(ElementRef);
|
|
76
|
-
this.uppy = new Uppy();
|
|
77
|
-
this.props = {};
|
|
78
|
-
}
|
|
79
|
-
ngOnInit() {
|
|
80
|
-
this.onMount({ id: 'angular:ProgressBar', target: this.el.nativeElement }, ProgressBar);
|
|
81
|
-
}
|
|
82
|
-
ngOnChanges(changes) {
|
|
83
|
-
this.handleChanges(changes, ProgressBar);
|
|
84
|
-
}
|
|
85
|
-
ngOnDestroy() {
|
|
86
|
-
this.uninstall();
|
|
87
|
-
}
|
|
88
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ProgressBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
89
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: ProgressBarComponent, isStandalone: true, selector: "uppy-progress-bar", inputs: { uppy: "uppy", props: "props" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
90
|
-
}
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ProgressBarComponent, decorators: [{
|
|
92
|
-
type: Component,
|
|
93
|
-
args: [{
|
|
94
|
-
selector: 'uppy-progress-bar',
|
|
95
|
-
template: '',
|
|
96
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
97
|
-
}]
|
|
98
|
-
}], ctorParameters: () => [], propDecorators: { uppy: [{
|
|
99
|
-
type: Input
|
|
100
|
-
}], props: [{
|
|
101
|
-
type: Input
|
|
102
|
-
}] } });
|
|
103
|
-
|
|
104
|
-
class DragDropComponent extends UppyAngularWrapper {
|
|
105
|
-
constructor() {
|
|
106
|
-
super();
|
|
107
|
-
this.el = inject(ElementRef);
|
|
108
|
-
this.uppy = new Uppy();
|
|
109
|
-
this.props = {};
|
|
110
|
-
}
|
|
111
|
-
ngOnInit() {
|
|
112
|
-
this.onMount({ id: 'angular:DragDrop', target: this.el.nativeElement }, DragDrop);
|
|
113
|
-
}
|
|
114
|
-
ngOnChanges(changes) {
|
|
115
|
-
this.handleChanges(changes, DragDrop);
|
|
116
|
-
}
|
|
117
|
-
ngOnDestroy() {
|
|
118
|
-
this.uninstall();
|
|
119
|
-
}
|
|
120
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DragDropComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
121
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DragDropComponent, isStandalone: true, selector: "uppy-drag-drop", inputs: { uppy: "uppy", props: "props" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
122
|
-
}
|
|
123
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DragDropComponent, decorators: [{
|
|
124
|
-
type: Component,
|
|
125
|
-
args: [{
|
|
126
|
-
selector: 'uppy-drag-drop',
|
|
127
|
-
template: '',
|
|
128
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
129
|
-
}]
|
|
130
|
-
}], ctorParameters: () => [], propDecorators: { uppy: [{
|
|
131
|
-
type: Input
|
|
132
|
-
}], props: [{
|
|
133
|
-
type: Input
|
|
134
|
-
}] } });
|
|
135
|
-
|
|
136
|
-
class DashboardComponent extends UppyAngularWrapper {
|
|
137
|
-
constructor() {
|
|
138
|
-
super();
|
|
139
|
-
this.el = inject(ElementRef);
|
|
140
|
-
this.uppy = new Uppy();
|
|
141
|
-
this.props = {};
|
|
142
|
-
}
|
|
143
|
-
ngOnInit() {
|
|
144
|
-
this.onMount({ id: 'angular:Dashboard', inline: true, target: this.el.nativeElement }, Dashboard);
|
|
145
|
-
}
|
|
146
|
-
ngOnChanges(changes) {
|
|
147
|
-
this.handleChanges(changes, Dashboard);
|
|
148
|
-
}
|
|
149
|
-
ngOnDestroy() {
|
|
150
|
-
this.uninstall();
|
|
151
|
-
}
|
|
152
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
153
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DashboardComponent, isStandalone: true, selector: "uppy-dashboard", inputs: { uppy: "uppy", props: "props" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
154
|
-
}
|
|
155
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DashboardComponent, decorators: [{
|
|
156
|
-
type: Component,
|
|
157
|
-
args: [{
|
|
158
|
-
selector: 'uppy-dashboard',
|
|
159
|
-
template: '',
|
|
160
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
161
|
-
}]
|
|
162
|
-
}], ctorParameters: () => [], propDecorators: { uppy: [{
|
|
163
|
-
type: Input
|
|
164
|
-
}], props: [{
|
|
165
|
-
type: Input
|
|
166
|
-
}] } });
|
|
167
|
-
|
|
168
|
-
class DashboardModalComponent extends UppyAngularWrapper {
|
|
169
|
-
constructor() {
|
|
170
|
-
super();
|
|
171
|
-
this.el = inject(ElementRef);
|
|
172
|
-
this.uppy = new Uppy();
|
|
173
|
-
this.props = {};
|
|
174
|
-
this.open = false;
|
|
175
|
-
}
|
|
176
|
-
ngOnInit() {
|
|
177
|
-
this.onMount({
|
|
178
|
-
id: 'angular:DashboardModal',
|
|
179
|
-
inline: false,
|
|
180
|
-
target: this.el.nativeElement,
|
|
181
|
-
}, Dashboard);
|
|
182
|
-
}
|
|
183
|
-
ngOnChanges(changes) {
|
|
184
|
-
this.handleChanges(changes, Dashboard);
|
|
185
|
-
// Handle dashboard-modal specific changes
|
|
186
|
-
if (changes['open'] && this.open !== changes['open'].previousValue) {
|
|
187
|
-
if (this.open && !changes['open'].previousValue) {
|
|
188
|
-
this.plugin.openModal();
|
|
189
|
-
}
|
|
190
|
-
if (!this.open && changes['open'].previousValue) {
|
|
191
|
-
this.plugin.closeModal();
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
ngOnDestroy() {
|
|
196
|
-
this.uninstall();
|
|
197
|
-
}
|
|
198
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DashboardModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
199
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DashboardModalComponent, isStandalone: true, selector: "uppy-dashboard-modal", inputs: { uppy: "uppy", props: "props", open: "open" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
200
|
-
}
|
|
201
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DashboardModalComponent, decorators: [{
|
|
202
|
-
type: Component,
|
|
203
|
-
args: [{
|
|
204
|
-
selector: 'uppy-dashboard-modal',
|
|
205
|
-
template: '',
|
|
206
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
207
|
-
}]
|
|
208
|
-
}], ctorParameters: () => [], propDecorators: { uppy: [{
|
|
209
|
-
type: Input
|
|
210
|
-
}], props: [{
|
|
211
|
-
type: Input
|
|
212
|
-
}], open: [{
|
|
213
|
-
type: Input
|
|
214
|
-
}] } });
|
|
215
|
-
|
|
216
|
-
/*
|
|
217
|
-
* Public API Surface of @uppy/angular
|
|
218
|
-
*/
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Generated bundle index. Do not edit.
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
|
-
export { DashboardComponent, DashboardModalComponent, DragDropComponent, ProgressBarComponent, StatusBarComponent };
|
|
225
|
-
//# sourceMappingURL=uppy-angular.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uppy-angular.mjs","sources":["../../../../projects/uppy/angular/src/lib/utils/wrapper.ts","../../../../projects/uppy/angular/src/lib/components/status-bar/status-bar.component.ts","../../../../projects/uppy/angular/src/lib/components/progress-bar/progress-bar.component.ts","../../../../projects/uppy/angular/src/lib/components/drag-drop/drag-drop.component.ts","../../../../projects/uppy/angular/src/lib/components/dashboard/dashboard.component.ts","../../../../projects/uppy/angular/src/lib/components/dashboard-modal/dashboard-modal.component.ts","../../../../projects/uppy/angular/src/public-api.ts","../../../../projects/uppy/angular/src/uppy-angular.ts"],"sourcesContent":["import type { Uppy, UIPlugin, UIPluginOptions } from '@uppy/core';\nimport type { ElementRef, SimpleChanges } from '@angular/core';\nimport type { DragDropOptions } from '@uppy/drag-drop';\nimport type { StatusBarOptions } from '@uppy/status-bar';\nimport type { ProgressBarOptions } from '@uppy/progress-bar';\nimport { Body, Meta } from '@uppy/utils/lib/UppyFile';\n\nexport abstract class UppyAngularWrapper<\n M extends Meta,\n B extends Body,\n Opts extends UIPluginOptions,\n PluginType extends UIPlugin<Opts, M, B> = UIPlugin<Opts, M, B>,\n> {\n abstract props: DragDropOptions | StatusBarOptions | ProgressBarOptions;\n abstract el: ElementRef;\n abstract uppy: Uppy<M, B>;\n private options: any;\n plugin: PluginType | undefined;\n\n onMount(\n defaultOptions: Partial<Opts>,\n plugin: new (uppy: any, opts?: Opts) => UIPlugin<Opts, M, B>,\n ) {\n this.options = {\n ...defaultOptions,\n ...this.props,\n };\n\n this.uppy.use(plugin, this.options);\n this.plugin = this.uppy.getPlugin(this.options.id) as PluginType;\n }\n\n handleChanges(changes: SimpleChanges, plugin: any): void {\n // Without the last part of this conditional, it tries to uninstall before the plugin is mounted\n if (\n changes['uppy'] &&\n this.uppy !== changes['uppy'].previousValue &&\n changes['uppy'].previousValue !== undefined\n ) {\n this.uninstall(changes['uppy'].previousValue);\n // @ts-expect-error The options correspond to the plugin, I swear\n this.uppy.use(plugin, this.options);\n }\n this.options = { ...this.options, ...this.props };\n this.plugin = this.uppy.getPlugin(this.options.id) as PluginType;\n if (\n changes['props'] &&\n this.props !== changes['props'].previousValue &&\n changes['props'].previousValue !== undefined\n ) {\n this.plugin.setOptions({ ...this.options });\n }\n }\n\n uninstall(uppy = this.uppy): void {\n uppy.removePlugin(this.plugin!);\n }\n}\n","import { Component, ChangeDetectionStrategy, Input, ElementRef, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';\nimport { Uppy } from '@uppy/core';\nimport StatusBar from '@uppy/status-bar';\nimport type { StatusBarOptions } from '@uppy/status-bar';\nimport { Body, Meta } from '@uppy/utils/lib/UppyFile';\nimport { UppyAngularWrapper } from '../../utils/wrapper';\n\n@Component({\n selector: 'uppy-status-bar',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class StatusBarComponent<M extends Meta, B extends Body>\n extends UppyAngularWrapper<M, B, StatusBarOptions>\n implements OnDestroy, OnChanges\n{\n el = inject(ElementRef);\n\n @Input() uppy: Uppy<M, B> = new Uppy();\n @Input() props: StatusBarOptions = {};\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.onMount(\n { id: 'angular:StatusBar', target: this.el.nativeElement },\n StatusBar,\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.handleChanges(changes, StatusBar);\n }\n\n ngOnDestroy(): void {\n this.uninstall();\n }\n}\n","import { Component, ChangeDetectionStrategy, ElementRef, Input, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';\nimport { Uppy } from '@uppy/core';\nimport ProgressBar from '@uppy/progress-bar';\nimport type { ProgressBarOptions } from '@uppy/progress-bar';\nimport { Body, Meta } from '@uppy/utils/lib/UppyFile';\nimport { UppyAngularWrapper } from '../../utils/wrapper';\n\n@Component({\n selector: 'uppy-progress-bar',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ProgressBarComponent<M extends Meta, B extends Body>\n extends UppyAngularWrapper<M, B, ProgressBarOptions>\n implements OnDestroy, OnChanges\n{\n el = inject(ElementRef);\n\n @Input() uppy: Uppy<M, B> = new Uppy();\n @Input() props: ProgressBarOptions = {};\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.onMount(\n { id: 'angular:ProgressBar', target: this.el.nativeElement },\n ProgressBar,\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.handleChanges(changes, ProgressBar);\n }\n\n ngOnDestroy(): void {\n this.uninstall();\n }\n}\n","import { Component, ChangeDetectionStrategy, Input, OnDestroy, OnChanges, SimpleChanges, ElementRef, inject } from '@angular/core';\nimport { Uppy } from '@uppy/core';\nimport DragDrop from '@uppy/drag-drop';\nimport type { DragDropOptions } from '@uppy/drag-drop';\nimport { Body, Meta } from '@uppy/utils/lib/UppyFile';\nimport { UppyAngularWrapper } from '../../utils/wrapper';\n\n@Component({\n selector: 'uppy-drag-drop',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DragDropComponent<M extends Meta, B extends Body>\n extends UppyAngularWrapper<M, B, DragDropOptions>\n implements OnDestroy, OnChanges\n{\n el = inject(ElementRef);\n\n @Input() uppy: Uppy<M, B> = new Uppy();\n @Input() props: DragDropOptions = {};\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.onMount(\n { id: 'angular:DragDrop', target: this.el.nativeElement },\n DragDrop,\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.handleChanges(changes, DragDrop);\n }\n\n ngOnDestroy(): void {\n this.uninstall();\n }\n}\n","import { Component, ChangeDetectionStrategy, ElementRef, Input, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';\nimport Dashboard from '@uppy/dashboard';\nimport type { DashboardOptions } from '@uppy/dashboard';\nimport { Uppy } from '@uppy/core';\nimport { UppyAngularWrapper } from '../../utils/wrapper';\nimport { Body, Meta } from '@uppy/utils/lib/UppyFile';\n\n@Component({\n selector: 'uppy-dashboard',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DashboardComponent<M extends Meta, B extends Body>\n extends UppyAngularWrapper<M, B, DashboardOptions<M,B>>\n implements OnDestroy, OnChanges\n{\n el = inject(ElementRef);\n\n @Input() uppy: Uppy<M, B> = new Uppy();\n @Input() props: DashboardOptions<M, B> = {};\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.onMount(\n { id: 'angular:Dashboard', inline: true, target: this.el.nativeElement },\n Dashboard,\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.handleChanges(changes, Dashboard);\n }\n\n ngOnDestroy(): void {\n this.uninstall();\n }\n}\n","import { Component, ChangeDetectionStrategy, ElementRef, Input, OnDestroy, OnChanges, SimpleChanges, inject } from '@angular/core';\nimport Dashboard from '@uppy/dashboard';\nimport type { DashboardOptions } from '@uppy/dashboard';\nimport { Uppy } from '@uppy/core';\nimport { UppyAngularWrapper } from '../../utils/wrapper';\nimport { Body, Meta } from '@uppy/utils/lib/UppyFile';\n\n@Component({\n selector: 'uppy-dashboard-modal',\n template: '',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DashboardModalComponent<M extends Meta, B extends Body>\n extends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>>\n implements OnDestroy, OnChanges\n{\n el = inject(ElementRef);\n\n @Input() uppy: Uppy<M, B> = new Uppy();\n @Input() props: DashboardOptions<M, B> = {};\n @Input() open: boolean = false;\n\n /** Inserted by Angular inject() migration for backwards compatibility */\n constructor(...args: unknown[]);\n\n constructor() {\n super();\n }\n\n ngOnInit() {\n this.onMount(\n {\n id: 'angular:DashboardModal',\n inline: false,\n target: this.el.nativeElement,\n },\n Dashboard,\n );\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n this.handleChanges(changes, Dashboard);\n // Handle dashboard-modal specific changes\n if (changes['open'] && this.open !== changes['open'].previousValue) {\n if (this.open && !changes['open'].previousValue) {\n this.plugin!.openModal();\n }\n if (!this.open && changes['open'].previousValue) {\n this.plugin!.closeModal();\n }\n }\n }\n\n ngOnDestroy(): void {\n this.uninstall();\n }\n}\n","/*\n * Public API Surface of @uppy/angular\n */\n\nexport { StatusBarComponent } from './lib/components/status-bar/status-bar.component';\nexport { ProgressBarComponent } from './lib/components/progress-bar/progress-bar.component';\nexport { DragDropComponent } from './lib/components/drag-drop/drag-drop.component';\nexport { DashboardComponent } from './lib/components/dashboard/dashboard.component';\nexport { DashboardModalComponent } from './lib/components/dashboard-modal/dashboard-modal.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;MAOsB,kBAAkB,CAAA;IAYtC,OAAO,CACL,cAA6B,EAC7B,MAA4D,EAAA;QAE5D,IAAI,CAAC,OAAO,GAAG;AACb,YAAA,GAAG,cAAc;YACjB,GAAG,IAAI,CAAC,KAAK;SACd;QAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC;AACnC,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAe;;IAGlE,aAAa,CAAC,OAAsB,EAAE,MAAW,EAAA;;QAE/C,IACE,OAAO,CAAC,MAAM,CAAC;YACf,IAAI,CAAC,IAAI,KAAK,O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} from '@uppy/dashboard';
|
|
3
|
-
import { Uppy } from '@uppy/core';
|
|
4
|
-
import { UppyAngularWrapper } from '../../utils/wrapper';
|
|
5
|
-
import { Body, Meta } from '@uppy/utils/lib/UppyFile';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class DashboardComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, DashboardOptions<M, B>> implements OnDestroy, OnChanges {
|
|
8
|
-
el: ElementRef<any>;
|
|
9
|
-
uppy: Uppy<M, B>;
|
|
10
|
-
props: DashboardOptions<M, B>;
|
|
11
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
12
|
-
constructor(...args: unknown[]);
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
-
ngOnDestroy(): void;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DashboardComponent<any, any>, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DashboardComponent<any, any>, "uppy-dashboard", never, { "uppy": { "alias": "uppy"; "required": false; }; "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
18
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ElementRef, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import Dashboard from '@uppy/dashboard';
|
|
3
|
-
import type { DashboardOptions } from '@uppy/dashboard';
|
|
4
|
-
import { Uppy } from '@uppy/core';
|
|
5
|
-
import { UppyAngularWrapper } from '../../utils/wrapper';
|
|
6
|
-
import { Body, Meta } from '@uppy/utils/lib/UppyFile';
|
|
7
|
-
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class DashboardModalComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>> implements OnDestroy, OnChanges {
|
|
9
|
-
el: ElementRef<any>;
|
|
10
|
-
uppy: Uppy<M, B>;
|
|
11
|
-
props: DashboardOptions<M, B>;
|
|
12
|
-
open: boolean;
|
|
13
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
14
|
-
constructor(...args: unknown[]);
|
|
15
|
-
ngOnInit(): void;
|
|
16
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
17
|
-
ngOnDestroy(): void;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DashboardModalComponent<any, any>, never>;
|
|
19
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DashboardModalComponent<any, any>, "uppy-dashboard-modal", never, { "uppy": { "alias": "uppy"; "required": false; }; "props": { "alias": "props"; "required": false; }; "open": { "alias": "open"; "required": false; }; }, {}, never, never, true, never>;
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { OnDestroy, OnChanges, SimpleChanges, ElementRef } from '@angular/core';
|
|
2
|
-
import { Uppy } from '@uppy/core';
|
|
3
|
-
import type { DragDropOptions } from '@uppy/drag-drop';
|
|
4
|
-
import { Body, Meta } from '@uppy/utils/lib/UppyFile';
|
|
5
|
-
import { UppyAngularWrapper } from '../../utils/wrapper';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class DragDropComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, DragDropOptions> implements OnDestroy, OnChanges {
|
|
8
|
-
el: ElementRef<any>;
|
|
9
|
-
uppy: Uppy<M, B>;
|
|
10
|
-
props: DragDropOptions;
|
|
11
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
12
|
-
constructor(...args: unknown[]);
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
-
ngOnDestroy(): void;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DragDropComponent<any, any>, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DragDropComponent<any, any>, "uppy-drag-drop", never, { "uppy": { "alias": "uppy"; "required": false; }; "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ElementRef, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { Uppy } from '@uppy/core';
|
|
3
|
-
import type { ProgressBarOptions } from '@uppy/progress-bar';
|
|
4
|
-
import { Body, Meta } from '@uppy/utils/lib/UppyFile';
|
|
5
|
-
import { UppyAngularWrapper } from '../../utils/wrapper';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class ProgressBarComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, ProgressBarOptions> implements OnDestroy, OnChanges {
|
|
8
|
-
el: ElementRef<any>;
|
|
9
|
-
uppy: Uppy<M, B>;
|
|
10
|
-
props: ProgressBarOptions;
|
|
11
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
12
|
-
constructor(...args: unknown[]);
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
-
ngOnDestroy(): void;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ProgressBarComponent<any, any>, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ProgressBarComponent<any, any>, "uppy-progress-bar", never, { "uppy": { "alias": "uppy"; "required": false; }; "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { ElementRef, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
|
|
2
|
-
import { Uppy } from '@uppy/core';
|
|
3
|
-
import type { StatusBarOptions } from '@uppy/status-bar';
|
|
4
|
-
import { Body, Meta } from '@uppy/utils/lib/UppyFile';
|
|
5
|
-
import { UppyAngularWrapper } from '../../utils/wrapper';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class StatusBarComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, StatusBarOptions> implements OnDestroy, OnChanges {
|
|
8
|
-
el: ElementRef<any>;
|
|
9
|
-
uppy: Uppy<M, B>;
|
|
10
|
-
props: StatusBarOptions;
|
|
11
|
-
/** Inserted by Angular inject() migration for backwards compatibility */
|
|
12
|
-
constructor(...args: unknown[]);
|
|
13
|
-
ngOnInit(): void;
|
|
14
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
15
|
-
ngOnDestroy(): void;
|
|
16
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<StatusBarComponent<any, any>, never>;
|
|
17
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<StatusBarComponent<any, any>, "uppy-status-bar", never, { "uppy": { "alias": "uppy"; "required": false; }; "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
|
|
18
|
-
}
|
package/lib/utils/wrapper.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Uppy, UIPlugin, UIPluginOptions } from '@uppy/core';
|
|
2
|
-
import type { ElementRef, SimpleChanges } from '@angular/core';
|
|
3
|
-
import type { DragDropOptions } from '@uppy/drag-drop';
|
|
4
|
-
import type { StatusBarOptions } from '@uppy/status-bar';
|
|
5
|
-
import type { ProgressBarOptions } from '@uppy/progress-bar';
|
|
6
|
-
import { Body, Meta } from '@uppy/utils/lib/UppyFile';
|
|
7
|
-
export declare abstract class UppyAngularWrapper<M extends Meta, B extends Body, Opts extends UIPluginOptions, PluginType extends UIPlugin<Opts, M, B> = UIPlugin<Opts, M, B>> {
|
|
8
|
-
abstract props: DragDropOptions | StatusBarOptions | ProgressBarOptions;
|
|
9
|
-
abstract el: ElementRef;
|
|
10
|
-
abstract uppy: Uppy<M, B>;
|
|
11
|
-
private options;
|
|
12
|
-
plugin: PluginType | undefined;
|
|
13
|
-
onMount(defaultOptions: Partial<Opts>, plugin: new (uppy: any, opts?: Opts) => UIPlugin<Opts, M, B>): void;
|
|
14
|
-
handleChanges(changes: SimpleChanges, plugin: any): void;
|
|
15
|
-
uninstall(uppy?: Uppy<M, B>): void;
|
|
16
|
-
}
|