@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.
@@ -41,6 +41,18 @@ export class EzUpload {
41
41
  }
42
42
  }
43
43
  async addFiles(files) {
44
+ if (this.maxfiles > 0) {
45
+ let countDistinctFiles = this._filePointers.size;
46
+ files.forEach(file => {
47
+ if (!this._filePointers.has(file.name)) {
48
+ countDistinctFiles++;
49
+ }
50
+ });
51
+ if (countDistinctFiles > this.maxfiles) {
52
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
53
+ return;
54
+ }
55
+ }
44
56
  Array.prototype.forEach.call(files, this.addFile.bind(this));
45
57
  }
46
58
  async addFile(file) {
@@ -99,7 +111,7 @@ export class EzUpload {
99
111
  });
100
112
  }
101
113
  validateFile(file) {
102
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
114
+ if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
103
115
  this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
104
116
  return false;
105
117
  }
@@ -162,12 +174,7 @@ export class EzUpload {
162
174
  }
163
175
  openFilesDialog() {
164
176
  if (this.enabled) {
165
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
166
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
167
- }
168
- else {
169
- this._fileInput.click();
170
- }
177
+ this._fileInput.click();
171
178
  }
172
179
  }
173
180
  componentDidLoad() {
@@ -199,11 +206,12 @@ export class EzUpload {
199
206
  */
200
207
  render() {
201
208
  return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') },
202
- this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null,
203
209
  h("div", { class: "iu__container", onClick: () => this.openFilesDialog() },
204
- h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') },
205
- h("button", { class: "iu__file-icon", disabled: !this.enabled }),
206
- 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')),
210
+ h("div", { class: "iu_header" },
211
+ this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null,
212
+ h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') },
213
+ h("button", { class: "iu__file-icon", disabled: !this.enabled }),
214
+ 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'))),
207
215
  this.buildFooter()),
208
216
  h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
209
217
  }
@@ -6,18 +6,15 @@ export default class Application {
6
6
  dialog = document.createElement("ez-dialog");
7
7
  window.document.body.appendChild(dialog);
8
8
  }
9
- dialog.ezTitle = title;
10
- dialog.message = message;
11
- dialog.critical = critical;
12
- dialog.confirm = confirm;
13
- dialog.personalizedIconPath = icon;
14
- dialog.oppened = true;
15
- dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
9
+ dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
16
10
  });
17
11
  }
18
12
  static async alert(title, message, icon = null) {
19
13
  return Application.showDialog(title, message, icon, false, false);
20
14
  }
15
+ static async error(title, message, icon = null) {
16
+ return Application.showDialog(title, message, icon, false, true);
17
+ }
21
18
  static async confirm(title, message, icon = null, critical = false) {
22
19
  return Application.showDialog(title, message, icon, true, critical);
23
20
  }
@@ -1142,7 +1142,7 @@ let EzComboBox$1 = class extends HTMLElement {
1142
1142
  }
