@sankhyalabs/ezui 1.1.48 → 1.1.52

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.
@@ -441,7 +441,7 @@ let EzComboBox = class {
441
441
  }
442
442
  cancelPreselection() {
443
443
  if (!this._inputElement.value && this.value) {
444
- this.value = null;
444
+ this.selectOption(null);
445
445
  }
446
446
  else {
447
447
  this.internalUpdate();
@@ -2158,18 +2158,15 @@ class Application {
2158
2158
  dialog = document.createElement("ez-dialog");
2159
2159
  window.document.body.appendChild(dialog);
2160
2160
  }
2161
- dialog.ezTitle = title;
2162
- dialog.message = message;
2163
- dialog.critical = critical;
2164
- dialog.confirm = confirm;
2165
- dialog.personalizedIconPath = icon;
2166
- dialog.oppened = true;
2167
- dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
2161
+ dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
2168
2162
  });
2169
2163
  }
2170
2164
  static async alert(title, message, icon = null) {
2171
2165
  return Application.showDialog(title, message, icon, false, false);
2172
2166
  }
2167
+ static async error(title, message, icon = null) {
2168
+ return Application.showDialog(title, message, icon, false, true);
2169
+ }
2173
2170
  static async confirm(title, message, icon = null, critical = false) {
2174
2171
  return Application.showDialog(title, message, icon, true, critical);
2175
2172
  }
@@ -2404,7 +2401,12 @@ class DataUnit {
2404
2401
  saveResult = this.saveExecutor(this.getChangesToSave());
2405
2402
  }
2406
2403
  if (saveResult instanceof Promise) {
2407
- saveResult.then(r => this.processSaveResult(r));
2404
+ saveResult
2405
+ .then(r => this.processSaveResult(r))
2406
+ .catch(e => {
2407
+ this._store.dispatch(dataLoaded$1(this.name));
2408
+ Application.error("Falha ao tentar salvar", e);
2409
+ });
2408
2410
  }
2409
2411
  else {
2410
2412
  this.processSaveResult(saveResult);
@@ -2696,6 +2698,7 @@ let EzForm = class {
2696
2698
  constructor(hostRef) {
2697
2699
  index.registerInstance(this, hostRef);
2698
2700
  this.enabled = true;
2701
+ this.loading = false;
2699
2702
  this._dataUnits = new Map();
2700
2703
  this._duSources = new Map();
2701
2704
  this._tabPositionByField = new Map();
@@ -2926,7 +2929,12 @@ let EzForm = class {
2926
2929
  dataUnit.recordsValidator = this;
2927
2930
  }
2928
2931
  render() {
2929
- return this._preparedMetadata ? index.h(FormSheet, { enabled: this.enabled, store: this._store, source: this._preparedMetadata, parentName: "__MAIN__FORM__", dataUnitBuilder: (du, parentDataUnit) => this.buildDataUnit(du, parentDataUnit) }) : null;
2932
+ if (this.loading) {
2933
+ return index.h("place-holder", null);
2934
+ }
2935
+ else {
2936
+ return this._preparedMetadata ? index.h(FormSheet, { enabled: this.enabled, store: this._store, source: this._preparedMetadata, parentName: "__MAIN__FORM__", dataUnitBuilder: (du, parentDataUnit) => this.buildDataUnit(du, parentDataUnit) }) : null;
2937
+ }
2930
2938
  }
2931
2939
  static get assetsDirs() { return ["assets"]; }
2932
2940
  get _host() { return index.getElement(this); }
@@ -2994,7 +3002,10 @@ let EzNumericInput = class {
2994
3002
  }
2995
3003
  }
2996
3004
  getTextValue(value) {
2997
- return value ? RequestMetadata.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : null;
3005
+ if (value) {
3006
+ return this.precision > 0 ? RequestMetadata.NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : value.toString();
3007
+ }
3008
+ return null;
2998
3009
  }
2999
3010
  render() {
3000
3011
  return (index.h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errormessage: this.errormessage }));
@@ -3393,14 +3404,16 @@ let EzTextInput = class {
3393
3404
  }
3394
3405
  }
