@sankhyalabs/ezui 1.1.49 → 1.1.53

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.
Files changed (38) hide show
  1. package/dist/cjs/ez-button_16.cjs.entry.js +26 -7
  2. package/dist/cjs/ez-dialog.cjs.entry.js +3 -2
  3. package/dist/cjs/ez-modal.cjs.entry.js +2 -2
  4. package/dist/cjs/ez-popup.cjs.entry.js +2 -2
  5. package/dist/cjs/ezui.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/ez-combo-box/ez-combo-box.js +1 -1
  8. package/dist/collection/components/ez-dialog/ez-dialog.js +19 -4
  9. package/dist/collection/components/ez-form/ez-form.js +25 -1
  10. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +6 -1
  11. package/dist/collection/components/ez-modal/ez-modal.js +4 -4
  12. package/dist/collection/components/ez-numeric-input/ez-numeric-input.js +4 -1
  13. package/dist/collection/components/ez-popup/ez-popup.js +5 -5
  14. package/dist/collection/components/ez-text-input/ez-text-input.js +5 -3
  15. package/dist/collection/utils/Application.js +3 -0
  16. package/dist/custom-elements/index.js +34 -14
  17. package/dist/esm/ez-button_16.entry.js +26 -7
  18. package/dist/esm/ez-dialog.entry.js +3 -2
  19. package/dist/esm/ez-modal.entry.js +2 -2
  20. package/dist/esm/ez-popup.entry.js +2 -2
  21. package/dist/esm/ezui.js +1 -1
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/ezui/ezui.esm.js +1 -1
  24. package/dist/ezui/p-09c7a16a.entry.js +1 -0
  25. package/dist/ezui/p-1457f4f9.entry.js +1 -0
  26. package/dist/ezui/p-26af789f.entry.js +1 -0
  27. package/dist/ezui/p-34e7a3b9.entry.js +1 -0
  28. package/dist/types/components/ez-dialog/ez-dialog.d.ts +6 -2
  29. package/dist/types/components/ez-form/ez-form.d.ts +1 -0
  30. package/dist/types/components/ez-modal/ez-modal.d.ts +2 -2
  31. package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
  32. package/dist/types/components.d.ts +11 -5
  33. package/dist/types/utils/Application.d.ts +1 -0
  34. package/package.json +1 -1
  35. package/dist/ezui/p-4a87d740.entry.js +0 -1
  36. package/dist/ezui/p-7d9ad9ce.entry.js +0 -1
  37. package/dist/ezui/p-83a25af0.entry.js +0 -1
  38. package/dist/ezui/p-b4b43048.entry.js +0 -1
@@ -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();
@@ -2164,6 +2164,9 @@ class Application {
2164
2164
  static async alert(title, message, icon = null) {
2165
2165
  return Application.showDialog(title, message, icon, false, false);
2166
2166
  }
2167
+ static async error(title, message, icon = null) {
2168
+ return Application.showDialog(title, message, icon, false, true);
2169
+ }
2167
2170
  static async confirm(title, message, icon = null, critical = false) {
2168
2171
  return Application.showDialog(title, message, icon, true, critical);
2169
2172
  }
@@ -2398,7 +2401,12 @@ class DataUnit {
2398
2401
  saveResult = this.saveExecutor(this.getChangesToSave());
2399
2402
  }
2400
2403
  if (saveResult instanceof Promise) {
2401
- 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
+ });
2402
2410
  }
2403
2411
  else {
2404
2412
  this.processSaveResult(saveResult);
@@ -2690,6 +2698,7 @@ let EzForm = class {
2690
2698
  constructor(hostRef) {
2691
2699
  index.registerInstance(this, hostRef);
2692
2700
  this.enabled = true;
2701
+ this.loading = false;
2693
2702
  this._dataUnits = new Map();
2694
2703
  this._duSources = new Map();
2695
2704
  this._tabPositionByField = new Map();
@@ -2920,7 +2929,12 @@ let EzForm = class {
2920
2929
  dataUnit.recordsValidator = this;
2921
2930
  }
2922
2931
  render() {
2923
- 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
+ }
2924
2938
  }
2925
2939
  static get assetsDirs() { return ["assets"]; }
2926
2940
  get _host() { return index.getElement(this); }
@@ -2988,7 +3002,10 @@ let EzNumericInput = class {
2988
3002
  }
2989
3003
  }
2990
3004
  getTextValue(value) {
2991
- 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;
2992
3009
  }
2993
3010
  render() {
2994
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 }));
@@ -3387,14 +3404,16 @@ let EzTextInput = class {
3387
3404
  }