1143
1143
  cancelPreselection() {
1144
1144
  if (!this._inputElement.value && this.value) {
1145
- this.value = null;
1145
+ this.selectOption(null);
1146
1146
  }
1147
1147
  else {
1148
1148
  this.internalUpdate();
@@ -1320,6 +1320,16 @@ let EzDateInput$1 = class extends HTMLElement {
1320
1320
 
1321
1321
  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%}}";
1322
1322
 
1323
+ class Message {
1324
+ constructor(title, message, critical, confirm, icon, callBack) {
1325
+ this.title = title;
1326
+ this.message = message;
1327
+ this.critical = critical;
1328
+ this.confirm = confirm;
1329
+ this.icon = icon;
1330
+ this.callBack = callBack;
1331
+ }
1332
+ }
1323
1333
  let EzDialog$1 = class extends HTMLElement {
1324
1334
  constructor() {
1325
1335
  super();
@@ -1337,20 +1347,46 @@ let EzDialog$1 = class extends HTMLElement {
1337
1347
  /**
1338
1348
  * Controla a exibição do componente
1339
1349
  */
1340
- this.oppened = false;
1350
+ this.opened = false;
1351
+ this._messageQueue = [];
1341
1352
  }
1342
1353
  async handleButtonClick(selectedOption) {
1343
- this.oppened = false;
1344
- this.ezChange.emit(selectedOption);
1354
+ this.opened = this._messageQueue.length > 0;
1355
+ if (this._currentMessage.callBack) {
1356
+ this._currentMessage.callBack(selectedOption);
1357
+ }
1358
+ else {
1359
+ this.ezChange.emit(selectedOption);
1360
+ }
1361
+ this._currentMessage = this._messageQueue.shift();
1362
+ forceUpdate(this);
1363
+ }
1364
+ async show(title, message, critical, confirm, icon) {
1365
+ this.opened = true;
1366
+ return new Promise(resolve => {
1367
+ this._messageQueue.push(new Message(title, message, critical, confirm, icon, resolve));
1368
+ });
1369
+ }
1370
+ componentWillRender() {
1371
+ if (!this._currentMessage) {
1372
+ if (this._messageQueue.length > 0) {
1373
+ this._currentMessage = this._messageQueue.pop();
1374
+ }
1375
+ else {
1376
+ if (this.opened) {
1377
+ this._currentMessage = new Message(this.ezTitle, this.message, this.critical, this.confirm, this.personalizedIconPath, null);
1378
+ }
1379
+ }
1380
+ }
1345
1381
  }
1346
1382
  render() {
1347
- if (this.oppened) {
1348
- return (h("div", { class: "overlay" }, h("div", { class: "dialog" }, h("div", { class: this.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }), h("div", { class: "dialog__container" }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.personalizedIconPath ?
1349
- h("svg", { class: "iconePersonalizado", role: "img" }, h("use", { xlinkHref: this.personalizedIconPath }))
1383
+ if (this.opened && this._currentMessage) {
1384
+ return (h("div", { class: "overlay" }, h("div", { class: "dialog" }, h("div", { class: this._currentMessage.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }), h("div", { class: "dialog__container" }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this._currentMessage.icon ?
1385
+ h("svg", { class: "iconePersonalizado", role: "img" }, h("use", { xlinkHref: this._currentMessage.icon }))
1350
1386
  :
1351
- h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }), h("div", { class: "title title--label" }, h("h2", null, this.ezTitle))), h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit(false); } })), h("div", { class: "text text--primary text--medium message" }, this.message), this.confirm ?
1387
+ h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }), h("div", { class: "title title--label" }, h("h2", null, this._currentMessage.title))), h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })), h("div", { class: "text text--primary text--medium message" }, this._currentMessage.message), this._currentMessage.confirm ?
1352
1388
  h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }), h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
1353
- : undefined, !this.confirm ?
1389
+ : undefined, !this._currentMessage.confirm ?
1354
1390
  h("div", { class: "button__ok--container" }, h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
1355
1391
  : undefined))));
1356
1392
  }
@@ -2902,18 +2938,15 @@ class Application {
2902
2938
  dialog = document.createElement("ez-dialog");
2903
2939
  window.document.body.appendChild(dialog);
2904
2940
  }
2905
- dialog.ezTitle = title;
2906
- dialog.message = message;
2907
- dialog.critical = critical;
2908
- dialog.confirm = confirm;
2909
- dialog.personalizedIconPath = icon;
2910
- dialog.oppened = true;
2911
- dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
2941
+ dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
2912
2942
  });
2913
2943
  }
2914
2944
  static async alert(title, message, icon = null) {
2915
2945
  return Application.showDialog(title, message, icon, false, false);
2916
2946
  }
2947
+ static async error(title, message, icon = null) {
2948
+ return Application.showDialog(title, message, icon, false, true);
2949
+ }
2917
2950
  static async confirm(title, message, icon = null, critical = false) {
2918
2951
  return Application.showDialog(title, message, icon, true, critical);
2919
2952
  }
@@ -3148,7 +3181,12 @@ class DataUnit {
3148
3181
  saveResult = this.saveExecutor(this.getChangesToSave());
3149
3182
  }
