@sankhyalabs/ezui 1.1.39 → 1.1.43

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 (49) hide show
  1. package/dist/cjs/ez-button_16.cjs.entry.js +305 -201
  2. package/dist/cjs/ez-dialog.cjs.entry.js +4 -4
  3. package/dist/cjs/ez-popup.cjs.entry.js +3 -3
  4. package/dist/cjs/ez-toast.cjs.entry.js +37 -0
  5. package/dist/cjs/ezui.cjs.js +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/collection-manifest.json +2 -1
  8. package/dist/collection/components/ez-dialog/ez-dialog.js +16 -12
  9. package/dist/collection/components/ez-form/assets/trash-can-outline.svg +3 -0
  10. package/dist/collection/components/ez-form/ez-form.js +1 -0
  11. package/dist/collection/components/ez-form/subcomponents/DataUnit.js +2 -1
  12. package/dist/collection/components/ez-form/subcomponents/form-metadata.js +1 -5
  13. package/dist/collection/components/ez-form/subcomponents/structure/Field.js +2 -3
  14. package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +6 -3
  15. package/dist/collection/components/ez-popup/ez-popup.js +5 -5
  16. package/dist/collection/components/ez-toast/ez-toast.css +108 -0
  17. package/dist/collection/components/ez-toast/ez-toast.js +113 -0
  18. package/dist/collection/components/ez-upload/RemoteFile.js +89 -0
  19. package/dist/collection/components/ez-upload/ez-upload.css +23 -3
  20. package/dist/collection/components/ez-upload/ez-upload.js +257 -297
  21. package/dist/collection/utils/Application.js +34 -0
  22. package/dist/custom-elements/index.d.ts +6 -0
  23. package/dist/custom-elements/index.js +350 -212
  24. package/dist/esm/ez-button_16.entry.js +305 -201
  25. package/dist/esm/ez-dialog.entry.js +4 -4
  26. package/dist/esm/ez-popup.entry.js +3 -3
  27. package/dist/esm/ez-toast.entry.js +33 -0
  28. package/dist/esm/ezui.js +1 -1
  29. package/dist/esm/loader.js +1 -1
  30. package/dist/ezui/assets/trash-can-outline.svg +3 -0
  31. package/dist/ezui/ezui.esm.js +1 -1
  32. package/dist/ezui/p-1ff02df6.entry.js +1 -0
  33. package/dist/ezui/p-4a87d740.entry.js +1 -0
  34. package/dist/ezui/p-c12beec1.entry.js +1 -0
  35. package/dist/ezui/p-c3b18332.entry.js +1 -0
  36. package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -3
  37. package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
  38. package/dist/types/components/ez-toast/ez-toast.d.ts +17 -0
  39. package/dist/types/components/ez-upload/RemoteFile.d.ts +14 -0
  40. package/dist/types/components/ez-upload/ez-upload.d.ts +51 -57
  41. package/dist/types/components.d.ts +91 -57
  42. package/dist/types/utils/Application.d.ts +6 -0
  43. package/package.json +2 -2
  44. package/react/components.d.ts +1 -0
  45. package/react/components.js +1 -0
  46. package/react/components.js.map +1 -1
  47. package/dist/ezui/p-40fe4f51.entry.js +0 -1
  48. package/dist/ezui/p-c7cee3ae.entry.js +0 -1
  49. package/dist/ezui/p-caa50ec5.entry.js +0 -1
@@ -2134,10 +2134,47 @@ function showHideNavBtn(state, { buttonName, status }) {
2134
2134
  return Object.assign(Object.assign({}, state), { visibleButtons });
2135
2135
  }
2136
2136
 
