@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
@@ -2138,10 +2138,47 @@ function showHideNavBtn(state, { buttonName, status }) {
2138
2138
  return Object.assign(Object.assign({}, state), { visibleButtons });
2139
2139
  }
2140
2140
 
2141
- function removeHandler(dataUnit) {
2142
- if (confirm("Tem certeza que deseja Remover?")) {
2143
- dataUnit.remove();
2141
+ class Application {
2142
+ static async showDialog(title, message, icon = null, confirm, critical = false) {
2143
+ return new Promise(resolve => {
2144
+ let dialog = document.querySelector("ez-dialog");
2145
+ if (!dialog) {
2146
+ dialog = document.createElement("ez-dialog");
2147
+ window.document.body.appendChild(dialog);
2148
+ }
2149
+ dialog.ezTitle = title;
2150
+ dialog.message = message;
2151
+ dialog.critical = critical;
2152
+ dialog.confirm = confirm;
2153
+ dialog.personalizedIconPath = icon;
2154
+ dialog.oppened = true;
2155
+ dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
2156
+ });
2157
+ }
2158
+ static async alert(title, message, icon = null) {
2159
+ return Application.showDialog(title, message, icon, false, false);
2160
+ }
2161
+ static async confirm(title, message, icon = null, critical = false) {
2162
+ return Application.showDialog(title, message, icon, true, critical);
2144
2163
  }
2164
+ static async info(message) {
2165
+ let toast = document.querySelector("ez-toast");
2166
+ if (!toast) {
2167
+ toast = document.createElement("ez-toast");
2168
+ window.document.body.appendChild(toast);
2169
+ }
2170
+ toast.message = message;
2171
+ toast.fadeTime = 4000;
2172
+ toast.show();
2173
+ }
2174
+ }
2175
+
2176
+ function removeHandler(dataUnit) {
2177
+ Application.confirm("Exclusão de registro", "Tem certeza que deseja Remover?", null, true).then(ok => {
2178
+ if (ok) {
2179
+ dataUnit.remove();
2180
+ }
2181
+ });
2145
2182
  }
2146
2183
  const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
2147
2184
  if (buttonProps.previousVisible
@@ -2476,7 +2513,7 @@ class DataUnit {
2476
2513
  });
2477
2514
  const result = this.recordsValidator.validateRecords(this, recordsToValidate, triggedBy);
2478
2515
  if (result.message) {
2479
- alert(result.message);
2516
+ Application.info(result.message);
2480
2517
  }
2481
2518
  return result.isValid;
2482
2519
  }
@@ -2554,10 +2591,9 @@ const Field = ({ dataUnit, field, forceScroll, enabled }) => {
2554
2591
  const target = getProp(properties, 'URL');
2555
2592
  const strHeaders = getProp(properties, 'HEADERS');
2556
2593
  const headers = strHeaders ? JSON.parse(strHeaders) : {};
2594
+ const maxfiles = Number(getProp(properties, "maxfiles") || 0);
2557
2595
  return (index.h("div", { class: "col col--sd-12 padding--small" },
2558
- index.h("ez-upload", { onEzChange: (event) => {
2559
- changeFieldHandler(event.target['value']);
2560
- }, target: target, headers: headers, value: value })));
2596
+ index.h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
2561
2597
  case 'DATE':
2562
2598
  return index.h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? index.h("place-holder", null) :
2563
2599
  index.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 }));