3150
3183
  if (saveResult instanceof Promise) {
3151
- saveResult.then(r => this.processSaveResult(r));
3184
+ saveResult
3185
+ .then(r => this.processSaveResult(r))
3186
+ .catch(e => {
3187
+ this._store.dispatch(dataLoaded$1(this.name));
3188
+ Application.error("Falha ao tentar salvar", e);
3189
+ });
3152
3190
  }
3153
3191
  else {
3154
3192
  this.processSaveResult(saveResult);
@@ -3441,6 +3479,7 @@ let EzForm$1 = class extends HTMLElement {
3441
3479
  super();
3442
3480
  this.__registerHost();
3443
3481
  this.enabled = true;
3482
+ this.loading = false;
3444
3483
  this._dataUnits = new Map();
3445
3484
  this._duSources = new Map();
3446
3485
  this._tabPositionByField = new Map();
@@ -3671,7 +3710,12 @@ let EzForm$1 = class extends HTMLElement {
3671
3710
  dataUnit.recordsValidator = this;
3672
3711
  }
3673
3712
  render() {
3674
- 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;
3713
+ if (this.loading) {
3714
+ return h("place-holder", null);
3715
+ }
3716
+ else {
3717
+ 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;
3718
+ }
3675
3719
  }
3676
3720
  static get assetsDirs() { return ["assets"]; }
3677
3721
  get _host() { return this; }
@@ -4226,7 +4270,10 @@ let EzNumericInput$1 = class extends HTMLElement {
4226
4270
  }
4227
4271
  }
4228
4272
  getTextValue(value) {
4229
- return value ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : null;
4273
+ if (value) {
4274
+ return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : value.toString();
4275
+ }
4276
+ return null;
4230
4277
  }
4231
4278
  render() {
4232
4279
  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 }));
@@ -4775,14 +4822,16 @@ let EzTextInput$1 = class extends HTMLElement {
4775
4822
  }
4776
4823
  }
4777
4824
  updateInputValue() {
4778
- this._inputElem.value = this.value;
4825
+ if (this._inputElem) {
4826
+ this._inputElem.value = this.value;
4827
+ }
4779
4828
  this.handleChange();
4780
4829
  this.ezChange.emit();
4781
4830
  this.adjustFloatingLabel();
4782
4831
  }
4783
4832
  adjustFloatingLabel() {
4784
- if (this.label) {
4785
- if (!this._inputElem.classList.contains("input--with--label")) {
4833
+ if (this.label && this._labelElem) {
4834
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
4786
4835
  this._inputElem.classList.add("input--with--label");
4787
4836
  }
4788
4837
  const hasValue = this.value && this.value.toString().length > 0;
@@ -5229,7 +5278,7 @@ class RemoteFile {
5229
5278
  }
5230
5279
  }
5231
5280
 
5232
- 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%}}";
5281
+ 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%}}";
5233
5282
 
5234
5283
  let EzUpload$1 = class extends HTMLElement {
5235
5284
  constructor() {
@@ -5275,6 +5324,18 @@ let EzUpload$1 = class extends HTMLElement {
5275
5324
  }
5276
5325
  }
5277
5326
  async addFiles(files) {
5327
+ if (this.maxfiles > 0) {
5328
+ let countDistinctFiles = this._filePointers.size;
5329
+ files.forEach(file => {
5330
+ if (!this._filePointers.has(file.name)) {
5331
+ countDistinctFiles++;
5332
+ }
5333
+ });
5334
+ if (countDistinctFiles > this.maxfiles) {
5335
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
5336
+ return;
5337
+ }
5338
+ }
5278
5339
  Array.prototype.forEach.call(files, this.addFile.bind(this));
5279
5340
  }
5280
5341
  async addFile(file) {
@@ -5333,7 +5394,7 @@ let EzUpload$1 = class extends HTMLElement {
5333
5394
  });
5334
5395
  }
5335
5396
  validateFile(file) {
5336
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
5397
+ if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
5337
5398
  this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
5338
5399
  return false;
5339
5400
  }
