@sankhyalabs/ezui 1.1.40 → 1.1.41

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,136 +1,121 @@
1
- import { Component, Host, h, Prop, Method, Event } from '@stencil/core';
1
+ import { Component, h, Prop, Element, Event, Method, Watch, forceUpdate } from '@stencil/core';
2
+ import Application from '../../utils/Application';
3
+ import RemoteFile from './RemoteFile';
2
4
  export class EzUpload {
3
- fileListChange() {
4
- this.ezChange.emit({ value: this.value });
5
+ constructor() {
6
+ this._filePointers = new Map();
7
+ /**
8
+ * Deixa o campo disponível ou não para digitação.
9
+ */
10
+ this.enabled = true;
5
11
  }
6
- async addFiles(files) {
7
- Array.prototype.forEach.call(files, this.addFile.bind(this));
12
+ updatePointers(newValue) {
13
+ if (newValue !== this._updatingValue) {
14
+ this._filePointers.forEach(f => {
15
+ if (this.isRemoteFile(f)) {
16
+ f.abortUpload();
17
+ }
18
+ });
19
+ this._filePointers = new Map();
20
+ if (newValue) {
21
+ newValue.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
22
+ }
23
+ }
24
+ this._updatingValue = undefined;
8
25
  }
9
- addFile(file) {
10
- this.errorMessage = undefined;
11
- if (this.validateFile(file)) {
12
- if (this.target) {
13
- this._uploadFile(file);
26
+ normalizeRequestHeaders() {
27
+ this._requestHeaders = new Map();
28
+ if (typeof this.requestheaders == 'string') {
29
+ try {
30
+ this.requestheaders = JSON.parse(this.requestheaders);
14
31
  }
15
- else {
16
- this.errorMessage = "Endereço de upload não informado";
17
- alert(this.errorMessage);
32
+ catch (e) {
33
+ this.requestheaders = undefined;
18
34
  }
19
35
  }
20
- else {
21
- if (this.errorMessage && this.errorMessage.length > 0) {
22
- alert(this.errorMessage);
23
- }
36
+ for (var key in this.requestheaders) {
37
+ this._requestHeaders.set(key, this.requestheaders[key]);
24
38
  }
25
39
  }
26
- validateFile(file) {
27
- this.errorMessage = '';
28
- let isValid = true;
29
- if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
30
- this.errorMessage = 'O tamanho máximo dos arquivos é de ' + this.formatBytes(this.maxFileSize);
31
- isValid = false;
32
- }
33
- this.validatedEvent.emit({ isValid: isValid, fileName: file.name });
34
- return isValid;
40
+ async addFiles(files) {
41
+ Array.prototype.forEach.call(files, this.addFile.bind(this));
35
42
  }
36
- _uploadFile(file) {
37
- const xhr = (file.xhr = this._createXhr());
38
- const newValue = this.value ? [...this.value] : [];
39
- newValue.push({ name: file.name, size: file.size, xhr: file.xhr });
40
- let stalledId;
41
- xhr.upload.onprogress = (e) => {
42
- clearTimeout(stalledId);
43
- const loaded = e.loaded, total = e.total, progress = ~~((loaded / total) * 100);
44
- let viewFile = newValue.find(f => f.name === file.name);
45
- if (viewFile) {
46
- viewFile.progress = progress;
47
- }
48
- };
49
- xhr.onreadystatechange = () => {
50
- this.errorMessage = '';
51
- if (xhr.readyState == 4) {
52
- clearTimeout(stalledId);
53
- file.indeterminate = file.uploading = false;
54
- if (xhr.status === 0) {
55
- // this.errorMessage = "Servidor indisponível";
56
- }
57
- else if (xhr.status >= 500) {
58
- this.errorMessage = "Erro inesperado no servidor";
59
- }
60
- else if (xhr.status >= 400) {
61
- this.errorMessage = "Operação não permitida";
62
- }
63
- if (this.errorMessage && this.errorMessage.length > 0) {
64
- //TODO
65
- // Conferir com o time de UX um estado de erro ou remoção da lista
66
- // this.removeFile(file.name);
67
- alert(this.errorMessage);
68
- }
69
- else {
70
- if (xhr.response) {
71
- let response = JSON.parse(xhr.response);
72
- response.forEach(element => {
73
- let viewFile = newValue.find(f => f.name === this.decode_utf8(element.name));
74
- if (viewFile) {
75
- viewFile.progress = undefined;
76
- //Validar estado de erro com UX
77
- viewFile.error = false;
78
- delete viewFile.xhr;
79
- viewFile.downloadURL = element.downloadURL;
80
- viewFile.lastModifiedDate = element.lastModifiedDate;
81
- viewFile.properties = element.properties;
82
- }
83
- else {
84
- //caso não encontre o elemento na lista
85
- }
86
- });
87
- this.value = newValue;
88
- this.fileListChange();
89
- }
90
- else {
91
- let viewFile = newValue.find(f => f.name === file.name);
92
- viewFile.progress = undefined;
93
- //Validar estado de erro com UX
94
- viewFile.error = true;
43
+ async addFile(file) {
44
+ const oldFile = this._filePointers.get(file.name);
45
+ if (oldFile) {
46
+ Application.confirm("Substituir arquivo", `Já existe um arquivo chamado "${file.name}". Deseja substituí-lo?`)
47
+ .then(ok => {
48
+ if (ok) {
49
+ if (this.isRemoteFile(oldFile)) {
50
+ oldFile.abortUpload();
95
51
  }
52
+ this.doAddFile(file);
96
53
  }
97
- }
98
- };
99
- xhr.ontimeout = () => {
100
- if (this.errorMessage && this.errorMessage.length > 0) {
101
- this.errorMessage.concat(" / Tempo expirado");
102
- this.removeFile(file.name);
103
- alert(this.errorMessage);
104
- }
105
- };
106
- const formData = new FormData();
107
- formData.append(this.formDataName, file, file.name);
108
- xhr.open("POST", this.target, true);
109
- this._configureXhr(xhr);
110
- file.status = "conectando";
111
- file.uploading = file.indeterminate = true;
112
- file.complete = file.abort = file.error = file.held = false;
113
- xhr.send(formData);
54
+ });
55
+ }
56
+ else {
57
+ this.doAddFile(file);
58
+ }
59
+ }
60
+ async doAddFile(file) {
61
+ if (this.validateFile(file)) {
62
+ const uploadingFile = new RemoteFile(file);
63
+ this._filePointers.set(file.name, uploadingFile);
64
+ uploadingFile.upload(this.urlupload, this._requestHeaders, (file) => this.updateFeedback(file))
65
+ .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
66
+ .catch(msg => this.showError(msg));
67
+ forceUpdate(this);
68
+ }
114
69
  }
115
- _createXhr() {
116
- return new XMLHttpRequest();
70
+ finishUpload(ezFile) {
71
+ this._filePointers.set(ezFile.name, ezFile);
72
+ this.updateValue();
117
73
  }
118
- _configureXhr(xhr) {
119
- if (typeof this.headers == 'string') {
120
- try {
121
- this.headers = JSON.parse(this.headers);
74
+ updateValue() {
75
+ this._updatingValue = [];
76
+ this._filePointers.forEach(f => {
77
+ if (!this.isRemoteFile(f)) {
78
+ this._updatingValue.push(f);
122
79
  }
123
- catch (e) {
124
- this.headers = undefined;
80
+ });
81
+ this.value = this._updatingValue;
82
+ this.ezChange.emit(this.value);
83
+ }
84
+ buildProgressId(uploading) {
85
+ let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, '_');
86
+ return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
87
+ }
88
+ updateFeedback(uf) {
89
+ window.requestAnimationFrame(() => {
90
+ if (this._host) {
91
+ const progress = this._host.shadowRoot.querySelector('#' + this.buildProgressId(uf));
92
+ if (progress) {
93
+ progress.value = uf.progress;
94
+ }
125
95
  }
96
+ });
97
+ }
98
+ validateFile(file) {
99
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
100
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
101
+ return false;
102
+ }
103
+ if (file.size === 0) {
104
+ this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
105
+ return false;
126
106
  }
127
- for (var key in this.headers) {
128
- xhr.setRequestHeader(key, this.headers[key]);
107
+ if (!this.urlupload) {
108
+ this.showError("Endereço de upload não informado");
109
+ return false;
129
110
  }
130
- if (this.timeout) {
131
- xhr.timeout = this.timeout;
111
+ if (this.maxfilesize >= 0 && file.size > this.maxfilesize) {
112
+ this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxfilesize));
113
+ return false;
132
114
  }
133
- xhr.withCredentials = this.withCredentials;
115
+ return true;
116
+ }
117
+ showError(message) {
118
+ Application.alert("Enviando arquivo", message);
134
119
  }
135
120
  formatBytes(bytes, decimals = 1) {
136
121
  if (bytes === 0)
@@ -142,118 +127,92 @@ export class EzUpload {
142
127
  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
143
128
  }
144
129
  onFileInputChange(event) {
145
- this.addFiles(event.target.files);
130
+ const input = event.target;
131
+ this.addFiles(Array.from(input.files));
146
132
  this._fileInput.value = '';
147
133
  }
148
- /*componentWillLoad() {
149
- if (this.fileList?.length > 0) {
150
- this.fileList.forEach(item => {
151
- if (item.size) {
152
- item.strSize = this.formatBytes(item.size);
153
- }
154
- })
155
- this.fileList = [...this.fileList];
134
+ isRemoteFile(item) {
135
+ return "file" in item;
136
+ }
137
+ removeFromList(name) {
138
+ this._filePointers.delete(name);
139
+ this.updateValue();
140
+ }
141
+ removeFile(name) {
142
+ const item = this._filePointers.get(name);
143
+ if (this.isRemoteFile(item)) {
144
+ item.abortUpload();
145
+ this.removeFromList(name);
146
+ }
147
+ else {
148
+ if (this.urldelete) {
149
+ const uploadingFile = new RemoteFile(null);
150
+ this._filePointers.set(item.name, uploadingFile);
151
+ uploadingFile.delete(item, this.urldelete, null)
152
+ .then(_ok => this.removeFromList(name))
153
+ .catch(msg => this.showError(msg));
154
+ }
155
+ else {
156
+ this.removeFromList(name);
157
+ }
156
158
  }
157
- }*/
158
- decode_utf8(s) {
159
- return decodeURIComponent(escape(s));
160
159
  }
161
160
  componentDidLoad() {
162
- if (this.dropZone && window.FileList && window.File) {
163
- this.dropZone.addEventListener('dragover', event => {
161
+ if (this._dropZone && window.FileList && window.File) {
162
+ this._dropZone.addEventListener('dragover', event => {
164
163
  event.stopPropagation();
165
164
  event.preventDefault();
166
165
  event.dataTransfer.dropEffect = 'copy';
167
166
  });
168
- this.dropZone.addEventListener('drop', event => {
167
+ this._dropZone.addEventListener('drop', event => {
169
168
  event.stopPropagation();
170
169
  event.preventDefault();
171
- this.addFiles(event.dataTransfer.files);
170
+ this.addFiles(Array.from(event.dataTransfer.files));
172
171
  });
173
172
  }
174
173
  }
175
- removeFile(name, xhr, downloadURL) {
176
- if (xhr) {
177
- xhr.abort();
174
+ openFilesDialog() {
175
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
176
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
178
177
  }
179
- if (downloadURL) {
180
- this.removeFileFromServer(name, downloadURL);
178
+ else {
179
+ this._fileInput.click();
181
180
  }
182
- this.value = [...this.value.filter(function (value) { return value.name !== name; })];
183
- this.fileListChange();
184
- }
185
- removeFileFromServer(name, donwloadURL) {
186
- const xhr = this._createXhr();
187
- this.errorMessage = '';
188
- let stalledId;
189
- xhr.onreadystatechange = () => {
190
- if (xhr.readyState == 4) {
191
- clearTimeout(stalledId);
192
- if (xhr.status === 0) {
193
- this.errorMessage = "Servidor indisponível";
194
- }
195
- else if (xhr.status >= 500) {
196
- this.errorMessage = "Erro inesperado no servidor";
197
- }
198
- else if (xhr.status >= 400) {
199
- this.errorMessage = "Operação não permitida";
200
- }
201
- if (this.errorMessage && this.errorMessage.length > 0) {
202
- //TODO
203
- // Conferir com o time de UX um estado de erro ou remoção da lista
204
- // this.removeFile(file.name);
205
- alert(this.errorMessage);
206
- }
207
- }
208
- };
209
- xhr.ontimeout = () => {
210
- if (this.errorMessage && this.errorMessage.length > 0) {
211
- alert(this.errorMessage);
212
- }
213
- };
214
- const body = JSON.stringify({
215
- name: name,
216
- donwloadURL: donwloadURL,
217
- });
218
- xhr.open("DELETE", this.target, true);
219
- xhr.setRequestHeader('Content-Type', 'application/json');
220
- this._configureXhr(xhr);
221
- xhr.send(body);
222
181
  }
223
182
  render() {
224
- var _a;
225
- return (h(Host, null,
226
- h("slot", null,
227
- h("div", { ref: (el) => this.dropZone = el, class: "iu" },
228
- h("div", { class: "iu__container" },
229
- h("div", { onClick: () => this._fileInput.click(), class: "iu__icon-label" },
230
- h("button", { class: "iu__file-icon" }),
231
- h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para anexar arquivo")),
232
- ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ?
233
- h("div", { class: "iu__footer" }, this.value.map(file => {
234
- return (h("div", { class: "iu__item" },
235
- h("div", { class: "iu__item-label" + (file.progress ? " modificador " : " modificador ") }, file.downloadURL ?
236
- h("div", { title: file.name + "(" + this.formatBytes(file.size) + ")", class: "file__name text text--primary text--small text--ellipsis align--middle" },
237
- h("a", { href: file.downloadURL, download: true },
238
- file.name,
239
- " (",
240
- this.formatBytes(file.size),
241
- ")"))
242
- :
243
- h("div", { title: file.name + "(" + this.formatBytes(file.size) + ")", class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle " },
244
- file.name,
245
- " (",
246
- this.formatBytes(file.size),
247
- ")")),
248
- file.progress ?
249
- h("div", { class: "col col--sd-4 col--stretch align--middle" },
250
- h("progress", { value: file.progress, max: "100" }))
251
- : undefined,
252
- h("div", { class: "col col--stretch align--middle" },
253
- h("button", { class: "btn-cancel ", onClick: () => this.removeFile(file.name, file.xhr) }))));
254
- }))
255
- : undefined))),
256
- h("input", { ref: (el) => this._fileInput = el, type: "file", id: "fileInput", hidden: true, onChange: (ev) => this.onFileInputChange(ev), multiple: true })));
183
+ return (h("div", { ref: (el) => this._dropZone = el, class: "iu" },
184
+ this.label ? h("label", { class: "iu__label", title: this.label }, this.label) : null,
185
+ h("div", { class: "iu__container", onClick: () => this.openFilesDialog() },
186
+ h("div", { class: "iu__icon-label" },
187
+ h("button", { class: "iu__file-icon" }),
188
+ h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para adicionar arquivos")),
189
+ this.buildFooter()),
190
+ h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
191
+ }
192
+ buildFooter() {
193
+ if (this._filePointers.size === 0) {
194
+ return null;
195
+ }
196
+ const items = [];
197
+ this._filePointers.forEach(item => items.push(this.buildFileItem(item)));
198
+ return (h("div", { class: "iu__footer" }, items));
199
+ }
200
+ buildFileItem(item) {
201
+ const fileName = item.name;
202
+ const progress = Number(item['progress']);
203
+ const downloadURL = item['downloadURL'];
204
+ const label = `${fileName} (${this.formatBytes(item.size)})`;
205
+ return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() },
206
+ h("div", { class: "iu__item-label modificador" },
207
+ h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? h("a", { href: downloadURL, download: true }, label) : label)),
208
+ isNaN(progress)
209
+ ?
210
+ null
211
+ :
212
+ h("div", { class: "col col--sd-4 col--stretch align--middle" },
213
+ h("progress", { id: this.buildProgressId(item), value: progress, max: "100" })),
214
+ h("div", { class: "col col--stretch align--middle" },
215
+ h("button", { class: "btn-cancel ", onClick: () => this.removeFile(fileName) }))));
257
216
  }
258
217
  static get is() { return "ez-upload"; }
259
218
  static get encapsulation() { return "shadow"; }
@@ -264,41 +223,42 @@ export class EzUpload {
264
223
  "$": ["ez-upload.css"]
265
224
  }; }
266
225
  static get properties() { return {
267
- "maxFileSize": {
268
- "type": "number",
226
+ "label": {
227
+ "type": "string",
269
228
  "mutable": false,
270
229
  "complexType": {
271
- "original": "number",
272
- "resolved": "number",
230
+ "original": "string",
231
+ "resolved": "string",
273
232
  "references": {}
274
233
  },
275
234
  "required": false,
276
235
  "optional": false,
277
236
  "docs": {
278
237
  "tags": [],
279
- "text": "Define se o tamanho m\u00E1ximo (em bytes) de cada arquivo que pode ser transferido"
238
+ "text": "Label \u00E9 o t\u00EDtulo do campo"
280
239
  },
281
- "attribute": "max-file-size",
282
- "reflect": true
240
+ "attribute": "label",
241
+ "reflect": false
283
242
  },
284
- "headers": {
285
- "type": "any",
243
+ "enabled": {
244
+ "type": "boolean",
286
245
  "mutable": false,
287
246
  "complexType": {
288
- "original": "any",
289
- "resolved": "any",
247
+ "original": "boolean",
248
+ "resolved": "boolean",
290
249
  "references": {}
291
250
  },
292
251
  "required": false,
293
252
  "optional": false,
294
253
  "docs": {
295
254
  "tags": [],
296
- "text": "Headers da requisi\u00E7\u00E3o XMLHttpRequest que ser\u00E1 montada para fazer o upload"
255
+ "text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para digita\u00E7\u00E3o."
297
256
  },
298
- "attribute": "headers",
299
- "reflect": true
257
+ "attribute": "enabled",
258
+ "reflect": false,
259
+ "defaultValue": "true"
300
260
  },
301
- "timeout": {
261
+ "maxfilesize": {
302
262
  "type": "number",
303
263
  "mutable": false,
304
264
  "complexType": {
@@ -310,29 +270,46 @@ export class EzUpload {
310
270
  "optional": false,
311
271
  "docs": {
312
272
  "tags": [],
313
- "text": "Define o tempo permitido para realizar a requisi\u00E7\u00E3o, ap\u00F3s esse per\u00EDodo \u00E9 disparado um erro"
273
+ "text": "Define o tamanho m\u00E1ximo (em bytes) de cada arquivo que pode ser transferido"
314
274
  },
315
- "attribute": "timeout",
316
- "reflect": true
275
+ "attribute": "maxfilesize",
276
+ "reflect": false
317
277
  },
318
- "withCredentials": {
319
- "type": "boolean",
278
+ "maxfiles": {
279
+ "type": "number",
320
280
  "mutable": false,
321
281
  "complexType": {
322
- "original": "boolean",
323
- "resolved": "boolean",
282
+ "original": "number",
283
+ "resolved": "number",
284
+ "references": {}
285
+ },
286
+ "required": false,
287
+ "optional": false,
288
+ "docs": {
289
+ "tags": [],
290
+ "text": "Define um limite para a quantidade de arquivos"
291
+ },
292
+ "attribute": "maxfiles",
293
+ "reflect": false
294
+ },
295
+ "requestheaders": {
296
+ "type": "any",
297
+ "mutable": false,
298
+ "complexType": {
299
+ "original": "any",
300
+ "resolved": "any",
324
301
  "references": {}
325
302
  },
326
303
  "required": false,
327
304
  "optional": false,
328
305
  "docs": {
329
306
  "tags": [],
330
- "text": "Define se a requisi\u00E7\u00E3o deve ou n\u00E3o utilizar credenciais"
307
+ "text": "Headers para a requisi\u00E7\u00E3o Http"
331
308
  },
332
- "attribute": "with-credentials",
333
- "reflect": true
309
+ "attribute": "requestheaders",
310
+ "reflect": false
334
311
  },
335
- "formDataName": {
312
+ "urlupload": {
336
313
  "type": "string",
337
314
  "mutable": false,
338
315
  "complexType": {
@@ -344,12 +321,12 @@ export class EzUpload {
344
321
  "optional": false,
345
322
  "docs": {
346
323
  "tags": [],
347
- "text": "Define a propriedade name do Content-Disposition"
324
+ "text": "Define a URL de upload"
348
325
  },
349
- "attribute": "form-data-name",
350
- "reflect": true
326
+ "attribute": "urlupload",
327
+ "reflect": false
351
328
  },
352
- "target": {
329
+ "urldelete": {
353
330
  "type": "string",
354
331
  "mutable": false,
355
332
  "complexType": {
@@ -361,22 +338,22 @@ export class EzUpload {
361
338
  "optional": false,
362
339
  "docs": {
363
340
  "tags": [],
364
- "text": "Define a URL do servidor de destino"
341
+ "text": "Define a URL do dele\u00E7\u00E3o"
365
342
  },
366
- "attribute": "target",
367
- "reflect": true
343
+ "attribute": "urldelete",
344
+ "reflect": false
368
345
  },
369
346
  "value": {
370
347
  "type": "unknown",
371
- "mutable": false,
348
+ "mutable": true,
372
349
  "complexType": {
373
- "original": "Array<FileType>",
374
- "resolved": "FileType[]",
350
+ "original": "Array<EzFile>",
351
+ "resolved": "EzFile[]",
375
352
  "references": {
376
353
  "Array": {
377
354
  "location": "global"
378
355
  },
379
- "FileType": {
356
+ "EzFile": {
380
357
  "location": "local"
381
358
  }
382
359
  }
@@ -390,51 +367,6 @@ export class EzUpload {
390
367
  }
391
368
  }; }
392
369
  static get events() { return [{
393
- "method": "validatedEvent",
394
- "name": "validatedEvent",
395
- "bubbles": true,
396
- "cancelable": true,
397
- "composed": true,
398
- "docs": {
399
- "tags": [],
400
- "text": "Evento emitido ao validar um arquivo"
401
- },
402
- "complexType": {
403
- "original": "{ isValid: boolean, fileName: string }",
404
- "resolved": "{ isValid: boolean; fileName: string; }",
405
- "references": {}
406
- }
407
- }, {
408
- "method": "initUploadEvent",
409
- "name": "initUploadEvent",
410
- "bubbles": true,
411
- "cancelable": true,
412
- "composed": true,
413
- "docs": {
414
- "tags": [],
415
- "text": "Evento emitido ao iniciar o upload de um arquivo"
416
- },
417
- "complexType": {
418
- "original": "string",
419
- "resolved": "string",
420
- "references": {}
421
- }
422
- }, {
423
- "method": "finishedUploadEvent",
424
- "name": "finishedUploadEvent",
425
- "bubbles": true,
426
- "cancelable": true,
427
- "composed": true,
428
- "docs": {
429
- "tags": [],
430
- "text": "Evento emitido ao finalizar o upload de um arquivo"
431
- },
432
- "complexType": {
433
- "original": "{ isValid: boolean, fileName: string }",
434
- "resolved": "{ isValid: boolean; fileName: string; }",
435
- "references": {}
436
- }
437
- }, {
438
370
  "method": "ezChange",
439
371
  "name": "ezChange",
440
372
  "bubbles": true,
@@ -445,13 +377,13 @@ export class EzUpload {
445
377
  "text": "Evento emitido ao finalizar o upload de um arquivo"
446
378
  },
447
379
  "complexType": {
448
- "original": "{ value: Array<FileType> }",
449
- "resolved": "{ value: FileType[]; }",
380
+ "original": "Array<EzFile>",
381
+ "resolved": "EzFile[]",
450
382
  "references": {
451
383
  "Array": {
452
384
  "location": "global"
453
385
  },
454
- "FileType": {
386
+ "EzFile": {
455
387
  "location": "local"
456
388
  }
457
389
  }
@@ -460,7 +392,7 @@ export class EzUpload {
460
392
  static get methods() { return {
461
393
  "addFiles": {
462
394
  "complexType": {
463
- "signature": "(files: any) => Promise<void>",
395
+ "signature": "(files: Array<File>) => Promise<void>",
464
396
  "parameters": [{
465
397
  "tags": [],
466
398
  "text": ""
@@ -468,6 +400,12 @@ export class EzUpload {
468
400
  "references": {
469
401
  "Promise": {
470
402
  "location": "global"
403
+ },
404
+ "Array": {
405
+ "location": "global"
406
+ },
407
+ "File": {
408
+ "location": "global"
471
409
  }
472
410
  },
473
411
  "return": "Promise<void>"
@@ -478,4 +416,12 @@ export class EzUpload {
478
416
  }
479
417
  }
480
418
  }; }
419
+ static get elementRef() { return "_host"; }
420
+ static get watchers() { return [{
421
+ "propName": "value",
422
+ "methodName": "updatePointers"
423
+ }, {
424
+ "propName": "requestheaders",
425
+ "methodName": "normalizeRequestHeaders"
426
+ }]; }
481
427
  }