@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
|
@@ -2194,14 +2194,7 @@ const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
|
|
|
2194
2194
|
buttonProps.removeVisible ? index.h("ez-button", { key: du.name + '_remove', label: "Remover", enabled: enabled && du.hasCurrentRecord(), onClick: () => removeHandler(du), image: "/themes/default/images/icons/actions-sprite.svg#minus-circle-inverted", class: "button--secondary margin-right--medium" }) : null,
|
|
2195
2195
|
buttonProps.addVisible ? index.h("ez-button", { key: du.name + '_add', label: "Adicionar", enabled: enabled, onClick: () => du.insert(), class: "button--secondary margin-right--medium" }) : null,
|
|
2196
2196
|
buttonProps.reloadVisible ? index.h("ez-button", { key: du.name + '_reload', title: "Recarregar", enabled: enabled, mode: "icon", onClick: () => du.load(), image: "/themes/default/images/icons/actions-sprite.svg#rotate", class: "button--secondary margin-right--medium" }) : null,
|
|
2197
|
-
buttonProps.cancelVisible ? index.h("ez-button", { key: du.name + '_cancel', label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () =>
|
|
2198
|
-
Application.confirm("Confirmar cancelamento", "Você perderá a edição atual do registro. Deseja continuar?", /*
|
|
2199
|
-
getAssetPath("./assets/trash-can-outline.svg")*/ null, true).then(ok => {
|
|
2200
|
-
if (ok) {
|
|
2201
|
-
du.cancel();
|
|
2202
|
-
}
|
|
2203
|
-
});
|
|
2204
|
-
}, class: "button--secondary margin-right--medium" }) : null,
|
|
2197
|
+
buttonProps.cancelVisible ? index.h("ez-button", { key: du.name + '_cancel', label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () => du.cancel(), class: "button--secondary margin-right--medium" }) : null,
|
|
2205
2198
|
buttonProps.saveVisible ? index.h("ez-button", { key: du.name + '_save', label: "Salvar", enabled: enabled && du.hasChanges(), onClick: () => du.save(), class: "button--primary margin-right--medium" }) : null);
|
|
2206
2199
|
}
|
|
2207
2200
|
else {
|
|
@@ -2598,10 +2591,9 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
2598
2591
|
const target = getProp(properties, 'URL');
|
|
2599
2592
|
const strHeaders = getProp(properties, 'HEADERS');
|
|
2600
2593
|
const headers = strHeaders ? JSON.parse(strHeaders) : {};
|
|
2594
|
+
const maxfiles = Number(getProp(properties, "maxfiles") || 0);
|
|
2601
2595
|
return (index.h("div", { class: "col col--sd-12 padding--small" },
|
|
2602
|
-
index.h("ez-upload", { onEzChange: (event) =>
|
|
2603
|
-
changeFieldHandler(event.target['value']);
|
|
2604
|
-
}, target: target, headers: headers, value: value })));
|
|
2596
|
+
index.h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
|
|
2605
2597
|
case 'DATE':
|
|
2606
2598
|
return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
|
|
2607
2599
|
index.h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']), errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
|
|
@@ -3540,142 +3532,215 @@ let EzTextInput = class {
|
|
|
3540
3532
|
};
|
|
3541
3533
|
EzTextInput.style = ezTextInputCss;
|
|
3542
3534
|
|
|
3543
|
-
|
|
3535
|
+
class RemoteFile {
|
|
3536
|
+
constructor(file) {
|
|
3537
|
+
this.file = file;
|
|
3538
|
+
this.size = file.size;
|
|
3539
|
+
this.name = file.name;
|
|
3540
|
+
}
|
|
3541
|
+
abortUpload() {
|
|
3542
|
+
if (this._uploadingXhr) {
|
|
3543
|
+
this._aborted = true;
|
|
3544
|
+
this._uploadingXhr.abort();
|
|
3545
|
+
this._uploadingXhr = undefined;
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
isUploading() {
|
|
3549
|
+
return this._uploadingXhr !== undefined;
|
|
3550
|
+
}
|
|
3551
|
+
async upload(server, headers, updateCallBack) {
|
|
3552
|
+
return new Promise((resolve, reject) => {
|
|
3553
|
+
const xhr = new XMLHttpRequest();
|
|
3554
|
+
this._uploadingXhr = xhr;
|
|
3555
|
+
this._aborted = false;
|
|
3556
|
+
this.progress = 0;
|
|
3557
|
+
xhr.upload.onprogress = (e) => {
|
|
3558
|
+
const loaded = e.loaded;
|
|
3559
|
+
const total = e.total;
|
|
3560
|
+
this.progress = ~~((loaded / total) * 100);
|
|
3561
|
+
updateCallBack(this, loaded, total);
|
|
3562
|
+
};
|
|
3563
|
+
xhr.onreadystatechange = () => {
|
|
3564
|
+
if (xhr.readyState == 4) {
|
|
3565
|
+
this._uploadingXhr = undefined;
|
|
3566
|
+
const status = xhr.status;
|
|
3567
|
+
if (!this._aborted) {
|
|
3568
|
+
if (status === 0) {
|
|
3569
|
+
reject("Servidor indisponível");
|
|
3570
|
+
}
|
|
3571
|
+
else if (status >= 500) {
|
|
3572
|
+
reject("Erro inesperado no servidor");
|
|
3573
|
+
}
|
|
3574
|
+
else if (status >= 400) {
|
|
3575
|
+
reject("Operação não permitida");
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
const response = xhr.response;
|
|
3579
|
+
if (response) {
|
|
3580
|
+
resolve(JSON.parse(response));
|
|
3581
|
+
}
|
|
3582
|
+
}
|
|
3583
|
+
};
|
|
3584
|
+
xhr.ontimeout = () => {
|
|
3585
|
+
reject("Tempo limite de transferência atingido.");
|
|
3586
|
+
};
|
|
3587
|
+
const formData = new FormData();
|
|
3588
|
+
formData.append("ARQUIVO", this.file, this.file.name);
|
|
3589
|
+
xhr.open("POST", server, true);
|
|
3590
|
+
if (headers) {
|
|
3591
|
+
headers.forEach((value, key) => xhr.setRequestHeader(key, value));
|
|
3592
|
+
}
|
|
3593
|
+
xhr.send(formData);
|
|
3594
|
+
});
|
|
3595
|
+
}
|
|
3596
|
+
async delete(item, server, headers) {
|
|
3597
|
+
return new Promise((resolve, reject) => {
|
|
3598
|
+
const xhr = new XMLHttpRequest();
|
|
3599
|
+
xhr.onreadystatechange = () => {
|
|
3600
|
+
if (xhr.readyState == 4) {
|
|
3601
|
+
if (xhr.status === 0) {
|
|
3602
|
+
reject("Servidor indisponível");
|
|
3603
|
+
}
|
|
3604
|
+
else if (xhr.status >= 500) {
|
|
3605
|
+
reject("Erro inesperado no servidor");
|
|
3606
|
+
}
|
|
3607
|
+
else if (xhr.status >= 400) {
|
|
3608
|
+
reject("Operação não permitida");
|
|
3609
|
+
}
|
|
3610
|
+
resolve(true);
|
|
3611
|
+
}
|
|
3612
|
+
};
|
|
3613
|
+
xhr.ontimeout = () => {
|
|
3614
|
+
reject("Tempo limite de remoção atingido.");
|
|
3615
|
+
};
|
|
3616
|
+
xhr.open("DELETE", server, true);
|
|
3617
|
+
if (headers) {
|
|
3618
|
+
headers.forEach((value, key) => xhr.setRequestHeader(key, value));
|
|
3619
|
+
}
|
|
3620
|
+
xhr.send(JSON.stringify(item));
|
|
3621
|
+
});
|
|
3622
|
+
}
|
|
3623
|
+
}
|
|
3624
|
+
|
|
3625
|
+
const ezUploadCss = ":host{--iu--height:42px;--iu--width:100%;--iu__icon--width:48px;--iu__container--background-color:var(--background--medium, #d2dce9);--iu__color--primary:var(--color--primary, #008561);--iu--padding--extra-small:var(--space--extra-small, 3px);--iu--padding--small:var(--space--small, 6px);--iu--padding--medium:var(--space--medium, 12px);--iu--padding--large:var(--space--large, 24px);--iu--border-radius:var(--border--radius-medium, 12px);--iu__border--color:var(--color-strokes, #DCE0E8);--iu__input--border:var(--border--medium, 2px solid);--iu--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--iu--text--primary:var(--text-primary, #626e82);--iu--font-size:var(--text--medium, 14px);--iu--font-family:var(--font-pattern, Arial);--iu--font-weight:var(--text-weight--large, 500);display:flex;flex-wrap:wrap;position:relative;font-family:var(--iu--font-family);font-size:var(--iu--font-size);width:var(--iu--width);font-weight:var(--iu--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:var(--iu--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--iu--padding--medium) var(--iu--padding--medium) var(--iu--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--iu--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--iu__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--iu__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;clip-path:path(\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\")}.iu__label{padding:var(--space--small);padding-top:0;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--iu--font-family);font-size:var(--text--extra-small);font-weight:var( --iu--font-weight);color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;clip-path:path(\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\")}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
3544
3626
|
|
|
3545
3627
|
let EzUpload = class {
|
|
3546
3628
|
constructor(hostRef) {
|
|
3547
3629
|
index.registerInstance(this, hostRef);
|
|
3548
|
-
this.validatedEvent = index.createEvent(this, "validatedEvent", 7);
|
|
3549
|
-
this.initUploadEvent = index.createEvent(this, "initUploadEvent", 7);
|
|
3550
|
-
this.finishedUploadEvent = index.createEvent(this, "finishedUploadEvent", 7);
|
|
3551
3630
|
this.ezChange = index.createEvent(this, "ezChange", 7);
|
|
3631
|
+
this._filePointers = new Map();
|
|
3632
|
+
/**
|
|
3633
|
+
* Deixa o campo disponível ou não para digitação.
|
|
3634
|
+
*/
|
|
3635
|
+
this.enabled = true;
|
|
3552
3636
|
}
|
|
3553
|
-
|
|
3554
|
-
|
|
3637
|
+
updatePointers(newValue) {
|
|
3638
|
+
if (newValue !== this._updatingValue) {
|
|
3639
|
+
this._filePointers.forEach(f => {
|
|
3640
|
+
if (this.isRemoteFile(f)) {
|
|
3641
|
+
f.abortUpload();
|
|
3642
|
+
}
|
|
3643
|
+
});
|
|
3644
|
+
this._filePointers = new Map();
|
|
3645
|
+
if (newValue) {
|
|
3646
|
+
newValue.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
|
|
3647
|
+
}
|
|
3648
|
+
}
|
|
3649
|
+
this._updatingValue = undefined;
|
|
3650
|
+
}
|
|
3651
|
+
normalizeRequestHeaders() {
|
|
3652
|
+
this._requestHeaders = new Map();
|
|
3653
|
+
if (typeof this.requestheaders == 'string') {
|
|
3654
|
+
try {
|
|
3655
|
+
this.requestheaders = JSON.parse(this.requestheaders);
|
|
3656
|
+
}
|
|
3657
|
+
catch (e) {
|
|
3658
|
+
this.requestheaders = undefined;
|
|
3659
|
+
}
|
|
3660
|
+
}
|
|
3661
|
+
for (var key in this.requestheaders) {
|
|
3662
|
+
this._requestHeaders.set(key, this.requestheaders[key]);
|
|
3663
|
+
}
|
|
3555
3664
|
}
|
|
3556
3665
|
async addFiles(files) {
|
|
3557
3666
|
Array.prototype.forEach.call(files, this.addFile.bind(this));
|
|
3558
3667
|
}
|
|
3559
|
-
addFile(file) {
|
|
3560
|
-
|
|
3561
|
-
if (
|
|
3562
|
-
|
|
3563
|
-
|
|
3564
|
-
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3668
|
+
async addFile(file) {
|
|
3669
|
+
const oldFile = this._filePointers.get(file.name);
|
|
3670
|
+
if (oldFile) {
|
|
3671
|
+
Application.confirm("Substituir arquivo", `Já existe um arquivo chamado "${file.name}". Deseja substituí-lo?`)
|
|
3672
|
+
.then(ok => {
|
|
3673
|
+
if (ok) {
|
|
3674
|
+
if (this.isRemoteFile(oldFile)) {
|
|
3675
|
+
oldFile.abortUpload();
|
|
3676
|
+
}
|
|
3677
|
+
this.doAddFile(file);
|
|
3678
|
+
}
|
|
3679
|
+
});
|
|
3569
3680
|
}
|
|
3570
3681
|
else {
|
|
3571
|
-
|
|
3572
|
-
alert(this.errorMessage);
|
|
3573
|
-
}
|
|
3682
|
+
this.doAddFile(file);
|
|
3574
3683
|
}
|
|
3575
3684
|
}
|
|
3576
|
-
|
|
3577
|
-
this.
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
this.
|
|
3581
|
-
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3585
|
-
}
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
if (viewFile) {
|
|
3596
|
-
viewFile.progress = progress;
|
|
3685
|
+
async doAddFile(file) {
|
|
3686
|
+
if (this.validateFile(file)) {
|
|
3687
|
+
const uploadingFile = new RemoteFile(file);
|
|
3688
|
+
this._filePointers.set(file.name, uploadingFile);
|
|
3689
|
+
uploadingFile.upload(this.urlupload, this._requestHeaders, (file) => this.updateFeedback(file))
|
|
3690
|
+
.then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
|
|
3691
|
+
.catch(msg => this.showError(msg));
|
|
3692
|
+
index.forceUpdate(this);
|
|
3693
|
+
}
|
|
3694
|
+
}
|
|
3695
|
+
finishUpload(ezFile) {
|
|
3696
|
+
this._filePointers.set(ezFile.name, ezFile);
|
|
3697
|
+
this.updateValue();
|
|
3698
|
+
}
|
|
3699
|
+
updateValue() {
|
|
3700
|
+
this._updatingValue = [];
|
|
3701
|
+
this._filePointers.forEach(f => {
|
|
3702
|
+
if (!this.isRemoteFile(f)) {
|
|
3703
|
+
this._updatingValue.push(f);
|
|
3597
3704
|
}
|
|
3598
|
-
};
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
//TODO
|
|
3613
|
-
// Conferir com o time de UX um estado de erro ou remoção da lista
|
|
3614
|
-
// this.removeFile(file.name);
|
|
3615
|
-
alert(this.errorMessage);
|
|
3616
|
-
}
|
|
3617
|
-
else {
|
|
3618
|
-
if (xhr.response) {
|
|
3619
|
-
let response = JSON.parse(xhr.response);
|
|
3620
|
-
response.forEach(element => {
|
|
3621
|
-
let viewFile = newValue.find(f => f.name === this.decode_utf8(element.name));
|
|
3622
|
-
if (viewFile) {
|
|
3623
|
-
viewFile.progress = undefined;
|
|
3624
|
-
//Validar estado de erro com UX
|
|
3625
|
-
viewFile.error = false;
|
|
3626
|
-
delete viewFile.xhr;
|
|
3627
|
-
viewFile.downloadURL = element.downloadURL;
|
|
3628
|
-
viewFile.lastModifiedDate = element.lastModifiedDate;
|
|
3629
|
-
viewFile.properties = element.properties;
|
|
3630
|
-
}
|
|
3631
|
-
});
|
|
3632
|
-
this.value = newValue;
|
|
3633
|
-
this.fileListChange();
|
|
3634
|
-
}
|
|
3635
|
-
else {
|
|
3636
|
-
let viewFile = newValue.find(f => f.name === file.name);
|
|
3637
|
-
viewFile.progress = undefined;
|
|
3638
|
-
//Validar estado de erro com UX
|
|
3639
|
-
viewFile.error = true;
|
|
3640
|
-
}
|
|
3705
|
+
});
|
|
3706
|
+
this.value = this._updatingValue;
|
|
3707
|
+
this.ezChange.emit(this.value);
|
|
3708
|
+
}
|
|
3709
|
+
buildProgressId(uploading) {
|
|
3710
|
+
let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, '_');
|
|
3711
|
+
return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
|
|
3712
|
+
}
|
|
3713
|
+
updateFeedback(uf) {
|
|
3714
|
+
window.requestAnimationFrame(() => {
|
|
3715
|
+
if (this._host) {
|
|
3716
|
+
const progress = this._host.shadowRoot.querySelector('#' + this.buildProgressId(uf));
|
|
3717
|
+
if (progress) {
|
|
3718
|
+
progress.value = uf.progress;
|
|
3641
3719
|
}
|
|
3642
3720
|
}
|
|
3643
|
-
};
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
}
|
|
3650
|
-
};
|
|
3651
|
-
const formData = new FormData();
|
|
3652
|
-
formData.append(this.formDataName, file, file.name);
|
|
3653
|
-
xhr.open("POST", this.target, true);
|
|
3654
|
-
this._configureXhr(xhr);
|
|
3655
|
-
file.status = "conectando";
|
|
3656
|
-
file.uploading = file.indeterminate = true;
|
|
3657
|
-
file.complete = file.abort = file.error = file.held = false;
|
|
3658
|
-
xhr.send(formData);
|
|
3659
|
-
}
|
|
3660
|
-
_createXhr() {
|
|
3661
|
-
return new XMLHttpRequest();
|
|
3662
|
-
}
|
|
3663
|
-
_configureXhr(xhr) {
|
|
3664
|
-
if (typeof this.headers == 'string') {
|
|
3665
|
-
try {
|
|
3666
|
-
this.headers = JSON.parse(this.headers);
|
|
3667
|
-
}
|
|
3668
|
-
catch (e) {
|
|
3669
|
-
this.headers = undefined;
|
|
3670
|
-
}
|
|
3721
|
+
});
|
|
3722
|
+
}
|
|
3723
|
+
validateFile(file) {
|
|
3724
|
+
if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
|
|
3725
|
+
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
3726
|
+
return false;
|
|
3671
3727
|
}
|
|
3672
|
-
|
|
3673
|
-
|
|
3728
|
+
if (file.size === 0) {
|
|
3729
|
+
this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
|
|
3730
|
+
return false;
|
|
3674
3731
|
}
|
|
3675
|
-
if (this.
|
|
3676
|
-
|
|
3732
|
+
if (!this.urlupload) {
|
|
3733
|
+
this.showError("Endereço de upload não informado");
|
|
3734
|
+
return false;
|
|
3677
3735
|
}
|
|
3678
|
-
|
|
3736
|
+
if (this.maxfilesize >= 0 && file.size > this.maxfilesize) {
|
|
3737
|
+
this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxfilesize));
|
|
3738
|
+
return false;
|
|
3739
|
+
}
|
|
3740
|
+
return true;
|
|
3741
|
+
}
|
|
3742
|
+
showError(message) {
|
|
3743
|
+
Application.alert("Enviando arquivo", message);
|
|
3679
3744
|
}
|
|
3680
3745
|
formatBytes(bytes, decimals = 1) {
|
|
3681
3746
|
if (bytes === 0)
|
|
@@ -3687,97 +3752,85 @@ let EzUpload = class {
|
|
|
3687
3752
|
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
3688
3753
|
}
|
|
3689
3754
|
onFileInputChange(event) {
|
|
3690
|
-
|
|
3755
|
+
const input = event.target;
|
|
3756
|
+
this.addFiles(Array.from(input.files));
|
|
3691
3757
|
this._fileInput.value = '';
|
|
3692
3758
|
}
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3759
|
+
isRemoteFile(item) {
|
|
3760
|
+
return "file" in item;
|
|
3761
|
+
}
|
|
3762
|
+
removeFromList(name) {
|
|
3763
|
+
this._filePointers.delete(name);
|
|
3764
|
+
this.updateValue();
|
|
3765
|
+
}
|
|
3766
|
+
removeFile(name) {
|
|
3767
|
+
const item = this._filePointers.get(name);
|
|
3768
|
+
if (this.isRemoteFile(item)) {
|
|
3769
|
+
item.abortUpload();
|
|
3770
|
+
this.removeFromList(name);
|
|
3771
|
+
}
|
|
3772
|
+
else {
|
|
3773
|
+
if (this.urldelete) {
|
|
3774
|
+
const uploadingFile = new RemoteFile(null);
|
|
3775
|
+
this._filePointers.set(item.name, uploadingFile);
|
|
3776
|
+
uploadingFile.delete(item, this.urldelete, null)
|
|
3777
|
+
.then(_ok => this.removeFromList(name))
|
|
3778
|
+
.catch(msg => this.showError(msg));
|
|
3779
|
+
}
|
|
3780
|
+
else {
|
|
3781
|
+
this.removeFromList(name);
|
|
3782
|
+
}
|
|
3701
3783
|
}
|
|
3702
|
-
}*/
|
|
3703
|
-
decode_utf8(s) {
|
|
3704
|
-
return decodeURIComponent(escape(s));
|
|
3705
3784
|
}
|
|
3706
3785
|
componentDidLoad() {
|
|
3707
|
-
if (this.
|
|
3708
|
-
this.
|
|
3786
|
+
if (this._dropZone && window.FileList && window.File) {
|
|
3787
|
+
this._dropZone.addEventListener('dragover', event => {
|
|
3709
3788
|
event.stopPropagation();
|
|
3710
3789
|
event.preventDefault();
|
|
3711
3790
|
event.dataTransfer.dropEffect = 'copy';
|
|
3712
3791
|
});
|
|
3713
|
-
this.
|
|
3792
|
+
this._dropZone.addEventListener('drop', event => {
|
|
3714
3793
|
event.stopPropagation();
|
|
3715
3794
|
event.preventDefault();
|
|
3716
|
-
this.addFiles(event.dataTransfer.files);
|
|
3795
|
+
this.addFiles(Array.from(event.dataTransfer.files));
|
|
3717
3796
|
});
|
|
3718
3797
|
}
|
|
3719
3798
|
}
|
|
3720
|
-
|
|
3721
|
-
if (
|
|
3722
|
-
|
|
3799
|
+
openFilesDialog() {
|
|
3800
|
+
if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
|
|
3801
|
+
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
3723
3802
|
}
|
|
3724
|
-
|
|
3725
|
-
this.
|
|
3803
|
+
else {
|
|
3804
|
+
this._fileInput.click();
|
|
3726
3805
|
}
|
|
3727
|
-
this.value = [...this.value.filter(function (value) { return value.name !== name; })];
|
|
3728
|
-
this.fileListChange();
|
|
3729
|
-
}
|
|
3730
|
-
removeFileFromServer(name, donwloadURL) {
|
|
3731
|
-
const xhr = this._createXhr();
|
|
3732
|
-
this.errorMessage = '';
|
|
3733
|
-
let stalledId;
|
|
3734
|
-
xhr.onreadystatechange = () => {
|
|
3735
|
-
if (xhr.readyState == 4) {
|
|
3736
|
-
clearTimeout(stalledId);
|
|
3737
|
-
if (xhr.status === 0) {
|
|
3738
|
-
this.errorMessage = "Servidor indisponível";
|
|
3739
|
-
}
|
|
3740
|
-
else if (xhr.status >= 500) {
|
|
3741
|
-
this.errorMessage = "Erro inesperado no servidor";
|
|
3742
|
-
}
|
|
3743
|
-
else if (xhr.status >= 400) {
|
|
3744
|
-
this.errorMessage = "Operação não permitida";
|
|
3745
|
-
}
|
|
3746
|
-
if (this.errorMessage && this.errorMessage.length > 0) {
|
|
3747
|
-
//TODO
|
|
3748
|
-
// Conferir com o time de UX um estado de erro ou remoção da lista
|
|
3749
|
-
// this.removeFile(file.name);
|
|
3750
|
-
alert(this.errorMessage);
|
|
3751
|
-
}
|
|
3752
|
-
}
|
|
3753
|
-
};
|
|
3754
|
-
xhr.ontimeout = () => {
|
|
3755
|
-
if (this.errorMessage && this.errorMessage.length > 0) {
|
|
3756
|
-
alert(this.errorMessage);
|
|
3757
|
-
}
|
|
3758
|
-
};
|
|
3759
|
-
const body = JSON.stringify({
|
|
3760
|
-
name: name,
|
|
3761
|
-
donwloadURL: donwloadURL,
|
|
3762
|
-
});
|
|
3763
|
-
xhr.open("DELETE", this.target, true);
|
|
3764
|
-
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
3765
|
-
this._configureXhr(xhr);
|
|
3766
|
-
xhr.send(body);
|
|
3767
3806
|
}
|
|
3768
3807
|
render() {
|
|
3769
|
-
|
|
3770
|
-
return (index.h(index.Host, null, index.h("slot", null, index.h("div", { ref: (el) => this.dropZone = el, class: "iu" }, index.h("div", { class: "iu__container" }, index.h("div", { onClick: () => this._fileInput.click(), class: "iu__icon-label" }, index.h("button", { class: "iu__file-icon" }), index.h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para anexar arquivo")), ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ?
|
|
3771
|
-
index.h("div", { class: "iu__footer" }, this.value.map(file => {
|
|
3772
|
-
return (index.h("div", { class: "iu__item" }, index.h("div", { class: "iu__item-label" + (file.progress ? " modificador " : " modificador ") }, file.downloadURL ?
|
|
3773
|
-
index.h("div", { title: file.name + "(" + this.formatBytes(file.size) + ")", class: "file__name text text--primary text--small text--ellipsis align--middle" }, index.h("a", { href: file.downloadURL, download: true }, file.name, " (", this.formatBytes(file.size), ")"))
|
|
3774
|
-
:
|
|
3775
|
-
index.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 " }, file.name, " (", this.formatBytes(file.size), ")")), file.progress ?
|
|
3776
|
-
index.h("div", { class: "col col--sd-4 col--stretch align--middle" }, index.h("progress", { value: file.progress, max: "100" }))
|
|
3777
|
-
: undefined, index.h("div", { class: "col col--stretch align--middle" }, index.h("button", { class: "btn-cancel ", onClick: () => this.removeFile(file.name, file.xhr) }))));
|
|
3778
|
-
}))
|
|
3779
|
-
: undefined))), index.h("input", { ref: (el) => this._fileInput = el, type: "file", id: "fileInput", hidden: true, onChange: (ev) => this.onFileInputChange(ev), multiple: true })));
|
|
3808
|
+
return (index.h("div", { ref: (el) => this._dropZone = el, class: "iu" }, this.label ? index.h("label", { class: "iu__label", title: this.label }, this.label) : null, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: "iu__icon-label" }, index.h("button", { class: "iu__file-icon" }), index.h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para adicionar arquivos")), this.buildFooter()), index.h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
|
|
3780
3809
|
}
|
|
3810
|
+
buildFooter() {
|
|
3811
|
+
if (this._filePointers.size === 0) {
|
|
3812
|
+
return null;
|
|
3813
|
+
}
|
|
3814
|
+
const items = [];
|
|
3815
|
+
this._filePointers.forEach(item => items.push(this.buildFileItem(item)));
|
|
3816
|
+
return (index.h("div", { class: "iu__footer" }, items));
|
|
3817
|
+
}
|
|
3818
|
+
buildFileItem(item) {
|
|
3819
|
+
const fileName = item.name;
|
|
3820
|
+
const progress = Number(item['progress']);
|
|
3821
|
+
const downloadURL = item['downloadURL'];
|
|
3822
|
+
const label = `${fileName} (${this.formatBytes(item.size)})`;
|
|
3823
|
+
return (index.h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, index.h("div", { class: "iu__item-label modificador" }, index.h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? index.h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
|
|
3824
|
+
?
|
|
3825
|
+
null
|
|
3826
|
+
:
|
|
3827
|
+
index.h("div", { class: "col col--sd-4 col--stretch align--middle" }, index.h("progress", { id: this.buildProgressId(item), value: progress, max: "100" })), index.h("div", { class: "col col--stretch align--middle" }, index.h("button", { class: "btn-cancel ", onClick: () => this.removeFile(fileName) }))));
|
|
3828
|
+
}
|
|
3829
|
+
get _host() { return index.getElement(this); }
|
|
3830
|
+
static get watchers() { return {
|
|
3831
|
+
"value": ["updatePointers"],
|
|
3832
|
+
"requestheaders": ["normalizeRequestHeaders"]
|
|
3833
|
+
}; }
|
|
3781
3834
|
};
|
|
3782
3835
|
EzUpload.style = ezUploadCss;
|
|
3783
3836
|
|
|
@@ -3803,11 +3856,6 @@ let FormMetadata = class {
|
|
|
3803
3856
|
properties.push({ name: "options", value: JSON.stringify(objOpts) });
|
|
3804
3857
|
}
|
|
3805
3858
|
else if (userInterface === "FILE") {
|
|
3806
|
-
/*<URL>http://localhost:8080/2a3skw-graphql/uploadFiles</URL>
|
|
3807
|
-
<HEADERS>
|
|
3808
|
-
<HEADER NAME="Authorization">dsfs</HEADER>
|
|
3809
|
-
</HEADER>
|
|
3810
|
-
</field> */
|
|
3811
3859
|
const urlElement = element.querySelector('URL');
|
|
3812
3860
|
const headersElement = element.querySelectorAll('HEADERS>HEADER');
|
|
3813
3861
|
if (urlElement) {
|
|
@@ -3820,6 +3868,7 @@ let FormMetadata = class {
|
|
|
3820
3868
|
});
|
|
3821
3869
|
properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
|
|
3822
3870
|
}
|
|
3871
|
+
this.addPropertyIfExists(properties, element, "maxfiles");
|
|
3823
3872
|
}
|
|
3824
3873
|
else {
|
|
3825
3874
|
if (!label) {
|
package/dist/cjs/ezui.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64]}]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errormessage":[1537],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"strvalue":[1025],"value":[1026],"label":[513],"enabled":[516],"errormessage":[1537],"precision":[1538],"prettyprecision":[1538],"textleft":[516],"formatnumber":[513],"setFocus":[64],"setBlur":[64],"handleFocusout":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoclose":[516],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxwidth":[513],"isOpened":[1540,"is-opened"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16.cjs",[[0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"validate":[64],"getChanges":[64],"changeFieldValue":[64]}],[1,"form-metadata",{"name":[1],"label":[1],"dataunit":[1025],"many":[4],"autoload":[4],"metadata":[1040]}],[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}],[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errormessage":[1537],"optionloader":[16],"showselectedvalue":[4],"showoptionvalue":[4]}],[1,"ez-numeric-input",{"label":[513],"value":[1538],"enabled":[516],"errormessage":[1537],"precision":[8],"prettyprecision":[8]}],[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}],[1,"ez-collapsable-box",{"value":[1540],"label":[513],"showHide":[64]}],[1,"ez-tabselector",{"selectedindex":[1537],"selectedtab":[1537],"tabs":[1]}],[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"rows":[1538],"setFocus":[64],"setBlur":[64]}],[1,"ez-upload",{"
|
|
18
|
+
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64]}]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errormessage":[1537],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"strvalue":[1025],"value":[1026],"label":[513],"enabled":[516],"errormessage":[1537],"precision":[1538],"prettyprecision":[1538],"textleft":[516],"formatnumber":[513],"setFocus":[64],"setBlur":[64],"handleFocusout":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoclose":[516],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxwidth":[513],"isOpened":[1540,"is-opened"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16.cjs",[[0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"validate":[64],"getChanges":[64],"changeFieldValue":[64]}],[1,"form-metadata",{"name":[1],"label":[1],"dataunit":[1025],"many":[4],"autoload":[4],"metadata":[1040]}],[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}],[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errormessage":[1537],"optionloader":[16],"showselectedvalue":[4],"showoptionvalue":[4]}],[1,"ez-numeric-input",{"label":[513],"value":[1538],"enabled":[516],"errormessage":[1537],"precision":[8],"prettyprecision":[8]}],[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}],[1,"ez-collapsable-box",{"value":[1540],"label":[513],"showHide":[64]}],[1,"ez-tabselector",{"selectedindex":[1537],"selectedtab":[1537],"tabs":[1]}],[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"rows":[1538],"setFocus":[64],"setBlur":[64]}],[1,"ez-upload",{"label":[1],"enabled":[4],"maxfilesize":[2],"maxfiles":[2],"requestheaders":[8],"urlupload":[1],"urldelete":[1],"value":[1040],"addFiles":[64]}],[1,"place-holder"],[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513]}],[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errormessage":[1537],"searchmode":[4],"showselectedvalue":[4],"showoptionvalue":[4],"optionloader":[16],"_preSelection":[32],"_visibleOptions":[32]}],[1,"ez-calendar",{"value":[1040],"floating":[516],"show":[64],"hide":[64]}],[1,"ez-icon",{"size":[513],"href":[513]}],[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"onlynumber":[516],"mask":[1],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64]}]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errormessage":[1537],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"strvalue":[1025],"value":[1026],"label":[513],"enabled":[516],"errormessage":[1537],"precision":[1538],"prettyprecision":[1538],"textleft":[516],"formatnumber":[513],"setFocus":[64],"setBlur":[64],"handleFocusout":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoclose":[516],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxwidth":[513],"isOpened":[1540,"is-opened"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16.cjs",[[0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"validate":[64],"getChanges":[64],"changeFieldValue":[64]}],[1,"form-metadata",{"name":[1],"label":[1],"dataunit":[1025],"many":[4],"autoload":[4],"metadata":[1040]}],[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}],[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errormessage":[1537],"optionloader":[16],"showselectedvalue":[4],"showoptionvalue":[4]}],[1,"ez-numeric-input",{"label":[513],"value":[1538],"enabled":[516],"errormessage":[1537],"precision":[8],"prettyprecision":[8]}],[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}],[1,"ez-collapsable-box",{"value":[1540],"label":[513],"showHide":[64]}],[1,"ez-tabselector",{"selectedindex":[1537],"selectedtab":[1537],"tabs":[1]}],[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"rows":[1538],"setFocus":[64],"setBlur":[64]}],[1,"ez-upload",{"
|
|
17
|
+
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64]}]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errormessage":[1537],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"strvalue":[1025],"value":[1026],"label":[513],"enabled":[516],"errormessage":[1537],"precision":[1538],"prettyprecision":[1538],"textleft":[516],"formatnumber":[513],"setFocus":[64],"setBlur":[64],"handleFocusout":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoclose":[516],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxwidth":[513],"isOpened":[1540,"is-opened"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16.cjs",[[0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"validate":[64],"getChanges":[64],"changeFieldValue":[64]}],[1,"form-metadata",{"name":[1],"label":[1],"dataunit":[1025],"many":[4],"autoload":[4],"metadata":[1040]}],[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}],[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errormessage":[1537],"optionloader":[16],"showselectedvalue":[4],"showoptionvalue":[4]}],[1,"ez-numeric-input",{"label":[513],"value":[1538],"enabled":[516],"errormessage":[1537],"precision":[8],"prettyprecision":[8]}],[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}],[1,"ez-collapsable-box",{"value":[1540],"label":[513],"showHide":[64]}],[1,"ez-tabselector",{"selectedindex":[1537],"selectedtab":[1537],"tabs":[1]}],[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"rows":[1538],"setFocus":[64],"setBlur":[64]}],[1,"ez-upload",{"label":[1],"enabled":[4],"maxfilesize":[2],"maxfiles":[2],"requestheaders":[8],"urlupload":[1],"urldelete":[1],"value":[1040],"addFiles":[64]}],[1,"place-holder"],[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513]}],[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errormessage":[1537],"searchmode":[4],"showselectedvalue":[4],"showoptionvalue":[4],"optionloader":[16],"_preSelection":[32],"_visibleOptions":[32]}],[1,"ez-calendar",{"value":[1040],"floating":[516],"show":[64],"hide":[64]}],[1,"ez-icon",{"size":[513],"href":[513]}],[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"onlynumber":[516],"mask":[1],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -19,11 +19,6 @@ export class FormMetadata {
|
|
|
19
19
|
properties.push({ name: "options", value: JSON.stringify(objOpts) });
|
|
20
20
|
}
|
|
21
21
|
else if (userInterface === "FILE") {
|
|
22
|
-
/*<URL>http://localhost:8080/2a3skw-graphql/uploadFiles</URL>
|
|
23
|
-
<HEADERS>
|
|
24
|
-
<HEADER NAME="Authorization">dsfs</HEADER>
|
|
25
|
-
</HEADER>
|
|
26
|
-
</field> */
|
|
27
22
|
const urlElement = element.querySelector('URL');
|
|
28
23
|
const headersElement = element.querySelectorAll('HEADERS>HEADER');
|
|
29
24
|
if (urlElement) {
|
|
@@ -36,6 +31,7 @@ export class FormMetadata {
|
|
|
36
31
|
});
|
|
37
32
|
properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
|
|
38
33
|
}
|
|
34
|
+
this.addPropertyIfExists(properties, element, "maxfiles");
|
|
39
35
|
}
|
|
40
36
|
else {
|
|
41
37
|
if (!label) {
|