@uppy/angular 2.0.0 → 2.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @uppy/angular
2
2
 
3
+ ## 2.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 29e5b45: Fix `<uppy-dashboard-modal [open]="true">` throwing `Cannot read properties of undefined (reading 'openModal')` on the first render. Angular runs `ngOnChanges` before `ngOnInit`, so the initial `open` value is now applied after the plugin is mounted.
8
+
9
+ Also keep an open `<uppy-dashboard-modal>` open when its `uppy` input is swapped for another instance; it used to close because the plugin is reinstalled on the new instance.
10
+
3
11
  ## 2.0.0
4
12
 
5
13
  ### Minor Changes
@@ -1,164 +1,244 @@
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 Dashboard from '@uppy/dashboard';
5
- import StatusBar from '@uppy/status-bar';
6
-
7
- class UppyAngularWrapper {
8
- options;
9
- plugin;
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 DashboardComponent extends UppyAngularWrapper {
41
- el = inject(ElementRef);
42
- uppy = new Uppy();
43
- props = {};
44
- constructor() {
45
- super();
46
- }
47
- ngOnInit() {
48
- this.onMount({ id: "angular:Dashboard", inline: true, target: this.el.nativeElement }, Dashboard);
49
- }
50
- ngOnChanges(changes) {
51
- this.handleChanges(changes, Dashboard);
52
- }
53
- ngOnDestroy() {
54
- this.uninstall();
55
- }
56
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: DashboardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
57
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", 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 });
58
- }
59
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: DashboardComponent, decorators: [{
60
- type: Component,
61
- args: [{
62
- selector: "uppy-dashboard",
63
- template: "",
64
- changeDetection: ChangeDetectionStrategy.OnPush,
65
- standalone: true,
66
- }]
67
- }], ctorParameters: () => [], propDecorators: { uppy: [{
68
- type: Input
69
- }], props: [{
70
- type: Input
71
- }] } });
72
-
73
- class DashboardModalComponent extends UppyAngularWrapper {
74
- el = inject(ElementRef);
75
- uppy = new Uppy();
76
- props = {};
77
- open = false;
78
- constructor() {
79
- super();
80
- }
81
- ngOnInit() {
82
- this.onMount({
83
- id: "angular:DashboardModal",
84
- inline: false,
85
- target: this.el.nativeElement,
86
- }, Dashboard);
87
- }
88
- ngOnChanges(changes) {
89
- this.handleChanges(changes, Dashboard);
90
- // Handle dashboard-modal specific changes
91
- if (changes["open"] && this.open !== changes["open"].previousValue) {
92
- if (this.open && !changes["open"].previousValue) {
93
- this.plugin.openModal();
94
- }
95
- if (!this.open && changes["open"].previousValue) {
96
- this.plugin.closeModal();
97
- }
98
- }
99
- }
100
- ngOnDestroy() {
101
- this.uninstall();
102
- }
103
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: DashboardModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
104
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", 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 });
105
- }
106
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: DashboardModalComponent, decorators: [{
107
- type: Component,
108
- args: [{
109
- selector: "uppy-dashboard-modal",
110
- template: "",
111
- changeDetection: ChangeDetectionStrategy.OnPush,
112
- standalone: true,
113
- }]
114
- }], ctorParameters: () => [], propDecorators: { uppy: [{
115
- type: Input
116
- }], props: [{
117
- type: Input
118
- }], open: [{
119
- type: Input
120
- }] } });
121
-
122
- class StatusBarComponent extends UppyAngularWrapper {
123
- el = inject(ElementRef);
124
- uppy = new Uppy();
125
- props = {};
126
- constructor() {
127
- super();
128
- }
129
- ngOnInit() {
130
- this.onMount({ id: "angular:StatusBar", target: this.el.nativeElement }, StatusBar);
131
- }
132
- ngOnChanges(changes) {
133
- this.handleChanges(changes, StatusBar);
134
- }
135
- ngOnDestroy() {
136
- this.uninstall();
137
- }
138
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: StatusBarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
139
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.1", 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 });
140
- }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: StatusBarComponent, decorators: [{
142
- type: Component,
143
- args: [{
144
- selector: "uppy-status-bar",
145
- template: "",
146
- changeDetection: ChangeDetectionStrategy.OnPush,
147
- standalone: true,
148
- }]
149
- }], ctorParameters: () => [], propDecorators: { uppy: [{
150
- type: Input
151
- }], props: [{
152
- type: Input
153
- }] } });
154
-
155
- /*
156
- * Public API Surface of @uppy/angular
157
- */
158
-
159
- /**
160
- * Generated bundle index. Do not edit.
161
- */
162
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, ElementRef, Input, inject } from "@angular/core";
3
+ import { Uppy } from "@uppy/core";
4
+ import Dashboard from "@uppy/dashboard";
5
+ import StatusBar from "@uppy/status-bar";
6
+ var UppyAngularWrapper = class {
7
+ options;
8
+ plugin;
9
+ onMount(defaultOptions, plugin) {
10
+ this.options = {
11
+ ...defaultOptions,
12
+ ...this.props
13
+ };
14
+ this.uppy.use(plugin, this.options);
15
+ this.plugin = this.uppy.getPlugin(this.options.id);
16
+ }
17
+ handleChanges(changes, plugin) {
18
+ if (changes["uppy"] && this.uppy !== changes["uppy"].previousValue && changes["uppy"].previousValue !== void 0) {
19
+ this.uninstall(changes["uppy"].previousValue);
20
+ this.uppy.use(plugin, this.options);
21
+ }
22
+ this.options = {
23
+ ...this.options,
24
+ ...this.props
25
+ };
26
+ this.plugin = this.uppy.getPlugin(this.options.id);
27
+ if (changes["props"] && this.props !== changes["props"].previousValue && changes["props"].previousValue !== void 0) this.plugin.setOptions({ ...this.options });
28
+ }
29
+ uninstall(uppy = this.uppy) {
30
+ uppy.removePlugin(this.plugin);
31
+ }
32
+ };
33
+ var DashboardComponent = class DashboardComponent extends UppyAngularWrapper {
34
+ el = inject(ElementRef);
35
+ uppy = new Uppy();
36
+ props = {};
37
+ constructor() {
38
+ super();
39
+ }
40
+ ngOnInit() {
41
+ this.onMount({
42
+ id: "angular:Dashboard",
43
+ inline: true,
44
+ target: this.el.nativeElement
45
+ }, Dashboard);
46
+ }
47
+ ngOnChanges(changes) {
48
+ this.handleChanges(changes, Dashboard);
49
+ }
50
+ ngOnDestroy() {
51
+ this.uninstall();
52
+ }
53
+ static ɵfac = i0.ɵɵngDeclareFactory({
54
+ minVersion: "12.0.0",
55
+ version: "22.2.3",
56
+ ngImport: i0,
57
+ type: DashboardComponent,
58
+ deps: [],
59
+ target: i0.ɵɵFactoryTarget.Component
60
+ });
61
+ static ɵcmp = i0.ɵɵngDeclareComponent({
62
+ minVersion: "14.0.0",
63
+ version: "22.2.3",
64
+ type: DashboardComponent,
65
+ isStandalone: true,
66
+ selector: "uppy-dashboard",
67
+ inputs: {
68
+ uppy: "uppy",
69
+ props: "props"
70
+ },
71
+ usesInheritance: true,
72
+ usesOnChanges: true,
73
+ ngImport: i0,
74
+ template: "",
75
+ isInline: true,
76
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
77
+ });
78
+ };
79
+ i0.ɵɵngDeclareClassMetadata({
80
+ minVersion: "12.0.0",
81
+ version: "22.2.3",
82
+ ngImport: i0,
83
+ type: DashboardComponent,
84
+ decorators: [{
85
+ type: Component,
86
+ args: [{
87
+ selector: "uppy-dashboard",
88
+ template: "",
89
+ changeDetection: ChangeDetectionStrategy.OnPush,
90
+ standalone: true
91
+ }]
92
+ }],
93
+ ctorParameters: () => [],
94
+ propDecorators: {
95
+ uppy: [{ type: Input }],
96
+ props: [{ type: Input }]
97
+ }
98
+ });
99
+ var DashboardModalComponent = class DashboardModalComponent extends UppyAngularWrapper {
100
+ el = inject(ElementRef);
101
+ uppy = new Uppy();
102
+ props = {};
103
+ open = false;
104
+ constructor() {
105
+ super();
106
+ }
107
+ ngOnInit() {
108
+ this.onMount({
109
+ id: "angular:DashboardModal",
110
+ inline: false,
111
+ target: this.el.nativeElement
112
+ }, Dashboard);
113
+ if (this.open) this.plugin.openModal();
114
+ }
115
+ ngOnChanges(changes) {
116
+ const previousPlugin = this.plugin;
117
+ if (previousPlugin === void 0) return;
118
+ this.handleChanges(changes, Dashboard);
119
+ if (this.plugin !== previousPlugin) {
120
+ if (this.open) this.plugin.openModal();
121
+ } else if (changes["open"] && this.open !== changes["open"].previousValue) {
122
+ if (this.open && !changes["open"].previousValue) this.plugin.openModal();
123
+ if (!this.open && changes["open"].previousValue) this.plugin.closeModal();
124
+ }
125
+ }
126
+ ngOnDestroy() {
127
+ this.uninstall();
128
+ }
129
+ static ɵfac = i0.ɵɵngDeclareFactory({
130
+ minVersion: "12.0.0",
131
+ version: "22.2.3",
132
+ ngImport: i0,
133
+ type: DashboardModalComponent,
134
+ deps: [],
135
+ target: i0.ɵɵFactoryTarget.Component
136
+ });
137
+ static ɵcmp = i0.ɵɵngDeclareComponent({
138
+ minVersion: "14.0.0",
139
+ version: "22.2.3",
140
+ type: DashboardModalComponent,
141
+ isStandalone: true,
142
+ selector: "uppy-dashboard-modal",
143
+ inputs: {
144
+ uppy: "uppy",
145
+ props: "props",
146
+ open: "open"
147
+ },
148
+ usesInheritance: true,
149
+ usesOnChanges: true,
150
+ ngImport: i0,
151
+ template: "",
152
+ isInline: true,
153
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
154
+ });
155
+ };
156
+ i0.ɵɵngDeclareClassMetadata({
157
+ minVersion: "12.0.0",
158
+ version: "22.2.3",
159
+ ngImport: i0,
160
+ type: DashboardModalComponent,
161
+ decorators: [{
162
+ type: Component,
163
+ args: [{
164
+ selector: "uppy-dashboard-modal",
165
+ template: "",
166
+ changeDetection: ChangeDetectionStrategy.OnPush,
167
+ standalone: true
168
+ }]
169
+ }],
170
+ ctorParameters: () => [],
171
+ propDecorators: {
172
+ uppy: [{ type: Input }],
173
+ props: [{ type: Input }],
174
+ open: [{ type: Input }]
175
+ }
176
+ });
177
+ var StatusBarComponent = class StatusBarComponent extends UppyAngularWrapper {
178
+ el = inject(ElementRef);
179
+ uppy = new Uppy();
180
+ props = {};
181
+ constructor() {
182
+ super();
183
+ }
184
+ ngOnInit() {
185
+ this.onMount({
186
+ id: "angular:StatusBar",
187
+ target: this.el.nativeElement
188
+ }, StatusBar);
189
+ }
190
+ ngOnChanges(changes) {
191
+ this.handleChanges(changes, StatusBar);
192
+ }
193
+ ngOnDestroy() {
194
+ this.uninstall();
195
+ }
196
+ static ɵfac = i0.ɵɵngDeclareFactory({
197
+ minVersion: "12.0.0",
198
+ version: "22.2.3",
199
+ ngImport: i0,
200
+ type: StatusBarComponent,
201
+ deps: [],
202
+ target: i0.ɵɵFactoryTarget.Component
203
+ });
204
+ static ɵcmp = i0.ɵɵngDeclareComponent({
205
+ minVersion: "14.0.0",
206
+ version: "22.2.3",
207
+ type: StatusBarComponent,
208
+ isStandalone: true,
209
+ selector: "uppy-status-bar",
210
+ inputs: {
211
+ uppy: "uppy",
212
+ props: "props"
213
+ },
214
+ usesInheritance: true,
215
+ usesOnChanges: true,
216
+ ngImport: i0,
217
+ template: "",
218
+ isInline: true,
219
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
220
+ });
221
+ };
222
+ i0.ɵɵngDeclareClassMetadata({
223
+ minVersion: "12.0.0",
224
+ version: "22.2.3",
225
+ ngImport: i0,
226
+ type: StatusBarComponent,
227
+ decorators: [{
228
+ type: Component,
229
+ args: [{
230
+ selector: "uppy-status-bar",
231
+ template: "",
232
+ changeDetection: ChangeDetectionStrategy.OnPush,
233
+ standalone: true
234
+ }]
235
+ }],
236
+ ctorParameters: () => [],
237
+ propDecorators: {
238
+ uppy: [{ type: Input }],
239
+ props: [{ type: Input }]
240
+ }
241
+ });
163
242
  export { DashboardComponent, DashboardModalComponent, StatusBarComponent };