2137
- function removeHandler(dataUnit) {
2138
- if (confirm("Tem certeza que deseja Remover?")) {
2139
- dataUnit.remove();
2137
+ class Application {
2138
+ static async showDialog(title, message, icon = null, confirm, critical = false) {
2139
+ return new Promise(resolve => {
2140
+ let dialog = document.querySelector("ez-dialog");
2141
+ if (!dialog) {
2142
+ dialog = document.createElement("ez-dialog");
2143
+ window.document.body.appendChild(dialog);
2144
+ }
2145
+ dialog.ezTitle = title;
2146
+ dialog.message = message;
2147
+ dialog.critical = critical;
2148
+ dialog.confirm = confirm;
2149
+ dialog.personalizedIconPath = icon;
2150
+ dialog.oppened = true;
2151
+ dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
2152
+ });
2153
+ }
2154
+ static async alert(title, message, icon = null) {
2155
+ return Application.showDialog(title, message, icon, false, false);
2156
+ }
2157
+ static async confirm(title, message, icon = null, critical = false) {
2158
+ return Application.showDialog(title, message, icon, true, critical);
2140
2159
  }
2160
+ static async info(message) {
2161
+ let toast = document.querySelector("ez-toast");
2162
+ if (!toast) {
2163
+ toast = document.createElement("ez-toast");
2164
+ window.document.body.appendChild(toast);
2165
+ }
2166
+ toast.message = message;
2167
+ toast.fadeTime = 4000;
2168
+ toast.show();
2169
+ }
2170
+ }
2171
+
2172
+ function removeHandler(dataUnit) {
2173
+ Application.confirm("Exclusão de registro", "Tem certeza que deseja Remover?", null, true).then(ok => {
2174
+ if (ok) {
2175
+ dataUnit.remove();
2176
+ }
2177
+ });
2141
2178
  }
2142
2179
  const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
2143
2180
  if (buttonProps.previousVisible
@@ -2472,7 +2509,7 @@ class DataUnit {
2472
2509
  });
2473
2510
  const result = this.recordsValidator.validateRecords(this, recordsToValidate, triggedBy);
2474
2511
  if (result.message) {
2475
- alert(result.message);
2512
+ Application.info(result.message);
2476
2513
  }
2477
2514
  return result.isValid;
2478
2515
  }
@@ -2550,10 +2587,9 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
2550
2587
  const target = getProp(properties, 'URL');
2551
2588
  const strHeaders = getProp(properties, 'HEADERS');
2552
2589
  const headers = strHeaders ? JSON.parse(strHeaders) : {};
2590
+ const maxfiles = Number(getProp(properties, "maxfiles") || 0);
2553
2591
  return (h("div", { class: "col col--sd-12 padding--small" },
2554
- h("ez-upload", { onEzChange: (event) => {
2555
- changeFieldHandler(event.target['value']);
2556
- }, target: target, headers: headers, value: value })));
2592
+ h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
2557
2593
  case 'DATE':
2558
2594
  return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
2559
2595
  h("ez-date-input", { value: !value ? null : DateUtils.clearTime(value), label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.target['value']), errormessage: errorMessage, ref: elem => scrollToView(forceScroll, elem), key: key }));