3388
3405
  }
3389
3406
  updateInputValue() {
3390
- this._inputElem.value = this.value;
3407
+ if (this._inputElem) {
3408
+ this._inputElem.value = this.value;
3409
+ }
3391
3410
  this.handleChange();
3392
3411
  this.ezChange.emit();
3393
3412
  this.adjustFloatingLabel();
3394
3413
  }
3395
3414
  adjustFloatingLabel() {
3396
- if (this.label) {
3397
- 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")) {
3398
3417
  this._inputElem.classList.add("input--with--label");
3399
3418
  }
3400
3419
  const hasValue = this.value && this.value.toString().length > 0;
@@ -19,7 +19,8 @@ class Message {
19
19
  let EzDialog = class {
20
20
  constructor(hostRef) {
21
21
  index.registerInstance(this, hostRef);
22
- this.ezChange = index.createEvent(this, "ezChange", 7);
22
+ this.ezCancel = index.createEvent(this, "ezCancel", 7);
23
+ this.ezAccept = index.createEvent(this, "ezAccept", 7);
23
24
  /**
24
25
  * Define se o componente será utilizado no modo de confirmação.
25
26
  */
@@ -40,7 +41,7 @@ let EzDialog = class {
40
41
  this._currentMessage.callBack(selectedOption);
41
42
  }
42
43
  else {
43
- this.ezChange.emit(selectedOption);
44
+ selectedOption ? this.ezAccept.emit(selectedOption) : this.ezCancel.emit(selectedOption);
44
45
  }
45
46
  this._currentMessage = this._messageQueue.shift();
46
47
  index.forceUpdate(this);
@@ -9,7 +9,7 @@ const ezModalCss = ":host{--modal-z-index:var(--most-visible, 3);--modal-vertica
9
9
  let EzModal = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
- this.ezChange = index.createEvent(this, "ezChange", 7);
12
+ this.ezCloseModal = index.createEvent(this, "ezCloseModal", 7);
13
13
  /**
14
14
  * Controle de exibição do Modal
15
15
  */
@@ -45,7 +45,7 @@ let EzModal = class {
45
45
  }
46
46
  closeModal() {
47
47
  this.oppened = false;
48
- this.ezChange.emit(this.oppened);
48
+ this.ezCloseModal.emit(this.oppened);
49
49
  }
50
50
  ///////
51
51
  // trapTabKey(e) {
@@ -9,7 +9,7 @@ const ezPopupCss = ":host{display:flex;--popup-title--primary:var(--title--prima
9
9
  let EzPopup = class {
10
10
  constructor(hostRef) {
11
11
  index.registerInstance(this, hostRef);
12
- this.ezChange = index.createEvent(this, "ezChange", 7);
12
+ this.ezClosePopup = index.createEvent(this, "ezClosePopup", 7);
13
13
  /**
14
14
  * Define o width que o componente deve ter, seguindo o grid system.
15
15
  */
@@ -27,7 +27,7 @@ let EzPopup = class {
27
27
  if (this.opened) {
28
28
  return (index.h(index.Host, null, index.h("div", { class: "overlay" }, index.h("div", { class: "popup col " + this.size }, index.h("div", { class: "popup__container" }, index.h("div", { class: "popup__content" }, index.h("div", { class: "popup__header" }, this.ezTitle ?
29
29
  index.h("div", { class: "title popup__title" }, this.ezTitle)
30
- : undefined, index.h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezChange.emit("CANCEL"); } })), index.h("div", { class: "popup__expandable-content" }, index.h("slot", null))))))));
30
+ : undefined, index.h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } })), index.h("div", { class: "popup__expandable-content" }, index.h("slot", null))))))));
31
31
  }