164
- //# sourceMappingURL=uppy-angular.mjs.map
243
+
244
+ //# sourceMappingURL=uppy-angular.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"uppy-angular.mjs","sources":["../../src/utils/wrapper.ts","../../src/components/dashboard/dashboard.component.ts","../../src/components/dashboard-modal/dashboard-modal.component.ts","../../src/components/status-bar/status-bar.component.ts","../../src/public-api.ts","../../src/uppy-angular.ts"],"sourcesContent":["import type { ElementRef, SimpleChanges } from \"@angular/core\";\nimport type { UIPlugin, UIPluginOptions, Uppy, Body, Meta } from \"@uppy/core\";\nimport type { DashboardOptions } from \"@uppy/dashboard\";\n\nexport abstract class UppyAngularWrapper<\n\tM extends Meta,\n\tB extends Body,\n\tOpts extends UIPluginOptions,\n\tPluginType extends UIPlugin<Opts, M, B> = UIPlugin<Opts, M, B>,\n> {\n\tabstract props: DashboardOptions<M, B>;\n\tabstract el: ElementRef;\n\tabstract uppy: Uppy<M, B>;\n\tprivate options: any;\n\tplugin: PluginType | undefined;\n\n\tonMount(\n\t\tdefaultOptions: Partial<Opts>,\n\t\tplugin: new (uppy: any, opts?: Opts) => UIPlugin<Opts, M, B>,\n\t) {\n\t\tthis.options = {\n\t\t\t...defaultOptions,\n\t\t\t...this.props,\n\t\t};\n\n\t\tthis.uppy.use(plugin, this.options);\n\t\tthis.plugin = this.uppy.getPlugin(this.options.id) as PluginType;\n\t}\n\n\thandleChanges(changes: SimpleChanges, plugin: any): void {\n\t\t// Without the last part of this conditional, it tries to uninstall before the plugin is mounted\n\t\tif (\n\t\t\tchanges[\"uppy\"] &&\n\t\t\tthis.uppy !== changes[\"uppy\"].previousValue &&\n\t\t\tchanges[\"uppy\"].previousValue !== undefined\n\t\t) {\n\t\t\tthis.uninstall(changes[\"uppy\"].previousValue);\n\t\t\t// @ts-expect-error The options correspond to the plugin, I swear\n\t\t\tthis.uppy.use(plugin, this.options);\n\t\t}\n\t\tthis.options = { ...this.options, ...this.props };\n\t\tthis.plugin = this.uppy.getPlugin(this.options.id) as PluginType;\n\t\tif (\n\t\t\tchanges[\"props\"] &&\n\t\t\tthis.props !== changes[\"props\"].previousValue &&\n\t\t\tchanges[\"props\"].previousValue !== undefined\n\t\t) {\n\t\t\tthis.plugin.setOptions({ ...this.options });\n\t\t}\n\t}\n\n\tuninstall(uppy = this.uppy): void {\n\t\tuppy.removePlugin(this.plugin!);\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tInput,\n\tinject,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges,\n} from \"@angular/core\";\nimport { Uppy } from \"@uppy/core\";\nimport type { DashboardOptions } from \"@uppy/dashboard\";\nimport Dashboard from \"@uppy/dashboard\";\nimport type { Body, Meta } from \"@uppy/core\";\nimport { UppyAngularWrapper } from \"../../utils/wrapper\";\n\n@Component({\n\tselector: \"uppy-dashboard\",\n\ttemplate: \"\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class DashboardComponent<M extends Meta, B extends Body>\n\textends UppyAngularWrapper<M, B, DashboardOptions<M, B>>\n\timplements OnDestroy, OnChanges\n{\n\tel = inject(ElementRef);\n\n\t@Input() uppy: Uppy<M, B> = new Uppy();\n\t@Input() props: DashboardOptions<M, B> = {};\n\n\t/** Inserted by Angular inject() migration for backwards compatibility */\n\tconstructor(...args: unknown[]);\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tngOnInit() {\n\t\tthis.onMount(\n\t\t\t{ id: \"angular:Dashboard\", inline: true, target: this.el.nativeElement },\n\t\t\tDashboard,\n\t\t);\n\t}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tthis.handleChanges(changes, Dashboard);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.uninstall();\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tInput,\n\tinject,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges,\n} from \"@angular/core\";\nimport { Uppy } from \"@uppy/core\";\nimport type { DashboardOptions } from \"@uppy/dashboard\";\nimport Dashboard from \"@uppy/dashboard\";\nimport type { Body, Meta } from \"@uppy/core\";\nimport { UppyAngularWrapper } from \"../../utils/wrapper\";\n\n@Component({\n\tselector: \"uppy-dashboard-modal\",\n\ttemplate: \"\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class DashboardModalComponent<M extends Meta, B extends Body>\n\textends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>>\n\timplements OnDestroy, OnChanges\n{\n\tel = inject(ElementRef);\n\n\t@Input() uppy: Uppy<M, B> = new Uppy();\n\t@Input() props: DashboardOptions<M, B> = {};\n\t@Input() open: boolean = false;\n\n\t/** Inserted by Angular inject() migration for backwards compatibility */\n\tconstructor(...args: unknown[]);\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tngOnInit() {\n\t\tthis.onMount(\n\t\t\t{\n\t\t\t\tid: \"angular:DashboardModal\",\n\t\t\t\tinline: false,\n\t\t\t\ttarget: this.el.nativeElement,\n\t\t\t},\n\t\t\tDashboard,\n\t\t);\n\t}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tthis.handleChanges(changes, Dashboard);\n\t\t// Handle dashboard-modal specific changes\n\t\tif (changes[\"open\"] && this.open !== changes[\"open\"].previousValue) {\n\t\t\tif (this.open && !changes[\"open\"].previousValue) {\n\t\t\t\tthis.plugin!.openModal();\n\t\t\t}\n\t\t\tif (!this.open && changes[\"open\"].previousValue) {\n\t\t\t\tthis.plugin!.closeModal();\n\t\t\t}\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.uninstall();\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tInput,\n\tinject,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges,\n} from \"@angular/core\";\nimport { Uppy } from \"@uppy/core\";\nimport type { StatusBarOptions } from \"@uppy/status-bar\";\nimport StatusBar from \"@uppy/status-bar\";\nimport type { Body, Meta } from \"@uppy/core\";\nimport { UppyAngularWrapper } from \"../../utils/wrapper\";\n\n@Component({\n\tselector: \"uppy-status-bar\",\n\ttemplate: \"\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class StatusBarComponent<M extends Meta, B extends Body>\n\textends UppyAngularWrapper<M, B, StatusBarOptions>\n\timplements OnDestroy, OnChanges\n{\n\tel = inject(ElementRef);\n\n\t@Input() uppy: Uppy<M, B> = new Uppy();\n\t@Input() props: StatusBarOptions = {};\n\n\t/** Inserted by Angular inject() migration for backwards compatibility */\n\tconstructor(...args: unknown[]);\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tngOnInit() {\n\t\tthis.onMount(\n\t\t\t{ id: \"angular:StatusBar\", target: this.el.nativeElement },\n\t\t\tStatusBar,\n\t\t);\n\t}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tthis.handleChanges(changes, StatusBar);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.uninstall();\n\t}\n}\n","/*\n * Public API Surface of @uppy/angular\n */\n\nexport { DashboardComponent } from './components/dashboard/dashboard.component'\nexport { DashboardModalComponent } from './components/dashboard-modal/dashboard-modal.component'\nexport { StatusBarComponent } from './components/status-bar/status-bar.component'\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAIsB,kBAAkB,CAAA;AAS/B,IAAA,OAAO;AACf,IAAA,MAAM;IAEN,OAAO,CACN,cAA6B,EAC7B,MAA4D,EAAA;QAE5D,IAAI,CAAC,OAAO,GAAG;AACd,YAAA,GAAG,cAAc;YACjB,GAAG,IAAI,CAAC,KAAK;SACb;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;IACjE;IAEA,aAAa,CAAC,OAAsB,EAAE,MAAW,EAAA;;QAEhD,IACC,OAAO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AM,CAAC,UAAU,CAAC;AAEd,IAAA,IAAI,GAAe,IAAI,IAAI,EAAE;IAC7B,KAAK,GAAqB,EAAE;AAKrC,IAAA,WAAA,GAAA;AACC,QAAA,KAAK,EAAE;IACR;IAEA,QAAQ,GAAA;AACP,QAAA,IAAI,CAAC,OAAO,CACX,EAAE,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,EAC1D,SAAS,CACT;IACF;AAEA,IAAA,WAAW,CAAC,OAAsB,EAAA;AACjC,QAAA,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,SAAS,CAAC;IACvC;IAEA,WAAW,GAAA;QACV,IAAI,CAAC,SAAS,EAAE;IACjB;uGA7BY,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,kBAAkB,iKAJpB,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAIA,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAN9B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,EAAE;oBACZ,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,UAAU,EAAE,IAAI;AAChB,iBAAA;;sBAOC;;sBACA;;;AC7BF;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"uppy-angular.mjs","names":[],"sources":["../../src/utils/wrapper.ts","../../src/components/dashboard/dashboard.component.ts","../../src/components/dashboard-modal/dashboard-modal.component.ts","../../src/components/status-bar/status-bar.component.ts"],"sourcesContent":["import type { ElementRef, SimpleChanges } from \"@angular/core\";\nimport type { UIPlugin, UIPluginOptions, Uppy, Body, Meta } from \"@uppy/core\";\nimport type { DashboardOptions } from \"@uppy/dashboard\";\n\nexport abstract class UppyAngularWrapper<\n\tM extends Meta,\n\tB extends Body,\n\tOpts extends UIPluginOptions,\n\tPluginType extends UIPlugin<Opts, M, B> = UIPlugin<Opts, M, B>,\n> {\n\tabstract props: DashboardOptions<M, B>;\n\tabstract el: ElementRef;\n\tabstract uppy: Uppy<M, B>;\n\tprivate options: any;\n\tplugin: PluginType | undefined;\n\n\tonMount(\n\t\tdefaultOptions: Partial<Opts>,\n\t\tplugin: new (uppy: any, opts?: Opts) => UIPlugin<Opts, M, B>,\n\t) {\n\t\tthis.options = {\n\t\t\t...defaultOptions,\n\t\t\t...this.props,\n\t\t};\n\n\t\tthis.uppy.use(plugin, this.options);\n\t\tthis.plugin = this.uppy.getPlugin(this.options.id) as PluginType;\n\t}\n\n\thandleChanges(changes: SimpleChanges, plugin: any): void {\n\t\t// Without the last part of this conditional, it tries to uninstall before the plugin is mounted\n\t\tif (\n\t\t\tchanges[\"uppy\"] &&\n\t\t\tthis.uppy !== changes[\"uppy\"].previousValue &&\n\t\t\tchanges[\"uppy\"].previousValue !== undefined\n\t\t) {\n\t\t\tthis.uninstall(changes[\"uppy\"].previousValue);\n\t\t\t// @ts-expect-error The options correspond to the plugin, I swear\n\t\t\tthis.uppy.use(plugin, this.options);\n\t\t}\n\t\tthis.options = { ...this.options, ...this.props };\n\t\tthis.plugin = this.uppy.getPlugin(this.options.id) as PluginType;\n\t\tif (\n\t\t\tchanges[\"props\"] &&\n\t\t\tthis.props !== changes[\"props\"].previousValue &&\n\t\t\tchanges[\"props\"].previousValue !== undefined\n\t\t) {\n\t\t\tthis.plugin.setOptions({ ...this.options });\n\t\t}\n\t}\n\n\tuninstall(uppy = this.uppy): void {\n\t\tuppy.removePlugin(this.plugin!);\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tInput,\n\tinject,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges,\n} from \"@angular/core\";\nimport { Uppy } from \"@uppy/core\";\nimport type { DashboardOptions } from \"@uppy/dashboard\";\nimport Dashboard from \"@uppy/dashboard\";\nimport type { Body, Meta } from \"@uppy/core\";\nimport { UppyAngularWrapper } from \"../../utils/wrapper\";\n\n@Component({\n\tselector: \"uppy-dashboard\",\n\ttemplate: \"\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class DashboardComponent<M extends Meta, B extends Body>\n\textends UppyAngularWrapper<M, B, DashboardOptions<M, B>>\n\timplements OnDestroy, OnChanges\n{\n\tel = inject(ElementRef);\n\n\t@Input() uppy: Uppy<M, B> = new Uppy();\n\t@Input() props: DashboardOptions<M, B> = {};\n\n\t/** Inserted by Angular inject() migration for backwards compatibility */\n\tconstructor(...args: unknown[]);\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tngOnInit() {\n\t\tthis.onMount(\n\t\t\t{ id: \"angular:Dashboard\", inline: true, target: this.el.nativeElement },\n\t\t\tDashboard,\n\t\t);\n\t}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tthis.handleChanges(changes, Dashboard);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.uninstall();\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tInput,\n\tinject,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges,\n} from \"@angular/core\";\nimport { Uppy } from \"@uppy/core\";\nimport type { DashboardOptions } from \"@uppy/dashboard\";\nimport Dashboard from \"@uppy/dashboard\";\nimport type { Body, Meta } from \"@uppy/core\";\nimport { UppyAngularWrapper } from \"../../utils/wrapper\";\n\n@Component({\n\tselector: \"uppy-dashboard-modal\",\n\ttemplate: \"\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class DashboardModalComponent<M extends Meta, B extends Body>\n\textends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>>\n\timplements OnDestroy, OnChanges\n{\n\tel = inject(ElementRef);\n\n\t@Input() uppy: Uppy<M, B> = new Uppy();\n\t@Input() props: DashboardOptions<M, B> = {};\n\t@Input() open: boolean = false;\n\n\t/** Inserted by Angular inject() migration for backwards compatibility */\n\tconstructor(...args: unknown[]);\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tngOnInit() {\n\t\tthis.onMount(\n\t\t\t{\n\t\t\t\tid: \"angular:DashboardModal\",\n\t\t\t\tinline: false,\n\t\t\t\ttarget: this.el.nativeElement,\n\t\t\t},\n\t\t\tDashboard,\n\t\t);\n\t\t// Angular runs `ngOnChanges` before `ngOnInit`, so the initial value of\n\t\t// `open` — which only ever shows up in that first `SimpleChanges` — has to\n\t\t// be applied here, once the plugin actually exists.\n\t\tif (this.open) {\n\t\t\tthis.plugin!.openModal();\n\t\t}\n\t}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\t// The first `ngOnChanges` runs before `ngOnInit`, when there is no plugin\n\t\t// to talk to yet. Every input still carries `previousValue: undefined` at\n\t\t// that point, so nothing is lost by skipping it: `ngOnInit` mounts the\n\t\t// plugin with the current `props` and applies the current `open` value.\n\t\tconst previousPlugin = this.plugin;\n\t\tif (previousPlugin === undefined) return;\n\n\t\tthis.handleChanges(changes, Dashboard);\n\t\tif (this.plugin !== previousPlugin) {\n\t\t\t// A new `uppy` got a freshly installed plugin, which starts out closed.\n\t\t\tif (this.open) {\n\t\t\t\tthis.plugin!.openModal();\n\t\t\t}\n\t\t} else if (changes[\"open\"] && this.open !== changes[\"open\"].previousValue) {\n\t\t\tif (this.open && !changes[\"open\"].previousValue) {\n\t\t\t\tthis.plugin!.openModal();\n\t\t\t}\n\t\t\tif (!this.open && changes[\"open\"].previousValue) {\n\t\t\t\tthis.plugin!.closeModal();\n\t\t\t}\n\t\t}\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.uninstall();\n\t}\n}\n","import {\n\tChangeDetectionStrategy,\n\tComponent,\n\tElementRef,\n\tInput,\n\tinject,\n\ttype OnChanges,\n\ttype OnDestroy,\n\ttype SimpleChanges,\n} from \"@angular/core\";\nimport { Uppy } from \"@uppy/core\";\nimport type { StatusBarOptions } from \"@uppy/status-bar\";\nimport StatusBar from \"@uppy/status-bar\";\nimport type { Body, Meta } from \"@uppy/core\";\nimport { UppyAngularWrapper } from \"../../utils/wrapper\";\n\n@Component({\n\tselector: \"uppy-status-bar\",\n\ttemplate: \"\",\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tstandalone: true,\n})\nexport class StatusBarComponent<M extends Meta, B extends Body>\n\textends UppyAngularWrapper<M, B, StatusBarOptions>\n\timplements OnDestroy, OnChanges\n{\n\tel = inject(ElementRef);\n\n\t@Input() uppy: Uppy<M, B> = new Uppy();\n\t@Input() props: StatusBarOptions = {};\n\n\t/** Inserted by Angular inject() migration for backwards compatibility */\n\tconstructor(...args: unknown[]);\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tngOnInit() {\n\t\tthis.onMount(\n\t\t\t{ id: \"angular:StatusBar\", target: this.el.nativeElement },\n\t\t\tStatusBar,\n\t\t);\n\t}\n\n\tngOnChanges(changes: SimpleChanges): void {\n\t\tthis.handleChanges(changes, StatusBar);\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis.uninstall();\n\t}\n}\n"],"mappings":";;;;;AAIA,IAAsB,qBAAtB,MAAwC;CAS/B;CACR;CAEA,QACC,gBACA,QAA4D;EAE5D,KAAK,UAAU;GACd,GAAG;GACH,GAAG,KAAK;EACR;EAED,KAAK,KAAK,IAAI,QAAQ,KAAK,OAAO;EAClC,KAAK,SAAS,KAAK,KAAK,UAAU,KAAK,QAAQ,EAAE;CAClD;CAEA,cAAc,SAAwB,QAAW;EAEhD,IACC,QAAQ,WACR,KAAK,SAAS,QAAQ,OAAO,CAAC,iBAC9B,QAAQ,OAAO,CAA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,7 @@
1
1
  {
2
2
  "name": "@uppy/angular",
3
3
  "description": "Angular component wrappers around Uppy's official UI plugins.",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://uppy.io",
7
7
  "keywords": [
@@ -19,7 +19,8 @@
19
19
  "url": "git+https://github.com/transloadit/uppy.git"
20
20
  },
21
21
  "scripts": {
22
- "build": "ng-packagr && mv dist/fesm2022 ./ && mv dist/types ./"
22
+ "build": "ng-packagr -c tsconfig.lib.prod.json && node scripts/collect-dist.mjs",
23
+ "test": "vitest run --silent='passed-only'"
23
24
  },
24
25
  "main": "./fesm2022/uppy-angular.mjs",
25
26
  "types": "./types/uppy-angular.d.ts",
@@ -31,11 +32,10 @@
31
32
  "tslib": "^2.8.1"
32
33
  },
