@sankhyalabs/ezui 1.1.50 → 1.1.54

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 (30) hide show
  1. package/dist/cjs/ez-button_16.cjs.entry.js +10 -2
  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 +17 -6
  5. package/dist/collection/components/ez-dialog/ez-dialog.js +19 -4
  6. package/dist/collection/components/ez-form/ez-form.js +2 -2
  7. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +6 -1
  8. package/dist/collection/components/ez-modal/ez-modal.js +4 -4
  9. package/dist/collection/components/ez-popup/ez-popup.css +7 -4
  10. package/dist/collection/components/ez-popup/ez-popup.js +21 -10
  11. package/dist/collection/utils/Application.js +3 -0
  12. package/dist/custom-elements/index.js +32 -12
  13. package/dist/esm/ez-button_16.entry.js +10 -2
  14. package/dist/esm/ez-dialog.entry.js +3 -2
  15. package/dist/esm/ez-modal.entry.js +2 -2
  16. package/dist/esm/ez-popup.entry.js +17 -6
  17. package/dist/ezui/ezui.esm.js +1 -1
  18. package/dist/ezui/{p-a4a5fe72.entry.js → p-1457f4f9.entry.js} +1 -1
  19. package/dist/ezui/p-26af789f.entry.js +1 -0
  20. package/dist/ezui/p-34e7a3b9.entry.js +1 -0
  21. package/dist/ezui/p-c0c6804e.entry.js +1 -0
  22. package/dist/types/components/ez-dialog/ez-dialog.d.ts +6 -2
  23. package/dist/types/components/ez-modal/ez-modal.d.ts +2 -2
  24. package/dist/types/components/ez-popup/ez-popup.d.ts +11 -2
  25. package/dist/types/components.d.ts +11 -7
  26. package/dist/types/utils/Application.d.ts +1 -0
  27. package/package.json +1 -1
  28. package/dist/ezui/p-4a87d740.entry.js +0 -1
  29. package/dist/ezui/p-7d9ad9ce.entry.js +0 -1
  30. package/dist/ezui/p-b4b43048.entry.js +0 -1