@@ -5396,12 +5457,7 @@ let EzUpload$1 = class extends HTMLElement {
5396
5457
  }
5397
5458
  openFilesDialog() {
5398
5459
  if (this.enabled) {
5399
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
5400
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
5401
- }
5402
- else {
5403
- this._fileInput.click();
5404
- }
5460
+ this._fileInput.click();
5405
5461
  }
5406
5462
  }
5407
5463
  componentDidLoad() {
@@ -5432,7 +5488,7 @@ let EzUpload$1 = class extends HTMLElement {
5432
5488
  mouse-poiter--disabled
5433
5489
  */
5434
5490
  render() {
5435
- return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), 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()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
5491
+ return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), 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()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
5436
5492
  }
5437
5493
  buildFooter() {
5438
5494
  if (this._filePointers.size === 0) {
@@ -5611,8 +5667,8 @@ const EzCheck = /*@__PURE__*/proxyCustomElement(EzCheck$1, [1,"ez-check",{"label
5611
5667
  const EzCollapsableBox = /*@__PURE__*/proxyCustomElement(EzCollapsableBox$1, [1,"ez-collapsable-box",{"value":[1540],"label":[513]}]);
5612
5668
  const EzComboBox = /*@__PURE__*/proxyCustomElement(EzComboBox$1, [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]}]);
5613
5669
  const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}]);
5614
- const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"]}]);
5615
- const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4]}]);
5670
+ const EzDialog = /*@__PURE__*/proxyCustomElement(EzDialog$1, [1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"]}]);
5671
+ const EzForm = /*@__PURE__*/proxyCustomElement(EzForm$1, [0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"loading":[1540]}]);
5616
5672
  const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513]}]);
5617
5673
  const EzLabelChip = /*@__PURE__*/proxyCustomElement(EzLabelChip$1, [1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540]}]);
5618
5674
  const EzModal = /*@__PURE__*/proxyCustomElement(EzModal$1, [1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]);
@@ -437,7 +437,7 @@ let EzComboBox = class {
437
437
  }
438
438
  cancelPreselection() {
439
439
  if (!this._inputElement.value && this.value) {
440
- this.value = null;
440
+ this.selectOption(null);
441
441
  }
442
442
  else {
443
443
  this.internalUpdate();
@@ -2154,18 +2154,15 @@ class Application {
2154
2154
  dialog = document.createElement("ez-dialog");
2155
2155
  window.document.body.appendChild(dialog);
2156
2156
  }
2157
- dialog.ezTitle = title;
2158
- dialog.message = message;
2159
- dialog.critical = critical;
2160
- dialog.confirm = confirm;
2161
- dialog.personalizedIconPath = icon;
2162
- dialog.oppened = true;
2163
- dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
2157
+ dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
2164
2158
  });
2165
2159
  }
2166
2160
  static async alert(title, message, icon = null) {
2167
2161
  return Application.showDialog(title, message, icon, false, false);
2168
2162
  }
2163
+ static async error(title, message, icon = null) {
2164
+ return Application.showDialog(title, message, icon, false, true);
2165
+ }
2169
2166
  static async confirm(title, message, icon = null, critical = false) {
2170
2167
  return Application.showDialog(title, message, icon, true, critical);
2171
2168
  }
@@ -2400,7 +2397,12 @@ class DataUnit {
2400
2397
  saveResult = this.saveExecutor(this.getChangesToSave());
2401
2398
  }
2402
2399
  if (saveResult instanceof Promise) {
2403
- saveResult.then(r => this.processSaveResult(r));
2400
+ saveResult
2401
+ .then(r => this.processSaveResult(r))
2402
+ .catch(e => {
2403
+ this._store.dispatch(dataLoaded$1(this.name));
2404
+ Application.error("Falha ao tentar salvar", e);
2405
+ });
2404
2406
  }