@@ -2876,6 +2912,7 @@ let EzForm = class {
2876
2912
  render() {
2877
2913
  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;
2878
2914
  }
2915
+ static get assetsDirs() { return ["assets"]; }
2879
2916
  get _host() { return getElement(this); }
2880
2917
  static get watchers() { return {
2881
2918
  "metadata": ["cleanPreparedMetadata"]
@@ -3491,142 +3528,218 @@ let EzTextInput = class {
3491
3528
  };
3492
3529
  EzTextInput.style = ezTextInputCss;
3493
3530
 
3494
- const ezUploadCss = ":host{--iu--height:42px;--iu--width:100%;--iu__icon--width:48px;--iu__container--background-color:var(--background--medium, #d2dce9);--iu__color--primary:var(--color--primary, #008561);--iu--padding--extra-small:var(--space--extra-small, 3px);--iu--padding--small:var(--space--small, 6px);--iu--padding--medium:var(--space--medium, 12px);--iu--padding--large:var(--space--large, 24px);--iu--border-radius:var(--border--radius-medium, 12px);--iu__border--color:var(--color-strokes, #DCE0E8);--iu__input--border:var(--border--medium, 2px solid);--iu--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--iu--text--primary:var(--text-primary, #626e82);--iu--font-size:var(--text--medium, 14px);--iu--font-family:var(--font-pattern, Arial);--iu--font-weight:var(--text-weight--large, 500);display:flex;flex-wrap:wrap;position:relative;font-family:var(--iu--font-family);font-size:var(--iu--font-size);width:var(--iu--width);font-weight:var(--iu--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:var(--iu--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;height:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--iu--padding--medium) var(--iu--padding--medium) var(--iu--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--iu--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--iu__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--iu__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;clip-path:path(\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\")}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;clip-path:path(\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\")}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
3531
+ class RemoteFile {
3532
+ constructor(file) {
3533
+ this.file = file;
3534
+ this.size = file.size;
3535
+ this.name = file.name;
3536
+ }
3537
+ abortUpload() {
3538
+ if (this._uploadingXhr) {
3539
+ this._aborted = true;
3540
+ this._uploadingXhr.abort();
3541
+ this._uploadingXhr = undefined;
3542
+ }
3543
+ }
3544
+ isUploading() {
3545
+ return this._uploadingXhr !== undefined;
3546
+ }
3547
+ async upload(server, headers, updateCallBack) {
3548
+ return new Promise((resolve, reject) => {
3549
+ const xhr = new XMLHttpRequest();
3550
+ this._uploadingXhr = xhr;
3551
+ this._aborted = false;
3552
+ this.progress = 0;
3553
+ xhr.upload.onprogress = (e) => {
3554
+ const loaded = e.loaded;
3555
+ const total = e.total;
3556
+ this.progress = ~~((loaded / total) * 100);
3557
+ updateCallBack(this, loaded, total);
3558
+ };
3559
+ xhr.onreadystatechange = () => {
3560
+ if (xhr.readyState == 4) {
3561
+ this._uploadingXhr = undefined;
3562
+ const status = xhr.status;
3563
+ if (!this._aborted) {
3564
+ if (status === 0) {
3565
+ reject("Servidor indisponível");
3566
+ }
3567
+ else if (status >= 500) {
3568
+ reject("Erro inesperado no servidor");
3569
+ }
3570
+ else if (status >= 400) {
3571
+ reject("Operação não permitida");
3572
+ }
3573
+ }
3574
+ const response = xhr.response;
3575
+ if (response) {
3576
+ resolve(JSON.parse(response));
3577
+ }
3578
+ }
3579
+ };
3580
+ xhr.ontimeout = () => {
3581
+ reject("Tempo limite de transferência atingido.");
3582
+ };
3583
+ const formData = new FormData();
3584
+ formData.append("ARQUIVO", this.file, this.file.name);
3585
+ xhr.open("POST", server, true);
3586
+ if (headers) {
3587
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
3588
+ }
3589
+ xhr.send(formData);
3590
+ });
3591
+ }
3592
+ async delete(item, server, headers) {
3593
+ return new Promise((resolve, reject) => {
3594
+ const xhr = new XMLHttpRequest();
3595
+ xhr.onreadystatechange = () => {
3596
+ if (xhr.readyState == 4) {
3597
+ if (xhr.status === 0) {
3598
+ reject("Servidor indisponível");
3599
+ }
3600
+ else if (xhr.status >= 500) {
3601
+ reject("Erro inesperado no servidor");
3602
+ }
3603
+ else if (xhr.status >= 400) {
3604
+ reject("Operação não permitida");
3605
+ }
3606
+ resolve(true);
3607
+ }
3608
+ };
3609
+ xhr.ontimeout = () => {
3610
+ reject("Tempo limite de remoção atingido.");
3611
+ };
3612
+ xhr.open("DELETE", server, true);
3613
+ if (headers) {
3614
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
3615
+ }
3616
+ xhr.send(JSON.stringify(item));
3617
+ });
3618
+ }
3619
+ }
3620
+
3621
+ const ezUploadCss = ":host{--iu--height:42px;--iu--width:100%;--iu__icon--width:48px;--iu__container--background-color:var(--background--medium, #d2dce9);--iu__color--primary:var(--color--primary, #008561);--iu--padding--extra-small:var(--space--extra-small, 3px);--iu--padding--small:var(--space--small, 6px);--iu--padding--medium:var(--space--medium, 12px);--iu--padding--large:var(--space--large, 24px);--iu--border-radius:var(--border--radius-medium, 12px);--iu__border--color:var(--color-strokes, #DCE0E8);--iu__input--border:var(--border--medium, 2px solid);--iu--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--iu--text--primary:var(--text-primary, #626e82);--iu--font-size:var(--text--medium, 14px);--iu--font-family:var(--font-pattern, Arial);--iu--font-weight:var(--text-weight--large, 500);--iu__btn-cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--iu__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--iu--font-family);font-size:var(--iu--font-size);width:var(--iu--width);font-weight:var(--iu--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:var(--iu--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--iu--padding--medium) var(--iu--padding--medium) var(--iu--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--iu--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--iu__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--iu__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--iu__btn-cancel-image);mask-image:var(--iu__btn-cancel-image)}.iu__label{padding:var(--space--small);padding-top:0;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--iu--font-family);font-size:var(--text--extra-small);font-weight:var( --iu--font-weight);color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--iu__file-icon-image);mask-image:var(--iu__file-icon-image)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
3495
3622
 
3496
3623
  let EzUpload = class {
3497
3624
  constructor(hostRef) {
3498
3625
  registerInstance(this, hostRef);
3499
- this.validatedEvent = createEvent(this, "validatedEvent", 7);
3500
- this.initUploadEvent = createEvent(this, "initUploadEvent", 7);
3501
- this.finishedUploadEvent = createEvent(this, "finishedUploadEvent", 7);
3502
3626
  this.ezChange = createEvent(this, "ezChange", 7);
3627
+ this._filePointers = new Map();
3628
+ /**
3629
+ * Deixa o campo disponível ou não para digitação.
3630
+ */
3631
+ this.enabled = true;
3503
3632
  }
3504
- fileListChange() {
3505
- this.ezChange.emit({ value: this.value });
3633
+ changeValue(newValue) {
3634
+ if (newValue !== this._updatingValue) {
3635
+ this._filePointers.forEach(f => {
3636
+ if (this.isRemoteFile(f)) {
3637
+ f.abortUpload();
3638
+ }
3639
+ });
3640
+ this._filePointers = new Map();
3641
+ this.updateFilePointers();
3642
+ }
3643
+ this._updatingValue = undefined;
3506
3644
  }
3507
- addFiles(files) {
3508
- Array.prototype.forEach.call(files, this.addFile.bind(this));
3645
+ updateFilePointers() {
3646
+ if (this.value) {
3647
+ this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
3648
+ }
3509
3649
  }
3510
- addFile(file) {
3511
- this.errorMessage = undefined;
3512
- if (this.validateFile(file)) {
3513
- if (this.target) {
3514
- this._uploadFile(file);
3650
+ normalizeRequestHeaders() {
3651
+ this._requestHeaders = new Map();
3652
+ if (typeof this.requestheaders == 'string') {
3653
+ try {
3654
+ this.requestheaders = JSON.parse(this.requestheaders);
3515
3655
  }
3516
- else {
3517
- this.errorMessage = "Endereço de upload não informado";
3518
- alert(this.errorMessage);
3656
+ catch (e) {
3657
+ this.requestheaders = undefined;
3519
3658
  }
3520
3659
  }
3521
- else {
3522
- if (this.errorMessage && this.errorMessage.length > 0) {
3523
- alert(this.errorMessage);
3524
- }
3660
+ for (var key in this.requestheaders) {
3661
+ this._requestHeaders.set(key, this.requestheaders[key]);
3525
3662
  }
3526
3663
  }
3527
- validateFile(file) {
3528
- this.errorMessage = '';
3529
- let isValid = true;
3530
- if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
3531
- this.errorMessage = 'O tamanho máximo dos arquivos é de ' + this.formatBytes(this.maxFileSize);
3532
- isValid = false;
3533
- }
3534
- this.validatedEvent.emit({ isValid: isValid, fileName: file.name });
3535
- return isValid;
3536
- }
3537
- _uploadFile(file) {
3538
- const xhr = (file.xhr = this._createXhr());
3539
- const newValue = this.value ? [...this.value] : [];
3540
- newValue.push({ name: file.name, size: file.size, xhr: file.xhr });
3541
- let stalledId;
3542
- xhr.upload.onprogress = (e) => {
3543
- clearTimeout(stalledId);
3544
- const loaded = e.loaded, total = e.total, progress = ~~((loaded / total) * 100);
3545
- let viewFile = newValue.find(f => f.name === file.name);
3546
- if (viewFile) {
3547
- viewFile.progress = progress;
3548
- }
3549
- };
3550
- xhr.onreadystatechange = () => {
3551
- this.errorMessage = '';
3552
- if (xhr.readyState == 4) {
3553
- clearTimeout(stalledId);
3554
- file.indeterminate = file.uploading = false;
3555
- if (xhr.status === 0) ;
3556
- else if (xhr.status >= 500) {
3557
- this.errorMessage = "Erro inesperado no servidor";
3558
- }
3559
- else if (xhr.status >= 400) {
3560
- this.errorMessage = "Operação não permitida";
3561
- }
3562
- if (this.errorMessage && this.errorMessage.length > 0) {
3563
- //TODO
3564
- // Conferir com o time de UX um estado de erro ou remoção da lista
3565
- // this.removeFile(file.name);
3566
- alert(this.errorMessage);
3567
- }
3568
- else {
3569
- if (xhr.response) {
3570
- let response = JSON.parse(xhr.response);
3571
- response.forEach(element => {
3572
- let viewFile = newValue.find(f => f.name === this.decode_utf8(element.name));
3573
- if (viewFile) {
3574
- viewFile.progress = undefined;
3575
- //Validar estado de erro com UX
3576
- viewFile.error = false;
3577
- delete viewFile.xhr;
3578
- viewFile.downloadURL = element.downloadURL;
3579
- viewFile.lastModifiedDate = element.lastModifiedDate;
3580
- viewFile.properties = element.properties;
3581
- }
3582
- });
3583
- this.value = newValue;
3584
- this.fileListChange();
3585
- }
3586
- else {
3587
- let viewFile = newValue.find(f => f.name === file.name);
3588
- viewFile.progress = undefined;
3589
- //Validar estado de erro com UX
3590
- viewFile.error = true;
3664
+ async addFiles(files) {
3665
+ Array.prototype.forEach.call(files, this.addFile.bind(this));
3666
+ }
3667
+ async addFile(file) {
3668
+ const oldFile = this._filePointers.get(file.name);
3669
+ if (oldFile) {
3670
+ Application.confirm("Substituir arquivo", `Já existe um arquivo chamado "${file.name}". Deseja substituí-lo?`)
3671
+ .then(ok => {
3672
+ if (ok) {
3673
+ if (this.isRemoteFile(oldFile)) {
3674
+ oldFile.abortUpload();
3591
3675
  }
3676
+ this.doAddFile(file);
3592
3677
  }
3678
+ });
3679
+ }
3680
+ else {
3681
+ this.doAddFile(file);
3682
+ }
3683
+ }
3684
+ async doAddFile(file) {
3685
+ if (this.validateFile(file)) {
3686
+ const uploadingFile = new RemoteFile(file);
3687
+ this._filePointers.set(file.name, uploadingFile);
3688
+ uploadingFile.upload(this.urlupload, this._requestHeaders, (file) => this.updateFeedback(file))
3689
+ .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
3690
+ .catch(msg => this.showError(msg));
3691
+ forceUpdate(this);
3692
+ }
3693
+ }
3694
+ finishUpload(ezFile) {
3695
+ this._filePointers.set(ezFile.name, ezFile);
3696
+ this.updateValue();
3697
+ }
3698
+ updateValue() {
3699
+ this._updatingValue = [];
3700
+ this._filePointers.forEach(f => {
3701
+ if (!this.isRemoteFile(f)) {
3702
+ this._updatingValue.push(f);
3593
3703
  }
3594
- };
3595
- xhr.ontimeout = () => {
3596
- if (this.errorMessage && this.errorMessage.length > 0) {
3597
- this.errorMessage.concat(" / Tempo expirado");
3598
- this.removeFile(file.name);
3599
- alert(this.errorMessage);
3600
- }
3601
- };
3602
- const formData = new FormData();
3603
- formData.append(this.formDataName, file, file.name);
3604
- xhr.open("POST", this.target, true);
3605
- this._configureXhr(xhr);
3606
- file.status = "conectando";
3607
- file.uploading = file.indeterminate = true;
3608
- file.complete = file.abort = file.error = file.held = false;
3609
- xhr.send(formData);
3610
- }
3611
- _createXhr() {
3612
- return new XMLHttpRequest();
3613
- }
3614
- _configureXhr(xhr) {
3615
- if (typeof this.headers == 'string') {
3616
- try {
3617
- this.headers = JSON.parse(this.headers);
3618
- }
3619
- catch (e) {
3620
- this.headers = undefined;
3704
+ });
3705
+ this.value = this._updatingValue;
3706
+ this.ezChange.emit(this.value);
3707
+ }
3708
+ buildProgressId(uploading) {
3709
+ let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, '_');
3710
+ return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
3711
+ }
3712
+ updateFeedback(uf) {
3713
+ window.requestAnimationFrame(() => {
3714
+ if (this._host) {
3715
+ const progress = this._host.shadowRoot.querySelector('#' + this.buildProgressId(uf));
3716
+ if (progress) {
3717
+ progress.value = uf.progress;
3718
+ }
3621
3719
  }
3720
+ });
3721
+ }
3722
+ validateFile(file) {
3723
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3724
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3725
+ return false;
3726
+ }
3727
+ if (file.size === 0) {
3728
+ this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
3729
+ return false;
3622
3730
  }
3623
- for (var key in this.headers) {
3624
- xhr.setRequestHeader(key, this.headers[key]);
3731
+ if (!this.urlupload) {
3732
+ this.showError("Endereço de upload não informado");
3733
+ return false;
3625
3734
  }
3626
- if (this.timeout) {
3627
- xhr.timeout = this.timeout;
3735
+ if (this.maxfilesize >= 0 && file.size > this.maxfilesize) {
3736
+ this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxfilesize));
3737
+ return false;
3628
3738
  }
3629
- xhr.withCredentials = this.withCredentials;
3739
+ return true;
3740
+ }
3741
+ showError(message) {
3742
+ Application.alert("Enviando arquivo", message);
3630
3743
  }
3631
3744
  formatBytes(bytes, decimals = 1) {
3632
3745
  if (bytes === 0)
@@ -3638,97 +3751,92 @@ let EzUpload = class {
3638
3751
  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
3639
3752
  }
3640
3753
  onFileInputChange(event) {
3641
- this.addFiles(event.target.files);
3754
+ const input = event.target;
3755
+ this.addFiles(Array.from(input.files));
3642
3756
  this._fileInput.value = '';
3643
3757
  }
3644
- /*componentWillLoad() {
3645
- if (this.fileList?.length > 0) {
3646
- this.fileList.forEach(item => {
3647
- if (item.size) {
3648
- item.strSize = this.formatBytes(item.size);
3649
- }
3650
- })
3651
- this.fileList = [...this.fileList];
3758
+ isRemoteFile(item) {
3759
+ return "file" in item;
3760
+ }
3761
+ removeFromList(name) {
3762
+ this._filePointers.delete(name);
3763
+ this.updateValue();
3764
+ }
3765
+ removeFile(name) {
3766
+ const item = this._filePointers.get(name);
3767
+ if (this.isRemoteFile(item)) {
3768
+ item.abortUpload();
3769
+ this.removeFromList(name);
3770
+ }
3771
+ else {
3772
+ if (this.urldelete) {
3773
+ const uploadingFile = new RemoteFile(null);
3774
+ this._filePointers.set(item.name, uploadingFile);
3775
+ uploadingFile.delete(item, this.urldelete, null)
3776
+ .then(_ok => this.removeFromList(name))
3777
+ .catch(msg => this.showError(msg));
3778
+ }
3779
+ else {
3780
+ this.removeFromList(name);
3781
+ }
3782
+ }
3783
+ }
3784
+ openFilesDialog() {
3785
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3786
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3787
+ }
3788
+ else {
3789
+ this._fileInput.click();
3652
3790
  }
3653
- }*/
3654
- decode_utf8(s) {
3655
- return decodeURIComponent(escape(s));
3656
3791
  }
3657
3792
  componentDidLoad() {
3658
- if (this.dropZone && window.FileList && window.File) {
3659
- this.dropZone.addEventListener('dragover', event => {
3793
+ if (this._dropZone && window.FileList && window.File) {
3794
+ this._dropZone.addEventListener('dragover', event => {
3660
3795
  event.stopPropagation();
3661
3796
  event.preventDefault();
3662
3797
  event.dataTransfer.dropEffect = 'copy';
3663
3798
  });
3664
- this.dropZone.addEventListener('drop', event => {
3799
+ this._dropZone.addEventListener('drop', event => {
3665
3800
  event.stopPropagation();
3666
3801
  event.preventDefault();
3667
- this.addFiles(event.dataTransfer.files);
3802
+ this.addFiles(Array.from(event.dataTransfer.files));
3668
3803
  });
3669
3804
  }
3670
3805
  }
3671
- removeFile(name, xhr, downloadURL) {
3672
- if (xhr) {
3673
- xhr.abort();
3674
- }
3675
- if (downloadURL) {
3676
- this.removeFileFromServer(name, downloadURL);
3677
- }
3678
- this.value = [...this.value.filter(function (value) { return value.name !== name; })];
3679
- this.fileListChange();
3680
- }
3681
- removeFileFromServer(name, donwloadURL) {
3682
- const xhr = this._createXhr();
3683
- this.errorMessage = '';
3684
- let stalledId;
3685
- xhr.onreadystatechange = () => {
3686
- if (xhr.readyState == 4) {
3687
- clearTimeout(stalledId);
3688
- if (xhr.status === 0) {
3689
- this.errorMessage = "Servidor indisponível";
3690
- }
3691
- else if (xhr.status >= 500) {
3692
- this.errorMessage = "Erro inesperado no servidor";
3693
- }
3694
- else if (xhr.status >= 400) {
3695
- this.errorMessage = "Operação não permitida";
3696
- }
3697
- if (this.errorMessage && this.errorMessage.length > 0) {
3698
- //TODO
3699
- // Conferir com o time de UX um estado de erro ou remoção da lista
3700
- // this.removeFile(file.name);
3701
- alert(this.errorMessage);
3702
- }
3703
- }
3704
- };
3705
- xhr.ontimeout = () => {
3706
- if (this.errorMessage && this.errorMessage.length > 0) {
3707
- alert(this.errorMessage);
3806
+ componentWillRender() {
3807
+ if (this.value) {
3808
+ if (this._filePointers.size < this.value.length) {
3809
+ this.updateFilePointers();
3708
3810
  }
3709
- };
3710
- const body = JSON.stringify({
3711
- name: name,
3712
- donwloadURL: donwloadURL,
3713
- });
3714
- xhr.open("DELETE", this.target, true);
3715
- xhr.setRequestHeader('Content-Type', 'application/json');
3716
- this._configureXhr(xhr);
3717
- xhr.send(body);
3811
+ }
3718
3812
  }
3719
3813
  render() {
3720
- var _a;
3721
- return (h(Host, null, h("slot", null, h("div", { ref: (el) => this.dropZone = el, class: "iu" }, h("div", { class: "iu__container" }, h("div", { onClick: () => this._fileInput.click(), class: "iu__icon-label" }, h("button", { class: "iu__file-icon" }), h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para anexar arquivo")), ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ?
3722
- h("div", { class: "iu__footer" }, this.value.map(file => {
3723
- return (h("div", { class: "iu__item" }, h("div", { class: "iu__item-label" + (file.progress ? " modificador " : " modificador ") }, file.downloadURL ?
3724
- h("div", { title: file.name + "(" + this.formatBytes(file.size) + ")", class: "file__name text text--primary text--small text--ellipsis align--middle" }, h("a", { href: file.downloadURL, download: true }, file.name, " (", this.formatBytes(file.size), ")"))
3725
- :
3726
- h("div", { title: file.name + "(" + this.formatBytes(file.size) + ")", class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle " }, file.name, " (", this.formatBytes(file.size), ")")), file.progress ?
3727
- h("div", { class: "col col--sd-4 col--stretch align--middle" }, h("progress", { value: file.progress, max: "100" }))
3728
- : undefined, h("div", { class: "col col--stretch align--middle" }, h("button", { class: "btn-cancel ", onClick: () => this.removeFile(file.name, file.xhr) }))));
3729
- }))
3730
- : undefined))), h("input", { ref: (el) => this._fileInput = el, type: "file", id: "fileInput", hidden: true, onChange: (ev) => this.onFileInputChange(ev), multiple: true })));
3814
+ return (h("div", { ref: (el) => this._dropZone = el, class: "iu" }, this.label ? h("label", { class: "iu__label", title: this.label }, this.label) : null, h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, h("div", { class: "iu__icon-label" }, h("button", { class: "iu__file-icon" }), h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para adicionar arquivos")), this.buildFooter()), h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
3731
3815
  }
3816
+ buildFooter() {
3817
+ if (this._filePointers.size === 0) {
3818
+ return null;
3819
+ }
3820
+ const items = [];
3821
+ this._filePointers.forEach(item => items.push(this.buildFileItem(item)));
3822
+ return (h("div", { class: "iu__footer" }, items));
3823
+ }
3824
+ buildFileItem(item) {
3825
+ const fileName = item.name;
3826
+ const progress = Number(item['progress']);
3827
+ const downloadURL = item['downloadURL'];
3828
+ const label = `${fileName} (${this.formatBytes(item.size)})`;
3829
+ return (h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, h("div", { class: "iu__item-label modificador" }, h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
3830
+ ?
3831
+ null
3832
+ :
3833
+ h("div", { class: "col col--sd-4 col--stretch align--middle" }, h("progress", { id: this.buildProgressId(item), value: progress, max: "100" })), h("div", { class: "col col--stretch align--middle" }, h("button", { class: "btn-cancel ", onClick: () => this.removeFile(fileName) }))));
3834
+ }
3835
+ get _host() { return getElement(this); }
3836
+ static get watchers() { return {
3837
+ "value": ["changeValue"],
3838
+ "requestheaders": ["normalizeRequestHeaders"]
3839
+ }; }
3732
3840
  };
3733
3841
  EzUpload.style = ezUploadCss;
3734
3842
 
@@ -3754,11 +3862,6 @@ let FormMetadata = class {
3754
3862
  properties.push({ name: "options", value: JSON.stringify(objOpts) });
3755
3863
  }
3756
3864
  else if (userInterface === "FILE") {
3757
- /*<URL>http://localhost:8080/2a3skw-graphql/uploadFiles</URL>
3758
- <HEADERS>
3759
- <HEADER NAME="Authorization">dsfs</HEADER>
3760
- </HEADER>
3761
- </field> */
3762
3865
  const urlElement = element.querySelector('URL');
3763
3866
  const headersElement = element.querySelectorAll('HEADERS>HEADER');
3764
3867
  if (urlElement) {
@@ -3771,6 +3874,7 @@ let FormMetadata = class {
3771
3874
  });
3772
3875
  properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
3773
3876
  }
3877
+ this.addPropertyIfExists(properties, element, "maxfiles");
3774
3878
  }
3775
3879
  else {
3776
3880
  if (!label) {
@@ -19,7 +19,7 @@ let EzDialog = class {
19
19
  */
20
20
  this.oppened = false;
21
21
  }
22
- handleButtonClick(selectedOption) {
22
+ async handleButtonClick(selectedOption) {
23
23
  this.oppened = false;
24
24
  this.ezChange.emit(selectedOption);
25
25
  }
@@ -28,10 +28,10 @@ let EzDialog = class {
28
28
  return (h("div", { class: "overlay" }, h("div", { class: "dialog" }, h("div", { class: this.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }), h("div", { class: "dialog__container" }, h("div", { class: "title__container" }, h("div", { class: "title__box" }, this.personalizedIconPath ?
29
29
  h("svg", { class: "iconePersonalizado", role: "img" }, h("use", { xlinkHref: this.personalizedIconPath }))
30
30
  :
31
- h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }), h("div", { class: "title title--label" }, h("h2", null, this.title))), h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit("CANCEL"); } })), h("div", { class: "text text--primary text--medium message" }, this.message), this.confirm ?
32
- h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick("N") }), h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick("S") }))
31
+ h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }), h("div", { class: "title title--label" }, h("h2", null, this.ezTitle))), h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit(false); } })), h("div", { class: "text text--primary text--medium message" }, this.message), this.confirm ?
32
+ h("div", { class: "button-yes-no__container" }, h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }), h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
33
33
  : undefined, !this.confirm ?
34
- h("div", { class: "button__ok--container" }, h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick("S") }))
34
+ h("div", { class: "button__ok--container" }, h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
35
35
  : undefined))));
36
36
  }
37
37
  return null;
@@ -21,9 +21,9 @@ let EzPopup = class {
21
21
  }
22
22
  render() {
23
23
  if (this.opened) {
24
- 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.title ?
25
- h("div", { class: "title popup__title" }, this.title)
26
- : undefined, h("button", { class: this.title ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezChange.emit("CANCEL"); } })), h("div", { class: "popup__expandable-content" }, h("slot", null))))))));
24
+ 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 ?
25
+ h("div", { class: "title popup__title" }, this.ezTitle)
26
+ : 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))))))));
27
27
  }
28
28
  return null;
29
29
  }