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