@@ -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,7 +2698,7 @@ let EzForm = class {
2690
2698
  constructor(hostRef) {
2691
2699
  index.registerInstance(this, hostRef);
2692
2700
  this.enabled = true;
2693
- this.loading = true;
2701
+ this.loading = false;
2694
2702
  this._dataUnits = new Map();
2695
2703
  this._duSources = new Map();
2696
2704
  this._tabPositionByField = new Map();
@@ -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) {
@@ -4,16 +4,24 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-0f668cc5.js');
6
6
 
7
- const ezPopupCss = ":host{display:flex;--popup-title--primary:var(--title--primary, #2b3a54);--popup-font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--popup-text-weight--large:var(--text-weight--large, 600);--popup-space--small:var(--space--small, 6px);--popup-space--medium:var(--space--medium, 12px);--popup-space--large:var(--space--large, 24px);--popup-error--background-color:var(--color--alert-error-800, #BD0025);--popup-warning--background-color:var(--color--alert-warning-500, #EFB103);--popup-text-weight--medium:var(--text-weight--medium, 400);--popup-text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--popup-text--medium:var(--text--medium, 14px);--popup-text--primary:var(--text--primary, #626e82);--popup-z-index:var(--most-visible, 3);--popup--trash__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--popup--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>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;display:flex;flex-wrap:wrap;overflow:hidden;background:#FFFF;color:var(--popup-title--primary);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--popup-space--large)}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:flex;flex-wrap:wrap}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;width:100%;display:flex;flex-wrap:wrap;max-height:80vh;content-visibility:auto}.popup__header{padding-bottom:var(--popup-space--large);width:100%;display:flex}.popup__title{width:100%}.dialog__error--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--popup-error--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--popup-warning--background-color)}.message{font-weight:var(--popup-text-weight--medium)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--popup-title--primary);width:12px;height:12px;-webkit-mask-image:var(--popup--close__image);mask-image:var(--popup--close__image)}.btn-close--solo{width:100%}.title{display:flex;font-family:var(--popup-font-pattern);margin:0;font-weight:var(--popup-text-weight--large);line-height:1.3}.title--large{font-size:var(--popup-title--large)}.title__container{display:flex;align-items:center;padding-bottom:var(--popup-space--medium);align-self:center}.title--label{padding-left:var(--popup-space--small)}.text{font-family:var(--popup-font-pattern);text-shadow:var(--popup-text-shadow)}.text--medium{font-size:var(--popup-text--medium)}.text--primary{color:var(--popup-text--primary);text-shadow:var(--popup-text-shadow)}.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%}}";
7
+ const ezPopupCss = ":host{display:flex;--popup-title--primary:var(--title--primary, #2b3a54);--popup-font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--popup-text-weight--large:var(--text-weight--large, 600);--popup-space--small:var(--space--small, 6px);--popup-space--medium:var(--space--medium, 12px);--popup-space--large:var(--space--large, 24px);--popup-error--background-color:var(--color--alert-error-800, #BD0025);--popup-warning--background-color:var(--color--alert-warning-500, #EFB103);--popup-text-weight--medium:var(--text-weight--medium, 400);--popup-text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--popup-text--medium:var(--text--medium, 14px);--popup-text--primary:var(--text--primary, #626e82);--popup-z-index:var(--most-visible, 3);--popup--trash__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--popup--close__image:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;display:flex;flex-wrap:wrap;overflow:hidden;background:#FFFF;color:var(--popup-title--primary);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--popup-space--large)}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:flex;flex-wrap:wrap}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;width:100%;display:flex;flex-wrap:wrap;max-height:80vh;content-visibility:auto}.popup__header{padding-bottom:var(--space--medium);width:100%;display:flex}.popup__title{width:100%;font-family:var(--popup-font-pattern);font-size:var(--title--extra-large);color:var(--title--primary)}.dialog__error--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--popup-error--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--popup-warning--background-color)}.message{font-weight:var(--popup-text-weight--medium)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--popup-title--primary);width:14px;height:14px;-webkit-mask-image:var(--popup--close__image);mask-image:var(--popup--close__image)}.btn-close--solo{width:100%}.title{display:flex;font-family:var(--popup-font-pattern);margin:0;font-weight:var(--popup-text-weight--large);line-height:1.3}.title--large{font-size:var(--popup-title--large)}.title__container{display:flex;align-items:center;padding-bottom:var(--popup-space--medium);align-self:center}.title--label{padding-left:var(--popup-space--small)}.text{font-family:var(--popup-font-pattern);text-shadow:var(--popup-text-shadow)}.text--medium{font-size:var(--popup-text--medium)}.text--primary{color:var(--popup-text--primary);text-shadow:var(--popup-text-shadow)}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
8
8
 
9
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
+ this.sizeClasses = {
14
+ "x-small": "col--sd-3",
15
+ "small": "col--sd-5",
16
+ "medium": "col--sd-6",
17
+ "large": "col--sd-9",
18
+ "x-large": "col--sd-11"
19
+ };
13
20
  /**
14
- * Define o width que o componente deve ter, seguindo o grid system.
21
+ * Define o width que o componente deve ter, seguindo o grid system. Os valores devem estar
22
+ * compreendidos em [x-small | small | medium | large | x-large].
15
23
  */
16
- this.size = "col--sd-6";
24
+ this.size = "medium";
17
25
  /**
18
26
  * Controla a exibição do componente.
19
27
  */
@@ -23,11 +31,14 @@ let EzPopup = class {
23
31
  */
24
32
  this.useHeader = false;
25
33
  }
34
+ getGridSize() {
35
+ return this.sizeClasses[this.size] || this.sizeClasses["medium"];
36
+ }
26
37
  render() {
27
38
  if (this.opened) {
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 ?
39
+ return (index.h(index.Host, null, index.h("div", { class: "overlay" }, index.h("div", { class: "popup col " + this.getGridSize() }, index.h("div", { class: "popup__container" }, index.h("div", { class: "popup__content" }, index.h("div", { class: "popup__header" }, this.ezTitle ?
29
40
  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))))))));
41
+ : 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
42
  }
32
43
  return null;
33
44
  }
@@ -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,7 +9,7 @@ import DataUnit from './subcomponents/DataUnit';
9
9
  export class EzForm {
10
10
  constructor() {
11
11
  this.enabled = true;
12
- this.loading = true;
12
+ this.loading = false;
13
13
  this._dataUnits = new Map();
14
14
  this._duSources = new Map();
15
15
  this._tabPositionByField = new Map();
@@ -452,7 +452,7 @@ export class EzForm {
452
452
  },
453
453
  "attribute": "loading",
454
454
  "reflect": true,
455
- "defaultValue": "true"
455
+ "defaultValue": "false"
456
456
  }
457
457
  }; }