2405
2407
  else {
2406
2408
  this.processSaveResult(saveResult);
@@ -2692,6 +2694,7 @@ let EzForm = class {
2692
2694
  constructor(hostRef) {
2693
2695
  registerInstance(this, hostRef);
2694
2696
  this.enabled = true;
2697
+ this.loading = false;
2695
2698
  this._dataUnits = new Map();
2696
2699
  this._duSources = new Map();
2697
2700
  this._tabPositionByField = new Map();
@@ -2922,7 +2925,12 @@ let EzForm = class {
2922
2925
  dataUnit.recordsValidator = this;
2923
2926
  }
2924
2927
  render() {
2925
- 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;
2928
+ if (this.loading) {
2929
+ return h("place-holder", null);
2930
+ }
2931
+ else {
2932
+ 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;
2933
+ }
2926
2934
  }
2927
2935
  static get assetsDirs() { return ["assets"]; }
2928
2936
  get _host() { return getElement(this); }
@@ -2990,7 +2998,10 @@ let EzNumericInput = class {
2990
2998
  }
2991
2999
  }
2992
3000
  getTextValue(value) {
2993
- return value ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : null;
3001
+ if (value) {
3002
+ return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : value.toString();
3003
+ }
3004
+ return null;
2994
3005
  }
2995
3006
  render() {
2996
3007
  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 }));
@@ -3389,14 +3400,16 @@ let EzTextInput = class {
3389
3400
  }
3390
3401
  }
3391
3402
  updateInputValue() {
3392
- this._inputElem.value = this.value;
3403
+ if (this._inputElem) {
3404
+ this._inputElem.value = this.value;
3405
+ }
3393
3406
  this.handleChange();
3394
3407
  this.ezChange.emit();
3395
3408
  this.adjustFloatingLabel();
3396
3409
  }
3397
3410
  adjustFloatingLabel() {
3398
- if (this.label) {
3399
- if (!this._inputElem.classList.contains("input--with--label")) {
3411
+ if (this.label && this._labelElem) {
3412
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
3400
3413
  this._inputElem.classList.add("input--with--label");
3401
3414
  }
3402
3415
  const hasValue = this.value && this.value.toString().length > 0;
@@ -3637,7 +3650,7 @@ class RemoteFile {
3637
3650
  }
3638
3651
  }
3639
3652
 
3640
- 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%}}";
3653
+ 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%}}";
3641
3654
 
3642
3655
  let EzUpload = class {
3643
3656
  constructor(hostRef) {
@@ -3681,6 +3694,18 @@ let EzUpload = class {
3681
3694
  }
3682
3695
  }
3683
3696
  async addFiles(files) {
3697
+ if (this.maxfiles > 0) {
3698
+ let countDistinctFiles = this._filePointers.size;
3699
+ files.forEach(file => {
3700
+ if (!this._filePointers.has(file.name)) {
3701
+ countDistinctFiles++;
3702
+ }
3703
+ });
3704
+ if (countDistinctFiles > this.maxfiles) {
3705
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3706
+ return;
3707
+ }
3708
+ }
3684
3709
  Array.prototype.forEach.call(files, this.addFile.bind(this));
3685
3710
  }
3686
3711
  async addFile(file) {
@@ -3739,7 +3764,7 @@ let EzUpload = class {
3739
3764
  });
3740
3765
  }
3741
3766
  validateFile(file) {
3742
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3767
+ if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3743
3768
  this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3744
3769
  return false;
3745
3770
  }
@@ -3802,12 +3827,7 @@ let EzUpload = class {
3802
3827
  }
3803
3828
  openFilesDialog() {
3804
3829
  if (this.enabled) {
3805
- if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3806
- this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3807
- }
3808
- else {
3809
- this._fileInput.click();
3810
- }
3830
+ this._fileInput.click();
3811
3831
  }
3812
3832
  }
3813
3833
  componentDidLoad() {
@@ -3838,7 +3858,7 @@ let EzUpload = class {
3838
3858
  mouse-poiter--disabled
3839
3859
  */
3840
3860
  render() {
3841
- return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), 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()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
3861
+ return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu_header" }, this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, h("button", { class: "iu__file-icon", disabled: !this.enabled }), 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()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
3842
3862
  }
3843
3863
  buildFooter() {
3844
3864
  if (this._filePointers.size === 0) {