3395
3406
  updateInputValue() {
3396
- this._inputElem.value = this.value;
3407
+ if (this._inputElem) {
3408
+ this._inputElem.value = this.value;
3409
+ }
3397
3410
  this.handleChange();
3398
3411
  this.ezChange.emit();
3399
3412
  this.adjustFloatingLabel();
3400
3413
  }
3401
3414
  adjustFloatingLabel() {
3402
- if (this.label) {
3403
- if (!this._inputElem.classList.contains("input--with--label")) {
3415
+ if (this.label && this._labelElem) {
3416
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
3404
3417
  this._inputElem.classList.add("input--with--label");
3405
3418
  }
3406
3419
  const hasValue = this.value && this.value.toString().length > 0;
@@ -3641,7 +3654,7 @@ class RemoteFile {
3641
3654
  }
3642
3655
  }
3643
3656
 
3644
- 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);--iu__btn-cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"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\"/></svg>');--iu__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"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\"/></svg>');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;-webkit-mask-image:var(--iu__btn-cancel-image);mask-image:var(--iu__btn-cancel-image)}.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:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--iu__file-icon-image);mask-image:var(--iu__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:none}.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%}}";
3657
+ 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);--iu__btn-cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"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\"/></svg>');--iu__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"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\"/></svg>');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;-webkit-mask-image:var(--iu__btn-cancel-image);mask-image:var(--iu__btn-cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);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:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--iu__file-icon-image);mask-image:var(--iu__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:none}.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%}}";
3645
3658
 
3646
3659
  let EzUpload = class {
3647
3660
  constructor(hostRef) {
@@ -3685,6 +3698,18 @@ let EzUpload = class {
3685
3698
  }
3686
3699
  }
3687
3700
  async addFiles(files) {
3701
+ if (this.maxfiles > 0) {
3702
+ let countDistinctFiles = this._filePointers.size;
3703
+ files.forEach(file => {
3704
+ if (!this._filePointers.has(file.name)) {
3705
+ countDistinctFiles++;
3706
+ }
3707
+ });
3708
+ if (countDistinctFiles > this.maxfiles) {
3709
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3710
+ return;
3711
+ }
3712
+ }
3688
3713
  Array.prototype.forEach.call(files, this.addFile.bind(this));
3689
3714
  }
3690
3715
  async addFile(file) {
@@ -3743,7 +3768,7 @@ let EzUpload = class {
3743
3768
  });
3744
3769
  }
3745
3770
  validateFile(file) {
3746
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3771
+ if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3747
3772
  this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3748
3773
  return false;
3749
3774
  }
@@ -3806,12 +3831,7 @@ let EzUpload = class {
3806
3831
  }
3807
3832
  openFilesDialog() {
3808
3833
  if (this.enabled) {
3809
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3810
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3811
- }
3812
- else {
3813
- this._fileInput.click();
3814
- }
3834
+ this._fileInput.click();
3815
3835
  }
3816
3836
  }
3817
3837
  componentDidLoad() {
@@ -3842,7 +3862,7 @@ let EzUpload = class {
3842
3862
  mouse-poiter--disabled
3843
3863
  */
3844
3864
  render() {
3845
- return (index.h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, this.label ? index.h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, index.h("button", { class: "iu__file-icon", disabled: !this.enabled }), index.h("div", { class: this.evalDisabledClass('text text--center text--medium text--primary', 'text--disabled') }, this.enabled ? 'Arraste e solte ou clique para adicionar arquivos' : 'Somente leitura')), this.buildFooter()), index.h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
3865
+ return (index.h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: "iu_header" }, this.label ? index.h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, index.h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, index.h("button", { class: "iu__file-icon", disabled: !this.enabled }), index.h("div", { class: this.evalDisabledClass('text text--center text--medium text--primary', 'text--disabled') }, this.enabled ? 'Arraste e solte ou clique para adicionar arquivos' : 'Somente leitura'))), this.buildFooter()), index.h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
3846
3866
  }