458
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",
@@ -16,7 +16,7 @@
16
16
  --popup-text--primary: var(--text--primary, #626e82);
17
17
  --popup-z-index: var(--most-visible, 3);
18
18
  --popup--trash__image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="16px" width="16px"><path d="M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z"/></svg>');
19
- --popup--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>');
19
+ --popup--close__image: url('data:image/svg+xml;utf8,<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z"/></svg>');
20
20
  }
21
21
 
22
22
  .overlay {
@@ -75,13 +75,16 @@
75
75
  }
76
76
 
77
77
  .popup__header {
78
- padding-bottom: var(--popup-space--large);
78
+ padding-bottom: var(--space--medium);
79
79
  width: 100%;
80
80
  display: flex;
81
81
  }
82
82
 
83
83
  .popup__title {
84
84
  width: 100%;
85
+ font-family: var(--popup-font-pattern);
86
+ font-size: var(--title--extra-large);
87
+ color: var(--title--primary);
85
88
  }
86
89
 
87
90
  .dialog__error--indicator {
@@ -117,8 +120,8 @@
117
120
  content: '';
118
121
  display: flex;
119
122
  background-color: var(--popup-title--primary);
120
- width: 12px;
121
- height: 12px;
123
+ width: 14px;
124
+ height: 14px;
122
125
  -webkit-mask-image: var(--popup--close__image);
123
126
  mask-image: var(--popup--close__image);
124
127
  }
@@ -1,10 +1,18 @@
1
1
  import { Component, Host, h, Prop, Event } from '@stencil/core';
2
2
  export class EzPopup {
3
3
  constructor() {
4
+ this.sizeClasses = {
5
+ "x-small": "col--sd-3",
6
+ "small": "col--sd-5",
7
+ "medium": "col--sd-6",
8
+ "large": "col--sd-9",
9
+ "x-large": "col--sd-11"
10
+ };
4
11
  /**
5
- * Define o width que o componente deve ter, seguindo o grid system.
12
+ * Define o width que o componente deve ter, seguindo o grid system. Os valores devem estar
13
+ * compreendidos em [x-small | small | medium | large | x-large].
6
14
  */
7
- this.size = "col--sd-6";
15
+ this.size = "medium";
8
16
  /**
9
17
  * Controla a exibição do componente.
10
18
  */
@@ -14,18 +22,21 @@ export class EzPopup {
14
22
  */
15
23
  this.useHeader = false;
16
24
  }
25
+ getGridSize() {
26
+ return this.sizeClasses[this.size] || this.sizeClasses["medium"];
27
+ }
17
28
  render() {
18
29
  if (this.opened) {
19
30
  return (h(Host, null,
20
31
  h("div", { class: "overlay" },
21
- h("div", { class: "popup col " + this.size },
32
+ h("div", { class: "popup col " + this.getGridSize() },
22
33
  h("div", { class: "popup__container" },
23
34
  h("div", { class: "popup__content" },
24
35
  h("div", { class: "popup__header" },
25
36
  this.ezTitle ?
26
37
  h("div", { class: "title popup__title" }, this.ezTitle)
27
38
  : undefined,
28
- h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezChange.emit("CANCEL"); } })),
39
+ h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezClosePopup.emit(); } })),
29
40
  h("div", { class: "popup__expandable-content" },
30
41
  h("slot", null))))))));
