@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.
@@ -2190,14 +2190,7 @@ const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
2190
2190
  buttonProps.removeVisible ? 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,
2191
2191
  buttonProps.addVisible ? h("ez-button", { key: du.name + '_add', label: "Adicionar", enabled: enabled, onClick: () => du.insert(), class: "button--secondary margin-right--medium" }) : null,
2192
2192
  buttonProps.reloadVisible ? 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,
2193
- buttonProps.cancelVisible ? h("ez-button", { key: du.name + '_cancel', label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () => {
2194
- Application.confirm("Confirmar cancelamento", "Você perderá a edição atual do registro. Deseja continuar?", /*
2195
- getAssetPath("./assets/trash-can-outline.svg")*/ null, true).then(ok => {
2196
- if (ok) {
2197
- du.cancel();
2198
- }
2199
- });
2200
- }, class: "button--secondary margin-right--medium" }) : null,
2193
+ buttonProps.cancelVisible ? h("ez-button", { key: du.name + '_cancel', label: "Cancelar", enabled: enabled && du.hasChanges(), onClick: () => du.cancel(), class: "button--secondary margin-right--medium" }) : null,
2201
2194
  buttonProps.saveVisible ? h("ez-button", { key: du.name + '_save', label: "Salvar", enabled: enabled && du.hasChanges(), onClick: () => du.save(), class: "button--primary margin-right--medium" }) : null);
2202
2195
  }
2203
2196
  else {
@@ -2594,10 +2587,9 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
2594
2587
  const target = getProp(properties, 'URL');
2595
2588
  const strHeaders = getProp(properties, 'HEADERS');
2596
2589
  const headers = strHeaders ? JSON.parse(strHeaders) : {};
2590
+ const maxfiles = Number(getProp(properties, "maxfiles") || 0);
2597
2591
  return (h("div", { class: "col col--sd-12 padding--small" },
2598
- h("ez-upload", { onEzChange: (event) => {
2599
- changeFieldHandler(event.target['value']);
2600
- }, target: target, headers: headers, value: value })));
2592
+ h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
2601
2593
  case 'DATE':
2602
2594
  return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
2603
2595
  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 }));
@@ -3536,142 +3528,215 @@ let EzTextInput = class {
3536
3528
  };
3537
3529
  EzTextInput.style = ezTextInputCss;
3538
3530
 
3539
- 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%;height: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__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%}}";
3531
+ class RemoteFile {
3532
+ constructor(file) {
3533
+ this.file = file;
3534
+ this.size = file.size;
3535
+ this.name = file.name;
3536
+ }
3537
+ abortUpload() {
3538
+ if (this._uploadingXhr) {
3539
+ this._aborted = true;
3540
+ this._uploadingXhr.abort();
3541
+ this._uploadingXhr = undefined;
3542
+ }
3543
+ }
3544
+ isUploading() {
3545
+ return this._uploadingXhr !== undefined;
3546
+ }
3547
+ async upload(server, headers, updateCallBack) {
3548
+ return new Promise((resolve, reject) => {
3549
+ const xhr = new XMLHttpRequest();
3550
+ this._uploadingXhr = xhr;
3551
+ this._aborted = false;
3552
+ this.progress = 0;
3553
+ xhr.upload.onprogress = (e) => {
3554
+ const loaded = e.loaded;
3555
+ const total = e.total;
3556
+ this.progress = ~~((loaded / total) * 100);
3557
+ updateCallBack(this, loaded, total);
3558
+ };
3559
+ xhr.onreadystatechange = () => {
3560
+ if (xhr.readyState == 4) {
3561
+ this._uploadingXhr = undefined;
3562
+ const status = xhr.status;
3563
+ if (!this._aborted) {
3564
+ if (status === 0) {
3565
+ reject("Servidor indisponível");
3566
+ }
3567
+ else if (status >= 500) {
3568
+ reject("Erro inesperado no servidor");
3569
+ }
3570
+ else if (status >= 400) {
3571
+ reject("Operação não permitida");
3572
+ }
3573
+ }
3574
+ const response = xhr.response;
3575
+ if (response) {
3576
+ resolve(JSON.parse(response));
3577
+ }
3578
+ }
3579
+ };
3580
+ xhr.ontimeout = () => {
3581
+ reject("Tempo limite de transferência atingido.");
3582
+ };
3583
+ const formData = new FormData();
3584
+ formData.append("ARQUIVO", this.file, this.file.name);
3585
+ xhr.open("POST", server, true);
3586
+ if (headers) {
3587
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
3588
+ }
3589
+ xhr.send(formData);
3590
+ });
3591
+ }
3592
+ async delete(item, server, headers) {
3593
+ return new Promise((resolve, reject) => {
3594
+ const xhr = new XMLHttpRequest();
3595
+ xhr.onreadystatechange = () => {
3596
+ if (xhr.readyState == 4) {
3597
+ if (xhr.status === 0) {
3598
+ reject("Servidor indisponível");
3599
+ }
3600
+ else if (xhr.status >= 500) {
3601
+ reject("Erro inesperado no servidor");
3602
+ }
3603
+ else if (xhr.status >= 400) {
3604
+ reject("Operação não permitida");
3605
+ }
3606
+ resolve(true);
3607
+ }
3608
+ };
3609
+ xhr.ontimeout = () => {
3610
+ reject("Tempo limite de remoção atingido.");
3611
+ };
3612
+ xhr.open("DELETE", server, true);
3613
+ if (headers) {
3614
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
3615
+ }
3616
+ xhr.send(JSON.stringify(item));
3617
+ });
3618
+ }
3619
+ }
3620
+
3621
+ 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%}}";
3540
3622
 