3847
3867
  buildFooter() {
3848
3868
  if (this._filePointers.size === 0) {
@@ -6,6 +6,16 @@ const index = require('./index-0f668cc5.js');
6
6
 
7
7
  const ezDialogCss = ":host{--dlg-title--primary:var(--title--primary, #2b3a54);--dlg-font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dlg-text-weight--large:var(--text-weight--large, 600);--dlg-space--small:var(--space--small, 6px);--dlg-space--medium:var(--space--medium, 12px);--dlg-space--large:var(--space--large, 24px);--dlg-critical--background-color:var(--color--alert-error-800, #BD0025);--dlg-warning--background-color:var(--color--alert-warning-500, #EFB103);--dlg-text-weight--medium:var(--text-weight--medium, 400);--dlg-text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--dlg-text--medium:var(--text--medium, 14px);--dlg-text--primary:var(--text--primary, #626e82);--dlg-z-index:var(--most-visible, 3);--dlg--close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--dlg--warning__image:url('data: image/svg+xml;utf8,<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895\"/></svg>');--dlg--critical__image:url('data: image/svg+xml;utf8,<svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z\"/></svg>')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dlg-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;color:var(--dlg-title--primary);border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dlg-space--large)}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dlg-critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dlg-warning--background-color)}.message{font-weight:var(--dlg-text-weight--medium);padding-bottom:var(--dlg-space--large);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.title{display:flex;font-family:var(--dlg-font-pattern);margin:0;font-weight:var(--dlg-text-weight--large);line-height:1.3}.title--large{font-size:var(--dlg-title--large)}.title__container{display:flex;padding-bottom:var(--dlg-space--medium)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title--label{padding-left:var(--dlg-space--small)}.title-icon{outline:none;border:none;background-color:var(--dlg-warning--background-color);width:26px;height:26px;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center}.title-icon--critical{background-color:var(--dlg-critical--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--dlg-title--primary);width:12px;height:12px;-webkit-mask-image:var(--dlg--close__image);mask-image:var(--dlg--close__image)}.title-icon::after{content:'';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dlg--warning__image);mask-image:var(--dlg--warning__image)}.title-icon--critical::after{content:'';display:flex;background-color:#FFFF;width:13px;height:13px;-webkit-mask-image:var(--dlg--critical__image);mask-image:var(--dlg--critical__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__no{padding-right:var(--dlg-space--large)}.button__ok--container{display:flex;justify-content:flex-end}.text{font-family:var(--dlg-font-pattern);text-shadow:var(--dlg-text-shadow)}.text--medium{font-size:var(--dlg-text--medium)}.text--primary{color:var(--dlg-text--primary);text-shadow:var(--dlg-text-shadow)}.iconePersonalizado{width:15px;height:15px}.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%}}";
8
8
 
9
+ class Message {
10
+ constructor(title, message, critical, confirm, icon, callBack) {
11
+ this.title = title;
12
+ this.message = message;
13
+ this.critical = critical;
14
+ this.confirm = confirm;
15
+ this.icon = icon;
16
+ this.callBack = callBack;
17
+ }
18
+ }
9
19
  let EzDialog = class {
10
20
  constructor(hostRef) {
11
21
  index.registerInstance(this, hostRef);
@@ -21,20 +31,46 @@ let EzDialog = class {
21
31
  /**
22
32
  * Controla a exibição do componente
23
33
  */
24
- this.oppened = false;
34
+ this.opened = false;
35
+ this._messageQueue = [];
25
36
  }
26
37
  async handleButtonClick(selectedOption) {
27
- this.oppened = false;
28
- this.ezChange.emit(selectedOption);
38
+ this.opened = this._messageQueue.length > 0;
39
+ if (this._currentMessage.callBack) {
40
+ this._currentMessage.callBack(selectedOption);
41
+ }
42
+ else {
43
+ this.ezChange.emit(selectedOption);
44
+ }
45
+ this._currentMessage = this._messageQueue.shift();
46
+ index.forceUpdate(this);
47
+ }
48
+ async show(title, message, critical, confirm, icon) {
49
+ this.opened = true;
50
+ return new Promise(resolve => {
51
+ this._messageQueue.push(new Message(title, message, critical, confirm, icon, resolve));
52
+ });
53
+ }
54
+ componentWillRender() {
55
+ if (!this._currentMessage) {
56
+ if (this._messageQueue.length > 0) {
57
+ this._currentMessage = this._messageQueue.pop();
58
+ }
59
+ else {
60
+ if (this.opened) {
61
+ this._currentMessage = new Message(this.ezTitle, this.message, this.critical, this.confirm, this.personalizedIconPath, null);
62
+ }
63
+ }
64
+ }
29
65
  }
30
66
  render() {
31
- if (this.oppened) {
32
- return (index.h("div", { class: "overlay" }, index.h("div", { class: "dialog" }, index.h("div", { class: this.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }), index.h("div", { class: "dialog__container" }, index.h("div", { class: "title__container" }, index.h("div", { class: "title__box" }, this.personalizedIconPath ?
33
- index.h("svg", { class: "iconePersonalizado", role: "img" }, index.h("use", { xlinkHref: this.personalizedIconPath }))
67
+ if (this.opened && this._currentMessage) {
68
+ return (index.h("div", { class: "overlay" }, index.h("div", { class: "dialog" }, index.h("div", { class: this._currentMessage.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }), index.h("div", { class: "dialog__container" }, index.h("div", { class: "title__container" }, index.h("div", { class: "title__box" }, this._currentMessage.icon ?
69
+ index.h("svg", { class: "iconePersonalizado", role: "img" }, index.h("use", { xlinkHref: this._currentMessage.icon }))
34
70
  :
35
- index.h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }), index.h("div", { class: "title title--label" }, index.h("h2", null, this.ezTitle))), index.h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit(false); } })), index.h("div", { class: "text text--primary text--medium message" }, this.message), this.confirm ?
71
+ index.h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }), index.h("div", { class: "title title--label" }, index.h("h2", null, this._currentMessage.title))), index.h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })), index.h("div", { class: "text text--primary text--medium message" }, this._currentMessage.message), this._currentMessage.confirm ?
36
72
  index.h("div", { class: "button-yes-no__container" }, index.h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }), index.h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
37
- : undefined, !this.confirm ?
73
+ : undefined, !this._currentMessage.confirm ?
38
74
  index.h("div", { class: "button__ok--container" }, index.h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
39
75
  : undefined))));
40
76
  }
@@ -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",{"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],"fitVertical":[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
+ return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[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],"loading":[1540],"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],"fitVertical":[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
  });