31
42
  }
@@ -52,11 +63,11 @@ export class EzPopup {
52
63
  "optional": false,
53
64
  "docs": {
54
65
  "tags": [],
55
- "text": "Define o width que o componente deve ter, seguindo o grid system."
66
+ "text": "Define o width que o componente deve ter, seguindo o grid system. Os valores devem estar\ncompreendidos em [x-small | small | medium | large | x-large]."
56
67
  },
57
68
  "attribute": "size",
58
69
  "reflect": false,
59
- "defaultValue": "\"col--sd-6\""
70
+ "defaultValue": "\"medium\""
60
71
  },
61
72
  "opened": {
62
73
  "type": "boolean",
@@ -113,8 +124,8 @@ export class EzPopup {
113
124
  }
114
125
  }; }
115
126
  static get events() { return [{
116
- "method": "ezChange",
117
- "name": "ezChange",
127
+ "method": "ezClosePopup",
128
+ "name": "ezClosePopup",
118
129
  "bubbles": true,
119
130
  "cancelable": true,
120
131
  "composed": true,
@@ -123,8 +134,8 @@ export class EzPopup {
123
134
  "text": "Evento disparado ao clicar no bot\u00E3o de fechar."
124
135
  },
125
136
  "complexType": {
126
- "original": "string",
127
- "resolved": "string",
137
+ "original": "any",
138
+ "resolved": "any",
128
139
  "references": {}
129
140
  }
130
141
  }]; }
@@ -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
  }