32
32
  return null;
33
33
  }
@@ -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],"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],"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],"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],"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();
@@ -31,7 +31,7 @@ export class EzDialog {
31
31
  this._currentMessage.callBack(selectedOption);
32
32
  }
33
33
  else {
34
- this.ezChange.emit(selectedOption);
34
+ selectedOption ? this.ezAccept.emit(selectedOption) : this.ezCancel.emit(selectedOption);
35
35
  }
36
36
  this._currentMessage = this._messageQueue.shift();
37
37
  forceUpdate(this);
@@ -199,14 +199,29 @@ export class EzDialog {
199
199
  }
200
200
  }; }
201
201
  static get events() { return [{
202
- "method": "ezChange",
203
- "name": "ezChange",
202
+ "method": "ezCancel",
203
+ "name": "ezCancel",
204
204
  "bubbles": true,
205
205
  "cancelable": true,
206
206
  "composed": true,
207
207
  "docs": {
208
208
  "tags": [],
209
- "text": "Evento disparado ao clicar em algum dos bot\u00F5es de confirma\u00E7\u00E3o."
209
+ "text": "Evento disparado ao clicar tanto no bot\u00E3o de nega\u00E7\u00E3o quanto no X."
210
+ },
211
+ "complexType": {
212
+ "original": "boolean",
213
+ "resolved": "boolean",
214
+ "references": {}
215
+ }
216
+ }, {
217
+ "method": "ezAccept",
218
+ "name": "ezAccept",
219
+ "bubbles": true,
220
+ "cancelable": true,
221
+ "composed": true,
222
+ "docs": {
223
+ "tags": [],
224
+ "text": "Evento disparado ao clicar no bot\u00E3o de aceita\u00E7\u00E3o."
210
225
  },
211
226
  "complexType": {
212
227
  "original": "boolean",
@@ -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);
@@ -36,7 +36,7 @@ export class EzModal {
36
36
  }
37
37
  closeModal() {
38
38
  this.oppened = false;
39
- this.ezChange.emit(this.oppened);
39
+ this.ezCloseModal.emit(this.oppened);
40
40
  }
41
41
  ///////
42
42
  // trapTabKey(e) {
@@ -202,14 +202,14 @@ export class EzModal {
202
202
  }
203
203
  }; }
204
204
  static get events() { return [{
205
- "method": "ezChange",
206
- "name": "ezChange",
205
+ "method": "ezCloseModal",
206
+ "name": "ezCloseModal",
207
207
  "bubbles": true,
208
208
  "cancelable": true,
209
209
  "composed": true,
210
210
  "docs": {
211
211
  "tags": [],
212
- "text": "Um evento disparado quando a propriedade oppened \u00E9 alterada."
212
+ "text": "Um evento disparado quando o modal \u00E9 fechado."
213
213
  },
214
214
  "complexType": {
215
215
  "original": "boolean",
@@ -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 }));
@@ -25,7 +25,7 @@ export class EzPopup {
25
25
  this.ezTitle ?
26
26
  h("div", { class: "title popup__title" }, this.ezTitle)
27
27
  : undefined,
28
- h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezChange.emit("CANCEL"); } })),
28
+ h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } })),
29
29
  h("div", { class: "popup__expandable-content" },
30
30
  h("slot", null))))))));
31
31
  }
@@ -113,8 +113,8 @@ export class EzPopup {
113
113
  }
114
114
  }; }
115
115
  static get events() { return [{
116
- "method": "ezChange",
117
- "name": "ezChange",
116
+ "method": "ezClosePopup",
117
+ "name": "ezClosePopup",
118
118
  "bubbles": true,
119
119
  "cancelable": true,
120
120
  "composed": true,
@@ -123,8 +123,8 @@ export class EzPopup {
123
123
  "text": "Evento disparado ao clicar no bot\u00E3o de fechar."
124
124
  },
125
125
  "complexType": {
126
- "original": "string",
127
- "resolved": "string",
126
+ "original": "any",
127
+ "resolved": "any",
128
128
  "references": {}
129
129
  }
130
130
  }]; }