@@ -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",{"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],"fitVertical":[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
+ return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[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],"loading":[1540],"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],"fitVertical":[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
 
@@ -139,7 +139,7 @@ export class EzComboBox {
139
139
  }
140
140
  cancelPreselection() {
141
141
  if (!this._inputElement.value && this.value) {
142
- this.value = null;
142
+ this.selectOption(null);
143
143
  }
144
144
  else {
145
145
  this.internalUpdate();
@@ -1,4 +1,14 @@
1
- import { Component, h, Prop, Method, Event } from '@stencil/core';
1
+ import { Component, h, Prop, Method, Event, forceUpdate } from '@stencil/core';
2
+ class Message {
3
+ constructor(title, message, critical, confirm, icon, callBack) {
4
+ this.title = title;
5
+ this.message = message;
6
+ this.critical = critical;
7
+ this.confirm = confirm;
8
+ this.icon = icon;
9
+ this.callBack = callBack;
10
+ }
11
+ }
2
12
  export class EzDialog {
3
13
  constructor() {
4
14
  /**
@@ -12,35 +22,61 @@ export class EzDialog {
12
22
  /**
13
23
  * Controla a exibição do componente
14
24
  */
15
- this.oppened = false;
25
+ this.opened = false;
26
+ this._messageQueue = [];
16
27
  }
17
28
  async handleButtonClick(selectedOption) {
18
- this.oppened = false;
19
- this.ezChange.emit(selectedOption);
29
+ this.opened = this._messageQueue.length > 0;
30
+ if (this._currentMessage.callBack) {
31
+ this._currentMessage.callBack(selectedOption);
32
+ }
33
+ else {
34
+ this.ezChange.emit(selectedOption);
35
+ }
36
+ this._currentMessage = this._messageQueue.shift();
37
+ forceUpdate(this);
38
+ }
39
+ async show(title, message, critical, confirm, icon) {
40
+ this.opened = true;
41
+ return new Promise(resolve => {
42
+ this._messageQueue.push(new Message(title, message, critical, confirm, icon, resolve));
43
+ });
44
+ }
45
+ componentWillRender() {
46
+ if (!this._currentMessage) {
47
+ if (this._messageQueue.length > 0) {
48
+ this._currentMessage = this._messageQueue.pop();
49
+ }
50
+ else {
51
+ if (this.opened) {
52
+ this._currentMessage = new Message(this.ezTitle, this.message, this.critical, this.confirm, this.personalizedIconPath, null);
53
+ }
54
+ }
55
+ }
20
56
  }
21
57
  render() {
22
- if (this.oppened) {
58
+ if (this.opened && this._currentMessage) {
23
59
  return (h("div", { class: "overlay" },
24
60
  h("div", { class: "dialog" },
25
- h("div", { class: this.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }),
61
+ h("div", { class: this._currentMessage.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }),
26
62
  h("div", { class: "dialog__container" },
27
63
  h("div", { class: "title__container" },
28
64
  h("div", { class: "title__box" },
29
- this.personalizedIconPath ?
65
+ this._currentMessage.icon ?
30
66
  h("svg", { class: "iconePersonalizado", role: "img" },
31
- h("use", { xlinkHref: this.personalizedIconPath }))
67
+ h("use", { xlinkHref: this._currentMessage.icon }))
32
68
  :
33
- h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }),
69
+ h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }),
34
70
  h("div", { class: "title title--label" },
35
- h("h2", null, this.ezTitle))),
36
- h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit(false); } })),
37
- h("div", { class: "text text--primary text--medium message" }, this.message),
38
- this.confirm ?
71
+ h("h2", null, this._currentMessage.title))),
72
+ h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })),
73
+ h("div", { class: "text text--primary text--medium message" }, this._currentMessage.message),
74
+ this._currentMessage.confirm ?
39
75
  h("div", { class: "button-yes-no__container" },
40
76
  h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }),