33
34
  "peerDependencies": {
34
- "@angular/common": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
35
35
  "@angular/core": "^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0 || ^21.0.0 || ^22.0.0",
36
- "@uppy/core": "^6.0.0",
37
- "@uppy/dashboard": "^6.0.0",
38
- "@uppy/status-bar": "^6.0.0"
36
+ "@uppy/core": "^6.3.2",
37
+ "@uppy/dashboard": "^6.0.3",
38
+ "@uppy/status-bar": "^6.0.1"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@uppy/dashboard": {
@@ -46,13 +46,18 @@
46
46
  }
47
47
  },
48
48
  "devDependencies": {
49
- "@angular/common": "^22.1.1",
50
- "@angular/compiler": "^22.1.1",
51
- "@angular/compiler-cli": "^22.1.1",
52
- "@angular/core": "^22.1.1",
53
- "ng-packagr": "^22.1.1",
49
+ "@angular/common": "^22.2.3",
50
+ "@angular/compiler": "^22.2.3",
51
+ "@angular/compiler-cli": "^22.2.3",
52
+ "@angular/core": "^22.2.3",
53
+ "@angular/platform-browser": "^22.2.3",
54
+ "@uppy-dev/tsconfig": "^0.0.0",
55
+ "@vitest/browser-playwright": "^5.0.5",
56
+ "ng-packagr": "^22.2.5",
57
+ "playwright": "1.64.1",
54
58
  "rxjs": "~7.8.0",
55
- "typescript": "^6.0.3"
59
+ "typescript": "^6.0.3",
60
+ "vitest": "^5.0.5"
56
61
  },