@@ -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;
@@ -12,6 +12,9 @@ export default class Application {
12
12
  static async alert(title, message, icon = null) {
13
13
  return Application.showDialog(title, message, icon, false, false);
14
14
  }
15
+ static async error(title, message, icon = null) {
16
+ return Application.showDialog(title, message, icon, false, true);
17
+ }
15
18
  static async confirm(title, message, icon = null, critical = false) {
16
19
  return Application.showDialog(title, message, icon, true, critical);
17
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();
@@ -1335,7 +1335,8 @@ let EzDialog$1 = class extends HTMLElement {
1335
1335
  super();
1336
1336
  this.__registerHost();
1337
1337
  this.__attachShadow();
1338
- this.ezChange = createEvent(this, "ezChange", 7);
1338
+ this.ezCancel = createEvent(this, "ezCancel", 7);
1339
+ this.ezAccept = createEvent(this, "ezAccept", 7);
1339
1340
  /**
1340
1341
  * Define se o componente será utilizado no modo de confirmação.
1341
1342
  */
@@ -1356,7 +1357,7 @@ let EzDialog$1 = class extends HTMLElement {
1356
1357
  this._currentMessage.callBack(selectedOption);
1357
1358
  }
1358
1359
  else {
1359
- this.ezChange.emit(selectedOption);
1360
+ selectedOption ? this.ezAccept.emit(selectedOption) : this.ezCancel.emit(selectedOption);
1360
1361
  }
1361
1362
  this._currentMessage = this._messageQueue.shift();
1362
1363
  forceUpdate(this);
@@ -2944,6 +2945,9 @@ class Application {
2944
2945
  static async alert(title, message, icon = null) {
2945
2946
  return Application.showDialog(title, message, icon, false, false);
2946
2947
  }
2948
+ static async error(title, message, icon = null) {
2949
+ return Application.showDialog(title, message, icon, false, true);
2950
+ }
2947
2951
  static async confirm(title, message, icon = null, critical = false) {
2948
2952
  return Application.showDialog(title, message, icon, true, critical);
2949
2953
  }
@@ -3178,7 +3182,12 @@ class DataUnit {
3178
3182
  saveResult = this.saveExecutor(this.getChangesToSave());
3179
3183
  }
3180
3184
  if (saveResult instanceof Promise) {
3181
- saveResult.then(r => this.processSaveResult(r));
3185
+ saveResult
3186
+ .then(r => this.processSaveResult(r))
3187
+ .catch(e => {
3188
+ this._store.dispatch(dataLoaded$1(this.name));
3189
+ Application.error("Falha ao tentar salvar", e);
3190
+ });
3182
3191
  }
3183
3192
  else {
3184
3193
  this.processSaveResult(saveResult);
@@ -3471,6 +3480,7 @@ let EzForm$1 = class extends HTMLElement {
3471
3480
  super();
3472
3481
  this.__registerHost();
3473
3482
  this.enabled = true;
3483
+ this.loading = false;
3474
3484
  this._dataUnits = new Map();
3475
3485
  this._duSources = new Map();
3476
3486
  this._tabPositionByField = new Map();
@@ -3701,7 +3711,12 @@ let EzForm$1 = class extends HTMLElement {
3701
3711
  dataUnit.recordsValidator = this;
3702
3712
  }
3703
3713
  render() {
3704
- 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;
3714
+ if (this.loading) {
3715
+ return h("place-holder", null);
3716
+ }
3717
+ else {
3718
+ 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;
3719
+ }
3705
3720
  }
3706
3721
  static get assetsDirs() { return ["assets"]; }
3707
3722
  get _host() { return this; }
@@ -3867,7 +3882,7 @@ let EzModal$1 = class extends HTMLElement {
3867
3882
  super();
3868
3883
  this.__registerHost();
3869
3884
  this.__attachShadow();
3870
- this.ezChange = createEvent(this, "ezChange", 7);
3885
+ this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
3871
3886
  /**
3872
3887
  * Controle de exibição do Modal
3873
3888
  */
@@ -3903,7 +3918,7 @@ let EzModal$1 = class extends HTMLElement {
3903
3918
  }
3904
3919
  closeModal() {
3905
3920
  this.oppened = false;
3906
- this.ezChange.emit(this.oppened);
3921
+ this.ezCloseModal.emit(this.oppened);
3907
3922
  }
3908
3923
  ///////
3909
3924
  // trapTabKey(e) {
@@ -4256,7 +4271,10 @@ let EzNumericInput$1 = class extends HTMLElement {
4256
4271
  }
4257
4272
  }
4258
4273
  getTextValue(value) {
4259
- return value ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : null;
4274
+ if (value) {
4275
+ return this.precision > 0 ? NumberUtils.format(value.toString(), Number(this.precision), Number(this.prettyprecision)) : value.toString();
4276
+ }
4277
+ return null;
4260
4278
  }
4261
4279
  render() {
4262
4280
  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 }));
@@ -4386,7 +4404,7 @@ let EzPopup$1 = class extends HTMLElement {
4386
4404
  super();
4387
4405
  this.__registerHost();
4388
4406
  this.__attachShadow();
4389
- this.ezChange = createEvent(this, "ezChange", 7);
4407
+ this.ezClosePopup = createEvent(this, "ezClosePopup", 7);
4390
4408
  /**
4391
4409
  * Define o width que o componente deve ter, seguindo o grid system.
4392
4410
  */
@@ -4404,7 +4422,7 @@ let EzPopup$1 = class extends HTMLElement {
4404
4422
  if (this.opened) {
4405
4423
  return (h(Host, null, h("div", { class: "overlay" }, h("div", { class: "popup col " + this.size }, h("div", { class: "popup__container" }, h("div", { class: "popup__content" }, h("div", { class: "popup__header" }, this.ezTitle ?
4406
4424
  h("div", { class: "title popup__title" }, this.ezTitle)
4407
- : undefined, h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezChange.emit("CANCEL"); } })), h("div", { class: "popup__expandable-content" }, h("slot", null))))))));
4425
+ : undefined, h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } })), h("div", { class: "popup__expandable-content" }, h("slot", null))))))));
4408
4426
  }