41
77
  h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
42
78
  : undefined,
43
- !this.confirm ?
79
+ !this._currentMessage.confirm ?
44
80
  h("div", { class: "button__ok--container" },
45
81
  h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
46
82
  : undefined))));
@@ -109,7 +145,7 @@ export class EzDialog {
109
145
  "attribute": "message",
110
146
  "reflect": false
111
147
  },
112
- "oppened": {
148
+ "opened": {
113
149
  "type": "boolean",
114
150
  "mutable": true,
115
151
  "complexType": {
@@ -123,7 +159,7 @@ export class EzDialog {
123
159
  "tags": [],
124
160
  "text": "Controla a exibi\u00E7\u00E3o do componente"
125
161
  },
126
- "attribute": "oppened",
162
+ "attribute": "opened",
127
163
  "reflect": true,
128
164
  "defaultValue": "false"
129
165
  },
@@ -197,6 +233,37 @@ export class EzDialog {
197
233
  "text": "",
198
234
  "tags": []
199
235
  }
236
+ },
237
+ "show": {
238
+ "complexType": {
239
+ "signature": "(title: string, message: string, critical: boolean, confirm: boolean, icon: string) => Promise<boolean>",
240
+ "parameters": [{
241
+ "tags": [],
242
+ "text": ""
243
+ }, {
244
+ "tags": [],
245
+ "text": ""
246
+ }, {
247
+ "tags": [],
248
+ "text": ""
249
+ }, {
250
+ "tags": [],
251
+ "text": ""
252
+ }, {
253
+ "tags": [],
254
+ "text": ""
255
+ }],
256
+ "references": {
257
+ "Promise": {
258
+ "location": "global"
259
+ }
260
+ },
261
+ "return": "Promise<boolean>"
262
+ },
263
+ "docs": {
264
+ "text": "",
265
+ "tags": []
266
+ }
200
267
  }
201
268
  }; }
202
269
  }