57
62
  "sideEffects": false
58
63
  }
@@ -1,58 +1,83 @@
1
- import * as i0 from '@angular/core';
2
- import { ElementRef, SimpleChanges, OnDestroy, OnChanges } from '@angular/core';
3
- import { Meta, Body, UIPluginOptions, UIPlugin, Uppy } from '@uppy/core';
4
- import Dashboard, { DashboardOptions } from '@uppy/dashboard';
5
- import { StatusBarOptions } from '@uppy/status-bar';
6
-
1
+ import * as i0 from "@angular/core";
2
+ import { ElementRef, OnChanges, OnDestroy, SimpleChanges } from "@angular/core";
3
+ import { Body, Meta, UIPlugin, UIPluginOptions, Uppy } from "@uppy/core";
4
+ import Dashboard, { DashboardOptions } from "@uppy/dashboard";
5
+ import { StatusBarOptions } from "@uppy/status-bar";
7
6
  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: DashboardOptions<M, B>;
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;
7
+ abstract props: DashboardOptions<M, B>;
8
+ abstract el: ElementRef;
9
+ abstract uppy: Uppy<M, B>;
10
+ private options;
11
+ plugin: PluginType | undefined;
12
+ onMount(defaultOptions: Partial<Opts>, plugin: new (uppy: any, opts?: Opts) => UIPlugin<Opts, M, B>): void;
13
+ handleChanges(changes: SimpleChanges, plugin: any): void;
14
+ uninstall(uppy?: Uppy<M, B>): void;
16
15
  }