4409
4427
  return null;
4410
4428
  }
@@ -4805,14 +4823,16 @@ let EzTextInput$1 = class extends HTMLElement {
4805
4823
  }
4806
4824
  }
4807
4825
  updateInputValue() {
4808
- this._inputElem.value = this.value;
4826
+ if (this._inputElem) {
4827
+ this._inputElem.value = this.value;
4828
+ }
4809
4829
  this.handleChange();
4810
4830
  this.ezChange.emit();
4811
4831
  this.adjustFloatingLabel();
4812
4832
  }
4813
4833
  adjustFloatingLabel() {
4814
- if (this.label) {
4815
- if (!this._inputElem.classList.contains("input--with--label")) {
4834
+ if (this.label && this._labelElem) {
4835
+ if (this._inputElem && !this._inputElem.classList.contains("input--with--label")) {
4816
4836
  this._inputElem.classList.add("input--with--label");
4817
4837
  }
4818
4838
  const hasValue = this.value && this.value.toString().length > 0;
@@ -5649,7 +5669,7 @@ const EzCollapsableBox = /*@__PURE__*/proxyCustomElement(EzCollapsableBox$1, [1,
5649
5669
  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]}]);
5650
5670
  const EzDateInput = /*@__PURE__*/proxyCustomElement(EzDateInput$1, [1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}]);
5651
5671
  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"]}]);
5652
- 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]}]);
5672
+ 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]}]);
5653
5673
  const EzIcon = /*@__PURE__*/proxyCustomElement(EzIcon$1, [1,"ez-icon",{"size":[513],"href":[513]}]);
5654
5674
  const EzLabelChip = /*@__PURE__*/proxyCustomElement(EzLabelChip$1, [1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540]}]);
5655
5675
  const EzModal = /*@__PURE__*/proxyCustomElement(EzModal$1, [1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]);