@sankhyalabs/ezui 1.1.39 → 1.1.43
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 +305 -201
- package/dist/cjs/ez-dialog.cjs.entry.js +4 -4
- package/dist/cjs/ez-popup.cjs.entry.js +3 -3
- package/dist/cjs/ez-toast.cjs.entry.js +37 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ez-dialog/ez-dialog.js +16 -12
- package/dist/collection/components/ez-form/assets/trash-can-outline.svg +3 -0
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +2 -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 +6 -3
- package/dist/collection/components/ez-popup/ez-popup.js +5 -5
- package/dist/collection/components/ez-toast/ez-toast.css +108 -0
- package/dist/collection/components/ez-toast/ez-toast.js +113 -0
- package/dist/collection/components/ez-upload/RemoteFile.js +89 -0
- package/dist/collection/components/ez-upload/ez-upload.css +23 -3
- package/dist/collection/components/ez-upload/ez-upload.js +257 -297
- package/dist/collection/utils/Application.js +34 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +350 -212
- package/dist/esm/ez-button_16.entry.js +305 -201
- package/dist/esm/ez-dialog.entry.js +4 -4
- package/dist/esm/ez-popup.entry.js +3 -3
- package/dist/esm/ez-toast.entry.js +33 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/assets/trash-can-outline.svg +3 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1ff02df6.entry.js +1 -0
- package/dist/ezui/p-4a87d740.entry.js +1 -0
- package/dist/ezui/p-c12beec1.entry.js +1 -0
- package/dist/ezui/p-c3b18332.entry.js +1 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -3
- package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
- package/dist/types/components/ez-toast/ez-toast.d.ts +17 -0
- package/dist/types/components/ez-upload/RemoteFile.d.ts +14 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +51 -57
- package/dist/types/components.d.ts +91 -57
- package/dist/types/utils/Application.d.ts +6 -0
- package/package.json +2 -2
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-40fe4f51.entry.js +0 -1
- package/dist/ezui/p-c7cee3ae.entry.js +0 -1
- package/dist/ezui/p-caa50ec5.entry.js +0 -1
|
@@ -1,136 +1,124 @@
|
|
|
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
|
+
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
|
-
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
this.
|
|
17
|
-
alert(this.errorMessage);
|
|
35
|
+
catch (e) {
|
|
36
|
+
this.requestheaders = undefined;
|
|
18
37
|
}
|
|
19
38
|
}
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
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;
|
|
43
|
+
async addFiles(files) {
|
|
44
|
+
Array.prototype.forEach.call(files, this.addFile.bind(this));
|
|
35
45
|
}
|
|
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;
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
+
}
|
|
114
62
|
}
|
|
115
|
-
|
|
116
|
-
|
|
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
|
+
}
|
|
117
72
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
73
|
+
finishUpload(ezFile) {
|
|
74
|
+
this._filePointers.set(ezFile.name, ezFile);
|
|
75
|
+
this.updateValue();
|
|
76
|
+
}
|
|
77
|
+
updateValue() {
|
|
78
|
+
this._updatingValue = [];
|
|
79
|
+
this._filePointers.forEach(f => {
|
|
80
|
+
if (!this.isRemoteFile(f)) {
|
|
81
|
+
this._updatingValue.push(f);
|
|
122
82
|
}
|
|
123
|
-
|
|
124
|
-
|
|
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;
|
|
126
105
|
}
|
|
127
|
-
|
|
128
|
-
|
|
106
|
+
if (file.size === 0) {
|
|
107
|
+
this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
|
|
108
|
+
return false;
|
|
129
109
|
}
|
|
130
|
-
if (this.
|
|
131
|
-
|
|
110
|
+
if (!this.urlupload) {
|
|
111
|
+
this.showError("Endereço de upload não informado");
|
|
112
|
+
return false;
|
|
132
113
|
}
|
|
133
|
-
|
|
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;
|
|
117
|
+
}
|
|
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,99 @@ export class EzUpload {
|
|
|
142
130
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
143
131
|
}
|
|
144
132
|
onFileInputChange(event) {
|
|
145
|
-
|
|
133
|
+
const input = event.target;
|
|
134
|
+
this.addFiles(Array.from(input.files));
|
|
146
135
|
this._fileInput.value = '';
|
|
147
136
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
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.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
|
|
165
|
+
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
this._fileInput.click();
|
|
156
169
|
}
|
|
157
|
-
}*/
|
|
158
|
-
decode_utf8(s) {
|
|
159
|
-
return decodeURIComponent(escape(s));
|
|
160
170
|
}
|
|
161
171
|
componentDidLoad() {
|
|
162
|
-
if (this.
|
|
163
|
-
this.
|
|
172
|
+
if (this._dropZone && window.FileList && window.File) {
|
|
173
|
+
this._dropZone.addEventListener('dragover', event => {
|
|
164
174
|
event.stopPropagation();
|
|
165
175
|
event.preventDefault();
|
|
166
176
|
event.dataTransfer.dropEffect = 'copy';
|
|
167
177
|
});
|
|
168
|
-
this.
|
|
178
|
+
this._dropZone.addEventListener('drop', event => {
|
|
169
179
|
event.stopPropagation();
|
|
170
180
|
event.preventDefault();
|
|
171
|
-
this.addFiles(event.dataTransfer.files);
|
|
181
|
+
this.addFiles(Array.from(event.dataTransfer.files));
|
|
172
182
|
});
|
|
173
183
|
}
|
|
174
184
|
}
|
|
175
|
-
|
|
176
|
-
if (
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
if (downloadURL) {
|
|
180
|
-
this.removeFileFromServer(name, downloadURL);
|
|
181
|
-
}
|
|
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);
|
|
185
|
+
componentWillRender() {
|
|
186
|
+
if (this.value) {
|
|
187
|
+
if (this._filePointers.size < this.value.length) {
|
|
188
|
+
this.updateFilePointers();
|
|
212
189
|
}
|
|
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);
|
|
190
|
+
}
|
|
222
191
|
}
|
|
223
192
|
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
|
-
|
|
193
|
+
return (h("div", { ref: (el) => this._dropZone = el, class: "iu" },
|
|
194
|
+
this.label ? h("label", { class: "iu__label", title: this.label }, this.label) : null,
|
|
195
|
+
h("div", { class: "iu__container", onClick: () => this.openFilesDialog() },
|
|
196
|
+
h("div", { class: "iu__icon-label" },
|
|
197
|
+
h("button", { class: "iu__file-icon" }),
|
|
198
|
+
h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para adicionar arquivos")),
|
|
199
|
+
this.buildFooter()),
|
|
200
|
+
h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
|
|
201
|
+
}
|
|
202
|
+
buildFooter() {
|
|
203
|
+
if (this._filePointers.size === 0) {
|
|
204
|
+
return null;
|
|
205
|
+
}
|
|
206
|
+
const items = [];
|
|
207
|
+
this._filePointers.forEach(item => items.push(this.buildFileItem(item)));
|
|
208
|
+
return (h("div", { class: "iu__footer" }, items));
|
|
209
|
+
}
|
|
210
|
+
buildFileItem(item) {
|
|
211
|
+
const fileName = item.name;
|
|
212
|
+
const progress = Number(item['progress']);
|
|
213
|
+
const downloadURL = item['downloadURL'];
|
|
214
|
+
const label = `${fileName} (${this.formatBytes(item.size)})`;
|
|
215
|
+
return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() },
|
|
216
|
+
h("div", { class: "iu__item-label modificador" },
|
|
217
|
+
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)),
|
|
218
|
+
isNaN(progress)
|
|
219
|
+
?
|
|
220
|
+
null
|
|
221
|
+
:
|
|
222
|
+
h("div", { class: "col col--sd-4 col--stretch align--middle" },
|
|
223
|
+
h("progress", { id: this.buildProgressId(item), value: progress, max: "100" })),
|
|
224
|
+
h("div", { class: "col col--stretch align--middle" },
|
|
225
|
+
h("button", { class: "btn-cancel ", onClick: () => this.removeFile(fileName) }))));
|
|
257
226
|
}
|
|
258
227
|
static get is() { return "ez-upload"; }
|
|
259
228
|
static get encapsulation() { return "shadow"; }
|
|
@@ -264,41 +233,42 @@ export class EzUpload {
|
|
|
264
233
|
"$": ["ez-upload.css"]
|
|
265
234
|
}; }
|
|
266
235
|
static get properties() { return {
|
|
267
|
-
"
|
|
268
|
-
"type": "
|
|
236
|
+
"label": {
|
|
237
|
+
"type": "string",
|
|
269
238
|
"mutable": false,
|
|
270
239
|
"complexType": {
|
|
271
|
-
"original": "
|
|
272
|
-
"resolved": "
|
|
240
|
+
"original": "string",
|
|
241
|
+
"resolved": "string",
|
|
273
242
|
"references": {}
|
|
274
243
|
},
|
|
275
244
|
"required": false,
|
|
276
245
|
"optional": false,
|
|
277
246
|
"docs": {
|
|
278
247
|
"tags": [],
|
|
279
|
-
"text": "
|
|
248
|
+
"text": "Label \u00E9 o t\u00EDtulo do campo"
|
|
280
249
|
},
|
|
281
|
-
"attribute": "
|
|
282
|
-
"reflect":
|
|
250
|
+
"attribute": "label",
|
|
251
|
+
"reflect": false
|
|
283
252
|
},
|
|
284
|
-
"
|
|
285
|
-
"type": "
|
|
253
|
+
"enabled": {
|
|
254
|
+
"type": "boolean",
|
|
286
255
|
"mutable": false,
|
|
287
256
|
"complexType": {
|
|
288
|
-
"original": "
|
|
289
|
-
"resolved": "
|
|
257
|
+
"original": "boolean",
|
|
258
|
+
"resolved": "boolean",
|
|
290
259
|
"references": {}
|
|
291
260
|
},
|
|
292
261
|
"required": false,
|
|
293
262
|
"optional": false,
|
|
294
263
|
"docs": {
|
|
295
264
|
"tags": [],
|
|
296
|
-
"text": "
|
|
265
|
+
"text": "Deixa o campo dispon\u00EDvel ou n\u00E3o para digita\u00E7\u00E3o."
|
|
297
266
|
},
|
|
298
|
-
"attribute": "
|
|
299
|
-
"reflect":
|
|
267
|
+
"attribute": "enabled",
|
|
268
|
+
"reflect": false,
|
|
269
|
+
"defaultValue": "true"
|
|
300
270
|
},
|
|
301
|
-
"
|
|
271
|
+
"maxfilesize": {
|
|
302
272
|
"type": "number",
|
|
303
273
|
"mutable": false,
|
|
304
274
|
"complexType": {
|
|
@@ -310,29 +280,46 @@ export class EzUpload {
|
|
|
310
280
|
"optional": false,
|
|
311
281
|
"docs": {
|
|
312
282
|
"tags": [],
|
|
313
|
-
"text": "Define o
|
|
283
|
+
"text": "Define o tamanho m\u00E1ximo (em bytes) de cada arquivo que pode ser transferido"
|
|
314
284
|
},
|
|
315
|
-
"attribute": "
|
|
316
|
-
"reflect":
|
|
285
|
+
"attribute": "maxfilesize",
|
|
286
|
+
"reflect": false
|
|
317
287
|
},
|
|
318
|
-
"
|
|
319
|
-
"type": "
|
|
288
|
+
"maxfiles": {
|
|
289
|
+
"type": "number",
|
|
320
290
|
"mutable": false,
|
|
321
291
|
"complexType": {
|
|
322
|
-
"original": "
|
|
323
|
-
"resolved": "
|
|
292
|
+
"original": "number",
|
|
293
|
+
"resolved": "number",
|
|
324
294
|
"references": {}
|
|
325
295
|
},
|
|
326
296
|
"required": false,
|
|
327
297
|
"optional": false,
|
|
328
298
|
"docs": {
|
|
329
299
|
"tags": [],
|
|
330
|
-
"text": "Define
|
|
300
|
+
"text": "Define um limite para a quantidade de arquivos"
|
|
331
301
|
},
|
|
332
|
-
"attribute": "
|
|
333
|
-
"reflect":
|
|
302
|
+
"attribute": "maxfiles",
|
|
303
|
+
"reflect": false
|
|
334
304
|
},
|
|
335
|
-
"
|
|
305
|
+
"requestheaders": {
|
|
306
|
+
"type": "any",
|
|
307
|
+
"mutable": false,
|
|
308
|
+
"complexType": {
|
|
309
|
+
"original": "any",
|
|
310
|
+
"resolved": "any",
|
|
311
|
+
"references": {}
|
|
312
|
+
},
|
|
313
|
+
"required": false,
|
|
314
|
+
"optional": false,
|
|
315
|
+
"docs": {
|
|
316
|
+
"tags": [],
|
|
317
|
+
"text": "Headers para a requisi\u00E7\u00E3o Http"
|
|
318
|
+
},
|
|
319
|
+
"attribute": "requestheaders",
|
|
320
|
+
"reflect": false
|
|
321
|
+
},
|
|
322
|
+
"urlupload": {
|
|
336
323
|
"type": "string",
|
|
337
324
|
"mutable": false,
|
|
338
325
|
"complexType": {
|
|
@@ -344,12 +331,12 @@ export class EzUpload {
|
|
|
344
331
|
"optional": false,
|
|
345
332
|
"docs": {
|
|
346
333
|
"tags": [],
|
|
347
|
-
"text": "Define a
|
|
334
|
+
"text": "Define a URL de upload"
|
|
348
335
|
},
|
|
349
|
-
"attribute": "
|
|
350
|
-
"reflect":
|
|
336
|
+
"attribute": "urlupload",
|
|
337
|
+
"reflect": false
|
|
351
338
|
},
|
|
352
|
-
"
|
|
339
|
+
"urldelete": {
|
|
353
340
|
"type": "string",
|
|
354
341
|
"mutable": false,
|
|
355
342
|
"complexType": {
|
|
@@ -361,22 +348,22 @@ export class EzUpload {
|
|
|
361
348
|
"optional": false,
|
|
362
349
|
"docs": {
|
|
363
350
|
"tags": [],
|
|
364
|
-
"text": "Define a URL do
|
|
351
|
+
"text": "Define a URL do dele\u00E7\u00E3o"
|
|
365
352
|
},
|
|
366
|
-
"attribute": "
|
|
367
|
-
"reflect":
|
|
353
|
+
"attribute": "urldelete",
|
|
354
|
+
"reflect": false
|
|
368
355
|
},
|
|
369
356
|
"value": {
|
|
370
357
|
"type": "unknown",
|
|
371
|
-
"mutable":
|
|
358
|
+
"mutable": true,
|
|
372
359
|
"complexType": {
|
|
373
|
-
"original": "Array<
|
|
374
|
-
"resolved": "
|
|
360
|
+
"original": "Array<EzFile>",
|
|
361
|
+
"resolved": "EzFile[]",
|
|
375
362
|
"references": {
|
|
376
363
|
"Array": {
|
|
377
364
|
"location": "global"
|
|
378
365
|
},
|
|
379
|
-
"
|
|
366
|
+
"EzFile": {
|
|
380
367
|
"location": "local"
|
|
381
368
|
}
|
|
382
369
|
}
|
|
@@ -390,51 +377,6 @@ export class EzUpload {
|
|
|
390
377
|
}
|
|
391
378
|
}; }
|
|
392
379
|
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
380
|
"method": "ezChange",
|
|
439
381
|
"name": "ezChange",
|
|
440
382
|
"bubbles": true,
|
|
@@ -445,13 +387,13 @@ export class EzUpload {
|
|
|
445
387
|
"text": "Evento emitido ao finalizar o upload de um arquivo"
|
|
446
388
|
},
|
|
447
389
|
"complexType": {
|
|
448
|
-
"original": "
|
|
449
|
-
"resolved": "
|
|
390
|
+
"original": "Array<EzFile>",
|
|
391
|
+
"resolved": "EzFile[]",
|
|
450
392
|
"references": {
|
|
451
393
|
"Array": {
|
|
452
394
|
"location": "global"
|
|
453
395
|
},
|
|
454
|
-
"
|
|
396
|
+
"EzFile": {
|
|
455
397
|
"location": "local"
|
|
456
398
|
}
|
|
457
399
|
}
|
|
@@ -460,12 +402,22 @@ export class EzUpload {
|
|
|
460
402
|
static get methods() { return {
|
|
461
403
|
"addFiles": {
|
|
462
404
|
"complexType": {
|
|
463
|
-
"signature": "(files:
|
|
405
|
+
"signature": "(files: Array<File>) => Promise<void>",
|
|
464
406
|
"parameters": [{
|
|
465
407
|
"tags": [],
|
|
466
408
|
"text": ""
|
|
467
409
|
}],
|
|
468
|
-
"references": {
|
|
410
|
+
"references": {
|
|
411
|
+
"Promise": {
|
|
412
|
+
"location": "global"
|
|
413
|
+
},
|
|
414
|
+
"Array": {
|
|
415
|
+
"location": "global"
|
|
416
|
+
},
|
|
417
|
+
"File": {
|
|
418
|
+
"location": "global"
|
|
419
|
+
}
|
|
420
|
+
},
|
|
469
421
|
"return": "Promise<void>"
|
|
470
422
|
},
|
|
471
423
|
"docs": {
|
|
@@ -474,4 +426,12 @@ export class EzUpload {
|
|
|
474
426
|
}
|
|
475
427
|
}
|
|
476
428
|
}; }
|
|
429
|
+
static get elementRef() { return "_host"; }
|
|
430
|
+
static get watchers() { return [{
|
|
431
|
+
"propName": "value",
|
|
432
|
+
"methodName": "changeValue"
|
|
433
|
+
}, {
|
|
434
|
+
"propName": "requestheaders",
|
|
435
|
+
"methodName": "normalizeRequestHeaders"
|
|
436
|
+
}]; }
|
|
477
437
|
}
|