@@ -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,7 +3480,7 @@ let EzForm$1 = class extends HTMLElement {
3471
3480
  super();
3472
3481
  this.__registerHost();
3473
3482
  this.enabled = true;
3474
- this.loading = true;
3483
+ this.loading = false;
3475
3484
  this._dataUnits = new Map();
3476
3485
  this._duSources = new Map();
3477
3486
  this._tabPositionByField = new Map();
@@ -3873,7 +3882,7 @@ let EzModal$1 = class extends HTMLElement {
3873
3882
  super();
3874
3883
  this.__registerHost();
3875
3884
  this.__attachShadow();
3876
- this.ezChange = createEvent(this, "ezChange", 7);
3885
+ this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
3877
3886
  /**
3878
3887
  * Controle de exibição do Modal
3879
3888
  */
@@ -3909,7 +3918,7 @@ let EzModal$1 = class extends HTMLElement {
3909
3918
  }
3910
3919
  closeModal() {
3911
3920
  this.oppened = false;
3912
- this.ezChange.emit(this.oppened);
3921
+ this.ezCloseModal.emit(this.oppened);
3913
3922
  }
3914
3923
  ///////
3915
3924
  // trapTabKey(e) {
@@ -4388,18 +4397,26 @@ let EzPopover$1 = class extends HTMLElement {
4388
4397
  static get style() { return ezPopoverCss; }
4389
4398
  };
4390
4399
 
4391
- const ezPopupCss = ":host{display:flex;--popup-title--primary:var(--title--primary, #2b3a54);--popup-font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--popup-text-weight--large:var(--text-weight--large, 600);--popup-space--small:var(--space--small, 6px);--popup-space--medium:var(--space--medium, 12px);--popup-space--large:var(--space--large, 24px);--popup-error--background-color:var(--color--alert-error-800, #BD0025);--popup-warning--background-color:var(--color--alert-warning-500, #EFB103);--popup-text-weight--medium:var(--text-weight--medium, 400);--popup-text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--popup-text--medium:var(--text--medium, 14px);--popup-text--primary:var(--text--primary, #626e82);--popup-z-index:var(--most-visible, 3);--popup--trash__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--popup--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>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;display:flex;flex-wrap:wrap;overflow:hidden;background:#FFFF;color:var(--popup-title--primary);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--popup-space--large)}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:flex;flex-wrap:wrap}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;width:100%;display:flex;flex-wrap:wrap;max-height:80vh;content-visibility:auto}.popup__header{padding-bottom:var(--popup-space--large);width:100%;display:flex}.popup__title{width:100%}.dialog__error--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--popup-error--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--popup-warning--background-color)}.message{font-weight:var(--popup-text-weight--medium)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--popup-title--primary);width:12px;height:12px;-webkit-mask-image:var(--popup--close__image);mask-image:var(--popup--close__image)}.btn-close--solo{width:100%}.title{display:flex;font-family:var(--popup-font-pattern);margin:0;font-weight:var(--popup-text-weight--large);line-height:1.3}.title--large{font-size:var(--popup-title--large)}.title__container{display:flex;align-items:center;padding-bottom:var(--popup-space--medium);align-self:center}.title--label{padding-left:var(--popup-space--small)}.text{font-family:var(--popup-font-pattern);text-shadow:var(--popup-text-shadow)}.text--medium{font-size:var(--popup-text--medium)}.text--primary{color:var(--popup-text--primary);text-shadow:var(--popup-text-shadow)}.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%}}";
4400
+ const ezPopupCss = ":host{display:flex;--popup-title--primary:var(--title--primary, #2b3a54);--popup-font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--popup-text-weight--large:var(--text-weight--large, 600);--popup-space--small:var(--space--small, 6px);--popup-space--medium:var(--space--medium, 12px);--popup-space--large:var(--space--large, 24px);--popup-error--background-color:var(--color--alert-error-800, #BD0025);--popup-warning--background-color:var(--color--alert-warning-500, #EFB103);--popup-text-weight--medium:var(--text-weight--medium, 400);--popup-text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--popup-text--medium:var(--text--medium, 14px);--popup-text--primary:var(--text--primary, #626e82);--popup-z-index:var(--most-visible, 3);--popup--trash__image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"16px\" width=\"16px\"><path d=\"M 1.8585859,3.0707069 7.9999998,9.2121212 14.141414,3.0707069 16,5.0101006 7.9999998,12.929293 0,4.9292932 Z\"/></svg>');--popup--close__image:url('data:image/svg+xml;utf8,<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 8.2421753,6.9944578 13.743748,1.4930784 C 13.907781,1.3290628 14,1.1065946 14,0.87462511 14,0.64266712 13.907782,0.42019873 13.743748,0.25617155 13.579712,0.09215597 13.35727,6.48e-8 13.125266,6.48e-8 12.89338,6.48e-8 12.670821,0.09215634 12.506787,0.25617155 L 7.005215,5.7575508 1.5035972,0.25617155 C 1.3395631,0.09215597 1.1170968,6.48e-8 0.88511716,6.48e-8 0.65314917,6.48e-8 0.4306712,0.09215597 0.26663695,0.25617155 0.10260271,0.42019873 0.01045441,0.64266712 0.01045441,0.87462511 c 0,0.23196949 0.0921483,0.45443769 0.25618254,0.61845329 L 5.7682546,6.9944578 0.26663695,12.497027 c -0.0834745,0.08067 -0.15003245,0.1772 -0.19581514,0.283871 C 0.02505077,12.887561 9.831648e-4,13.002399 2.950369e-5,13.118395 -9.2415746e-4,13.234504 0.02125019,13.349689 0.06527245,13.457057 c 0.04401053,0.107479 0.10898307,0.205064 0.1911168,0.287137 0.0821454,0.08208 0.17979645,0.146888 0.28727561,0.190839 0.10747906,0.04395 0.22262954,0.06598 0.33872417,0.06493 0.116095,-10e-4 0.23082547,-0.0253 0.33747687,-0.07112 0.1066637,-0.04593 0.2031133,-0.112615 0.2837313,-0.196086 L 7.005215,8.2313646 12.506787,13.732768 c 0.164034,0.164027 0.386593,0.256125 0.618479,0.256125 0.232004,0 0.454446,-0.09209 0.618482,-0.256125 C 13.907781,13.568741 14,13.346308 14,13.114315 14,12.882323 13.90779,12.659888 13.743748,12.495861 Z\"/></svg>')}.overlay{position:fixed;display:flex;top:0px;z-index:var(--popup-z-index);left:0px;width:100%;align-items:center;justify-content:center;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.popup{display:flex;height:100%;align-items:center;justify-content:center;box-sizing:border-box}.popup__container{width:100%;max-height:90%;display:flex;flex-wrap:wrap;overflow:hidden;background:#FFFF;color:var(--popup-title--primary);border-radius:12px;box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122);box-sizing:border-box;padding:var(--popup-space--large)}.popup__content{box-sizing:border-box;max-height:100%;width:100%;display:flex;flex-wrap:wrap}.popup__expandable-content{box-sizing:border-box;overflow-y:auto;width:100%;display:flex;flex-wrap:wrap;max-height:80vh;content-visibility:auto}.popup__header{padding-bottom:var(--space--medium);width:100%;display:flex}.popup__title{width:100%;font-family:var(--popup-font-pattern);font-size:var(--title--extra-large);color:var(--title--primary)}.dialog__error--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--popup-error--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--popup-warning--background-color)}.message{font-weight:var(--popup-text-weight--medium)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--popup-title--primary);width:14px;height:14px;-webkit-mask-image:var(--popup--close__image);mask-image:var(--popup--close__image)}.btn-close--solo{width:100%}.title{display:flex;font-family:var(--popup-font-pattern);margin:0;font-weight:var(--popup-text-weight--large);line-height:1.3}.title--large{font-size:var(--popup-title--large)}.title__container{display:flex;align-items:center;padding-bottom:var(--popup-space--medium);align-self:center}.title--label{padding-left:var(--popup-space--small)}.text{font-family:var(--popup-font-pattern);text-shadow:var(--popup-text-shadow)}.text--medium{font-size:var(--popup-text--medium)}.text--primary{color:var(--popup-text--primary);text-shadow:var(--popup-text-shadow)}.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%}}";
4392
4401
 
4393
4402
  let EzPopup$1 = class extends HTMLElement {
4394
4403
  constructor() {
4395
4404
  super();
4396
4405
  this.__registerHost();
4397
4406
  this.__attachShadow();
4398
- this.ezChange = createEvent(this, "ezChange", 7);
4407
+ this.ezClosePopup = createEvent(this, "ezClosePopup", 7);
4408
+ this.sizeClasses = {
4409
+ "x-small": "col--sd-3",
4410
+ "small": "col--sd-5",
4411
+ "medium": "col--sd-6",
4412
+ "large": "col--sd-9",
4413
+ "x-large": "col--sd-11"
4414
+ };
4399
4415
  /**
4400
- * Define o width que o componente deve ter, seguindo o grid system.
4416
+ * Define o width que o componente deve ter, seguindo o grid system. Os valores devem estar
4417
+ * compreendidos em [x-small | small | medium | large | x-large].
4401
4418
  */
4402
- this.size = "col--sd-6";
4419
+ this.size = "medium";
4403
4420
  /**
4404
4421
  * Controla a exibição do componente.
4405
4422
  */
@@ -4409,11 +4426,14 @@ let EzPopup$1 = class extends HTMLElement {
4409
4426
  */
4410
4427
  this.useHeader = false;
4411
4428
  }
4429
+ getGridSize() {
4430
+ return this.sizeClasses[this.size] || this.sizeClasses["medium"];
4431
+ }
4412
4432
  render() {
4413
4433
  if (this.opened) {
4414
- 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 ?
4434
+ return (h(Host, null, h("div", { class: "overlay" }, h("div", { class: "popup col " + this.getGridSize() }, h("div", { class: "popup__container" }, h("div", { class: "popup__content" }, h("div", { class: "popup__header" }, this.ezTitle ?
4415
4435
  h("div", { class: "title popup__title" }, this.ezTitle)
4416
- : 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))))))));
4436
+ : 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))))))));
4417
4437
  }
