@sankhyalabs/ezui 1.1.48 → 1.1.49
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.
- package/dist/cjs/ez-button_16.cjs.entry.js +17 -16
- package/dist/cjs/ez-dialog.cjs.entry.js +44 -8
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-dialog/ez-dialog.js +83 -16
- package/dist/collection/components/ez-upload/ez-upload.css +6 -1
- package/dist/collection/components/ez-upload/ez-upload.js +19 -11
- package/dist/collection/utils/Application.js +1 -7
- package/dist/custom-elements/index.js +62 -25
- package/dist/esm/ez-button_16.entry.js +17 -16
- package/dist/esm/ez-dialog.entry.js +45 -9
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-7d9ad9ce.entry.js +1 -0
- package/dist/ezui/{p-264022df.entry.js → p-83a25af0.entry.js} +1 -1
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +5 -1
- package/dist/types/components.d.ts +3 -2
- package/package.json +1 -1
- package/dist/ezui/p-1ff02df6.entry.js +0 -1
|
@@ -2158,13 +2158,7 @@ class Application {
|
|
|
2158
2158
|
dialog = document.createElement("ez-dialog");
|
|
2159
2159
|
window.document.body.appendChild(dialog);
|
|
2160
2160
|
}
|
|
2161
|
-
dialog.
|
|
2162
|
-
dialog.message = message;
|
|
2163
|
-
dialog.critical = critical;
|
|
2164
|
-
dialog.confirm = confirm;
|
|
2165
|
-
dialog.personalizedIconPath = icon;
|
|
2166
|
-
dialog.oppened = true;
|
|
2167
|
-
dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
|
|
2161
|
+
dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
|
|
2168
2162
|
});
|
|
2169
2163
|
}
|
|
2170
2164
|
static async alert(title, message, icon = null) {
|
|
@@ -3641,7 +3635,7 @@ class RemoteFile {
|
|
|
3641
3635
|
}
|
|
3642
3636
|
}
|
|
3643
3637
|
|
|
3644
|
-
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);
|
|
3638
|
+
const ezUploadCss = ":host{--iu--height:42px;--iu--width:100%;--iu__icon--width:48px;--iu__container--background-color:var(--background--medium, #d2dce9);--iu__color--primary:var(--color--primary, #008561);--iu--padding--extra-small:var(--space--extra-small, 3px);--iu--padding--small:var(--space--small, 6px);--iu--padding--medium:var(--space--medium, 12px);--iu--padding--large:var(--space--large, 24px);--iu--border-radius:var(--border--radius-medium, 12px);--iu__border--color:var(--color-strokes, #DCE0E8);--iu__input--border:var(--border--medium, 2px solid);--iu--text-shadow:var(--text-shadow, 0 0 0 #353535, 0 0 1px transparent);--iu--text--primary:var(--text-primary, #626e82);--iu--font-size:var(--text--medium, 14px);--iu--font-family:var(--font-pattern, Arial);--iu--font-weight:var(--text-weight--large, 500);--iu__btn-cancel-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"8x\" width=\"8px\"><path d=\"M 8,0.8 7.2,0 4,3.2 0.8,0 0,0.8 3.2,4 0,7.2 0.8,8 4,4.8 7.2,8 8,7.2 4.8,4 Z\"/></svg>');--iu__file-icon-image:url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" height=\"11x\" width=\"9px\"><path d=\"M 1.2272719,8.4999999 V 2.75 c 0,-1.1045695 1.4652499,-2 3.2727273,-2 1.8074777,0 3.2727281,0.8954305 3.2727281,2 V 8.9999999 C 7.7727273,9.690356 6.8569456,10.25 5.7272719,10.25 4.5975985,10.25 3.6818174,9.690356 3.6818174,8.9999999 V 3.75 c 0,-0.2761425 0.3663125,-0.5 0.8181818,-0.5 0.4518694,0 0.8181818,0.2238575 0.8181818,0.5 V 8.4999999 H 6.5454537 V 3.75 C 6.5454537,3.059644 5.6296725,2.5 4.4999992,2.5 3.3703258,2.5 2.4545446,3.059644 2.4545446,3.75 V 8.9999999 C 2.4545446,10.10457 3.9197945,11 5.7272719,11 7.5347496,11 9,10.10457 9,8.9999999 V 2.75 C 9,1.231217 6.9852809,0 4.4999992,0 2.0147181,5e-7 0,1.231217 0,2.75 v 5.7499999 z\"/></svg>');display:flex;flex-wrap:wrap;position:relative;font-family:var(--iu--font-family);font-size:var(--iu--font-size);width:var(--iu--width);font-weight:var(--iu--font-weight)}.iu{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:var(--iu--padding--small);width:100%;border-radius:12px;box-sizing:border-box}.iu__container{width:100%;display:flex;flex-wrap:wrap;justify-content:center;align-items:center;border:2px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.iu__footer{display:flex;flex-wrap:wrap;justify-content:flex-start;width:100%;padding:0 var(--iu--padding--medium) var(--iu--padding--medium) var(--iu--padding--medium);box-sizing:border-box}.iu__item{display:flex;width:100%;justify-content:flex-start;align-items:center;align-self:center;padding-bottom:var(--iu--padding--extra-small);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.iu__item-label{display:flex;max-width:80%;align-self:stretch;align-items:center}.file__name{font-weight:200}.box__content{width:100%;justify-content:center;align-items:center;height:100%;border:1px dashed var(--iu__border--color);border-radius:6px;box-sizing:border-box}.box__container{display:flex;flex-wrap:wrap;background-color:var(--iu__container--background-color);padding:6px;width:100%;border-radius:12px}a:-webkit-any-link{color:#008561;fill:#008561;cursor:pointer;text-decoration:none}progress[value]{display:flex;width:100%;appearance:none;border:1px solid var(--iu__border--color);height:12px;justify-content:flex-start;align-items:center;border-radius:3px;position:relative}progress[value]::-webkit-progress-bar{display:flex;-webkit-appearance:none;width:100%;background-color:rgb(255, 255, 255);border-radius:2px;padding:2px}progress[value]::-webkit-progress-value{display:flex;width:100%;background-color:var(--iu__color--primary)}.text--center{text-align:center}.align--middle{align-self:center;align-items:center}.text{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent}.text--primary{color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.text--ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.text--medium{font-size:14px}.text--small{font-size:12px}.btn-cancel{outline:none;border:none;background-color:unset;cursor:pointer}.btn-cancel::after{content:'';display:flex;background-color:var(--text--primary, #008561);width:8px;height:8px;-webkit-mask-image:var(--iu__btn-cancel-image);mask-image:var(--iu__btn-cancel-image)}.iu_header{display:flex;flex-direction:column;width:100%}.iu__label{padding:var(--space--small);box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-family:var(--iu--font-family);font-size:var(--text--extra-small);font-weight:var( --iu--font-weight);color:var(--iu--text--primary);text-shadow:var(--iu--text-shadow)}.iu__file-icon{outline:none;border:none;background-color:unset;cursor:pointer}.iu__file-icon:disabled{cursor:unset}.iu__file-icon::after{content:'';display:flex;background-color:var(--text--primary, #626e82);width:9px;height:11px;-webkit-mask-image:var(--iu__file-icon-image);mask-image:var(--iu__file-icon-image)}.iu__file-icon:disabled::after{background-color:var(--text--disable, #AFB6C0)}.iu__icon-label{justify-content:center;display:flex;cursor:pointer;padding:var(--iu--padding--large) 0px;box-sizing:border-box}.background--disabled{background-color:var(--color--disable-secondary, #F2F5F8)}.text--disabled{color:var(--text--disable, #AFB6C0)}.mouse-pointer--disabled{cursor:none}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
3645
3639
|
|
|
3646
3640
|
let EzUpload = class {
|
|
3647
3641
|
constructor(hostRef) {
|
|
@@ -3685,6 +3679,18 @@ let EzUpload = class {
|
|
|
3685
3679
|
}
|
|
3686
3680
|
}
|
|
3687
3681
|
async addFiles(files) {
|
|
3682
|
+
if (this.maxfiles > 0) {
|
|
3683
|
+
let countDistinctFiles = this._filePointers.size;
|
|
3684
|
+
files.forEach(file => {
|
|
3685
|
+
if (!this._filePointers.has(file.name)) {
|
|
3686
|
+
countDistinctFiles++;
|
|
3687
|
+
}
|
|
3688
|
+
});
|
|
3689
|
+
if (countDistinctFiles > this.maxfiles) {
|
|
3690
|
+
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
3691
|
+
return;
|
|
3692
|
+
}
|
|
3693
|
+
}
|
|
3688
3694
|
Array.prototype.forEach.call(files, this.addFile.bind(this));
|
|
3689
3695
|
}
|
|
3690
3696
|
async addFile(file) {
|
|
@@ -3743,7 +3749,7 @@ let EzUpload = class {
|
|
|
3743
3749
|
});
|
|
3744
3750
|
}
|
|
3745
3751
|
validateFile(file) {
|
|
3746
|
-
if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
|
|
3752
|
+
if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
|
|
3747
3753
|
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
3748
3754
|
return false;
|
|
3749
3755
|
}
|
|
@@ -3806,12 +3812,7 @@ let EzUpload = class {
|
|
|
3806
3812
|
}
|
|
3807
3813
|
openFilesDialog() {
|
|
3808
3814
|
if (this.enabled) {
|
|
3809
|
-
|
|
3810
|
-
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
3811
|
-
}
|
|
3812
|
-
else {
|
|
3813
|
-
this._fileInput.click();
|
|
3814
|
-
}
|
|
3815
|
+
this._fileInput.click();
|
|
3815
3816
|
}
|
|
3816
3817
|
}
|
|
3817
3818
|
componentDidLoad() {
|
|
@@ -3842,7 +3843,7 @@ let EzUpload = class {
|
|
|
3842
3843
|
mouse-poiter--disabled
|
|
3843
3844
|
*/
|
|
3844
3845
|
render() {
|
|
3845
|
-
return (index.h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, this.label ? index.h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, index.h("div", { class:
|
|
3846
|
+
return (index.h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') }, index.h("div", { class: "iu__container", onClick: () => this.openFilesDialog() }, index.h("div", { class: "iu_header" }, this.label ? index.h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null, index.h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') }, index.h("button", { class: "iu__file-icon", disabled: !this.enabled }), index.h("div", { class: this.evalDisabledClass('text text--center text--medium text--primary', 'text--disabled') }, this.enabled ? 'Arraste e solte ou clique para adicionar arquivos' : 'Somente leitura'))), this.buildFooter()), index.h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
|
|
3846
3847
|
}
|
|
3847
3848
|
buildFooter() {
|
|
3848
3849
|
if (this._filePointers.size === 0) {
|
|
@@ -6,6 +6,16 @@ const index = require('./index-0f668cc5.js');
|
|
|
6
6
|
|
|
7
7
|
const ezDialogCss = ":host{--dlg-title--primary:var(--title--primary, #2b3a54);--dlg-font-pattern:var(--font-pattern, \"'Sora', 'Algerian'\");--dlg-text-weight--large:var(--text-weight--large, 600);--dlg-space--small:var(--space--small, 6px);--dlg-space--medium:var(--space--medium, 12px);--dlg-space--large:var(--space--large, 24px);--dlg-critical--background-color:var(--color--alert-error-800, #BD0025);--dlg-warning--background-color:var(--color--alert-warning-500, #EFB103);--dlg-text-weight--medium:var(--text-weight--medium, 400);--dlg-text-shadow:var(--text-shadow, \"0 0 0 #353535, 0 0 1px transparent\");--dlg-text--medium:var(--text--medium, 14px);--dlg-text--primary:var(--text--primary, #626e82);--dlg-z-index:var(--most-visible, 3);--dlg--close__image:url('data:image/svg+xml;utf8,<svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" xmlns=\"http://www.w3.org/2000/svg%22%3E<path d=\"M 7.0060773,5.995511 11.461972,1.5397722 c 0.132856,-0.1328413 0.207547,-0.3130253 0.207547,-0.5009046 0,-0.18786999 -0.07469,-0.3680541 -0.207547,-0.5009048 -0.132857,-0.13284126 -0.31302,-0.20748126 -0.500927,-0.20748126 -0.187812,0 -0.36807,0.07464 -0.500926,0.20748126 L 6.0042244,4.9937015 1.5482921,0.5379628 C 1.4154357,0.40512154 1.2352533,0.33048154 1.0473657,0.33048154 c -0.18787813,0 -0.36807,0.07464 -0.50092647,0.20748126 -0.13285646,0.1328507 -0.20749026,0.31303481 -0.20749026,0.5009048 0,0.1878793 0.0746338,0.3680633 0.20749026,0.5009046 L 5.0023715,5.995511 0.54643923,10.452213 c -0.0676086,0.06534 -0.12151598,0.14352 -0.15859681,0.229916 -0.0370714,0.08639 -0.0565645,0.1794 -0.0573369,0.27335 -7.724e-4,0.09404 0.0171873,0.187331 0.0528423,0.274293 0.0356455,0.08705 0.0882688,0.166087 0.15479148,0.23256 0.0665321,0.06648 0.14562277,0.11897 0.2326735,0.154567 0.0870507,0.0356 0.18031463,0.05344 0.2743433,0.05259 0.094029,-8.5e-4 0.1869528,-0.02049 0.2733331,-0.0576 0.08639,-0.0372 0.1645078,-0.09121 0.2298029,-0.158817 L 6.0042244,6.9973204 10.460119,11.453078 c 0.132856,0.132851 0.313114,0.207444 0.500926,0.207444 0.187907,0 0.36807,-0.07459 0.500927,-0.207444 0.132856,-0.13285 0.207547,-0.313006 0.207547,-0.500904 0,-0.187898 -0.07469,-0.368054 -0.207547,-0.500905 z\"/></svg>');--dlg--warning__image:url('data: image/svg+xml;utf8,<svg width=\"15\" height=\"15\" viewBox=\"0 0 15 15\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.5,0 0,13 h 15 z m 0,2.73684 5.1341,8.89476 H 2.36591 Z M 6.81818,5.47368 V 8.21053 H 8.18182 V 5.47368 Z m 0,4.10527 V 10.9474 H 8.18182 V 9.57895\"/></svg>');--dlg--critical__image:url('data: image/svg+xml;utf8,<svg width=\"13\" height=\"13\" viewBox=\"0 0 13 13\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M 7.6534493,6.4948538 12.762051,1.3864299 C 12.914368,1.2341297 13,1.027552 13,0.81215179 13,0.59676225 12.914369,0.39018443 12.762051,0.23787352 12.609733,0.08557341 12.40318,0 12.187747,0 11.972425,0 11.765762,0.08557341 11.613445,0.23787352 L 6.5048431,5.3462975 1.3961977,0.23787352 C 1.2438802,0.08557341 1.0373043,0 0.82189458,0 0.60649572,0 0.39990901,0.08557341 0.24759147,0.23787352 0.09527396,0.39018443 0.00970766,0.59676225 0.00970766,0.81215179 c 0,0.21540021 0.0855663,0.42197791 0.23788381,0.57427811 L 5.3562369,6.4948538 0.24759147,11.604381 c -0.0775121,0.07492 -0.13931586,0.164543 -0.18182835,0.263595 -0.04250169,0.09905 -0.064850182,0.205678 -0.0657357237,0.313391 -8.8554258e-4,0.107813 0.0197049337,0.214771 0.0605827337,0.314472 0.04086693,0.0998 0.10119858,0.190415 0.17746563,0.266625 0.0762779,0.07622 0.16695386,0.136398 0.26675594,0.177208 0.099802,0.04082 0.20672745,0.06127 0.31452961,0.06029 0.1078025,-9.53e-4 0.21433799,-0.0235 0.31337139,-0.06604 0.099045,-0.04265 0.1886052,-0.104571 0.263465,-0.182081 L 6.5048431,7.6434102 11.613445,12.751855 c 0.152317,0.152312 0.35898,0.237831 0.574302,0.237831 0.215433,0 0.421986,-0.08552 0.574304,-0.237831 C 12.914368,12.599545 13,12.393 13,12.177578 13,11.962157 12.91437,11.75561 12.762051,11.603299 Z\"/></svg>')}h2{margin-block-start:0;margin-block-end:0;margin-inline-start:0px;margin-inline-end:0px}.overlay{position:fixed;display:flex;top:0px;z-index:var(--dlg-z-index);left:0px;width:100%;box-sizing:border-box;height:100vh;backdrop-filter:blur(4px);background:rgba(0, 4, 12, 0.4)}.dialog{display:flex;width:80%;position:absolute;top:50%;left:50%;margin-right:-50%;box-sizing:border-box;transform:translate(-50%, -50%);box-shadow:0px 0px 16px rgba(0, 38, 111, 0.122)}@media screen and (min-width: 768px){.dialog{width:50%}}@media screen and (min-width: 992px){.dialog{width:33.33333%}}.dialog__container{width:100%;background:#FFFF;color:var(--dlg-title--primary);border-radius:0px 6px 6px 0px;box-sizing:border-box;padding:var(--dlg-space--large)}.dialog__critical--indicator{box-sizing:border-box;width:12px;border-radius:6px 0px 0px 6px;background-color:var(--dlg-critical--background-color)}.dialog__warning--indicator{width:12px;border-radius:6px 0px 0px 6px;box-sizing:border-box;background-color:var(--dlg-warning--background-color)}.message{font-weight:var(--dlg-text-weight--medium);padding-bottom:var(--dlg-space--large);max-height:30vh;content-visibility:auto;margin-bottom:24px;overflow-y:auto}.title{display:flex;font-family:var(--dlg-font-pattern);margin:0;font-weight:var(--dlg-text-weight--large);line-height:1.3}.title--large{font-size:var(--dlg-title--large)}.title__container{display:flex;padding-bottom:var(--dlg-space--medium)}.title__box{display:flex;width:100%;align-items:center;align-self:center}.title--label{padding-left:var(--dlg-space--small)}.title-icon{outline:none;border:none;background-color:var(--dlg-warning--background-color);width:26px;height:26px;border-radius:100%;padding:0;display:flex;justify-content:center;align-items:center}.title-icon--critical{background-color:var(--dlg-critical--background-color)}.btn-close{justify-content:flex-end;align-self:flex-start;align-items:flex-start;display:flex;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:var(--dlg-title--primary);width:12px;height:12px;-webkit-mask-image:var(--dlg--close__image);mask-image:var(--dlg--close__image)}.title-icon::after{content:'';display:flex;background-color:#FFFF;width:15px;height:15px;-webkit-mask-image:var(--dlg--warning__image);mask-image:var(--dlg--warning__image)}.title-icon--critical::after{content:'';display:flex;background-color:#FFFF;width:13px;height:13px;-webkit-mask-image:var(--dlg--critical__image);mask-image:var(--dlg--critical__image)}.button-yes-no__container{display:flex;box-sizing:border-box;align-self:center;align-items:center;justify-content:flex-end}.button__no{padding-right:var(--dlg-space--large)}.button__ok--container{display:flex;justify-content:flex-end}.text{font-family:var(--dlg-font-pattern);text-shadow:var(--dlg-text-shadow)}.text--medium{font-size:var(--dlg-text--medium)}.text--primary{color:var(--dlg-text--primary);text-shadow:var(--dlg-text-shadow)}.iconePersonalizado{width:15px;height:15px}.row{width:100%;display:flex;flex-wrap:wrap}.col{display:flex;flex-wrap:wrap;align-self:flex-start;box-sizing:border-box}.col--stretch{align-self:stretch}.col--undefined{width:unset}.col--nowrap{flex-wrap:nowrap}@media screen and (min-width: 320px){.col--sd-1{width:8.33333%}.col--sd-2{width:16.66667%}.col--sd-3{width:25%}.col--sd-4{width:33.33333%}.col--sd-5{width:41.66667%}.col--sd-6{width:50%}.col--sd-7{width:58.33333%}.col--sd-8{width:66.66667%}.col--sd-9{width:75%}.col--sd-10{width:83.33333%}.col--sd-11{width:91.66667%}.col--sd-12{width:100%}}@media screen and (min-width: 480px){.col--pn-1{width:8.33333%}.col--pn-2{width:16.66667%}.col--pn-3{width:25%}.col--pn-4{width:33.33333%}.col--pn-5{width:41.66667%}.col--pn-6{width:50%}.col--pn-7{width:58.33333%}.col--pn-8{width:66.66667%}.col--pn-9{width:75%}.col--pn-10{width:83.33333%}.col--pn-11{width:91.66667%}.col--pn-12{width:100%}}@media screen and (min-width: 768px){.col--tb-1{width:8.33333%}.col--tb-2{width:16.66667%}.col--tb-3{width:25%}.col--tb-4{width:33.33333%}.col--tb-5{width:41.66667%}.col--tb-6{width:50%}.col--tb-7{width:58.33333%}.col--tb-8{width:66.66667%}.col--tb-9{width:75%}.col--tb-10{width:83.33333%}.col--tb-11{width:91.66667%}.col--tb-12{width:100%}}@media screen and (min-width: 992px){.col--md-1{width:8.33333%}.col--md-2{width:16.66667%}.col--md-3{width:25%}.col--md-4{width:33.33333%}.col--md-5{width:41.66667%}.col--md-6{width:50%}.col--md-7{width:58.33333%}.col--md-8{width:66.66667%}.col--md-9{width:75%}.col--md-10{width:83.33333%}.col--md-11{width:91.66667%}.col--md-12{width:100%}}@media screen and (min-width: 1200px){.col--ld-1{width:8.33333%}.col--ld-2{width:16.66667%}.col--ld-3{width:25%}.col--ld-4{width:33.33333%}.col--ld-5{width:41.66667%}.col--ld-6{width:50%}.col--ld-7{width:58.33333%}.col--ld-8{width:66.66667%}.col--ld-9{width:75%}.col--ld-10{width:83.33333%}.col--ld-11{width:91.66667%}.col--ld-12{width:100%}}";
|
|
8
8
|
|
|
9
|
+
class Message {
|
|
10
|
+
constructor(title, message, critical, confirm, icon, callBack) {
|
|
11
|
+
this.title = title;
|
|
12
|
+
this.message = message;
|
|
13
|
+
this.critical = critical;
|
|
14
|
+
this.confirm = confirm;
|
|
15
|
+
this.icon = icon;
|
|
16
|
+
this.callBack = callBack;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
9
19
|
let EzDialog = class {
|
|
10
20
|
constructor(hostRef) {
|
|
11
21
|
index.registerInstance(this, hostRef);
|
|
@@ -21,20 +31,46 @@ let EzDialog = class {
|
|
|
21
31
|
/**
|
|
22
32
|
* Controla a exibição do componente
|
|
23
33
|
*/
|
|
24
|
-
this.
|
|
34
|
+
this.opened = false;
|
|
35
|
+
this._messageQueue = [];
|
|
25
36
|
}
|
|
26
37
|
async handleButtonClick(selectedOption) {
|
|
27
|
-
this.
|
|
28
|
-
this.
|
|
38
|
+
this.opened = this._messageQueue.length > 0;
|
|
39
|
+
if (this._currentMessage.callBack) {
|
|
40
|
+
this._currentMessage.callBack(selectedOption);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.ezChange.emit(selectedOption);
|
|
44
|
+
}
|
|
45
|
+
this._currentMessage = this._messageQueue.shift();
|
|
46
|
+
index.forceUpdate(this);
|
|
47
|
+
}
|
|
48
|
+
async show(title, message, critical, confirm, icon) {
|
|
49
|
+
this.opened = true;
|
|
50
|
+
return new Promise(resolve => {
|
|
51
|
+
this._messageQueue.push(new Message(title, message, critical, confirm, icon, resolve));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
componentWillRender() {
|
|
55
|
+
if (!this._currentMessage) {
|
|
56
|
+
if (this._messageQueue.length > 0) {
|
|
57
|
+
this._currentMessage = this._messageQueue.pop();
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
if (this.opened) {
|
|
61
|
+
this._currentMessage = new Message(this.ezTitle, this.message, this.critical, this.confirm, this.personalizedIconPath, null);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
29
65
|
}
|
|
30
66
|
render() {
|
|
31
|
-
if (this.
|
|
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.
|
|
33
|
-
index.h("svg", { class: "iconePersonalizado", role: "img" }, index.h("use", { xlinkHref: this.
|
|
67
|
+
if (this.opened && this._currentMessage) {
|
|
68
|
+
return (index.h("div", { class: "overlay" }, index.h("div", { class: "dialog" }, index.h("div", { class: this._currentMessage.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._currentMessage.icon ?
|
|
69
|
+
index.h("svg", { class: "iconePersonalizado", role: "img" }, index.h("use", { xlinkHref: this._currentMessage.icon }))
|
|
34
70
|
:
|
|
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.
|
|
71
|
+
index.h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }), index.h("div", { class: "title title--label" }, index.h("h2", null, this._currentMessage.title))), index.h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })), index.h("div", { class: "text text--primary text--medium message" }, this._currentMessage.message), this._currentMessage.confirm ?
|
|
36
72
|
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
|
-
: undefined, !this.confirm ?
|
|
73
|
+
: undefined, !this._currentMessage.confirm ?
|
|
38
74
|
index.h("div", { class: "button__ok--container" }, index.h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
|
|
39
75
|
: undefined))));
|
|
40
76
|
}
|
package/dist/cjs/ezui.cjs.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"
|
|
18
|
+
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errormessage":[1537],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"strvalue":[1025],"value":[1026],"label":[513],"enabled":[516],"errormessage":[1537],"precision":[1538],"prettyprecision":[1538],"textleft":[516],"formatnumber":[513],"setFocus":[64],"setBlur":[64],"handleFocusout":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoclose":[516],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxwidth":[513],"isOpened":[1540,"is-opened"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16.cjs",[[0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"validate":[64],"getChanges":[64],"changeFieldValue":[64]}],[1,"form-metadata",{"name":[1],"label":[1],"dataunit":[1025],"many":[4],"autoload":[4],"metadata":[1040]}],[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}],[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errormessage":[1537],"optionloader":[16],"showselectedvalue":[4],"showoptionvalue":[4]}],[1,"ez-numeric-input",{"label":[513],"value":[1538],"enabled":[516],"errormessage":[1537],"precision":[8],"prettyprecision":[8]}],[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}],[1,"ez-collapsable-box",{"value":[1540],"label":[513],"showHide":[64]}],[1,"ez-tabselector",{"selectedindex":[1537],"selectedtab":[1537],"tabs":[1]}],[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"rows":[1538],"setFocus":[64],"setBlur":[64]}],[1,"ez-upload",{"label":[1],"enabled":[4],"maxfilesize":[2],"maxfiles":[2],"requestheaders":[8],"urlupload":[1],"urldelete":[1],"value":[1040],"addFiles":[64]}],[1,"place-holder"],[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513]}],[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errormessage":[1537],"searchmode":[4],"showselectedvalue":[4],"showoptionvalue":[4],"optionloader":[16],"_preSelection":[32],"_visibleOptions":[32]}],[1,"ez-calendar",{"value":[1040],"floating":[516],"show":[64],"fitVertical":[64],"hide":[64]}],[1,"ez-icon",{"size":[513],"href":[513]}],[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"onlynumber":[516],"mask":[1],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]]], options);
|
|
19
19
|
});
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"
|
|
17
|
+
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"opened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[64],"show":[64]}]]],["ez-label-chip.cjs",[[1,"ez-label-chip",{"label":[513],"enabled":[516],"removable":[516],"value":[1540],"setFocus":[64],"setBlur":[64]}]]],["ez-time-input.cjs",[[1,"ez-time-input",{"label":[513],"viewValue":[1537,"view-value"],"value":[1026],"enabled":[516],"errormessage":[1537],"showSeconds":[516,"show-seconds"],"setFocus":[64],"setBlur":[64]}]]],["ez-action-chip.cjs",[[1,"ez-action-chip",{"label":[513],"enabled":[516]}]]],["ez-modal.cjs",[[1,"ez-modal",{"modalsize":[1],"align":[1],"oppened":[4],"closeesc":[4],"closeoutsideclick":[4]}]]],["ez-number-input.cjs",[[1,"ez-number-input",{"strvalue":[1025],"value":[1026],"label":[513],"enabled":[516],"errormessage":[1537],"precision":[1538],"prettyprecision":[1538],"textleft":[516],"formatnumber":[513],"setFocus":[64],"setBlur":[64],"handleFocusout":[64]}]]],["ez-popover.cjs",[[1,"ez-popover",{"autoclose":[516],"top":[1537],"left":[1537],"bottom":[1537],"right":[1537],"boxwidth":[513],"isOpened":[1540,"is-opened"],"updatePosition":[64],"show":[64],"hide":[64]}]]],["ez-popup.cjs",[[1,"ez-popup",{"size":[1],"opened":[1540],"useHeader":[1540,"use-header"],"ezTitle":[1,"ez-title"]}]]],["ez-toast.cjs",[[1,"ez-toast",{"message":[1025],"fadeTime":[1026,"fade-time"],"useIcon":[1028,"use-icon"],"show":[64]}]]],["ez-button_16.cjs",[[0,"ez-form",{"metadataexecutor":[1],"loadexecutor":[1],"saveexecutor":[1],"removeexecutor":[1],"fieldsearchexecutor":[1],"ignoresavevalidation":[4],"metadata":[16],"slavemode":[4],"enabled":[4],"validate":[64],"getChanges":[64],"changeFieldValue":[64]}],[1,"form-metadata",{"name":[1],"label":[1],"dataunit":[1025],"many":[4],"autoload":[4],"metadata":[1040]}],[1,"ez-date-input",{"label":[513],"value":[1040],"enabled":[516],"errormessage":[1537]}],[1,"ez-search",{"value":[1537],"label":[1537],"enabled":[1540],"errormessage":[1537],"optionloader":[16],"showselectedvalue":[4],"showoptionvalue":[4]}],[1,"ez-numeric-input",{"label":[513],"value":[1538],"enabled":[516],"errormessage":[1537],"precision":[8],"prettyprecision":[8]}],[1,"ez-check",{"label":[513],"value":[1540],"enabled":[516],"mode":[513],"getMode":[64],"setFocus":[64]}],[1,"ez-collapsable-box",{"value":[1540],"label":[513],"showHide":[64]}],[1,"ez-tabselector",{"selectedindex":[1537],"selectedtab":[1537],"tabs":[1]}],[1,"ez-text-area",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"rows":[1538],"setFocus":[64],"setBlur":[64]}],[1,"ez-upload",{"label":[1],"enabled":[4],"maxfilesize":[2],"maxfiles":[2],"requestheaders":[8],"urlupload":[1],"urldelete":[1],"value":[1040],"addFiles":[64]}],[1,"place-holder"],[1,"ez-button",{"label":[513],"enabled":[516],"mode":[513],"image":[513]}],[1,"ez-combo-box",{"value":[1537],"label":[513],"enabled":[516],"options":[1040],"errormessage":[1537],"searchmode":[4],"showselectedvalue":[4],"showoptionvalue":[4],"optionloader":[16],"_preSelection":[32],"_visibleOptions":[32]}],[1,"ez-calendar",{"value":[1040],"floating":[516],"show":[64],"fitVertical":[64],"hide":[64]}],[1,"ez-icon",{"size":[513],"href":[513]}],[1,"ez-text-input",{"label":[513],"value":[1537],"enabled":[516],"loading":[516],"errormessage":[1537],"onlynumber":[516],"mask":[1],"restrict":[1],"setFocus":[64],"setBlur":[64]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { Component, h, Prop, Method, Event } from '@stencil/core';
|
|
1
|
+
import { Component, h, Prop, Method, Event, forceUpdate } from '@stencil/core';
|
|
2
|
+
class Message {
|
|
3
|
+
constructor(title, message, critical, confirm, icon, callBack) {
|
|
4
|
+
this.title = title;
|
|
5
|
+
this.message = message;
|
|
6
|
+
this.critical = critical;
|
|
7
|
+
this.confirm = confirm;
|
|
8
|
+
this.icon = icon;
|
|
9
|
+
this.callBack = callBack;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
2
12
|
export class EzDialog {
|
|
3
13
|
constructor() {
|
|
4
14
|
/**
|
|
@@ -12,35 +22,61 @@ export class EzDialog {
|
|
|
12
22
|
/**
|
|
13
23
|
* Controla a exibição do componente
|
|
14
24
|
*/
|
|
15
|
-
this.
|
|
25
|
+
this.opened = false;
|
|
26
|
+
this._messageQueue = [];
|
|
16
27
|
}
|
|
17
28
|
async handleButtonClick(selectedOption) {
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
29
|
+
this.opened = this._messageQueue.length > 0;
|
|
30
|
+
if (this._currentMessage.callBack) {
|
|
31
|
+
this._currentMessage.callBack(selectedOption);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.ezChange.emit(selectedOption);
|
|
35
|
+
}
|
|
36
|
+
this._currentMessage = this._messageQueue.shift();
|
|
37
|
+
forceUpdate(this);
|
|
38
|
+
}
|
|
39
|
+
async show(title, message, critical, confirm, icon) {
|
|
40
|
+
this.opened = true;
|
|
41
|
+
return new Promise(resolve => {
|
|
42
|
+
this._messageQueue.push(new Message(title, message, critical, confirm, icon, resolve));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
componentWillRender() {
|
|
46
|
+
if (!this._currentMessage) {
|
|
47
|
+
if (this._messageQueue.length > 0) {
|
|
48
|
+
this._currentMessage = this._messageQueue.pop();
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
if (this.opened) {
|
|
52
|
+
this._currentMessage = new Message(this.ezTitle, this.message, this.critical, this.confirm, this.personalizedIconPath, null);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
20
56
|
}
|
|
21
57
|
render() {
|
|
22
|
-
if (this.
|
|
58
|
+
if (this.opened && this._currentMessage) {
|
|
23
59
|
return (h("div", { class: "overlay" },
|
|
24
60
|
h("div", { class: "dialog" },
|
|
25
|
-
h("div", { class: this.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }),
|
|
61
|
+
h("div", { class: this._currentMessage.critical === true ? "dialog__critical--indicator" : "dialog__warning--indicator" }),
|
|
26
62
|
h("div", { class: "dialog__container" },
|
|
27
63
|
h("div", { class: "title__container" },
|
|
28
64
|
h("div", { class: "title__box" },
|
|
29
|
-
this.
|
|
65
|
+
this._currentMessage.icon ?
|
|
30
66
|
h("svg", { class: "iconePersonalizado", role: "img" },
|
|
31
|
-
h("use", { xlinkHref: this.
|
|
67
|
+
h("use", { xlinkHref: this._currentMessage.icon }))
|
|
32
68
|
:
|
|
33
|
-
h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }),
|
|
69
|
+
h("div", { class: this._currentMessage.critical ? "title-icon title-icon--critical" : "title-icon" }),
|
|
34
70
|
h("div", { class: "title title--label" },
|
|
35
|
-
h("h2", null, this.
|
|
36
|
-
h("button", { class: "btn-close", onClick: () =>
|
|
37
|
-
h("div", { class: "text text--primary text--medium message" }, this.message),
|
|
38
|
-
this.confirm ?
|
|
71
|
+
h("h2", null, this._currentMessage.title))),
|
|
72
|
+
h("button", { class: "btn-close", onClick: () => this.handleButtonClick(false) })),
|
|
73
|
+
h("div", { class: "text text--primary text--medium message" }, this._currentMessage.message),
|
|
74
|
+
this._currentMessage.confirm ?
|
|
39
75
|
h("div", { class: "button-yes-no__container" },
|
|
40
76
|
h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }),
|
|
41
77
|
h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
|
|
42
78
|
: undefined,
|
|
43
|
-
!this.confirm ?
|
|
79
|
+
!this._currentMessage.confirm ?
|
|
44
80
|
h("div", { class: "button__ok--container" },
|
|
45
81
|
h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
|
|
46
82
|
: undefined))));
|
|
@@ -109,7 +145,7 @@ export class EzDialog {
|
|
|
109
145
|
"attribute": "message",
|
|
110
146
|
"reflect": false
|
|
111
147
|
},
|
|
112
|
-
"
|
|
148
|
+
"opened": {
|
|
113
149
|
"type": "boolean",
|
|
114
150
|
"mutable": true,
|
|
115
151
|
"complexType": {
|
|
@@ -123,7 +159,7 @@ export class EzDialog {
|
|
|
123
159
|
"tags": [],
|
|
124
160
|
"text": "Controla a exibi\u00E7\u00E3o do componente"
|
|
125
161
|
},
|
|
126
|
-
"attribute": "
|
|
162
|
+
"attribute": "opened",
|
|
127
163
|
"reflect": true,
|
|
128
164
|
"defaultValue": "false"
|
|
129
165
|
},
|
|
@@ -197,6 +233,37 @@ export class EzDialog {
|
|
|
197
233
|
"text": "",
|
|
198
234
|
"tags": []
|
|
199
235
|
}
|
|
236
|
+
},
|
|
237
|
+
"show": {
|
|
238
|
+
"complexType": {
|
|
239
|
+
"signature": "(title: string, message: string, critical: boolean, confirm: boolean, icon: string) => Promise<boolean>",
|
|
240
|
+
"parameters": [{
|
|
241
|
+
"tags": [],
|
|
242
|
+
"text": ""
|
|
243
|
+
}, {
|
|
244
|
+
"tags": [],
|
|
245
|
+
"text": ""
|
|
246
|
+
}, {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": ""
|
|
249
|
+
}, {
|
|
250
|
+
"tags": [],
|
|
251
|
+
"text": ""
|
|
252
|
+
}, {
|
|
253
|
+
"tags": [],
|
|
254
|
+
"text": ""
|
|
255
|
+
}],
|
|
256
|
+
"references": {
|
|
257
|
+
"Promise": {
|
|
258
|
+
"location": "global"
|
|
259
|
+
}
|
|
260
|
+
},
|
|
261
|
+
"return": "Promise<boolean>"
|
|
262
|
+
},
|
|
263
|
+
"docs": {
|
|
264
|
+
"text": "",
|
|
265
|
+
"tags": []
|
|
266
|
+
}
|
|
200
267
|
}
|
|
201
268
|
}; }
|
|
202
269
|
}
|
|
@@ -203,9 +203,14 @@ progress[value]::-webkit-progress-value {
|
|
|
203
203
|
mask-image: var(--iu__btn-cancel-image);
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
.iu_header{
|
|
207
|
+
display: flex;
|
|
208
|
+
flex-direction: column;
|
|
209
|
+
width: 100%;
|
|
210
|
+
}
|
|
211
|
+
|
|
206
212
|
.iu__label{
|
|
207
213
|
padding: var(--space--small);
|
|
208
|
-
padding-top: 0;
|
|
209
214
|
box-sizing: border-box;
|
|
210
215
|
overflow: hidden;
|
|
211
216
|
text-overflow: ellipsis;
|
|
@@ -41,6 +41,18 @@ export class EzUpload {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
async addFiles(files) {
|
|
44
|
+
if (this.maxfiles > 0) {
|
|
45
|
+
let countDistinctFiles = this._filePointers.size;
|
|
46
|
+
files.forEach(file => {
|
|
47
|
+
if (!this._filePointers.has(file.name)) {
|
|
48
|
+
countDistinctFiles++;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (countDistinctFiles > this.maxfiles) {
|
|
52
|
+
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
44
56
|
Array.prototype.forEach.call(files, this.addFile.bind(this));
|
|
45
57
|
}
|
|
46
58
|
async addFile(file) {
|
|
@@ -99,7 +111,7 @@ export class EzUpload {
|
|
|
99
111
|
});
|
|
100
112
|
}
|
|
101
113
|
validateFile(file) {
|
|
102
|
-
if (this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
|
|
114
|
+
if (!this._filePointers.has(file.name) && this.maxfiles > 0 && this._filePointers.size >= this.maxfiles) {
|
|
103
115
|
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
104
116
|
return false;
|
|
105
117
|
}
|
|
@@ -162,12 +174,7 @@ export class EzUpload {
|
|
|
162
174
|
}
|
|
163
175
|
openFilesDialog() {
|
|
164
176
|
if (this.enabled) {
|
|
165
|
-
|
|
166
|
-
this.showError(`A quantidade máxima de arquivos é ${this.maxfiles}.`);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
this._fileInput.click();
|
|
170
|
-
}
|
|
177
|
+
this._fileInput.click();
|
|
171
178
|
}
|
|
172
179
|
}
|
|
173
180
|
componentDidLoad() {
|
|
@@ -199,11 +206,12 @@ export class EzUpload {
|
|
|
199
206
|
*/
|
|
200
207
|
render() {
|
|
201
208
|
return (h("div", { ref: (el) => this._dropZone = el, class: this.evalDisabledClass('iu', 'background--disabled') },
|
|
202
|
-
this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null,
|
|
203
209
|
h("div", { class: "iu__container", onClick: () => this.openFilesDialog() },
|
|
204
|
-
h("div", { class:
|
|
205
|
-
h("
|
|
206
|
-
h("div", { class: this.evalDisabledClass('
|
|
210
|
+
h("div", { class: "iu_header" },
|
|
211
|
+
this.label ? h("label", { class: this.evalDisabledClass('iu__label', 'text--disabled'), title: this.label }, this.label) : null,
|
|
212
|
+
h("div", { class: this.evalDisabledClass('iu__icon-label', 'mouse-pointer--disabled') },
|
|
213
|
+
h("button", { class: "iu__file-icon", disabled: !this.enabled }),
|
|
214
|
+
h("div", { class: this.evalDisabledClass('text text--center text--medium text--primary', 'text--disabled') }, this.enabled ? 'Arraste e solte ou clique para adicionar arquivos' : 'Somente leitura'))),
|
|
207
215
|
this.buildFooter()),
|
|
208
216
|
h("input", { ref: (el) => this._fileInput = el, onChange: (ev) => this.onFileInputChange(ev), type: "file", multiple: true, hidden: true })));
|
|
209
217
|
}
|
|
@@ -6,13 +6,7 @@ export default class Application {
|
|
|
6
6
|
dialog = document.createElement("ez-dialog");
|
|
7
7
|
window.document.body.appendChild(dialog);
|
|
8
8
|
}
|
|
9
|
-
dialog.
|
|
10
|
-
dialog.message = message;
|
|
11
|
-
dialog.critical = critical;
|
|
12
|
-
dialog.confirm = confirm;
|
|
13
|
-
dialog.personalizedIconPath = icon;
|
|
14
|
-
dialog.oppened = true;
|
|
15
|
-
dialog.addEventListener("ezChange", (evt) => resolve(evt.detail));
|
|
9
|
+
dialog.show(title, message, critical, confirm, icon).then(ok => resolve(ok));
|
|
16
10
|
});
|
|
17
11
|
}
|
|
18
12
|
static async alert(title, message, icon = null) {
|