nxt-dropzone-wrapper 20.0.0 → 21.0.0
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/README.md +11 -20
- package/fesm2022/nxt-dropzone-wrapper.mjs +196 -450
- package/fesm2022/nxt-dropzone-wrapper.mjs.map +1 -1
- package/package.json +13 -10
- package/types/nxt-dropzone-wrapper.d.ts +127 -0
- package/index.d.ts +0 -181
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken,
|
|
3
|
-
import
|
|
4
|
-
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
2
|
+
import { InjectionToken, makeEnvironmentProviders, output, Directive, inject, NgZone, ElementRef, KeyValueDiffers, PLATFORM_ID, input, computed, effect, viewChild, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
|
3
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
5
4
|
import Dropzone from 'dropzone';
|
|
6
5
|
|
|
6
|
+
/* eslint-disable @angular-eslint/no-output-rename */
|
|
7
7
|
const NXT_DROPZONE_CONFIG = new InjectionToken('NXT_DROPZONE_CONFIG');
|
|
8
|
+
function provideDropzoneConfig(config) {
|
|
9
|
+
return makeEnvironmentProviders([
|
|
10
|
+
{
|
|
11
|
+
provide: NXT_DROPZONE_CONFIG,
|
|
12
|
+
useValue: config
|
|
13
|
+
}
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
8
16
|
/** @internal */
|
|
9
17
|
const DropzoneEvents = [
|
|
10
18
|
'init',
|
|
@@ -66,519 +74,257 @@ class _DropzoneConfig {
|
|
|
66
74
|
}
|
|
67
75
|
}
|
|
68
76
|
}
|
|
77
|
+
class DropzoneListeners {
|
|
78
|
+
constructor() {
|
|
79
|
+
this.DZ_INIT = output({ alias: 'init' });
|
|
80
|
+
this.DZ_DROP = output({ alias: 'drop' });
|
|
81
|
+
this.DZ_DRAGSTART = output({ alias: 'dragStart' });
|
|
82
|
+
this.DZ_DRAGEND = output({ alias: 'dragEnd' });
|
|
83
|
+
this.DZ_DRAGENTER = output({ alias: 'dragEnter' });
|
|
84
|
+
this.DZ_DRAGOVER = output({ alias: 'dragOver' });
|
|
85
|
+
this.DZ_DRAGLEAVE = output({ alias: 'dragLeave' });
|
|
86
|
+
this.DZ_PASTE = output({ alias: 'paste' });
|
|
87
|
+
this.DZ_RESET = output({ alias: 'reset' });
|
|
88
|
+
this.DZ_ADDEDFILE = output({ alias: 'addedFile' });
|
|
89
|
+
this.DZ_ADDEDFILES = output({ alias: 'addedFiles' });
|
|
90
|
+
this.DZ_REMOVEDFILE = output({ alias: 'removedFile' });
|
|
91
|
+
this.DZ_THUMBNAIL = output({ alias: 'thumbnail' });
|
|
92
|
+
this.DZ_ERROR = output({ alias: 'error' });
|
|
93
|
+
this.DZ_ERRORMULTIPLE = output({ alias: 'errorMultiple' });
|
|
94
|
+
this.DZ_PROCESSING = output({ alias: 'processing' });
|
|
95
|
+
this.DZ_PROCESSINGMULTIPLE = output({ alias: 'processingMultiple' });
|
|
96
|
+
this.DZ_UPLOADPROGRESS = output({ alias: 'uploadProgress' });
|
|
97
|
+
this.DZ_TOTALUPLOADPROGRESS = output({ alias: 'totalUploadProgress' });
|
|
98
|
+
this.DZ_SENDING = output({ alias: 'sending' });
|
|
99
|
+
this.DZ_SENDINGMULTIPLE = output({ alias: 'sendingMultiple' });
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
101
|
+
this.DZ_SUCCESS = output({ alias: 'success' });
|
|
102
|
+
this.DZ_SUCCESSMULTIPLE = output({ alias: 'successMultiple' });
|
|
103
|
+
this.DZ_CANCELED = output({ alias: 'canceled' });
|
|
104
|
+
this.DZ_CANCELEDMULTIPLE = output({ alias: 'canceledMultiple' });
|
|
105
|
+
this.DZ_COMPLETE = output({ alias: 'complete' });
|
|
106
|
+
this.DZ_COMPLETEMULTIPLE = output({ alias: 'completeMultiple' });
|
|
107
|
+
this.DZ_MAXFILESEXCEEDED = output({ alias: 'maxFilesExceeded' });
|
|
108
|
+
this.DZ_MAXFILESREACHED = output({ alias: 'maxFilesReached' });
|
|
109
|
+
this.DZ_QUEUECOMPLETE = output({ alias: 'queueComplete' });
|
|
110
|
+
}
|
|
111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneListeners, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
112
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.0", type: DropzoneListeners, isStandalone: true, outputs: { DZ_INIT: "init", DZ_DROP: "drop", DZ_DRAGSTART: "dragStart", DZ_DRAGEND: "dragEnd", DZ_DRAGENTER: "dragEnter", DZ_DRAGOVER: "dragOver", DZ_DRAGLEAVE: "dragLeave", DZ_PASTE: "paste", DZ_RESET: "reset", DZ_ADDEDFILE: "addedFile", DZ_ADDEDFILES: "addedFiles", DZ_REMOVEDFILE: "removedFile", DZ_THUMBNAIL: "thumbnail", DZ_ERROR: "error", DZ_ERRORMULTIPLE: "errorMultiple", DZ_PROCESSING: "processing", DZ_PROCESSINGMULTIPLE: "processingMultiple", DZ_UPLOADPROGRESS: "uploadProgress", DZ_TOTALUPLOADPROGRESS: "totalUploadProgress", DZ_SENDING: "sending", DZ_SENDINGMULTIPLE: "sendingMultiple", DZ_SUCCESS: "success", DZ_SUCCESSMULTIPLE: "successMultiple", DZ_CANCELED: "canceled", DZ_CANCELEDMULTIPLE: "canceledMultiple", DZ_COMPLETE: "complete", DZ_COMPLETEMULTIPLE: "completeMultiple", DZ_MAXFILESEXCEEDED: "maxFilesExceeded", DZ_MAXFILESREACHED: "maxFilesReached", DZ_QUEUECOMPLETE: "queueComplete" }, ngImport: i0 }); }
|
|
113
|
+
}
|
|
114
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneListeners, decorators: [{
|
|
115
|
+
type: Directive
|
|
116
|
+
}], propDecorators: { DZ_INIT: [{ type: i0.Output, args: ["init"] }], DZ_DROP: [{ type: i0.Output, args: ["drop"] }], DZ_DRAGSTART: [{ type: i0.Output, args: ["dragStart"] }], DZ_DRAGEND: [{ type: i0.Output, args: ["dragEnd"] }], DZ_DRAGENTER: [{ type: i0.Output, args: ["dragEnter"] }], DZ_DRAGOVER: [{ type: i0.Output, args: ["dragOver"] }], DZ_DRAGLEAVE: [{ type: i0.Output, args: ["dragLeave"] }], DZ_PASTE: [{ type: i0.Output, args: ["paste"] }], DZ_RESET: [{ type: i0.Output, args: ["reset"] }], DZ_ADDEDFILE: [{ type: i0.Output, args: ["addedFile"] }], DZ_ADDEDFILES: [{ type: i0.Output, args: ["addedFiles"] }], DZ_REMOVEDFILE: [{ type: i0.Output, args: ["removedFile"] }], DZ_THUMBNAIL: [{ type: i0.Output, args: ["thumbnail"] }], DZ_ERROR: [{ type: i0.Output, args: ["error"] }], DZ_ERRORMULTIPLE: [{ type: i0.Output, args: ["errorMultiple"] }], DZ_PROCESSING: [{ type: i0.Output, args: ["processing"] }], DZ_PROCESSINGMULTIPLE: [{ type: i0.Output, args: ["processingMultiple"] }], DZ_UPLOADPROGRESS: [{ type: i0.Output, args: ["uploadProgress"] }], DZ_TOTALUPLOADPROGRESS: [{ type: i0.Output, args: ["totalUploadProgress"] }], DZ_SENDING: [{ type: i0.Output, args: ["sending"] }], DZ_SENDINGMULTIPLE: [{ type: i0.Output, args: ["sendingMultiple"] }], DZ_SUCCESS: [{ type: i0.Output, args: ["success"] }], DZ_SUCCESSMULTIPLE: [{ type: i0.Output, args: ["successMultiple"] }], DZ_CANCELED: [{ type: i0.Output, args: ["canceled"] }], DZ_CANCELEDMULTIPLE: [{ type: i0.Output, args: ["canceledMultiple"] }], DZ_COMPLETE: [{ type: i0.Output, args: ["complete"] }], DZ_COMPLETEMULTIPLE: [{ type: i0.Output, args: ["completeMultiple"] }], DZ_MAXFILESEXCEEDED: [{ type: i0.Output, args: ["maxFilesExceeded"] }], DZ_MAXFILESREACHED: [{ type: i0.Output, args: ["maxFilesReached"] }], DZ_QUEUECOMPLETE: [{ type: i0.Output, args: ["queueComplete"] }] } });
|
|
69
117
|
/** @internal */
|
|
70
118
|
const NXT_DROPZONE_LISTENERS = new InjectionToken('NXT_DROPZONE_LISTENERS');
|
|
71
119
|
|
|
72
|
-
|
|
73
|
-
class DropzoneDirective {
|
|
74
|
-
/** Disables / detaches Dropzone from the element */
|
|
75
|
-
set disabled(val) {
|
|
76
|
-
val = !!val;
|
|
77
|
-
if (val != this._disabled && this.instance) {
|
|
78
|
-
if (val)
|
|
79
|
-
this.zone.runOutsideAngular(() => {
|
|
80
|
-
this.instance.disable();
|
|
81
|
-
});
|
|
82
|
-
else
|
|
83
|
-
this.zone.runOutsideAngular(() => {
|
|
84
|
-
this.instance.enable();
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
this._disabled = val;
|
|
88
|
-
}
|
|
89
|
-
get disabled() {
|
|
90
|
-
return this._disabled;
|
|
91
|
-
}
|
|
120
|
+
class DropzoneDirective extends DropzoneListeners {
|
|
92
121
|
get dropzone() {
|
|
93
|
-
return this.
|
|
94
|
-
}
|
|
95
|
-
/** @internal */
|
|
96
|
-
get isSingle() {
|
|
97
|
-
return this._params?.maxFiles === 1;
|
|
122
|
+
return this._instance;
|
|
98
123
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
this.
|
|
105
|
-
this.
|
|
106
|
-
this.
|
|
107
|
-
this.
|
|
108
|
-
|
|
109
|
-
this.
|
|
110
|
-
this.
|
|
111
|
-
this.
|
|
112
|
-
|
|
113
|
-
: undefined;
|
|
114
|
-
this.configDiff = this.differs.find(this.config || {}).create();
|
|
115
|
-
this.paramDiff = this.differs.find(this._params || {}).create();
|
|
116
|
-
this.DZ_INIT = this.component?.DZ_INIT
|
|
117
|
-
?? new EventEmitter();
|
|
118
|
-
this.DZ_DROP = this.component?.DZ_DROP
|
|
119
|
-
?? new EventEmitter();
|
|
120
|
-
this.DZ_DRAGSTART = this.component?.DZ_DRAGSTART
|
|
121
|
-
?? new EventEmitter();
|
|
122
|
-
this.DZ_DRAGEND = this.component?.DZ_DRAGEND
|
|
123
|
-
?? new EventEmitter();
|
|
124
|
-
this.DZ_DRAGENTER = this.component?.DZ_DRAGENTER
|
|
125
|
-
?? new EventEmitter();
|
|
126
|
-
this.DZ_DRAGOVER = this.component?.DZ_DRAGOVER
|
|
127
|
-
?? new EventEmitter();
|
|
128
|
-
this.DZ_DRAGLEAVE = this.component?.DZ_DRAGLEAVE
|
|
129
|
-
?? new EventEmitter();
|
|
130
|
-
this.DZ_PASTE = this.component?.DZ_PASTE
|
|
131
|
-
?? new EventEmitter();
|
|
132
|
-
this.DZ_RESET = this.component?.DZ_RESET
|
|
133
|
-
?? new EventEmitter();
|
|
134
|
-
this.DZ_ADDEDFILE = this.component?.DZ_ADDEDFILE
|
|
135
|
-
?? new EventEmitter();
|
|
136
|
-
this.DZ_ADDEDFILES = this.component?.DZ_ADDEDFILES
|
|
137
|
-
?? new EventEmitter();
|
|
138
|
-
this.DZ_REMOVEDFILE = this.component?.DZ_REMOVEDFILE
|
|
139
|
-
?? new EventEmitter();
|
|
140
|
-
this.DZ_THUMBNAIL = this.component?.DZ_THUMBNAIL
|
|
141
|
-
?? new EventEmitter();
|
|
142
|
-
this.DZ_ERROR = this.component?.DZ_ERROR
|
|
143
|
-
?? new EventEmitter();
|
|
144
|
-
this.DZ_ERRORMULTIPLE = this.component?.DZ_ERRORMULTIPLE
|
|
145
|
-
?? new EventEmitter();
|
|
146
|
-
this.DZ_PROCESSING = this.component?.DZ_PROCESSING
|
|
147
|
-
?? new EventEmitter();
|
|
148
|
-
this.DZ_PROCESSINGMULTIPLE = this.component?.DZ_PROCESSINGMULTIPLE
|
|
149
|
-
?? new EventEmitter();
|
|
150
|
-
this.DZ_UPLOADPROGRESS = this.component?.DZ_UPLOADPROGRESS
|
|
151
|
-
?? new EventEmitter();
|
|
152
|
-
this.DZ_TOTALUPLOADPROGRESS = this.component?.DZ_TOTALUPLOADPROGRESS
|
|
153
|
-
?? new EventEmitter();
|
|
154
|
-
this.DZ_SENDING = this.component?.DZ_SENDING
|
|
155
|
-
?? new EventEmitter();
|
|
156
|
-
this.DZ_SENDINGMULTIPLE = this.component?.DZ_SENDINGMULTIPLE
|
|
157
|
-
?? new EventEmitter();
|
|
158
|
-
this.DZ_SUCCESS = this.component?.DZ_SUCCESS
|
|
159
|
-
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
160
|
-
?? new EventEmitter();
|
|
161
|
-
this.DZ_SUCCESSMULTIPLE = this.component?.DZ_SUCCESSMULTIPLE
|
|
162
|
-
?? new EventEmitter();
|
|
163
|
-
this.DZ_CANCELED = this.component?.DZ_CANCELED
|
|
164
|
-
?? new EventEmitter();
|
|
165
|
-
this.DZ_CANCELEDMULTIPLE = this.component?.DZ_CANCELEDMULTIPLE
|
|
166
|
-
?? new EventEmitter();
|
|
167
|
-
this.DZ_COMPLETE = this.component?.DZ_COMPLETE
|
|
168
|
-
?? new EventEmitter();
|
|
169
|
-
this.DZ_COMPLETEMULTIPLE = this.component?.DZ_COMPLETEMULTIPLE
|
|
170
|
-
?? new EventEmitter();
|
|
171
|
-
this.DZ_MAXFILESEXCEEDED = this.component?.DZ_MAXFILESEXCEEDED
|
|
172
|
-
?? new EventEmitter();
|
|
173
|
-
this.DZ_MAXFILESREACHED = this.component?.DZ_MAXFILESREACHED
|
|
174
|
-
?? new EventEmitter();
|
|
175
|
-
this.DZ_QUEUECOMPLETE = this.component?.DZ_QUEUECOMPLETE
|
|
176
|
-
?? new EventEmitter();
|
|
177
|
-
}
|
|
178
|
-
/** @internal */
|
|
179
|
-
ngOnInit() {
|
|
180
|
-
this.initInstance();
|
|
181
|
-
}
|
|
182
|
-
/** @internal */
|
|
183
|
-
ngOnDestroy() {
|
|
184
|
-
this.destroyInstance();
|
|
185
|
-
}
|
|
186
|
-
/** @internal */
|
|
187
|
-
ngDoCheck() {
|
|
188
|
-
const changes = this.configDiff.diff(this.config || {});
|
|
189
|
-
if (changes) {
|
|
124
|
+
constructor() {
|
|
125
|
+
super();
|
|
126
|
+
this.zone = inject(NgZone);
|
|
127
|
+
this.elementRef = inject(ElementRef);
|
|
128
|
+
this.differs = inject(KeyValueDiffers);
|
|
129
|
+
this.platformId = inject(PLATFORM_ID);
|
|
130
|
+
this.defaults = inject(NXT_DROPZONE_CONFIG, { optional: true });
|
|
131
|
+
this.listeners = inject(NXT_DROPZONE_LISTENERS, { optional: true }) || this;
|
|
132
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
133
|
+
/** Can be used to provide optional custom config */
|
|
134
|
+
this._config = input(undefined, { ...(ngDevMode ? { debugName: "_config" } : {}), alias: 'nxtDropzone' });
|
|
135
|
+
this.configDiff = this.differs.find(this._config() || {}).create();
|
|
136
|
+
this.config = computed(() => ({ ...this._config() }), { ...(ngDevMode ? { debugName: "config" } : {}), equal: (_, n) => !this.configDiff.diff(n) });
|
|
137
|
+
this._params = computed(() => {
|
|
190
138
|
let newParams = this.defaults
|
|
191
139
|
? new _DropzoneConfig(this.defaults)
|
|
192
140
|
: undefined;
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
141
|
+
const config = this.config();
|
|
142
|
+
if (newParams && config)
|
|
143
|
+
newParams.assign(config);
|
|
144
|
+
else if (config)
|
|
145
|
+
newParams = new _DropzoneConfig(config);
|
|
146
|
+
const params = { ...newParams };
|
|
147
|
+
Object.entries(params).forEach(([k, v]) => {
|
|
148
|
+
if (v === undefined)
|
|
149
|
+
delete params[k];
|
|
150
|
+
});
|
|
151
|
+
return params;
|
|
152
|
+
}, ...(ngDevMode ? [{ debugName: "_params" }] : []));
|
|
153
|
+
this.paramDiff = this.differs.find({ ...this._params() }).create();
|
|
154
|
+
this.params = computed(() => ({ ...this._params() }), { ...(ngDevMode ? { debugName: "params" } : {}), equal: (_, n) => {
|
|
155
|
+
const d = this.paramDiff.diff(n);
|
|
156
|
+
if (d) {
|
|
157
|
+
let hasChanges = false;
|
|
158
|
+
d.forEachItem(r => {
|
|
159
|
+
if (!internalChanges.has(r.key) && r.currentValue !== r.previousValue)
|
|
160
|
+
hasChanges = true;
|
|
161
|
+
});
|
|
162
|
+
return !hasChanges;
|
|
208
163
|
}
|
|
164
|
+
return !d;
|
|
165
|
+
} });
|
|
166
|
+
/** @internal */
|
|
167
|
+
this._isSingle = computed(() => this.params()?.maxFiles === 1, ...(ngDevMode ? [{ debugName: "_isSingle" }] : []));
|
|
168
|
+
/** @internal */
|
|
169
|
+
this._isMultiple = computed(() => this.params()?.maxFiles !== 1, ...(ngDevMode ? [{ debugName: "_isMultiple" }] : []));
|
|
170
|
+
let disabled = this.disabled();
|
|
171
|
+
effect(() => {
|
|
172
|
+
disabled = this.disabled();
|
|
173
|
+
const instance = this._instance;
|
|
174
|
+
if (instance) {
|
|
175
|
+
if (disabled)
|
|
176
|
+
this.zone.runOutsideAngular(() => {
|
|
177
|
+
instance.disable();
|
|
178
|
+
});
|
|
179
|
+
else
|
|
180
|
+
this.zone.runOutsideAngular(() => {
|
|
181
|
+
instance.enable();
|
|
182
|
+
});
|
|
209
183
|
}
|
|
210
|
-
}
|
|
184
|
+
});
|
|
185
|
+
effect(() => {
|
|
186
|
+
const params = this.params();
|
|
187
|
+
this.destroyInstance();
|
|
188
|
+
this.initInstance(params, disabled);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/** @internal */
|
|
192
|
+
ngOnDestroy() {
|
|
193
|
+
this.destroyInstance();
|
|
211
194
|
}
|
|
212
195
|
/** @internal */
|
|
213
196
|
reset(cancel) {
|
|
214
|
-
|
|
197
|
+
const instance = this._instance;
|
|
198
|
+
if (instance) {
|
|
215
199
|
this.zone.runOutsideAngular(() => {
|
|
216
|
-
|
|
200
|
+
instance.removeAllFiles(cancel);
|
|
217
201
|
});
|
|
218
202
|
}
|
|
219
203
|
}
|
|
220
|
-
initInstance() {
|
|
221
|
-
if (!isPlatformBrowser(this.platformId) || !
|
|
204
|
+
initInstance(params, disabled = false) {
|
|
205
|
+
if (!isPlatformBrowser(this.platformId) || !params) {
|
|
222
206
|
return;
|
|
223
207
|
}
|
|
224
208
|
this.zone.runOutsideAngular(() => {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
209
|
+
const instance = new Dropzone(this.elementRef.nativeElement, params);
|
|
210
|
+
if (disabled)
|
|
211
|
+
this.zone.runOutsideAngular(() => {
|
|
212
|
+
instance.disable();
|
|
213
|
+
});
|
|
214
|
+
this._instance = instance;
|
|
231
215
|
this.zone.run(() => {
|
|
232
|
-
this.DZ_INIT.emit(
|
|
216
|
+
this.listeners.DZ_INIT.emit(instance);
|
|
233
217
|
});
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
218
|
+
// Add auto reset handling for events
|
|
219
|
+
instance.on('success', () => {
|
|
220
|
+
const timeout = this.params()?.autoReset ?? -1;
|
|
221
|
+
if (timeout >= 0) {
|
|
222
|
+
setTimeout(() => this.reset(), timeout);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
instance.on('error', () => {
|
|
226
|
+
const timeout = this.params()?.errorReset ?? -1;
|
|
227
|
+
if (timeout >= 0) {
|
|
228
|
+
setTimeout(() => this.reset(), timeout);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
instance.on('canceled', () => {
|
|
232
|
+
const timeout = this.params()?.cancelReset ?? -1;
|
|
233
|
+
if (timeout >= 0) {
|
|
234
|
+
setTimeout(() => this.reset(), timeout);
|
|
235
|
+
}
|
|
236
|
+
});
|
|
237
|
+
// Add native Dropzone event handling
|
|
238
|
+
DropzoneEvents.forEach((eventName) => {
|
|
239
|
+
instance.on(eventName.toLowerCase(), (...args) => {
|
|
240
|
+
args = (args.length === 1) ? args[0] : args;
|
|
241
|
+
const output = `DZ_${eventName.toUpperCase()}`;
|
|
242
|
+
const emitter = this.listeners[output];
|
|
258
243
|
this.zone.run(() => {
|
|
259
244
|
emitter.emit(args);
|
|
260
245
|
});
|
|
261
|
-
}
|
|
246
|
+
});
|
|
262
247
|
});
|
|
263
248
|
});
|
|
264
249
|
}
|
|
265
250
|
destroyInstance() {
|
|
266
|
-
|
|
251
|
+
const instance = this._instance;
|
|
252
|
+
if (instance) {
|
|
267
253
|
this.zone.runOutsideAngular(() => {
|
|
268
|
-
|
|
254
|
+
instance.destroy();
|
|
269
255
|
});
|
|
270
|
-
this.
|
|
256
|
+
this._instance = undefined;
|
|
271
257
|
}
|
|
272
258
|
}
|
|
273
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
274
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
259
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
260
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.1.0", type: DropzoneDirective, isStandalone: true, selector: "[nxtDropzone]", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, _config: { classPropertyName: "_config", publicName: "nxtDropzone", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.dz-single": "_isSingle()", "class.dz-multiple": "_isMultiple()" } }, exportAs: ["nxtDropzone"], usesInheritance: true, ngImport: i0 }); }
|
|
275
261
|
}
|
|
276
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
262
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneDirective, decorators: [{
|
|
277
263
|
type: Directive,
|
|
278
264
|
args: [{
|
|
279
265
|
selector: '[nxtDropzone]',
|
|
280
266
|
exportAs: 'nxtDropzone',
|
|
281
|
-
|
|
267
|
+
host: {
|
|
268
|
+
'[class.dz-single]': '_isSingle()',
|
|
269
|
+
'[class.dz-multiple]': '_isMultiple()'
|
|
270
|
+
}
|
|
282
271
|
}]
|
|
283
|
-
}], ctorParameters: () => [{ type: i0.
|
|
284
|
-
type: Inject,
|
|
285
|
-
args: [PLATFORM_ID]
|
|
286
|
-
}] }, { type: undefined, decorators: [{
|
|
287
|
-
type: Optional
|
|
288
|
-
}, {
|
|
289
|
-
type: Inject,
|
|
290
|
-
args: [NXT_DROPZONE_CONFIG]
|
|
291
|
-
}] }, { type: undefined, decorators: [{
|
|
292
|
-
type: Optional
|
|
293
|
-
}, {
|
|
294
|
-
type: Inject,
|
|
295
|
-
args: [NXT_DROPZONE_LISTENERS]
|
|
296
|
-
}] }], propDecorators: { disabled: [{
|
|
297
|
-
type: Input
|
|
298
|
-
}], config: [{
|
|
299
|
-
type: Input,
|
|
300
|
-
args: ['nxtDropzone']
|
|
301
|
-
}], DZ_INIT: [{
|
|
302
|
-
type: Output,
|
|
303
|
-
args: ['init']
|
|
304
|
-
}], DZ_DROP: [{
|
|
305
|
-
type: Output,
|
|
306
|
-
args: ['drop']
|
|
307
|
-
}], DZ_DRAGSTART: [{
|
|
308
|
-
type: Output,
|
|
309
|
-
args: ['dragStart']
|
|
310
|
-
}], DZ_DRAGEND: [{
|
|
311
|
-
type: Output,
|
|
312
|
-
args: ['dragEnd']
|
|
313
|
-
}], DZ_DRAGENTER: [{
|
|
314
|
-
type: Output,
|
|
315
|
-
args: ['dragEnter']
|
|
316
|
-
}], DZ_DRAGOVER: [{
|
|
317
|
-
type: Output,
|
|
318
|
-
args: ['dragOver']
|
|
319
|
-
}], DZ_DRAGLEAVE: [{
|
|
320
|
-
type: Output,
|
|
321
|
-
args: ['dragLeave']
|
|
322
|
-
}], DZ_PASTE: [{
|
|
323
|
-
type: Output,
|
|
324
|
-
args: ['paste']
|
|
325
|
-
}], DZ_RESET: [{
|
|
326
|
-
type: Output,
|
|
327
|
-
args: ['reset']
|
|
328
|
-
}], DZ_ADDEDFILE: [{
|
|
329
|
-
type: Output,
|
|
330
|
-
args: ['addedFile']
|
|
331
|
-
}], DZ_ADDEDFILES: [{
|
|
332
|
-
type: Output,
|
|
333
|
-
args: ['addedFiles']
|
|
334
|
-
}], DZ_REMOVEDFILE: [{
|
|
335
|
-
type: Output,
|
|
336
|
-
args: ['removedFile']
|
|
337
|
-
}], DZ_THUMBNAIL: [{
|
|
338
|
-
type: Output,
|
|
339
|
-
args: ['thumbnail']
|
|
340
|
-
}], DZ_ERROR: [{
|
|
341
|
-
type: Output,
|
|
342
|
-
args: ['error']
|
|
343
|
-
}], DZ_ERRORMULTIPLE: [{
|
|
344
|
-
type: Output,
|
|
345
|
-
args: ['errorMultiple']
|
|
346
|
-
}], DZ_PROCESSING: [{
|
|
347
|
-
type: Output,
|
|
348
|
-
args: ['processing']
|
|
349
|
-
}], DZ_PROCESSINGMULTIPLE: [{
|
|
350
|
-
type: Output,
|
|
351
|
-
args: ['processingMultiple']
|
|
352
|
-
}], DZ_UPLOADPROGRESS: [{
|
|
353
|
-
type: Output,
|
|
354
|
-
args: ['uploadProgress']
|
|
355
|
-
}], DZ_TOTALUPLOADPROGRESS: [{
|
|
356
|
-
type: Output,
|
|
357
|
-
args: ['totalUploadProgress']
|
|
358
|
-
}], DZ_SENDING: [{
|
|
359
|
-
type: Output,
|
|
360
|
-
args: ['sending']
|
|
361
|
-
}], DZ_SENDINGMULTIPLE: [{
|
|
362
|
-
type: Output,
|
|
363
|
-
args: ['sendingMultiple']
|
|
364
|
-
}], DZ_SUCCESS: [{
|
|
365
|
-
type: Output,
|
|
366
|
-
args: ['success']
|
|
367
|
-
}], DZ_SUCCESSMULTIPLE: [{
|
|
368
|
-
type: Output,
|
|
369
|
-
args: ['successMultiple']
|
|
370
|
-
}], DZ_CANCELED: [{
|
|
371
|
-
type: Output,
|
|
372
|
-
args: ['canceled']
|
|
373
|
-
}], DZ_CANCELEDMULTIPLE: [{
|
|
374
|
-
type: Output,
|
|
375
|
-
args: ['canceledMultiple']
|
|
376
|
-
}], DZ_COMPLETE: [{
|
|
377
|
-
type: Output,
|
|
378
|
-
args: ['complete']
|
|
379
|
-
}], DZ_COMPLETEMULTIPLE: [{
|
|
380
|
-
type: Output,
|
|
381
|
-
args: ['completeMultiple']
|
|
382
|
-
}], DZ_MAXFILESEXCEEDED: [{
|
|
383
|
-
type: Output,
|
|
384
|
-
args: ['maxFilesExceeded']
|
|
385
|
-
}], DZ_MAXFILESREACHED: [{
|
|
386
|
-
type: Output,
|
|
387
|
-
args: ['maxFilesReached']
|
|
388
|
-
}], DZ_QUEUECOMPLETE: [{
|
|
389
|
-
type: Output,
|
|
390
|
-
args: ['queueComplete']
|
|
391
|
-
}], isSingle: [{
|
|
392
|
-
type: HostBinding,
|
|
393
|
-
args: ['class.dz-single']
|
|
394
|
-
}], isMultiple: [{
|
|
395
|
-
type: HostBinding,
|
|
396
|
-
args: ['class.dz-multiple']
|
|
397
|
-
}] } });
|
|
272
|
+
}], ctorParameters: () => [], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], _config: [{ type: i0.Input, args: [{ isSignal: true, alias: "nxtDropzone", required: false }] }] } });
|
|
398
273
|
|
|
399
|
-
|
|
400
|
-
class DropzoneComponent {
|
|
274
|
+
class DropzoneComponent extends DropzoneListeners {
|
|
401
275
|
constructor() {
|
|
276
|
+
super(...arguments);
|
|
402
277
|
/** Disables / detaches Dropzone from the element */
|
|
403
|
-
this.disabled = false;
|
|
278
|
+
this.disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
279
|
+
/** Custom config to override the global defaults */
|
|
280
|
+
this.config = input(...(ngDevMode ? [undefined, { debugName: "config" }] : []));
|
|
404
281
|
/** Message to show for the user on the upload area */
|
|
405
|
-
this.message = 'Click or drag files to upload';
|
|
282
|
+
this.message = input('Click or drag files to upload', ...(ngDevMode ? [{ debugName: "message" }] : []));
|
|
406
283
|
/** Placeholder image to be shown as the upload area */
|
|
407
|
-
this.placeholder = '';
|
|
284
|
+
this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
|
|
408
285
|
/** Use 'dropzone' class (use provided default styles) */
|
|
409
|
-
this.useDropzoneClass = true;
|
|
410
|
-
this.
|
|
411
|
-
|
|
412
|
-
this.
|
|
413
|
-
this.DZ_DRAGEND = new EventEmitter();
|
|
414
|
-
this.DZ_DRAGENTER = new EventEmitter();
|
|
415
|
-
this.DZ_DRAGOVER = new EventEmitter();
|
|
416
|
-
this.DZ_DRAGLEAVE = new EventEmitter();
|
|
417
|
-
this.DZ_PASTE = new EventEmitter();
|
|
418
|
-
this.DZ_RESET = new EventEmitter();
|
|
419
|
-
this.DZ_ADDEDFILE = new EventEmitter();
|
|
420
|
-
this.DZ_ADDEDFILES = new EventEmitter();
|
|
421
|
-
this.DZ_REMOVEDFILE = new EventEmitter();
|
|
422
|
-
this.DZ_THUMBNAIL = new EventEmitter();
|
|
423
|
-
this.DZ_ERROR = new EventEmitter();
|
|
424
|
-
this.DZ_ERRORMULTIPLE = new EventEmitter();
|
|
425
|
-
this.DZ_PROCESSING = new EventEmitter();
|
|
426
|
-
this.DZ_PROCESSINGMULTIPLE = new EventEmitter();
|
|
427
|
-
this.DZ_UPLOADPROGRESS = new EventEmitter();
|
|
428
|
-
this.DZ_TOTALUPLOADPROGRESS = new EventEmitter();
|
|
429
|
-
this.DZ_SENDING = new EventEmitter();
|
|
430
|
-
this.DZ_SENDINGMULTIPLE = new EventEmitter();
|
|
431
|
-
// eslint-disable-next-line @typescript-eslint/no-restricted-types
|
|
432
|
-
this.DZ_SUCCESS = new EventEmitter();
|
|
433
|
-
this.DZ_SUCCESSMULTIPLE = new EventEmitter();
|
|
434
|
-
this.DZ_CANCELED = new EventEmitter();
|
|
435
|
-
this.DZ_CANCELEDMULTIPLE = new EventEmitter();
|
|
436
|
-
this.DZ_COMPLETE = new EventEmitter();
|
|
437
|
-
this.DZ_COMPLETEMULTIPLE = new EventEmitter();
|
|
438
|
-
this.DZ_MAXFILESEXCEEDED = new EventEmitter();
|
|
439
|
-
this.DZ_MAXFILESREACHED = new EventEmitter();
|
|
440
|
-
this.DZ_QUEUECOMPLETE = new EventEmitter();
|
|
286
|
+
this.useDropzoneClass = input(true, ...(ngDevMode ? [{ debugName: "useDropzoneClass" }] : []));
|
|
287
|
+
this.directiveRef = viewChild(DropzoneDirective, ...(ngDevMode ? [{ debugName: "directiveRef" }] : []));
|
|
288
|
+
/** @internal */
|
|
289
|
+
this.text = computed(() => this.config()?.dictDefaultMessage || this.message(), ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
441
290
|
}
|
|
442
291
|
/** @internal */
|
|
443
292
|
ngOnInit() { }
|
|
444
293
|
/** @internal */
|
|
445
294
|
getPlaceholder() {
|
|
446
|
-
return 'url(' + encodeURI(this.placeholder) + ')';
|
|
295
|
+
return 'url(' + encodeURI(this.placeholder()) + ')';
|
|
447
296
|
}
|
|
448
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
449
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
297
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
298
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: DropzoneComponent, isStandalone: true, selector: "nxt-dropzone", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, useDropzoneClass: { classPropertyName: "useDropzoneClass", publicName: "useDropzoneClass", isSignal: true, isRequired: false, transformFunction: null } }, providers: [{
|
|
450
299
|
provide: NXT_DROPZONE_LISTENERS,
|
|
451
300
|
useExisting: DropzoneComponent
|
|
452
|
-
}], viewQueries: [{ propertyName: "directiveRef", first: true, predicate: DropzoneDirective, descendants: true }], ngImport: i0, template: "<div class=\"dz-wrapper\"\r\n [class.dropzone]=\"useDropzoneClass\"\r\n [nxtDropzone]=\"config\"\r\n [disabled]=\"disabled\">\r\n <div class=\"dz-message\"\r\n [class.disabled]=\"disabled\"\r\n [class.dz-placeholder]=\"placeholder\">\r\n <div class=\"dz-text\"\r\n [innerHTML]=\"
|
|
301
|
+
}], viewQueries: [{ propertyName: "directiveRef", first: true, predicate: DropzoneDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"dz-wrapper\"\r\n [class.dropzone]=\"useDropzoneClass()\"\r\n [nxtDropzone]=\"config()\"\r\n [disabled]=\"disabled()\">\r\n <div class=\"dz-message\"\r\n [class.disabled]=\"disabled()\"\r\n [class.dz-placeholder]=\"placeholder()\">\r\n <div class=\"dz-text\"\r\n [innerHTML]=\"text()\"></div>\r\n\r\n @if (placeholder()) {\r\n <div class=\"dz-image\"\r\n [style.background-image]=\"getPlaceholder()\"></div>\r\n }\r\n </div>\r\n\r\n <ng-content />\r\n</div>\r\n", styles: ["nxt-dropzone{display:flex;width:100%;height:auto}nxt-dropzone>.dropzone.dz-wrapper{overflow:auto;width:100%;min-height:0;max-height:100%;padding:0;border:none;color:#666;background:transparent;border-radius:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:16px}nxt-dropzone>.dropzone.dz-wrapper .dz-message{overflow:auto;min-height:60px;max-height:100%;border:2px dashed #aaa;background-color:#eee;display:flex;align-items:center;justify-content:center;margin:0;border-radius:5px;grid-column:span 2;grid-row:span 2}nxt-dropzone>.dropzone.dz-wrapper .dz-message .dz-text{padding:8px 16px;text-align:center}nxt-dropzone>.dropzone.dz-wrapper .dz-message .dz-image{width:100%;height:100%;background-size:contain;background-repeat:no-repeat;background-position:50% 50%}nxt-dropzone>.dropzone.dz-wrapper .dz-message.disabled{cursor:not-allowed}nxt-dropzone>.dropzone.dz-wrapper .dz-message.disabled .dz-text{opacity:.5}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder{position:relative;border-color:#aaa0;transition:border-color .25s ease-in-out}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder .dz-text{position:absolute;z-index:1;opacity:0;font-weight:700;background-color:#ffffff80;transition:filter .25s ease-in-out,opacity .25s ease-in-out}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder:hover:not(.disabled){border-color:#aaa}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder:hover:not(.disabled) .dz-text{opacity:1}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder:hover:not(.disabled) .dz-image{filter:blur(8px)}nxt-dropzone>.dropzone.dz-wrapper .dz-preview{margin:0}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-details{padding:24px}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-progress{width:80%;border:1px solid #aaa;border-radius:5px;overflow:hidden}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-progress .dz-upload{background-color:#666}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-filename span{display:block;overflow:hidden;width:100%;max-width:100%;text-overflow:ellipsis}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-filename span:hover{overflow:visible;white-space:normal;overflow-wrap:break-word}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-image{border-radius:5px;overflow:hidden;min-width:120px;min-height:120px;width:auto;height:auto}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-image img{max-width:120px;max-height:120px}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-message{width:100%;height:100%}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-preview{width:100%;height:100%;grid-column:span 2;grid-row:span 2}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-preview .dz-image{width:100%;height:100%}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-preview .dz-image img{display:block;width:100%;height:auto;margin:0}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-error-message{top:50%;left:50%;transform:translate(-50%) translateY(100%)}nxt-dropzone>.dropzone.dz-wrapper.dz-single.dz-started .dz-message{display:none}nxt-dropzone>.dropzone.dz-wrapper.dz-multiple.dz-started .dz-message{display:flex}\n", "@keyframes passing-through{0%{opacity:0;transform:translateY(40px)}30%,70%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-40px)}}@keyframes slide-in{0%{opacity:0;transform:translateY(40px)}30%{opacity:1;transform:translateY(0)}}@keyframes pulse{0%{transform:scale(1)}10%{transform:scale(1.1)}20%{transform:scale(1)}}.dropzone,.dropzone *{box-sizing:border-box}.dropzone{min-height:150px;border:1px solid rgba(0,0,0,.8);border-radius:5px;padding:20px}.dropzone.dz-clickable{cursor:pointer}.dropzone.dz-clickable *{cursor:default}.dropzone.dz-clickable .dz-message,.dropzone.dz-clickable .dz-message *{cursor:pointer}.dropzone.dz-started .dz-message{display:none}.dropzone.dz-drag-hover{border-style:solid}.dropzone.dz-drag-hover .dz-message{opacity:.5}.dropzone .dz-message{text-align:center;margin:3em 0}.dropzone .dz-message .dz-button{background:none;color:inherit;border:none;padding:0;font:inherit;cursor:pointer;outline:inherit}.dropzone .dz-preview{position:relative;display:inline-block;vertical-align:top;margin:16px;min-height:100px}.dropzone .dz-preview:hover{z-index:1000}.dropzone .dz-preview.dz-file-preview .dz-image{border-radius:20px;background:#999;background:linear-gradient(to bottom,#eee,#ddd)}.dropzone .dz-preview.dz-file-preview .dz-details{opacity:1}.dropzone .dz-preview.dz-image-preview{background:#fff}.dropzone .dz-preview.dz-image-preview .dz-details{transition:opacity .2s linear}.dropzone .dz-preview .dz-remove{font-size:14px;text-align:center;display:block;cursor:pointer;border:none}.dropzone .dz-preview .dz-remove:hover{text-decoration:underline}.dropzone .dz-preview:hover .dz-details{opacity:1}.dropzone .dz-preview .dz-details{z-index:20;position:absolute;top:0;left:0;opacity:0;font-size:13px;min-width:100%;max-width:100%;padding:2em 1em;text-align:center;color:#000000e6;line-height:150%}.dropzone .dz-preview .dz-details .dz-size{margin-bottom:1em;font-size:16px}.dropzone .dz-preview .dz-details .dz-filename{white-space:nowrap}.dropzone .dz-preview .dz-details .dz-filename:hover span{border:1px solid rgba(200,200,200,.8);background-color:#fffc}.dropzone .dz-preview .dz-details .dz-filename:not(:hover){overflow:hidden;text-overflow:ellipsis}.dropzone .dz-preview .dz-details .dz-filename:not(:hover) span{border:1px solid transparent}.dropzone .dz-preview .dz-details .dz-filename span,.dropzone .dz-preview .dz-details .dz-size span{background-color:#fff6;padding:0 .4em;border-radius:3px}.dropzone .dz-preview:hover .dz-image img{transform:scale(1.05);filter:blur(8px)}.dropzone .dz-preview .dz-image{border-radius:20px;overflow:hidden;width:120px;height:120px;position:relative;display:block;z-index:10}.dropzone .dz-preview .dz-image img{display:block}.dropzone .dz-preview.dz-success .dz-success-mark{animation:passing-through 3s cubic-bezier(.77,0,.175,1)}.dropzone .dz-preview.dz-error .dz-error-mark{opacity:1;animation:slide-in 3s cubic-bezier(.77,0,.175,1)}.dropzone .dz-preview .dz-success-mark,.dropzone .dz-preview .dz-error-mark{pointer-events:none;opacity:0;z-index:500;position:absolute;display:block;top:50%;left:50%;margin-left:-27px;margin-top:-27px;background:#000c;border-radius:50%}.dropzone .dz-preview .dz-success-mark svg,.dropzone .dz-preview .dz-error-mark svg{display:block;width:54px;height:54px;fill:#fff}.dropzone .dz-preview.dz-processing .dz-progress{opacity:1;transition:all .2s linear}.dropzone .dz-preview.dz-complete .dz-progress{opacity:0;transition:opacity .4s ease-in}.dropzone .dz-preview:not(.dz-processing) .dz-progress{animation:pulse 6s ease infinite}.dropzone .dz-preview .dz-progress{opacity:1;z-index:1000;pointer-events:none;position:absolute;height:20px;top:50%;margin-top:-10px;left:15%;right:15%;border:3px solid rgba(0,0,0,.8);background:#000c;border-radius:10px;overflow:hidden}.dropzone .dz-preview .dz-progress .dz-upload{background:#fff;display:block;position:relative;height:100%;width:0;transition:width .3s ease-in-out;border-radius:17px}.dropzone .dz-preview.dz-error .dz-error-message{display:block}.dropzone .dz-preview.dz-error:hover .dz-error-message{opacity:1;pointer-events:auto}.dropzone .dz-preview .dz-error-message{pointer-events:none;z-index:1000;position:absolute;display:block;display:none;opacity:0;transition:opacity .3s ease;border-radius:8px;font-size:13px;top:130px;left:-10px;width:140px;background:#b10606;padding:.5em 1em;color:#fff}.dropzone .dz-preview .dz-error-message:after{content:\"\";position:absolute;top:-6px;left:64px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #b10606}\n"], dependencies: [{ kind: "directive", type: DropzoneDirective, selector: "[nxtDropzone]", inputs: ["disabled", "nxtDropzone"], exportAs: ["nxtDropzone"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
|
453
302
|
}
|
|
454
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneComponent, decorators: [{
|
|
455
304
|
type: Component,
|
|
456
305
|
args: [{ selector: 'nxt-dropzone', encapsulation: ViewEncapsulation.None, providers: [{
|
|
457
306
|
provide: NXT_DROPZONE_LISTENERS,
|
|
458
307
|
useExisting: DropzoneComponent
|
|
459
|
-
}],
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
type: Input
|
|
464
|
-
}], message: [{
|
|
465
|
-
type: Input
|
|
466
|
-
}], placeholder: [{
|
|
467
|
-
type: Input
|
|
468
|
-
}], useDropzoneClass: [{
|
|
469
|
-
type: Input
|
|
470
|
-
}], DZ_INIT: [{
|
|
471
|
-
type: Output,
|
|
472
|
-
args: ['init']
|
|
473
|
-
}], DZ_DROP: [{
|
|
474
|
-
type: Output,
|
|
475
|
-
args: ['drop']
|
|
476
|
-
}], DZ_DRAGSTART: [{
|
|
477
|
-
type: Output,
|
|
478
|
-
args: ['dragStart']
|
|
479
|
-
}], DZ_DRAGEND: [{
|
|
480
|
-
type: Output,
|
|
481
|
-
args: ['dragEnd']
|
|
482
|
-
}], DZ_DRAGENTER: [{
|
|
483
|
-
type: Output,
|
|
484
|
-
args: ['dragEnter']
|
|
485
|
-
}], DZ_DRAGOVER: [{
|
|
486
|
-
type: Output,
|
|
487
|
-
args: ['dragOver']
|
|
488
|
-
}], DZ_DRAGLEAVE: [{
|
|
489
|
-
type: Output,
|
|
490
|
-
args: ['dragLeave']
|
|
491
|
-
}], DZ_PASTE: [{
|
|
492
|
-
type: Output,
|
|
493
|
-
args: ['paste']
|
|
494
|
-
}], DZ_RESET: [{
|
|
495
|
-
type: Output,
|
|
496
|
-
args: ['reset']
|
|
497
|
-
}], DZ_ADDEDFILE: [{
|
|
498
|
-
type: Output,
|
|
499
|
-
args: ['addedFile']
|
|
500
|
-
}], DZ_ADDEDFILES: [{
|
|
501
|
-
type: Output,
|
|
502
|
-
args: ['addedFiles']
|
|
503
|
-
}], DZ_REMOVEDFILE: [{
|
|
504
|
-
type: Output,
|
|
505
|
-
args: ['removedFile']
|
|
506
|
-
}], DZ_THUMBNAIL: [{
|
|
507
|
-
type: Output,
|
|
508
|
-
args: ['thumbnail']
|
|
509
|
-
}], DZ_ERROR: [{
|
|
510
|
-
type: Output,
|
|
511
|
-
args: ['error']
|
|
512
|
-
}], DZ_ERRORMULTIPLE: [{
|
|
513
|
-
type: Output,
|
|
514
|
-
args: ['errorMultiple']
|
|
515
|
-
}], DZ_PROCESSING: [{
|
|
516
|
-
type: Output,
|
|
517
|
-
args: ['processing']
|
|
518
|
-
}], DZ_PROCESSINGMULTIPLE: [{
|
|
519
|
-
type: Output,
|
|
520
|
-
args: ['processingMultiple']
|
|
521
|
-
}], DZ_UPLOADPROGRESS: [{
|
|
522
|
-
type: Output,
|
|
523
|
-
args: ['uploadProgress']
|
|
524
|
-
}], DZ_TOTALUPLOADPROGRESS: [{
|
|
525
|
-
type: Output,
|
|
526
|
-
args: ['totalUploadProgress']
|
|
527
|
-
}], DZ_SENDING: [{
|
|
528
|
-
type: Output,
|
|
529
|
-
args: ['sending']
|
|
530
|
-
}], DZ_SENDINGMULTIPLE: [{
|
|
531
|
-
type: Output,
|
|
532
|
-
args: ['sendingMultiple']
|
|
533
|
-
}], DZ_SUCCESS: [{
|
|
534
|
-
type: Output,
|
|
535
|
-
args: ['success']
|
|
536
|
-
}], DZ_SUCCESSMULTIPLE: [{
|
|
537
|
-
type: Output,
|
|
538
|
-
args: ['successMultiple']
|
|
539
|
-
}], DZ_CANCELED: [{
|
|
540
|
-
type: Output,
|
|
541
|
-
args: ['canceled']
|
|
542
|
-
}], DZ_CANCELEDMULTIPLE: [{
|
|
543
|
-
type: Output,
|
|
544
|
-
args: ['canceledMultiple']
|
|
545
|
-
}], DZ_COMPLETE: [{
|
|
546
|
-
type: Output,
|
|
547
|
-
args: ['complete']
|
|
548
|
-
}], DZ_COMPLETEMULTIPLE: [{
|
|
549
|
-
type: Output,
|
|
550
|
-
args: ['completeMultiple']
|
|
551
|
-
}], DZ_MAXFILESEXCEEDED: [{
|
|
552
|
-
type: Output,
|
|
553
|
-
args: ['maxFilesExceeded']
|
|
554
|
-
}], DZ_MAXFILESREACHED: [{
|
|
555
|
-
type: Output,
|
|
556
|
-
args: ['maxFilesReached']
|
|
557
|
-
}], DZ_QUEUECOMPLETE: [{
|
|
558
|
-
type: Output,
|
|
559
|
-
args: ['queueComplete']
|
|
560
|
-
}], directiveRef: [{
|
|
561
|
-
type: ViewChild,
|
|
562
|
-
args: [DropzoneDirective]
|
|
563
|
-
}] } });
|
|
308
|
+
}], imports: [
|
|
309
|
+
DropzoneDirective
|
|
310
|
+
], template: "<div class=\"dz-wrapper\"\r\n [class.dropzone]=\"useDropzoneClass()\"\r\n [nxtDropzone]=\"config()\"\r\n [disabled]=\"disabled()\">\r\n <div class=\"dz-message\"\r\n [class.disabled]=\"disabled()\"\r\n [class.dz-placeholder]=\"placeholder()\">\r\n <div class=\"dz-text\"\r\n [innerHTML]=\"text()\"></div>\r\n\r\n @if (placeholder()) {\r\n <div class=\"dz-image\"\r\n [style.background-image]=\"getPlaceholder()\"></div>\r\n }\r\n </div>\r\n\r\n <ng-content />\r\n</div>\r\n", styles: ["nxt-dropzone{display:flex;width:100%;height:auto}nxt-dropzone>.dropzone.dz-wrapper{overflow:auto;width:100%;min-height:0;max-height:100%;padding:0;border:none;color:#666;background:transparent;border-radius:0;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:16px}nxt-dropzone>.dropzone.dz-wrapper .dz-message{overflow:auto;min-height:60px;max-height:100%;border:2px dashed #aaa;background-color:#eee;display:flex;align-items:center;justify-content:center;margin:0;border-radius:5px;grid-column:span 2;grid-row:span 2}nxt-dropzone>.dropzone.dz-wrapper .dz-message .dz-text{padding:8px 16px;text-align:center}nxt-dropzone>.dropzone.dz-wrapper .dz-message .dz-image{width:100%;height:100%;background-size:contain;background-repeat:no-repeat;background-position:50% 50%}nxt-dropzone>.dropzone.dz-wrapper .dz-message.disabled{cursor:not-allowed}nxt-dropzone>.dropzone.dz-wrapper .dz-message.disabled .dz-text{opacity:.5}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder{position:relative;border-color:#aaa0;transition:border-color .25s ease-in-out}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder .dz-text{position:absolute;z-index:1;opacity:0;font-weight:700;background-color:#ffffff80;transition:filter .25s ease-in-out,opacity .25s ease-in-out}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder:hover:not(.disabled){border-color:#aaa}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder:hover:not(.disabled) .dz-text{opacity:1}nxt-dropzone>.dropzone.dz-wrapper .dz-message.dz-placeholder:hover:not(.disabled) .dz-image{filter:blur(8px)}nxt-dropzone>.dropzone.dz-wrapper .dz-preview{margin:0}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-details{padding:24px}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-progress{width:80%;border:1px solid #aaa;border-radius:5px;overflow:hidden}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-progress .dz-upload{background-color:#666}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-filename span{display:block;overflow:hidden;width:100%;max-width:100%;text-overflow:ellipsis}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-filename span:hover{overflow:visible;white-space:normal;overflow-wrap:break-word}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-image{border-radius:5px;overflow:hidden;min-width:120px;min-height:120px;width:auto;height:auto}nxt-dropzone>.dropzone.dz-wrapper .dz-preview .dz-image img{max-width:120px;max-height:120px}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-message{width:100%;height:100%}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-preview{width:100%;height:100%;grid-column:span 2;grid-row:span 2}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-preview .dz-image{width:100%;height:100%}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-preview .dz-image img{display:block;width:100%;height:auto;margin:0}nxt-dropzone>.dropzone.dz-wrapper.dz-single .dz-error-message{top:50%;left:50%;transform:translate(-50%) translateY(100%)}nxt-dropzone>.dropzone.dz-wrapper.dz-single.dz-started .dz-message{display:none}nxt-dropzone>.dropzone.dz-wrapper.dz-multiple.dz-started .dz-message{display:flex}\n", "@keyframes passing-through{0%{opacity:0;transform:translateY(40px)}30%,70%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-40px)}}@keyframes slide-in{0%{opacity:0;transform:translateY(40px)}30%{opacity:1;transform:translateY(0)}}@keyframes pulse{0%{transform:scale(1)}10%{transform:scale(1.1)}20%{transform:scale(1)}}.dropzone,.dropzone *{box-sizing:border-box}.dropzone{min-height:150px;border:1px solid rgba(0,0,0,.8);border-radius:5px;padding:20px}.dropzone.dz-clickable{cursor:pointer}.dropzone.dz-clickable *{cursor:default}.dropzone.dz-clickable .dz-message,.dropzone.dz-clickable .dz-message *{cursor:pointer}.dropzone.dz-started .dz-message{display:none}.dropzone.dz-drag-hover{border-style:solid}.dropzone.dz-drag-hover .dz-message{opacity:.5}.dropzone .dz-message{text-align:center;margin:3em 0}.dropzone .dz-message .dz-button{background:none;color:inherit;border:none;padding:0;font:inherit;cursor:pointer;outline:inherit}.dropzone .dz-preview{position:relative;display:inline-block;vertical-align:top;margin:16px;min-height:100px}.dropzone .dz-preview:hover{z-index:1000}.dropzone .dz-preview.dz-file-preview .dz-image{border-radius:20px;background:#999;background:linear-gradient(to bottom,#eee,#ddd)}.dropzone .dz-preview.dz-file-preview .dz-details{opacity:1}.dropzone .dz-preview.dz-image-preview{background:#fff}.dropzone .dz-preview.dz-image-preview .dz-details{transition:opacity .2s linear}.dropzone .dz-preview .dz-remove{font-size:14px;text-align:center;display:block;cursor:pointer;border:none}.dropzone .dz-preview .dz-remove:hover{text-decoration:underline}.dropzone .dz-preview:hover .dz-details{opacity:1}.dropzone .dz-preview .dz-details{z-index:20;position:absolute;top:0;left:0;opacity:0;font-size:13px;min-width:100%;max-width:100%;padding:2em 1em;text-align:center;color:#000000e6;line-height:150%}.dropzone .dz-preview .dz-details .dz-size{margin-bottom:1em;font-size:16px}.dropzone .dz-preview .dz-details .dz-filename{white-space:nowrap}.dropzone .dz-preview .dz-details .dz-filename:hover span{border:1px solid rgba(200,200,200,.8);background-color:#fffc}.dropzone .dz-preview .dz-details .dz-filename:not(:hover){overflow:hidden;text-overflow:ellipsis}.dropzone .dz-preview .dz-details .dz-filename:not(:hover) span{border:1px solid transparent}.dropzone .dz-preview .dz-details .dz-filename span,.dropzone .dz-preview .dz-details .dz-size span{background-color:#fff6;padding:0 .4em;border-radius:3px}.dropzone .dz-preview:hover .dz-image img{transform:scale(1.05);filter:blur(8px)}.dropzone .dz-preview .dz-image{border-radius:20px;overflow:hidden;width:120px;height:120px;position:relative;display:block;z-index:10}.dropzone .dz-preview .dz-image img{display:block}.dropzone .dz-preview.dz-success .dz-success-mark{animation:passing-through 3s cubic-bezier(.77,0,.175,1)}.dropzone .dz-preview.dz-error .dz-error-mark{opacity:1;animation:slide-in 3s cubic-bezier(.77,0,.175,1)}.dropzone .dz-preview .dz-success-mark,.dropzone .dz-preview .dz-error-mark{pointer-events:none;opacity:0;z-index:500;position:absolute;display:block;top:50%;left:50%;margin-left:-27px;margin-top:-27px;background:#000c;border-radius:50%}.dropzone .dz-preview .dz-success-mark svg,.dropzone .dz-preview .dz-error-mark svg{display:block;width:54px;height:54px;fill:#fff}.dropzone .dz-preview.dz-processing .dz-progress{opacity:1;transition:all .2s linear}.dropzone .dz-preview.dz-complete .dz-progress{opacity:0;transition:opacity .4s ease-in}.dropzone .dz-preview:not(.dz-processing) .dz-progress{animation:pulse 6s ease infinite}.dropzone .dz-preview .dz-progress{opacity:1;z-index:1000;pointer-events:none;position:absolute;height:20px;top:50%;margin-top:-10px;left:15%;right:15%;border:3px solid rgba(0,0,0,.8);background:#000c;border-radius:10px;overflow:hidden}.dropzone .dz-preview .dz-progress .dz-upload{background:#fff;display:block;position:relative;height:100%;width:0;transition:width .3s ease-in-out;border-radius:17px}.dropzone .dz-preview.dz-error .dz-error-message{display:block}.dropzone .dz-preview.dz-error:hover .dz-error-message{opacity:1;pointer-events:auto}.dropzone .dz-preview .dz-error-message{pointer-events:none;z-index:1000;position:absolute;display:block;display:none;opacity:0;transition:opacity .3s ease;border-radius:8px;font-size:13px;top:130px;left:-10px;width:140px;background:#b10606;padding:.5em 1em;color:#fff}.dropzone .dz-preview .dz-error-message:after{content:\"\";position:absolute;top:-6px;left:64px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #b10606}\n"] }]
|
|
311
|
+
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], config: [{ type: i0.Input, args: [{ isSignal: true, alias: "config", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], useDropzoneClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "useDropzoneClass", required: false }] }], directiveRef: [{ type: i0.ViewChild, args: [i0.forwardRef(() => DropzoneDirective), { isSignal: true }] }] } });
|
|
564
312
|
|
|
313
|
+
/** @deprecated use standalone imports */
|
|
565
314
|
class DropzoneModule {
|
|
566
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
567
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
568
|
-
DropzoneDirective],
|
|
315
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
316
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: DropzoneModule, imports: [DropzoneComponent,
|
|
317
|
+
DropzoneDirective], exports: [DropzoneComponent,
|
|
569
318
|
DropzoneDirective] }); }
|
|
570
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
319
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneModule }); }
|
|
571
320
|
}
|
|
572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DropzoneModule, decorators: [{
|
|
573
322
|
type: NgModule,
|
|
574
323
|
args: [{
|
|
575
|
-
|
|
324
|
+
imports: [
|
|
576
325
|
DropzoneComponent,
|
|
577
326
|
DropzoneDirective
|
|
578
327
|
],
|
|
579
|
-
imports: [
|
|
580
|
-
CommonModule
|
|
581
|
-
],
|
|
582
328
|
exports: [
|
|
583
329
|
DropzoneComponent,
|
|
584
330
|
DropzoneDirective
|
|
@@ -590,5 +336,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImpor
|
|
|
590
336
|
* Generated bundle index. Do not edit.
|
|
591
337
|
*/
|
|
592
338
|
|
|
593
|
-
export { DropzoneComponent, DropzoneDirective, DropzoneModule, NXT_DROPZONE_CONFIG };
|
|
339
|
+
export { DropzoneComponent, DropzoneDirective, DropzoneListeners, DropzoneModule, NXT_DROPZONE_CONFIG, provideDropzoneConfig };
|
|
594
340
|
//# sourceMappingURL=nxt-dropzone-wrapper.mjs.map
|