@sankhyalabs/ezui 1.1.40 → 1.1.44

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