3541
3623
  let EzUpload = class {
3542
3624
  constructor(hostRef) {
3543
3625
  registerInstance(this, hostRef);
3544
- this.validatedEvent = createEvent(this, "validatedEvent", 7);
3545
- this.initUploadEvent = createEvent(this, "initUploadEvent", 7);
3546
- this.finishedUploadEvent = createEvent(this, "finishedUploadEvent", 7);
3547
3626
  this.ezChange = createEvent(this, "ezChange", 7);
3627
+ this._filePointers = new Map();
3628
+ /**
3629
+ * Deixa o campo disponível ou não para digitação.
3630
+ */
3631
+ this.enabled = true;
3548
3632
  }
3549
- fileListChange() {
3550
- this.ezChange.emit({ value: this.value });
3633
+ updatePointers(newValue) {
3634
+ if (newValue !== this._updatingValue) {
3635
+ this._filePointers.forEach(f => {
3636
+ if (this.isRemoteFile(f)) {
3637
+ f.abortUpload();
3638
+ }
3639
+ });
3640
+ this._filePointers = new Map();
3641
+ if (newValue) {
3642
+ newValue.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
3643
+ }
3644
+ }
3645
+ this._updatingValue = undefined;
3646
+ }
3647
+ normalizeRequestHeaders() {
3648
+ this._requestHeaders = new Map();
3649
+ if (typeof this.requestheaders == 'string') {
3650
+ try {
3651
+ this.requestheaders = JSON.parse(this.requestheaders);
3652
+ }
3653
+ catch (e) {
3654
+ this.requestheaders = undefined;
3655
+ }
3656
+ }
3657
+ for (var key in this.requestheaders) {
3658
+ this._requestHeaders.set(key, this.requestheaders[key]);
3659
+ }
3551
3660
  }
3552
3661
  async addFiles(files) {
3553
3662
  Array.prototype.forEach.call(files, this.addFile.bind(this));
3554
3663
  }
3555
- addFile(file) {
3556
- this.errorMessage = undefined;
3557
- if (this.validateFile(file)) {
3558
- if (this.target) {
3559
- this._uploadFile(file);
3560
- }
3561
- else {
3562
- this.errorMessage = "Endereço de upload não informado";
3563
- alert(this.errorMessage);
3564
- }
3664
+ async addFile(file) {
3665
+ const oldFile = this._filePointers.get(file.name);
3666
+ if (oldFile) {
3667
+ Application.confirm("Substituir arquivo", `Já existe um arquivo chamado "${file.name}". Deseja substituí-lo?`)
3668
+ .then(ok => {
3669
+ if (ok) {
3670
+ if (this.isRemoteFile(oldFile)) {
3671
+ oldFile.abortUpload();
3672
+ }
3673
+ this.doAddFile(file);
3674
+ }
3675
+ });
3565
3676
  }
3566
3677
  else {
3567
- if (this.errorMessage && this.errorMessage.length > 0) {
3568
- alert(this.errorMessage);
3569
- }
3678
+ this.doAddFile(file);
3570
3679
  }
3571
3680
  }
3572
- validateFile(file) {
3573
- this.errorMessage = '';
3574
- let isValid = true;
3575
- if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
3576
- this.errorMessage = 'O tamanho máximo dos arquivos é de ' + this.formatBytes(this.maxFileSize);
3577
- isValid = false;
3578
- }
3579
- this.validatedEvent.emit({ isValid: isValid, fileName: file.name });
3580
- return isValid;
3581
- }
3582
- _uploadFile(file) {
3583
- const xhr = (file.xhr = this._createXhr());
3584
- const newValue = this.value ? [...this.value] : [];
3585
- newValue.push({ name: file.name, size: file.size, xhr: file.xhr });
3586
- let stalledId;
3587
- xhr.upload.onprogress = (e) => {
3588
- clearTimeout(stalledId);
3589
- const loaded = e.loaded, total = e.total, progress = ~~((loaded / total) * 100);
3590
- let viewFile = newValue.find(f => f.name === file.name);
3591
- if (viewFile) {
3592
- viewFile.progress = progress;
3681
+ async doAddFile(file) {
3682
+ if (this.validateFile(file)) {
3683
+ const uploadingFile = new RemoteFile(file);
3684
+ this._filePointers.set(file.name, uploadingFile);
3685
+ uploadingFile.upload(this.urlupload, this._requestHeaders, (file) => this.updateFeedback(file))
3686
+ .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
3687
+ .catch(msg => this.showError(msg));
3688
+ forceUpdate(this);
3689
+ }
3690
+ }
3691
+ finishUpload(ezFile) {
3692
+ this._filePointers.set(ezFile.name, ezFile);
3693
+ this.updateValue();
3694
+ }
3695
+ updateValue() {
3696
+ this._updatingValue = [];
3697
+ this._filePointers.forEach(f => {
3698
+ if (!this.isRemoteFile(f)) {
3699
+ this._updatingValue.push(f);
3593
3700
  }
3594
- };
3595
- xhr.onreadystatechange = () => {
3596
- this.errorMessage = '';
3597
- if (xhr.readyState == 4) {
3598
- clearTimeout(stalledId);
3599
- file.indeterminate = file.uploading = false;
3600
- if (xhr.status === 0) ;
3601
- else if (xhr.status >= 500) {
3602
- this.errorMessage = "Erro inesperado no servidor";
3603
- }
3604
- else if (xhr.status >= 400) {
3605
- this.errorMessage = "Operação não permitida";
3606
- }
3607
- if (this.errorMessage && this.errorMessage.length > 0) {
3608
- //TODO
3609
- // Conferir com o time de UX um estado de erro ou remoção da lista
3610
- // this.removeFile(file.name);
3611
- alert(this.errorMessage);
3612
- }
3613
- else {
3614
- if (xhr.response) {
3615
- let response = JSON.parse(xhr.response);
3616
- response.forEach(element => {
3617
- let viewFile = newValue.find(f => f.name === this.decode_utf8(element.name));
3618
- if (viewFile) {
3619
- viewFile.progress = undefined;
3620
- //Validar estado de erro com UX
3621
- viewFile.error = false;
3622
- delete viewFile.xhr;
3623
- viewFile.downloadURL = element.downloadURL;
3624
- viewFile.lastModifiedDate = element.lastModifiedDate;
3625
- viewFile.properties = element.properties;
3626
- }
3627
- });
3628
- this.value = newValue;
3629
- this.fileListChange();
3630
- }
3631
- else {
3632
- let viewFile = newValue.find(f => f.name === file.name);
3633
- viewFile.progress = undefined;
3634
- //Validar estado de erro com UX
3635
- viewFile.error = true;
3636
- }
3701
+ });
3702
+ this.value = this._updatingValue;
3703
+ this.ezChange.emit(this.value);
3704
+ }
3705
+ buildProgressId(uploading) {
3706
+ let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, '_');
3707
+ return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
3708
+ }
3709
+ updateFeedback(uf) {
3710
+ window.requestAnimationFrame(() => {
3711
+ if (this._host) {
3712
+ const progress = this._host.shadowRoot.querySelector('#' + this.buildProgressId(uf));
3713
+ if (progress) {
3714
+ progress.value = uf.progress;
3637
3715
  }
3638
3716
  }
3639
- };
3640
- xhr.ontimeout = () => {
3641
- if (this.errorMessage && this.errorMessage.length > 0) {
3642
- this.errorMessage.concat(" / Tempo expirado");
3643
- this.removeFile(file.name);
3644
- alert(this.errorMessage);
3645
- }
3646
- };
3647
- const formData = new FormData();
3648
- formData.append(this.formDataName, file, file.name);
3649
- xhr.open("POST", this.target, true);
3650
- this._configureXhr(xhr);
3651
- file.status = "conectando";
3652
- file.uploading = file.indeterminate = true;
3653
- file.complete = file.abort = file.error = file.held = false;
3654
- xhr.send(formData);
3655
- }
3656
- _createXhr() {
3657
- return new XMLHttpRequest();
3658
- }
3659
- _configureXhr(xhr) {
3660
- if (typeof this.headers == 'string') {
3661
- try {
3662
- this.headers = JSON.parse(this.headers);
3663
- }
3664
- catch (e) {
3665
- this.headers = undefined;
3666
- }
3717
+ });
3718
+ }
3719
+ validateFile(file) {
3720
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3721
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3722
+ return false;
3667
3723
  }
3668
- for (var key in this.headers) {
3669
- xhr.setRequestHeader(key, this.headers[key]);
3724
+ if (file.size === 0) {
3725
+ this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
3726
+ return false;
3670
3727
  }
3671
- if (this.timeout) {
3672
- xhr.timeout = this.timeout;
3728
+ if (!this.urlupload) {
3729
+ this.showError("Endereço de upload não informado");
3730
+ return false;
3673
3731
  }
3674
- xhr.withCredentials = this.withCredentials;
3732
+ if (this.maxfilesize >= 0 && file.size > this.maxfilesize) {
3733
+ this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxfilesize));
3734
+ return false;
3735
+ }
3736
+ return true;
3737
+ }
3738
+ showError(message) {
3739
+ Application.alert("Enviando arquivo", message);
3675
3740
  }
3676
3741
  formatBytes(bytes, decimals = 1) {
3677
3742
  if (bytes === 0)
@@ -3683,97 +3748,85 @@ let EzUpload = class {
3683
3748
  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
3684
3749
  }
3685
3750
  onFileInputChange(event) {
3686
- this.addFiles(event.target.files);
3751
+ const input = event.target;
3752
+ this.addFiles(Array.from(input.files));
3687
3753
  this._fileInput.value = '';
3688
3754
  }
3689
- /*componentWillLoad() {
3690
- if (this.fileList?.length > 0) {
3691
- this.fileList.forEach(item => {
3692
- if (item.size) {
3693
- item.strSize = this.formatBytes(item.size);
3694
- }
3695
- })
3696
- this.fileList = [...this.fileList];
3755
+ isRemoteFile(item) {
3756
+ return "file" in item;
3757
+ }
3758
+ removeFromList(name) {
3759
+ this._filePointers.delete(name);
3760
+ this.updateValue();
3761
+ }
3762
+ removeFile(name) {
3763
+ const item = this._filePointers.get(name);
3764
+ if (this.isRemoteFile(item)) {
3765
+ item.abortUpload();
3766
+ this.removeFromList(name);
3767
+ }
3768
+ else {
3769
+ if (this.urldelete) {
3770
+ const uploadingFile = new RemoteFile(null);
3771
+ this._filePointers.set(item.name, uploadingFile);
3772
+ uploadingFile.delete(item, this.urldelete, null)
3773
+ .then(_ok => this.removeFromList(name))
3774
+ .catch(msg => this.showError(msg));
3775
+ }
3776
+ else {
3777
+ this.removeFromList(name);
3778
+ }
3697
3779
  }
3698
- }*/
3699
- decode_utf8(s) {
3700
- return decodeURIComponent(escape(s));
3701
3780
  }
3702
3781
  componentDidLoad() {
3703
- if (this.dropZone && window.FileList && window.File) {
3704
- this.dropZone.addEventListener('dragover', event => {
3782
+ if (this._dropZone && window.FileList && window.File) {
3783
+ this._dropZone.addEventListener('dragover', event => {
3705
3784
  event.stopPropagation();
3706
3785
  event.preventDefault();
3707
3786
  event.dataTransfer.dropEffect = 'copy';
3708
3787
  });
3709
- this.dropZone.addEventListener('drop', event => {
3788
+ this._dropZone.addEventListener('drop', event => {
3710
3789
  event.stopPropagation();
3711
3790
  event.preventDefault();
3712
- this.addFiles(event.dataTransfer.files);
3791
+ this.addFiles(Array.from(event.dataTransfer.files));
3713
3792
  });
3714
3793
  }
3715
3794
  }
3716
- removeFile(name, xhr, downloadURL) {
3717
- if (xhr) {
3718
- xhr.abort();
3795
+ openFilesDialog() {
3796
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3797
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3719
3798
  }
3720
- if (downloadURL) {
3721
- this.removeFileFromServer(name, downloadURL);
3799
+ else {
3800
+ this._fileInput.click();
3722
3801
  }
3723
- this.value = [...this.value.filter(function (value) { return value.name !== name; })];
3724
- this.fileListChange();
3725
- }
3726
- removeFileFromServer(name, donwloadURL) {
3727
- const xhr = this._createXhr();
3728
- this.errorMessage = '';
3729
- let stalledId;
3730
- xhr.onreadystatechange = () => {
3731
- if (xhr.readyState == 4) {
3732
- clearTimeout(stalledId);
3733
- if (xhr.status === 0) {
3734
- this.errorMessage = "Servidor indisponível";
3735
- }
3736
- else if (xhr.status >= 500) {
3737
- this.errorMessage = "Erro inesperado no servidor";
3738
- }
3739
- else if (xhr.status >= 400) {
3740
- this.errorMessage = "Operação não permitida";
3741
- }
3742
- if (this.errorMessage && this.errorMessage.length > 0) {
3743
- //TODO
3744
- // Conferir com o time de UX um estado de erro ou remoção da lista
3745
- // this.removeFile(file.name);
3746
- alert(this.errorMessage);
3747
- }
3748
- }
3749
- };
3750
- xhr.ontimeout = () => {
3751
- if (this.errorMessage && this.errorMessage.length > 0) {
3752
- alert(this.errorMessage);
3753
- }
3754
- };
3755
- const body = JSON.stringify({
3756
- name: name,
3757
- donwloadURL: donwloadURL,
3758
- });
3759
- xhr.open("DELETE", this.target, true);
3760
- xhr.setRequestHeader('Content-Type', 'application/json');
3761
- this._configureXhr(xhr);
3762
- xhr.send(body);
3763
3802
  }
3764
3803
  render() {
3765
- var _a;
3766
- return (h(Host, null, h("slot", null, h("div", { ref: (el) => this.dropZone = el, class: "iu" }, h("div", { class: "iu__container" }, h("div", { onClick: () => this._fileInput.click(), class: "iu__icon-label" }, h("button", { class: "iu__file-icon" }), 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 ?
3767
- h("div", { class: "iu__footer" }, this.value.map(file => {
3768
- return (h("div", { class: "iu__item" }, h("div", { class: "iu__item-label" + (file.progress ? " modificador " : " modificador ") }, file.downloadURL ?
3769
- h("div", { title: file.name + "(" + this.formatBytes(file.size) + ")", class: "file__name text text--primary text--small text--ellipsis align--middle" }, h("a", { href: file.downloadURL, download: true }, file.name, " (", this.formatBytes(file.size), ")"))
3770
- :
3771
- 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 ?
3772
- h("div", { class: "col col--sd-4 col--stretch align--middle" }, h("progress", { value: file.progress, max: "100" }))
3773
- : undefined, h("div", { class: "col col--stretch align--middle" }, h("button", { class: "btn-cancel ", onClick: () => this.removeFile(file.name, file.xhr) }))));
3774
- }))
3775
- : undefined))), h("input", { ref: (el) => this._fileInput = el, type: "file", id: "fileInput", hidden: true, onChange: (ev) => this.onFileInputChange(ev), multiple: true })));
3804
+ return (h("div", { ref: (el) => this._dropZone = el, class: "iu" }, this.label ? h("label", { class: "iu__label", title: this.label }, this.label) : null, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu__icon-label" }, h("button", { class: "iu__file-icon" }), h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para adicionar arquivos")), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
3776
3805
  }
3806
+ buildFooter() {
3807
+ if (this._filePointers.size === 0) {
3808
+ return null;
3809
+ }
3810
+ const items = [];
3811
+ this._filePointers.forEach(item => items.push(this.buildFileItem(item)));
3812
+ return (h("div", { class: "iu__footer" }, items));
3813
+ }
3814
+ buildFileItem(item) {
3815
+ const fileName = item.name;
3816
+ const progress = Number(item['progress']);
3817
+ const downloadURL = item['downloadURL'];
3818
+ const label = `${fileName} (${this.formatBytes(item.size)})`;
3819
+ return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, h("div", { class: "iu__item-label modificador" }, 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)), isNaN(progress)
3820
+ ?
3821
+ null
3822
+ :
3823
+ h("div", { class: "col col--sd-4 col--stretch align--middle" }, h("progress", { id: this.buildProgressId(item), value: progress, max: "100" })), h("div", { class: "col col--stretch align--middle" }, h("button", { class: "btn-cancel ", onClick: () => this.removeFile(fileName) }))));
3824
+ }
3825
+ get _host() { return getElement(this); }
3826
+ static get watchers() { return {
3827
+ "value": ["updatePointers"],
3828
+ "requestheaders": ["normalizeRequestHeaders"]
3829
+ }; }
3777
3830
  };
3778
3831
  EzUpload.style = ezUploadCss;
3779
3832
 
@@ -3799,11 +3852,6 @@ let FormMetadata = class {
3799
3852
  properties.push({ name: "options", value: JSON.stringify(objOpts) });
3800
3853
  }
3801
3854
  else if (userInterface === "FILE") {
3802
- /*<URL>http://localhost:8080/2a3skw-graphql/uploadFiles</URL>
3803
- <HEADERS>
3804
- <HEADER NAME="Authorization">dsfs</HEADER>
3805
- </HEADER>
3806
- </field> */
3807
3855
  const urlElement = element.querySelector('URL');
3808
3856
  const headersElement = element.querySelectorAll('HEADERS>HEADER');
3809
3857
  if (urlElement) {
@@ -3816,6 +3864,7 @@ let FormMetadata = class {
3816
3864
  });
3817
3865
  properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
3818
3866
  }
3867
+ this.addPropertyIfExists(properties, element, "maxfiles");
3819
3868
  }
3820
3869
  else {
3821
3870
  if (!label) {
package/dist/esm/ezui.js CHANGED
@@ -13,5 +13,5 @@ const patchBrowser = () => {
13
13
  };
14
14
 
15
15
  patchBrowser().then(options => {
16
- return bootstrapLazy([["ez-dialog",[[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",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input",[[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",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16",[[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",{"maxFileSize":[514,"max-file-size"],"headers":[520],"timeout":[514],"withCredentials":[516,"with-credentials"],"formDataName":[513,"form-data-name"],"target":[513],"value":[16],"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);
16
+ return bootstrapLazy([["ez-dialog",[[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",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input",[[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",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16",[[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);
17
17
  });
@@ -10,7 +10,7 @@ const patchEsm = () => {
10
10
  const defineCustomElements = (win, options) => {
11
11
  if (typeof window === 'undefined') return Promise.resolve();
12
12
  return patchEsm().then(() => {
13
- return bootstrapLazy([["ez-dialog",[[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",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input",[[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",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16",[[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",{"maxFileSize":[514,"max-file-size"],"headers":[520],"timeout":[514],"withCredentials":[516,"with-credentials"],"formDataName":[513,"form-data-name"],"target":[513],"value":[16],"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);
13
+ return bootstrapLazy([["ez-dialog",[[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",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input",[[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",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input",[[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",[[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",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16",[[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);
14
14
  });
15
15
  };
16
16
 
@@ -1 +1 @@
1
- import{p as e,b as a}from"./p-762ac7a0.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((e=>a([["p-1ff02df6",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],oppened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64]}]]],["p-55c5b134",[[1,"ez-label-chip",{label:[513],enabled:[516],removable:[516],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-7f528c19",[[1,"ez-time-input",{label:[513],viewValue:[1537,"view-value"],value:[1026],enabled:[516],errormessage:[1537],showSeconds:[516,"show-seconds"],setFocus:[64],setBlur:[64]}]]],["p-b81916dd",[[1,"ez-action-chip",{label:[513],enabled:[516]}]]],["p-06c7c4e3",[[1,"ez-modal",{modalsize:[1],align:[1],oppened:[4],closeesc:[4],closeoutsideclick:[4]}]]],["p-d8a47f23",[[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]}]]],["p-171bdc12",[[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]}]]],["p-4a87d740",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-c3b18332",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],show:[64]}]]],["p-e930ba53",[[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",{maxFileSize:[514,"max-file-size"],headers:[520],timeout:[514],withCredentials:[516,"with-credentials"],formDataName:[513,"form-data-name"],target:[513],value:[16],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]}]]]],e)));
1
+ import{p as e,b as a}from"./p-762ac7a0.js";(()=>{const a=import.meta.url,l={};return""!==a&&(l.resourcesUrl=new URL(".",a).href),e(l)})().then((e=>a([["p-1ff02df6",[[1,"ez-dialog",{confirm:[1028],critical:[1028],message:[1025],oppened:[1540],personalizedIconPath:[1025,"personalized-icon-path"],ezTitle:[1025,"ez-title"],handleButtonClick:[64]}]]],["p-55c5b134",[[1,"ez-label-chip",{label:[513],enabled:[516],removable:[516],value:[1540],setFocus:[64],setBlur:[64]}]]],["p-7f528c19",[[1,"ez-time-input",{label:[513],viewValue:[1537,"view-value"],value:[1026],enabled:[516],errormessage:[1537],showSeconds:[516,"show-seconds"],setFocus:[64],setBlur:[64]}]]],["p-b81916dd",[[1,"ez-action-chip",{label:[513],enabled:[516]}]]],["p-06c7c4e3",[[1,"ez-modal",{modalsize:[1],align:[1],oppened:[4],closeesc:[4],closeoutsideclick:[4]}]]],["p-d8a47f23",[[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]}]]],["p-171bdc12",[[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]}]]],["p-4a87d740",[[1,"ez-popup",{size:[1],opened:[1540],useHeader:[1540,"use-header"],ezTitle:[1,"ez-title"]}]]],["p-c3b18332",[[1,"ez-toast",{message:[1025],fadeTime:[1026,"fade-time"],useIcon:[1028,"use-icon"],show:[64]}]]],["p-e9784201",[[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]}]]]],e)));