17
-
18
- declare class DashboardComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, DashboardOptions<M, B>> implements OnDestroy, OnChanges {
19
- el: ElementRef<any>;
20
- uppy: Uppy<M, B>;
21
- props: DashboardOptions<M, B>;
22
- /** Inserted by Angular inject() migration for backwards compatibility */
23
- constructor(...args: unknown[]);
24
- ngOnInit(): void;
25
- ngOnChanges(changes: SimpleChanges): void;
26
- ngOnDestroy(): void;
27
- static ɵfac: i0.ɵɵFactoryDeclaration<DashboardComponent<any, any>, never>;
28
- static ɵcmp: i0.ɵɵComponentDeclaration<DashboardComponent<any, any>, "uppy-dashboard", never, { "uppy": { "alias": "uppy"; "required": false; }; "props": { "alias": "props"; "required": false; }; }, {}, never, never, true, never>;
16
+ export declare class DashboardComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, DashboardOptions<M, B>> implements OnDestroy, OnChanges {
17
+ el: ElementRef<any>;
18
+ uppy: Uppy<M, B>;
19
+ props: DashboardOptions<M, B>;
20
+ /** Inserted by Angular inject() migration for backwards compatibility */
21
+ constructor(...args: unknown[]);
22
+ ngOnInit(): void;
23
+ ngOnChanges(changes: SimpleChanges): void;
24
+ ngOnDestroy(): void;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DashboardComponent<any, any>, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<DashboardComponent<any, any>, "uppy-dashboard", never, {
27
+ "uppy": {
28
+ "alias": "uppy";
29
+ "required": false;
30
+ };
31
+ "props": {
32
+ "alias": "props";
33
+ "required": false;
34
+ };
35
+ }, {}, never, never, true, never>;
29
36
  }
30
-
31
- declare class DashboardModalComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>> implements OnDestroy, OnChanges {
32
- el: ElementRef<any>;
33
- uppy: Uppy<M, B>;
34
- props: DashboardOptions<M, B>;
35
- open: boolean;
36
- /** Inserted by Angular inject() migration for backwards compatibility */
37
- constructor(...args: unknown[]);
38
- ngOnInit(): void;
39
- ngOnChanges(changes: SimpleChanges): void;
40
- ngOnDestroy(): void;
41
- static ɵfac: i0.ɵɵFactoryDeclaration<DashboardModalComponent<any, any>, never>;
42
- 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>;
37
+ export declare class DashboardModalComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, DashboardOptions<M, B>, Dashboard<M, B>> implements OnDestroy, OnChanges {
38
+ el: ElementRef<any>;
39
+ uppy: Uppy<M, B>;
40
+ props: DashboardOptions<M, B>;
41
+ open: boolean;
42
+ /** Inserted by Angular inject() migration for backwards compatibility */
43
+ constructor(...args: unknown[]);
44
+ ngOnInit(): void;
45
+ ngOnChanges(changes: SimpleChanges): void;
46
+ ngOnDestroy(): void;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<DashboardModalComponent<any, any>, never>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<DashboardModalComponent<any, any>, "uppy-dashboard-modal", never, {
49
+ "uppy": {
50
+ "alias": "uppy";
51
+ "required": false;
52
+ };
53
+ "props": {
54
+ "alias": "props";
55
+ "required": false;
56
+ };
57
+ "open": {
58
+ "alias": "open";
59
+ "required": false;
60
+ };
61
+ }, {}, never, never, true, never>;
43
62
  }
44
-
45
- declare class StatusBarComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, StatusBarOptions> implements OnDestroy, OnChanges {
46
- el: ElementRef<any>;
47
- uppy: Uppy<M, B>;
48
- props: StatusBarOptions;
49
- /** Inserted by Angular inject() migration for backwards compatibility */
50
- constructor(...args: unknown[]);
51
- ngOnInit(): void;
52
- ngOnChanges(changes: SimpleChanges): void;
53
- ngOnDestroy(): void;
54
- static ɵfac: i0.ɵɵFactoryDeclaration<StatusBarComponent<any, any>, never>;
55
- 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>;
56
- }
57
-
58
- export { DashboardComponent, DashboardModalComponent, StatusBarComponent };
63
+ export declare class StatusBarComponent<M extends Meta, B extends Body> extends UppyAngularWrapper<M, B, StatusBarOptions> implements OnDestroy, OnChanges {
64
+ el: ElementRef<any>;
65
+ uppy: Uppy<M, B>;
66
+ props: StatusBarOptions;
67
+ /** Inserted by Angular inject() migration for backwards compatibility */
68
+ constructor(...args: unknown[]);
69
+ ngOnInit(): void;
70
+ ngOnChanges(changes: SimpleChanges): void;
71
+ ngOnDestroy(): void;
72
+ static ɵfac: i0.ɵɵFactoryDeclaration<StatusBarComponent<any, any>, never>;
73
+ static ɵcmp: i0.ɵɵComponentDeclaration<StatusBarComponent<any, any>, "uppy-status-bar", never, {
74
+ "uppy": {
75
+ "alias": "uppy";
76
+ "required": false;
77
+ };
78
+ "props": {
79
+ "alias": "props";
80
+ "required": false;
81
+ };
82
+ }, {}, never, never, true, never>;
83
+ }