@@ -9,6 +9,7 @@ import DataUnit from './subcomponents/DataUnit';
9
9
  export class EzForm {
10
10
  constructor() {
11
11
  this.enabled = true;
12
+ this.loading = false;
12
13
  this._dataUnits = new Map();
13
14
  this._duSources = new Map();
14
15
  this._tabPositionByField = new Map();
@@ -239,7 +240,12 @@ export class EzForm {
239
240
  dataUnit.recordsValidator = this;
240
241
  }
241
242
  render() {
242
- return this._preparedMetadata ? h(FormSheet, { enabled: this.enabled, store: this._store, source: this._preparedMetadata, parentName: "__MAIN__FORM__", dataUnitBuilder: (du, parentDataUnit) => this.buildDataUnit(du, parentDataUnit) }) : null;
243
+ if (this.loading) {
244
+ return h("place-holder", null);
245
+ }
246
+ else {
247
+ return this._preparedMetadata ? h(FormSheet, { enabled: this.enabled, store: this._store, source: this._preparedMetadata, parentName: "__MAIN__FORM__", dataUnitBuilder: (du, parentDataUnit) => this.buildDataUnit(du, parentDataUnit) }) : null;
248
+ }
243
249
  }
244
250
  static get is() { return "ez-form"; }
245
251
  static get originalStyleUrls() { return {
@@ -429,6 +435,24 @@ export class EzForm {
429
435
  "attribute": "enabled",
430
436
  "reflect": false,
431
437
  "defaultValue": "true"
438
+ },
439
+ "loading": {
440
+ "type": "boolean",
441
+ "mutable": true,
442
+ "complexType": {
443
+ "original": "boolean",
444
+ "resolved": "boolean",
445
+ "references": {}
446
+ },
447
+ "required": false,
448
+ "optional": false,
449
+ "docs": {
450
+ "tags": [],
451
+ "text": ""
452
+ },
453
+ "attribute": "loading",
454
+ "reflect": true,
455
+ "defaultValue": "false"
432
456
  }
433
457
  }; }
434
458
  static get methods() { return {
@@ -153,7 +153,12 @@ export default class DataUnit {
153
153
  saveResult = this.saveExecutor(this.getChangesToSave());
154
154
  }
155
155
  if (saveResult instanceof Promise) {
156
- saveResult.then(r => this.processSaveResult(r));
156
+ saveResult
157
+ .then(r => this.processSaveResult(r))
158
+ .catch(e => {
159
+ this._store.dispatch(dataLoaded(this.name));
160
+ Application.error("Falha ao tentar salvar", e);
161
+ });
157
162
  }
158
163
  else {
159
164
  this.processSaveResult(saveResult);
@@ -33,7 +33,10 @@ export class EzNumericInput {
33
33
  }
34
34
  }
35
35
  getTextValue(value) {
36
- return value ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : null;
36
+ if (value) {
37
+ return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : value.toString();
38
+ }
39
+ return null;
37
40
  }
38
41
  render() {
39
42
  return (h("ez-text-input", { class: "text-input", ref: elem => this._textInput = elem, onBlur: () => this.parseNumber(), label: this.label, onEzChange: event => event.stopPropagation(), value: this.getTextValue(this.value), restrict: this.precision > 0 ? "0123456789-,." : "0123456789-", enabled: this.enabled, errormessage: this.errormessage }));
@@ -30,14 +30,16 @@ export class EzTextInput {
30
30
  }
31
31
  }
32
32
  updateInputValue() {
33
- this._inputElem.value = this.value;
33
+ if (this._inputElem) {
34
+ this._inputElem.value = this.value;
35
+ }
34
36
  this.handleChange();
35
37
  this.ezChange.emit();
36
38
  this.adjustFloatingLabel();
37
39
  }
38
40
  adjustFloatingLabel() {
39
- if (this.label) {
40
- if (!this._inputElem.classList.contains("input--with--label")) {
41
+ if (this.label && this._labelElem) {
42
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
41
43
  this._inputElem.classList.add("input--with--label");
42
44
  }
43
45
  const hasValue = this.value && this.value.toString().length > 0;
@@ -203,9 +203,14 @@ progress[value]::-webkit-progress-value {
203
203
  mask-image: var(--iu__btn-cancel-image);
204
204
  }
205
205
 
206
+ .iu_header{
207
+ display: flex;
208
+ flex-direction: column;
209
+ width: 100%;
210
+ }
211
+
206
212
  .iu__label{
207
213
  padding: var(--space--small);
208
- padding-top: 0;
209
214
  box-sizing: border-box;
210
215
  overflow: hidden;
211
216
  text-overflow: ellipsis;