4418
4438
  return null;
4419
4439
  }
@@ -2160,6 +2160,9 @@ class Application {
2160
2160
  static async alert(title, message, icon = null) {
2161
2161
  return Application.showDialog(title, message, icon, false, false);
2162
2162
  }
2163
+ static async error(title, message, icon = null) {
2164
+ return Application.showDialog(title, message, icon, false, true);
2165
+ }
2163
2166
  static async confirm(title, message, icon = null, critical = false) {
2164
2167
  return Application.showDialog(title, message, icon, true, critical);
2165
2168
  }
@@ -2394,7 +2397,12 @@ class DataUnit {
2394
2397
  saveResult = this.saveExecutor(this.getChangesToSave());
2395
2398
  }
2396
2399
  if (saveResult instanceof Promise) {
2397
- 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
+ });
2398
2406
  }
2399
2407
  else {
2400
2408
  this.processSaveResult(saveResult);
@@ -2686,7 +2694,7 @@ let EzForm = class {
2686
2694
  constructor(hostRef) {
2687
2695
  registerInstance(this, hostRef);
2688
2696
  this.enabled = true;
2689
- this.loading = true;
2697
+ this.loading = false;
2690
2698
  this._dataUnits = new Map();
2691
2699
  this._duSources = new Map();
2692
2700
  this._tabPositionByField = new Map();
@@ -15,7 +15,8 @@ class Message {
15
15
  let EzDialog = class {
16
16
  constructor(hostRef) {
17
17
  registerInstance(this, hostRef);
18
- this.ezChange = createEvent(this, "ezChange", 7);
18
+ this.ezCancel = createEvent(this, "ezCancel", 7);
19
+ this.ezAccept = createEvent(this, "ezAccept", 7);
19
20
  /**
20
21
  * Define se o componente será utilizado no modo de confirmação.
21
22
  */
@@ -36,7 +37,7 @@ let EzDialog = class {
36
37
  this._currentMessage.callBack(selectedOption);
37
38
  }
38
39
  else {
39
- this.ezChange.emit(selectedOption);
40
+ selectedOption ? this.ezAccept.emit(selectedOption) : this.ezCancel.emit(selectedOption);
40
41
  }
41
42
  this._currentMessage = this._messageQueue.shift();
42
43
  forceUpdate(this);
@@ -5,7 +5,7 @@ const ezModalCss = ":host{--modal-z-index:var(--most-visible, 3);--modal-vertica
5
5
  let EzModal = class {
6
6
  constructor(hostRef) {
7
7
  registerInstance(this, hostRef);
8
- this.ezChange = createEvent(this, "ezChange", 7);
8
+ this.ezCloseModal = createEvent(this, "ezCloseModal", 7);
9
9
  /**
10
10
  * Controle de exibição do Modal
11
11
  */
@@ -41,7 +41,7 @@ let EzModal = class {
41
41
  }
42
42
  closeModal() {
43
43
  this.oppened = false;
44
- this.ezChange.emit(this.oppened);
44
+ this.ezCloseModal.emit(this.oppened);
45
45
  }
46
46
  ///////
47
47
  // trapTabKey(e) {