@@ -2880,6 +2916,7 @@ let EzForm = class {
2880
2916
  render() {
2881
2917
  return this._preparedMetadata ? index.h(FormSheet, { enabled: this.enabled, store: this._store, source: this._preparedMetadata, parentName: "__MAIN__FORM__", dataUnitBuilder: (du, parentDataUnit) => this.buildDataUnit(du, parentDataUnit) }) : null;
2882
2918
  }
2919
+ static get assetsDirs() { return ["assets"]; }
2883
2920
  get _host() { return index.getElement(this); }
2884
2921
  static get watchers() { return {
2885
2922
  "metadata": ["cleanPreparedMetadata"]
@@ -3495,142 +3532,218 @@ let EzTextInput = class {
3495
3532
  };
3496
3533
  EzTextInput.style = ezTextInputCss;
3497
3534
 
3498
- 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%}}";
3535
+ class RemoteFile {
3536
+ constructor(file) {
3537
+ this.file = file;
3538
+ this.size = file.size;
3539
+ this.name = file.name;
3540
+ }
3541
+ abortUpload() {
3542
+ if (this._uploadingXhr) {
3543
+ this._aborted = true;
3544
+ this._uploadingXhr.abort();
3545
+ this._uploadingXhr = undefined;
3546
+ }
3547
+ }
3548
+ isUploading() {
3549
+ return this._uploadingXhr !== undefined;
3550
+ }
3551
+ async upload(server, headers, updateCallBack) {
3552
+ return new Promise((resolve, reject) => {
3553
+ const xhr = new XMLHttpRequest();
3554
+ this._uploadingXhr = xhr;
3555
+ this._aborted = false;
3556
+ this.progress = 0;
3557
+ xhr.upload.onprogress = (e) => {
3558
+ const loaded = e.loaded;
3559
+ const total = e.total;
3560
+ this.progress = ~~((loaded / total) * 100);
3561
+ updateCallBack(this, loaded, total);
3562
+ };
3563
+ xhr.onreadystatechange = () => {
3564
+ if (xhr.readyState == 4) {
3565
+ this._uploadingXhr = undefined;
3566
+ const status = xhr.status;
3567
+ if (!this._aborted) {
3568
+ if (status === 0) {
3569
+ reject("Servidor indisponível");
3570
+ }
3571
+ else if (status >= 500) {
3572
+ reject("Erro inesperado no servidor");
3573
+ }
3574
+ else if (status >= 400) {
3575
+ reject("Operação não permitida");
3576
+ }
3577
+ }
3578
+ const response = xhr.response;
3579
+ if (response) {
3580
+ resolve(JSON.parse(response));
3581
+ }
3582
+ }
3583
+ };
3584
+ xhr.ontimeout = () => {
3585
+ reject("Tempo limite de transferência atingido.");
3586
+ };
3587
+ const formData = new FormData();
3588
+ formData.append("ARQUIVO", this.file, this.file.name);
3589
+ xhr.open("POST", server, true);
3590
+ if (headers) {
3591
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
3592
+ }
3593
+ xhr.send(formData);
3594
+ });
3595
+ }
3596
+ async delete(item, server, headers) {
3597
+ return new Promise((resolve, reject) => {
3598
+ const xhr = new XMLHttpRequest();
3599
+ xhr.onreadystatechange = () => {
3600
+ if (xhr.readyState == 4) {
3601
+ if (xhr.status === 0) {
3602
+ reject("Servidor indisponível");
3603
+ }
3604
+ else if (xhr.status >= 500) {
3605
+ reject("Erro inesperado no servidor");
3606
+ }
3607
+ else if (xhr.status >= 400) {
3608
+ reject("Operação não permitida");
3609
+ }
3610
+ resolve(true);
3611
+ }
3612
+ };
3613
+ xhr.ontimeout = () => {
3614
+ reject("Tempo limite de remoção atingido.");
3615
+ };
3616
+ xhr.open("DELETE", server, true);
3617
+ if (headers) {
3618
+ headers.forEach((value, key) => xhr.setRequestHeader(key, value));
3619
+ }
3620
+ xhr.send(JSON.stringify(item));
3621
+ });
3622
+ }
3623
+ }
3624
+
3625
+ 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%}}";
3499
3626
 
