@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.
- package/dist/cjs/ez-button_16.cjs.entry.js +253 -204
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +1 -5
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +2 -3
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +1 -8
- package/dist/collection/components/ez-upload/RemoteFile.js +89 -0
- package/dist/collection/components/ez-upload/ez-upload.css +16 -1
- package/dist/collection/components/ez-upload/ez-upload.js +241 -295
- package/dist/custom-elements/index.js +254 -205
- package/dist/esm/ez-button_16.entry.js +253 -204
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-e930ba53.entry.js → p-e9784201.entry.js} +1 -1
- package/dist/types/components/ez-upload/RemoteFile.d.ts +14 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +49 -57
- package/dist/types/components.d.ts +36 -40
- package/package.json +1 -1
|
@@ -1,136 +1,121 @@
|
|
|
1
|
-
import { Component,
|
|
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
|
-
|
|
4
|
-
this.
|
|
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
|
-
|
|
7
|
-
|
|
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
|
-
|
|
10
|
-
this.
|
|
11
|
-
if (this.
|
|
12
|
-
|
|
13
|
-
this.
|
|
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
|
-
|
|
16
|
-
this.
|
|
17
|
-
alert(this.errorMessage);
|
|
32
|
+
catch (e) {
|
|
33
|
+
this.requestheaders = undefined;
|
|
18
34
|
}
|
|
19
35
|
}
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
27
|
-
this.
|
|
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
|
-
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
116
|
-
|
|
70
|
+
finishUpload(ezFile) {
|
|
71
|
+
this._filePointers.set(ezFile.name, ezFile);
|
|
72
|
+
this.updateValue();
|
|
117
73
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
74
|
+
updateValue() {
|
|
75
|
+
this._updatingValue = [];
|
|
76
|
+
this._filePointers.forEach(f => {
|
|
77
|
+
if (!this.isRemoteFile(f)) {
|
|
78
|
+
this._updatingValue.push(f);
|
|
122
79
|
}
|
|
123
|
-
|
|
124
|
-
|
|
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
|
-
|
|
128
|
-
|
|
107
|
+
if (!this.urlupload) {
|
|
108
|
+
this.showError("Endereço de upload não informado");
|
|
109
|
+
return false;
|
|
129
110
|
}
|
|
130
|
-
if (this.
|
|
131
|
-
|
|
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
|
-
|
|
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
|
-
|
|
130
|
+
const input = event.target;
|
|
131
|
+
this.addFiles(Array.from(input.files));
|
|
146
132
|
this._fileInput.value = '';
|
|
147
133
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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.
|
|
163
|
-
this.
|
|
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.
|
|
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
|
-
|
|
176
|
-
if (
|
|
177
|
-
|
|
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
|
-
|
|
180
|
-
this.
|
|
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
|
-
|
|
225
|
-
|
|
226
|
-
h("
|
|
227
|
-
h("div", {
|
|
228
|
-
h("
|
|
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
|
-
|
|
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
|
-
"
|
|
268
|
-
"type": "
|
|
226
|
+
"label": {
|
|
227
|
+
"type": "string",
|
|
269
228
|
"mutable": false,
|
|
270
229
|
"complexType": {
|
|
271
|
-
"original": "
|
|
272
|
-
"resolved": "
|
|
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": "
|
|
238
|
+
"text": "Label \u00E9 o t\u00EDtulo do campo"
|
|
280
239
|
},
|
|
281
|
-
"attribute": "
|
|
282
|
-
"reflect":
|
|
240
|
+
"attribute": "label",
|
|
241
|
+
"reflect": false
|
|
283
242
|
},
|
|
284
|
-
"
|
|
285
|
-
"type": "
|
|
243
|
+
"enabled": {
|
|
244
|
+
"type": "boolean",
|
|
286
245
|
"mutable": false,
|
|
287
246
|
"complexType": {
|
|
288
|
-
"original": "
|
|
289
|
-
"resolved": "
|
|
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": "
|
|
255
|
+
"text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para digita\u00E7\u00E3o."
|
|
297
256
|
},
|
|
298
|
-
"attribute": "
|
|
299
|
-
"reflect":
|
|
257
|
+
"attribute": "enabled",
|
|
258
|
+
"reflect": false,
|
|
259
|
+
"defaultValue": "true"
|
|
300
260
|
},
|
|
301
|
-
"
|
|
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
|
|
273
|
+
"text": "Define o tamanho m\u00E1ximo (em bytes) de cada arquivo que pode ser transferido"
|
|
314
274
|
},
|
|
315
|
-
"attribute": "
|
|
316
|
-
"reflect":
|
|
275
|
+
"attribute": "maxfilesize",
|
|
276
|
+
"reflect": false
|
|
317
277
|
},
|
|
318
|
-
"
|
|
319
|
-
"type": "
|
|
278
|
+
"maxfiles": {
|
|
279
|
+
"type": "number",
|
|
320
280
|
"mutable": false,
|
|
321
281
|
"complexType": {
|
|
322
|
-
"original": "
|
|
323
|
-
"resolved": "
|
|
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": "
|
|
307
|
+
"text": "Headers para a requisi\u00E7\u00E3o Http"
|
|
331
308
|
},
|
|
332
|
-
"attribute": "
|
|
333
|
-
"reflect":
|
|
309
|
+
"attribute": "requestheaders",
|
|
310
|
+
"reflect": false
|
|
334
311
|
},
|
|
335
|
-
"
|
|
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
|
|
324
|
+
"text": "Define a URL de upload"
|
|
348
325
|
},
|
|
349
|
-
"attribute": "
|
|
350
|
-
"reflect":
|
|
326
|
+
"attribute": "urlupload",
|
|
327
|
+
"reflect": false
|
|
351
328
|
},
|
|
352
|
-
"
|
|
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
|
|
341
|
+
"text": "Define a URL do dele\u00E7\u00E3o"
|
|
365
342
|
},
|
|
366
|
-
"attribute": "
|
|
367
|
-
"reflect":
|
|
343
|
+
"attribute": "urldelete",
|
|
344
|
+
"reflect": false
|
|
368
345
|
},
|
|
369
346
|
"value": {
|
|
370
347
|
"type": "unknown",
|
|
371
|
-
"mutable":
|
|
348
|
+
"mutable": true,
|
|
372
349
|
"complexType": {
|
|
373
|
-
"original": "Array<
|
|
374
|
-
"resolved": "
|
|
350
|
+
"original": "Array<EzFile>",
|
|
351
|
+
"resolved": "EzFile[]",
|
|
375
352
|
"references": {
|
|
376
353
|
"Array": {
|
|
377
354
|
"location": "global"
|
|
378
355
|
},
|
|
379
|
-
"
|
|
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": "
|
|
449
|
-
"resolved": "
|
|
380
|
+
"original": "Array<EzFile>",
|
|
381
|
+
"resolved": "EzFile[]",
|
|
450
382
|
"references": {
|
|
451
383
|
"Array": {
|
|
452
384
|
"location": "global"
|
|
453
385
|
},
|
|
454
|
-
"
|
|
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:
|
|
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
|
}
|