3500
3627
  let EzUpload = class {
3501
3628
  constructor(hostRef) {
3502
3629
  index.registerInstance(this, hostRef);
3503
- this.validatedEvent = index.createEvent(this, "validatedEvent", 7);
3504
- this.initUploadEvent = index.createEvent(this, "initUploadEvent", 7);
3505
- this.finishedUploadEvent = index.createEvent(this, "finishedUploadEvent", 7);
3506
3630
  this.ezChange = index.createEvent(this, "ezChange", 7);
3631
+ this._filePointers = new Map();
3632
+ /**
3633
+ * Deixa o campo disponível ou não para digitação.
3634
+ */
3635
+ this.enabled = true;
3507
3636
  }
3508
- fileListChange() {
3509
- this.ezChange.emit({ value: this.value });
3637
+ changeValue(newValue) {
3638
+ if (newValue !== this._updatingValue) {
3639
+ this._filePointers.forEach(f => {
3640
+ if (this.isRemoteFile(f)) {
3641
+ f.abortUpload();
3642
+ }
3643
+ });
3644
+ this._filePointers = new Map();
3645
+ this.updateFilePointers();
3646
+ }
3647
+ this._updatingValue = undefined;
3510
3648
  }
3511
- addFiles(files) {
3512
- Array.prototype.forEach.call(files, this.addFile.bind(this));
3649
+ updateFilePointers() {
3650
+ if (this.value) {
3651
+ this.value.forEach(ezFile => this._filePointers.set(ezFile.name, ezFile));
3652
+ }
3513
3653
  }
3514
- addFile(file) {
3515
- this.errorMessage = undefined;
3516
- if (this.validateFile(file)) {
3517
- if (this.target) {
3518
- this._uploadFile(file);
3654
+ normalizeRequestHeaders() {
3655
+ this._requestHeaders = new Map();
3656
+ if (typeof this.requestheaders == 'string') {
3657
+ try {
3658
+ this.requestheaders = JSON.parse(this.requestheaders);
3519
3659
  }
3520
- else {
3521
- this.errorMessage = "Endereço de upload não informado";
3522
- alert(this.errorMessage);
3660
+ catch (e) {
3661
+ this.requestheaders = undefined;
3523
3662
  }
3524
3663
  }
3525
- else {
3526
- if (this.errorMessage && this.errorMessage.length > 0) {
3527
- alert(this.errorMessage);
3528
- }
3664
+ for (var key in this.requestheaders) {
3665
+ this._requestHeaders.set(key, this.requestheaders[key]);
3529
3666
  }
3530
3667
  }
3531
- validateFile(file) {
3532
- this.errorMessage = '';
3533
- let isValid = true;
3534
- if (this.maxFileSize >= 0 && file.size > this.maxFileSize) {
3535
- this.errorMessage = 'O tamanho máximo dos arquivos é de ' + this.formatBytes(this.maxFileSize);
3536
- isValid = false;
3537
- }
3538
- this.validatedEvent.emit({ isValid: isValid, fileName: file.name });
3539
- return isValid;
3540
- }
3541
- _uploadFile(file) {
3542
- const xhr = (file.xhr = this._createXhr());
3543
- const newValue = this.value ? [...this.value] : [];
3544
- newValue.push({ name: file.name, size: file.size, xhr: file.xhr });
3545
- let stalledId;
3546
- xhr.upload.onprogress = (e) => {
3547
- clearTimeout(stalledId);
3548
- const loaded = e.loaded, total = e.total, progress = ~~((loaded / total) * 100);
3549
- let viewFile = newValue.find(f => f.name === file.name);
3550
- if (viewFile) {
3551
- viewFile.progress = progress;
3552
- }
3553
- };
3554
- xhr.onreadystatechange = () => {
3555
- this.errorMessage = '';
3556
- if (xhr.readyState == 4) {
3557
- clearTimeout(stalledId);
3558
- file.indeterminate = file.uploading = false;
3559
- if (xhr.status === 0) ;
3560
- else if (xhr.status >= 500) {
3561
- this.errorMessage = "Erro inesperado no servidor";
3562
- }
3563
- else if (xhr.status >= 400) {
3564
- this.errorMessage = "Operação não permitida";
3565
- }
3566
- if (this.errorMessage && this.errorMessage.length > 0) {
3567
- //TODO
3568
- // Conferir com o time de UX um estado de erro ou remoção da lista
3569
- // this.removeFile(file.name);
3570
- alert(this.errorMessage);
3571
- }
3572
- else {
3573
- if (xhr.response) {
3574
- let response = JSON.parse(xhr.response);
3575
- response.forEach(element => {
3576
- let viewFile = newValue.find(f => f.name === this.decode_utf8(element.name));
3577
- if (viewFile) {
3578
- viewFile.progress = undefined;
3579
- //Validar estado de erro com UX
3580
- viewFile.error = false;
3581
- delete viewFile.xhr;
3582
- viewFile.downloadURL = element.downloadURL;
3583
- viewFile.lastModifiedDate = element.lastModifiedDate;
3584
- viewFile.properties = element.properties;
3585
- }
3586
- });
3587
- this.value = newValue;
3588
- this.fileListChange();
3589
- }
3590
- else {
3591
- let viewFile = newValue.find(f => f.name === file.name);
3592
- viewFile.progress = undefined;
3593
- //Validar estado de erro com UX
3594
- viewFile.error = true;
3668
+ async addFiles(files) {
3669
+ Array.prototype.forEach.call(files, this.addFile.bind(this));
3670
+ }
3671
+ async addFile(file) {
3672
+ const oldFile = this._filePointers.get(file.name);
3673
+ if (oldFile) {
3674
+ Application.confirm("Substituir arquivo", `Já existe um arquivo chamado "${file.name}". Deseja substituí-lo?`)
3675
+ .then(ok => {
3676
+ if (ok) {
3677
+ if (this.isRemoteFile(oldFile)) {
3678
+ oldFile.abortUpload();
3595
3679
  }
3680
+ this.doAddFile(file);
3596
3681
  }
3682
+ });
3683
+ }
3684
+ else {
3685
+ this.doAddFile(file);
3686
+ }
3687
+ }
3688
+ async doAddFile(file) {
3689
+ if (this.validateFile(file)) {
3690
+ const uploadingFile = new RemoteFile(file);
3691
+ this._filePointers.set(file.name, uploadingFile);
3692
+ uploadingFile.upload(this.urlupload, this._requestHeaders, (file) => this.updateFeedback(file))
3693
+ .then((files) => files.forEach(ezFile => this.finishUpload(ezFile)))
3694
+ .catch(msg => this.showError(msg));
3695
+ index.forceUpdate(this);
3696
+ }
3697
+ }
3698
+ finishUpload(ezFile) {
3699
+ this._filePointers.set(ezFile.name, ezFile);
3700
+ this.updateValue();
3701
+ }
3702
+ updateValue() {
3703
+ this._updatingValue = [];
3704
+ this._filePointers.forEach(f => {
3705
+ if (!this.isRemoteFile(f)) {
3706
+ this._updatingValue.push(f);
3597
3707
  }
3598
- };
3599
- xhr.ontimeout = () => {
3600
- if (this.errorMessage && this.errorMessage.length > 0) {
3601
- this.errorMessage.concat(" / Tempo expirado");
3602
- this.removeFile(file.name);
3603
- alert(this.errorMessage);
3604
- }
3605
- };
3606
- const formData = new FormData();
3607
- formData.append(this.formDataName, file, file.name);
3608
- xhr.open("POST", this.target, true);
3609
- this._configureXhr(xhr);
3610
- file.status = "conectando";
3611
- file.uploading = file.indeterminate = true;
3612
- file.complete = file.abort = file.error = file.held = false;
3613
- xhr.send(formData);
3614
- }
3615
- _createXhr() {
3616
- return new XMLHttpRequest();
3617
- }
3618
- _configureXhr(xhr) {
3619
- if (typeof this.headers == 'string') {
3620
- try {
3621
- this.headers = JSON.parse(this.headers);
3622
- }
3623
- catch (e) {
3624
- this.headers = undefined;
3708
+ });
3709
+ this.value = this._updatingValue;
3710
+ this.ezChange.emit(this.value);
3711
+ }
3712
+ buildProgressId(uploading) {
3713
+ let sanitizedName = uploading.name.replace(/[^a-z0-9_]/gi, '_');
3714
+ return `PROGRESS_${sanitizedName}_${uploading.file.lastModified}`;
3715
+ }
3716
+ updateFeedback(uf) {
3717
+ window.requestAnimationFrame(() => {
3718
+ if (this._host) {
3719
+ const progress = this._host.shadowRoot.querySelector('#' + this.buildProgressId(uf));
3720
+ if (progress) {
3721
+ progress.value = uf.progress;
3722
+ }
3625
3723
  }
3724
+ });
3725
+ }
3726
+ validateFile(file) {
3727
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3728
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3729
+ return false;
3730
+ }
3731
+ if (file.size === 0) {
3732
+ this.showError(`Erro de permissão: O arquivo "${file.name}" não pode ser enviado.`);
3733
+ return false;
3626
3734
  }
3627
- for (var key in this.headers) {
3628
- xhr.setRequestHeader(key, this.headers[key]);
3735
+ if (!this.urlupload) {
3736
+ this.showError("Endereço de upload não informado");
3737
+ return false;
3629
3738
  }
3630
- if (this.timeout) {
3631
- xhr.timeout = this.timeout;
3739
+ if (this.maxfilesize >= 0 && file.size > this.maxfilesize) {
3740
+ this.showError("O tamanho máximo dos arquivos é de " + this.formatBytes(this.maxfilesize));
3741
+ return false;
3632
3742
  }
3633
- xhr.withCredentials = this.withCredentials;
3743
+ return true;
3744
+ }
3745
+ showError(message) {
3746
+ Application.alert("Enviando arquivo", message);
3634
3747
  }
3635
3748
  formatBytes(bytes, decimals = 1) {
3636
3749
  if (bytes === 0)
@@ -3642,97 +3755,92 @@ let EzUpload = class {
3642
3755
  return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
3643
3756
  }
3644
3757
  onFileInputChange(event) {
3645
- this.addFiles(event.target.files);
3758
+ const input = event.target;
3759
+ this.addFiles(Array.from(input.files));
3646
3760
  this._fileInput.value = '';
3647
3761
  }
3648
- /*componentWillLoad() {
3649
- if (this.fileList?.length > 0) {
3650
- this.fileList.forEach(item => {
3651
- if (item.size) {
3652
- item.strSize = this.formatBytes(item.size);
3653
- }
3654
- })
3655
- this.fileList = [...this.fileList];
3762
+ isRemoteFile(item) {
3763
+ return "file" in item;
3764
+ }
3765
+ removeFromList(name) {
3766
+ this._filePointers.delete(name);
3767
+ this.updateValue();
3768
+ }
3769
+ removeFile(name) {
3770
+ const item = this._filePointers.get(name);
3771
+ if (this.isRemoteFile(item)) {
3772
+ item.abortUpload();
3773
+ this.removeFromList(name);
3774
+ }
3775
+ else {
3776
+ if (this.urldelete) {
3777
+ const uploadingFile = new RemoteFile(null);
3778
+ this._filePointers.set(item.name, uploadingFile);
3779
+ uploadingFile.delete(item, this.urldelete, null)
3780
+ .then(_ok => this.removeFromList(name))
3781
+ .catch(msg => this.showError(msg));
3782
+ }
3783
+ else {
3784
+ this.removeFromList(name);
3785
+ }
3786
+ }
3787
+ }
3788
+ openFilesDialog() {
3789
+ if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
3790
+ this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
3791
+ }
3792
+ else {
3793
+ this._fileInput.click();
3656
3794
  }
3657
- }*/
3658
- decode_utf8(s) {
3659
- return decodeURIComponent(escape(s));
3660
3795
  }
3661
3796
  componentDidLoad() {
3662
- if (this.dropZone && window.FileList && window.File) {
3663
- this.dropZone.addEventListener('dragover', event => {
3797
+ if (this._dropZone && window.FileList && window.File) {
3798
+ this._dropZone.addEventListener('dragover', event => {
3664
3799
  event.stopPropagation();
3665
3800
  event.preventDefault();
3666
3801
  event.dataTransfer.dropEffect = 'copy';
3667
3802
  });
3668
- this.dropZone.addEventListener('drop', event => {
3803
+ this._dropZone.addEventListener('drop', event => {
3669
3804
  event.stopPropagation();
3670
3805
  event.preventDefault();
3671
- this.addFiles(event.dataTransfer.files);
3806
+ this.addFiles(Array.from(event.dataTransfer.files));
3672
3807
  });
3673
3808
  }
3674
3809
  }
3675
- removeFile(name, xhr, downloadURL) {
3676
- if (xhr) {
3677
- xhr.abort();
3678
- }
3679
- if (downloadURL) {
3680
- this.removeFileFromServer(name, downloadURL);
3681
- }
3682
- this.value = [...this.value.filter(function (value) { return value.name !== name; })];
3683
- this.fileListChange();
3684
- }
3685
- removeFileFromServer(name, donwloadURL) {
3686
- const xhr = this._createXhr();
3687
- this.errorMessage = '';
3688
- let stalledId;
3689
- xhr.onreadystatechange = () => {
3690
- if (xhr.readyState == 4) {
3691
- clearTimeout(stalledId);
3692
- if (xhr.status === 0) {
3693
- this.errorMessage = "Servidor indisponível";
3694
- }
3695
- else if (xhr.status >= 500) {
3696
- this.errorMessage = "Erro inesperado no servidor";
3697
- }
3698
- else if (xhr.status >= 400) {
3699
- this.errorMessage = "Operação não permitida";
3700
- }
3701
- if (this.errorMessage && this.errorMessage.length > 0) {
3702
- //TODO
3703
- // Conferir com o time de UX um estado de erro ou remoção da lista
3704
- // this.removeFile(file.name);
3705
- alert(this.errorMessage);
3706
- }
3707
- }
3708
- };
3709
- xhr.ontimeout = () => {
3710
- if (this.errorMessage && this.errorMessage.length > 0) {
3711
- alert(this.errorMessage);
3810
+ componentWillRender() {
3811
+ if (this.value) {
3812
+ if (this._filePointers.size < this.value.length) {
3813
+ this.updateFilePointers();
3712
3814
  }
3713
- };
3714
- const body = JSON.stringify({
3715
- name: name,
3716
- donwloadURL: donwloadURL,
3717
- });
3718
- xhr.open("DELETE", this.target, true);
3719
- xhr.setRequestHeader('Content-Type', 'application/json');
3720
- this._configureXhr(xhr);
3721
- xhr.send(body);
3815
+ }
3722
3816
  }
3723
3817
  render() {
3724
- var _a;
3725
- return (index.h(index.Host, null, index.h("slot", null, index.h("div", { ref: (el) => this.dropZone = el, class: "iu" }, index.h("div", { class: "iu__container" }, index.h("div", { onClick: () => this._fileInput.click(), class: "iu__icon-label" }, index.h("button", { class: "iu__file-icon" }), index.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 ?
3726
- index.h("div", { class: "iu__footer" }, this.value.map(file => {
3727
- return (index.h("div", { class: "iu__item" }, index.h("div", { class: "iu__item-label" + (file.progress ? " modificador " : " modificador ") }, file.downloadURL ?
3728
- index.h("div", { title: file.name + "(" + this.formatBytes(file.size) + ")", class: "file__name text text--primary text--small text--ellipsis align--middle" }, index.h("a", { href: file.downloadURL, download: true }, file.name, " (", this.formatBytes(file.size), ")"))
3729
- :
3730
- index.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 ?
3731
- index.h("div", { class: "col col--sd-4 col--stretch align--middle" }, index.h("progress", { value: file.progress, max: "100" }))
3732
- : undefined, index.h("div", { class: "col col--stretch align--middle" }, index.h("button", { class: "btn-cancel ", onClick: () => this.removeFile(file.name, file.xhr) }))));
3733
- }))
3734
- : undefined))), index.h("input", { ref: (el) => this._fileInput = el, type: "file", id: "fileInput", hidden: true, onChange: (ev) => this.onFileInputChange(ev), multiple: true })));
3818
+ return (index.h("div", { ref: (el) => this._dropZone = el, class: "iu" }, this.label ? index.h("label", { class: "iu__label", title: this.label }, this.label) : null, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: "iu__icon-label" }, index.h("button", { class: "iu__file-icon" }), index.h("div", { class: "text text--center text--medium text--primary" }, "Arraste e solte ou clique para adicionar arquivos")), this.buildFooter()), index.h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
3735
3819
  }
3820
+ buildFooter() {
3821
+ if (this._filePointers.size === 0) {
3822
+ return null;
3823
+ }
3824
+ const items = [];
3825
+ this._filePointers.forEach(item => items.push(this.buildFileItem(item)));
3826
+ return (index.h("div", { class: "iu__footer" }, items));
3827
+ }
3828
+ buildFileItem(item) {
3829
+ const fileName = item.name;
3830
+ const progress = Number(item['progress']);
3831
+ const downloadURL = item['downloadURL'];
3832
+ const label = `${fileName} (${this.formatBytes(item.size)})`;
3833
+ return (index.h("div", { class: "iu__item", key: fileName, onClick: evt => evt.stopPropagation() }, index.h("div", { class: "iu__item-label modificador" }, index.h("div", { title: label, class: "col--stretch align--middle file__name text text--primary text--small text--ellipsis align--middle" }, downloadURL ? index.h("a", { href: downloadURL, download: true }, label) : label)), isNaN(progress)
3834
+ ?
3835
+ null
3836
+ :
3837
+ index.h("div", { class: "col col--sd-4 col--stretch align--middle" }, index.h("progress", { id: this.buildProgressId(item), value: progress, max: "100" })), index.h("div", { class: "col col--stretch align--middle" }, index.h("button", { class: "btn-cancel ", onClick: () => this.removeFile(fileName) }))));
3838
+ }
3839
+ get _host() { return index.getElement(this); }
3840
+ static get watchers() { return {
3841
+ "value": ["changeValue"],
3842
+ "requestheaders": ["normalizeRequestHeaders"]
3843
+ }; }
3736
3844
  };
3737
3845
  EzUpload.style = ezUploadCss;
3738
3846
 
@@ -3758,11 +3866,6 @@ let FormMetadata = class {
3758
3866
  properties.push({ name: "options", value: JSON.stringify(objOpts) });
3759
3867
  }
3760
3868
  else if (userInterface === "FILE") {
3761
- /*<URL>http://localhost:8080/2a3skw-graphql/uploadFiles</URL>
3762
- <HEADERS>
3763
- <HEADER NAME="Authorization">dsfs</HEADER>
3764
- </HEADER>
3765
- </field> */
3766
3869
  const urlElement = element.querySelector('URL');
3767
3870
  const headersElement = element.querySelectorAll('HEADERS>HEADER');
3768
3871
  if (urlElement) {
@@ -3775,6 +3878,7 @@ let FormMetadata = class {
3775
3878
  });
3776
3879
  properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
3777
3880
  }
3881
+ this.addPropertyIfExists(properties, element, "maxfiles");
3778
3882
  }
3779
3883
  else {
3780
3884
  if (!label) {
@@ -23,7 +23,7 @@ let EzDialog = class {
23
23
  */
24
24
  this.oppened = false;
25
25
  }
26
- handleButtonClick(selectedOption) {
26
+ async handleButtonClick(selectedOption) {
27
27
  this.oppened = false;
28
28
  this.ezChange.emit(selectedOption);
29
29
  }
@@ -32,10 +32,10 @@ let EzDialog = class {
32
32
  return (index.h("div", { class: "overlay" }, index.h("div", { class: "dialog" }, index.h("div", { class: this.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }), index.h("div", { class: "dialog__container" }, index.h("div", { class: "title__container" }, index.h("div", { class: "title__box" }, this.personalizedIconPath ?
33
33
  index.h("svg", { class: "iconePersonalizado", role: "img" }, index.h("use", { xlinkHref: this.personalizedIconPath }))
34
34
  :
35
- index.h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }), index.h("div", { class: "title title--label" }, index.h("h2", null, this.title))), index.h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit("CANCEL"); } })), index.h("div", { class: "text text--primary text--medium message" }, this.message), this.confirm ?
36
- index.h("div", { class: "button-yes-no__container" }, index.h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick("N") }), index.h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick("S") }))
35
+ index.h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }), index.h("div", { class: "title title--label" }, index.h("h2", null, this.ezTitle))), index.h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit(false); } })), index.h("div", { class: "text text--primary text--medium message" }, this.message), this.confirm ?
36
+ index.h("div", { class: "button-yes-no__container" }, index.h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }), index.h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
37
37
  : undefined, !this.confirm ?
38
- index.h("div", { class: "button__ok--container" }, index.h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick("S") }))
38
+ index.h("div", { class: "button__ok--container" }, index.h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
39
39
  : undefined))));
40
40
  }
41
41
  return null;
@@ -25,9 +25,9 @@ let EzPopup = class {
25
25
  }
26
26
  render() {
27
27
  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.title ?
29
- index.h("div", { class: "title popup__title" }, this.title)
30
- : undefined, index.h("button", { class: this.title ? "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))))))));
28
+ return (index.h(index.Host, null, index.h("div", { class: "overlay" }, index.h("div", { class: "popup col " + this.size }, index.h("div", { class: "popup__container" }, index.h("div", { class: "popup__content" }, index.h("div", { class: "popup__header" }, this.ezTitle ?
29
+ 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))))))));
31
31
  }
32
32
  return null;
33
33
  }