@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.
- package/dist/cjs/ez-button_16.cjs.entry.js +305 -201
- package/dist/cjs/ez-dialog.cjs.entry.js +4 -4
- package/dist/cjs/ez-popup.cjs.entry.js +3 -3
- package/dist/cjs/ez-toast.cjs.entry.js +37 -0
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/ez-dialog/ez-dialog.js +16 -12
- package/dist/collection/components/ez-form/assets/trash-can-outline.svg +3 -0
- package/dist/collection/components/ez-form/ez-form.js +1 -0
- package/dist/collection/components/ez-form/subcomponents/DataUnit.js +2 -1
- package/dist/collection/components/ez-form/subcomponents/form-metadata.js +1 -5
- package/dist/collection/components/ez-form/subcomponents/structure/Field.js +2 -3
- package/dist/collection/components/ez-form/subcomponents/structure/NavigationBar.js +6 -3
- package/dist/collection/components/ez-popup/ez-popup.js +5 -5
- package/dist/collection/components/ez-toast/ez-toast.css +108 -0
- package/dist/collection/components/ez-toast/ez-toast.js +113 -0
- package/dist/collection/components/ez-upload/RemoteFile.js +89 -0
- package/dist/collection/components/ez-upload/ez-upload.css +23 -3
- package/dist/collection/components/ez-upload/ez-upload.js +257 -297
- package/dist/collection/utils/Application.js +34 -0
- package/dist/custom-elements/index.d.ts +6 -0
- package/dist/custom-elements/index.js +350 -212
- package/dist/esm/ez-button_16.entry.js +305 -201
- package/dist/esm/ez-dialog.entry.js +4 -4
- package/dist/esm/ez-popup.entry.js +3 -3
- package/dist/esm/ez-toast.entry.js +33 -0
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/assets/trash-can-outline.svg +3 -0
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-1ff02df6.entry.js +1 -0
- package/dist/ezui/p-4a87d740.entry.js +1 -0
- package/dist/ezui/p-c12beec1.entry.js +1 -0
- package/dist/ezui/p-c3b18332.entry.js +1 -0
- package/dist/types/components/ez-dialog/ez-dialog.d.ts +3 -3
- package/dist/types/components/ez-popup/ez-popup.d.ts +1 -1
- package/dist/types/components/ez-toast/ez-toast.d.ts +17 -0
- package/dist/types/components/ez-upload/RemoteFile.d.ts +14 -0
- package/dist/types/components/ez-upload/ez-upload.d.ts +51 -57
- package/dist/types/components.d.ts +91 -57
- package/dist/types/utils/Application.d.ts +6 -0
- package/package.json +2 -2
- package/react/components.d.ts +1 -0
- package/react/components.js +1 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-40fe4f51.entry.js +0 -1
- package/dist/ezui/p-c7cee3ae.entry.js +0 -1
- package/dist/ezui/p-caa50ec5.entry.js +0 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-0f668cc5.js');
|
|
6
|
+
|
|
7
|
+
const ezToastCss = ":host{--toast-z-index:var(--more-visible, 2);--toast-color--secondary:var(--color--secondary, #383c45);--toast-title--primary:var(--title--primary, #2b3a54);--toast-space--small:var(--space--small, 6px);--toast--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>')}.toast__container{position:fixed;display:flex;bottom:100px;z-index:var(--toast-z-index);left:100px;width:30%;box-sizing:border-box;background-color:var(--toast-color--secondary);border-radius:6px;align-items:center;padding:12px;visibility:hidden}.message__container{font-family:\"Sora\", \"Algerian\";text-shadow:0 0 0 #353535, 0 0 1px transparent;color:#FFFFFF;font-size:14px;width:90%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.message__conteiner--icon{padding-left:var(--toast-space--small);width:80%}.btn-close{display:flex;justify-content:flex-end;padding:0;outline:none;width:10%;border:none;background-color:unset;cursor:pointer}.btn-close::after{content:'';display:flex;background-color:#FFFFFF;width:12px;height:12px;-webkit-mask-image:var(--toast--close__image);mask-image:var(--toast--close__image)}.toast__container--oppened{animation:fadein 0.5s, fadeout 0.5s 3s;visibility:visible}@-webkit-keyframes fadein{from{left:-100px;opacity:0}to{left:100px;opacity:1}}@keyframes fadein{from{left:-100px;opacity:0}to{left:100px;opacity:1}}@-webkit-keyframes fadeout{from{left:100px;opacity:1}to{bottom:0;opacity:0}}@keyframes fadeout{from{left:100px;opacity:1}to{bottom:0;opacity:0}}";
|
|
8
|
+
|
|
9
|
+
let EzToast = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
/**
|
|
13
|
+
* Controla o tempo de exibição do componente em milissegundos.
|
|
14
|
+
*/
|
|
15
|
+
this.fadeTime = 5000;
|
|
16
|
+
/**
|
|
17
|
+
* Adiciona ícone de check no componente.
|
|
18
|
+
*/
|
|
19
|
+
this.useIcon = false;
|
|
20
|
+
}
|
|
21
|
+
async show() {
|
|
22
|
+
this.container.classList.add("toast__container--oppened");
|
|
23
|
+
this.container.style.animation = `fadein 0.5s, fadeout 0.5s ${this.fadeTime / 1000}s`;
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
this.container.classList.remove("toast__container--oppened");
|
|
26
|
+
this.container.style.animation = `none`;
|
|
27
|
+
}, this.fadeTime + 400);
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
return (index.h("div", { ref: (el) => this.container = el, class: "toast__container" }, this.useIcon ?
|
|
31
|
+
index.h("slot", { name: "icon" })
|
|
32
|
+
: undefined, index.h("div", { class: this.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this.message }, " ", this.message, " "), index.h("button", { class: "btn-close", onClick: () => { this.container.classList.remove("toast__container--oppened"); this.container.style.animation = `none`; } })));
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
EzToast.style = ezToastCss;
|
|
36
|
+
|
|
37
|
+
exports.ez_toast = EzToast;
|
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],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"
|
|
18
|
+
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[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],"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],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"
|
|
17
|
+
return index.bootstrapLazy([["ez-dialog.cjs",[[1,"ez-dialog",{"confirm":[1028],"critical":[1028],"message":[1025],"oppened":[1540],"personalizedIconPath":[1025,"personalized-icon-path"],"ezTitle":[1025,"ez-title"],"handleButtonClick":[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],"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
|
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"./components/ez-tabselector/ez-tabselector.js",
|
|
24
24
|
"./components/ez-text-area/ez-text-area.js",
|
|
25
25
|
"./components/ez-text-input/ez-text-input.js",
|
|
26
|
-
"./components/ez-time-input/ez-time-input.js"
|
|
26
|
+
"./components/ez-time-input/ez-time-input.js",
|
|
27
|
+
"./components/ez-toast/ez-toast.js"
|
|
27
28
|
],
|
|
28
29
|
"compiler": {
|
|
29
30
|
"name": "@stencil/core",
|
|
@@ -14,7 +14,7 @@ export class EzDialog {
|
|
|
14
14
|
*/
|
|
15
15
|
this.oppened = false;
|
|
16
16
|
}
|
|
17
|
-
handleButtonClick(selectedOption) {
|
|
17
|
+
async handleButtonClick(selectedOption) {
|
|
18
18
|
this.oppened = false;
|
|
19
19
|
this.ezChange.emit(selectedOption);
|
|
20
20
|
}
|
|
@@ -32,17 +32,17 @@ export class EzDialog {
|
|
|
32
32
|
:
|
|
33
33
|
h("div", { class: this.critical ? "title-icon title-icon--critical" : "title-icon" }),
|
|
34
34
|
h("div", { class: "title title--label" },
|
|
35
|
-
h("h2", null, this.
|
|
36
|
-
h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit(
|
|
35
|
+
h("h2", null, this.ezTitle))),
|
|
36
|
+
h("button", { class: "btn-close", onClick: () => { this.oppened = false; this.ezChange.emit(false); } })),
|
|
37
37
|
h("div", { class: "text text--primary text--medium message" }, this.message),
|
|
38
38
|
this.confirm ?
|
|
39
39
|
h("div", { class: "button-yes-no__container" },
|
|
40
|
-
h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(
|
|
41
|
-
h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(
|
|
40
|
+
h("ez-button", { class: "button__no", mode: "link", label: "N\u00E3o", onClick: () => this.handleButtonClick(false) }),
|
|
41
|
+
h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
|
|
42
42
|
: undefined,
|
|
43
43
|
!this.confirm ?
|
|
44
44
|
h("div", { class: "button__ok--container" },
|
|
45
|
-
h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(
|
|
45
|
+
h("ez-button", { label: "Ok", onClick: () => this.handleButtonClick(true) }))
|
|
46
46
|
: undefined))));
|
|
47
47
|
}
|
|
48
48
|
return null;
|
|
@@ -144,7 +144,7 @@ export class EzDialog {
|
|
|
144
144
|
"attribute": "personalized-icon-path",
|
|
145
145
|
"reflect": false
|
|
146
146
|
},
|
|
147
|
-
"
|
|
147
|
+
"ezTitle": {
|
|
148
148
|
"type": "string",
|
|
149
149
|
"mutable": true,
|
|
150
150
|
"complexType": {
|
|
@@ -158,7 +158,7 @@ export class EzDialog {
|
|
|
158
158
|
"tags": [],
|
|
159
159
|
"text": "Define o t\u00EDtulo do componente."
|
|
160
160
|
},
|
|
161
|
-
"attribute": "title",
|
|
161
|
+
"attribute": "ez-title",
|
|
162
162
|
"reflect": false
|
|
163
163
|
}
|
|
164
164
|
}; }
|
|
@@ -173,20 +173,24 @@ export class EzDialog {
|
|
|
173
173
|
"text": "Evento disparado ao clicar em algum dos bot\u00F5es de confirma\u00E7\u00E3o."
|
|
174
174
|
},
|
|
175
175
|
"complexType": {
|
|
176
|
-
"original": "
|
|
177
|
-
"resolved": "
|
|
176
|
+
"original": "boolean",
|
|
177
|
+
"resolved": "boolean",
|
|
178
178
|
"references": {}
|
|
179
179
|
}
|
|
180
180
|
}]; }
|
|
181
181
|
static get methods() { return {
|
|
182
182
|
"handleButtonClick": {
|
|
183
183
|
"complexType": {
|
|
184
|
-
"signature": "(selectedOption:
|
|
184
|
+
"signature": "(selectedOption: boolean) => Promise<void>",
|
|
185
185
|
"parameters": [{
|
|
186
186
|
"tags": [],
|
|
187
187
|
"text": ""
|
|
188
188
|
}],
|
|
189
|
-
"references": {
|
|
189
|
+
"references": {
|
|
190
|
+
"Promise": {
|
|
191
|
+
"location": "global"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
190
194
|
"return": "Promise<void>"
|
|
191
195
|
},
|
|
192
196
|
"docs": {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="11" height="12" viewBox="0 0 11 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M3.333 0V0.667H0V2H0.667V10.667C0.667 11.0205 0.80744 11.3596 1.05743 11.6096C1.30741 11.8596 1.64647 12 2 12H8.667C9.02053 12 9.35959 11.8596 9.60957 11.6096C9.85956 11.3596 10 11.0205 10 10.667V2H10.667V0.667H7.333V0H3.333ZM2 2H8.667V10.667H2V2ZM3.333 3.333V9.333H4.667V3.333H3.333ZM6 3.333V9.333H7.333V3.333H6Z" fill="white"/>
|
|
3
|
+
</svg>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { changeFieldValue, changesSaved, clearEdition, dataLoaded, dataLoading, insertRecord, nextRecord, previousRecord, recordRemoved, removingRecord, savingChanges } from '../store/Form.actions';
|
|
2
2
|
import { selectRecordChanges, selectCurrentRecordIndex, selectLoadingData, selectNewRecordIndex, selectDataUnitChanges, selectErrorMessage } from '../store/Form.selectors';
|
|
3
|
+
import Application from '../../../utils/Application';
|
|
3
4
|
export default class DataUnit {
|
|
4
5
|
constructor(name, unitLabel, cardinality = '1', parentDU = null) {
|
|
5
6
|
this.name = name;
|
|
@@ -276,7 +277,7 @@ export default class DataUnit {
|
|
|
276
277
|
});
|
|
277
278
|
const result = this.recordsValidator.validateRecords(this, recordsToValidate, triggedBy);
|
|
278
279
|
if (result.message) {
|
|
279
|
-
|
|
280
|
+
Application.info(result.message);
|
|
280
281
|
}
|
|
281
282
|
return result.isValid;
|
|
282
283
|
}
|
|
@@ -19,11 +19,6 @@ export class FormMetadata {
|
|
|
19
19
|
properties.push({ name: "options", value: JSON.stringify(objOpts) });
|
|
20
20
|
}
|
|
21
21
|
else if (userInterface === "FILE") {
|
|
22
|
-
/*<URL>http://localhost:8080/2a3skw-graphql/uploadFiles</URL>
|
|
23
|
-
<HEADERS>
|
|
24
|
-
<HEADER NAME="Authorization">dsfs</HEADER>
|
|
25
|
-
</HEADER>
|
|
26
|
-
</field> */
|
|
27
22
|
const urlElement = element.querySelector('URL');
|
|
28
23
|
const headersElement = element.querySelectorAll('HEADERS>HEADER');
|
|
29
24
|
if (urlElement) {
|
|
@@ -36,6 +31,7 @@ export class FormMetadata {
|
|
|
36
31
|
});
|
|
37
32
|
properties.push({ name: "HEADERS", value: JSON.stringify(headers) });
|
|
38
33
|
}
|
|
34
|
+
this.addPropertyIfExists(properties, element, "maxfiles");
|
|
39
35
|
}
|
|
40
36
|
else {
|
|
41
37
|
if (!label) {
|
|
@@ -67,10 +67,9 @@ export const Field = ({ dataUnit, field, forceScroll, enabled }) => {
|
|
|
67
67
|
const target = getProp(properties, 'URL');
|
|
68
68
|
const strHeaders = getProp(properties, 'HEADERS');
|
|
69
69
|
const headers = strHeaders ? JSON.parse(strHeaders) : {};
|
|
70
|
+
const maxfiles = Number(getProp(properties, "maxfiles") || 0);
|
|
70
71
|
return (h("div", { class: "col col--sd-12 padding--small" },
|
|
71
|
-
h("ez-upload", { onEzChange: (event) =>
|
|
72
|
-
changeFieldHandler(event.target['value']);
|
|
73
|
-
}, target: target, headers: headers, value: value })));
|
|
72
|
+
h("ez-upload", { value: value, label: formattedLabel, enabled: isEnabled, onEzChange: (event) => changeFieldHandler(event.detail), urlupload: target, requestheaders: headers, maxfiles: maxfiles })));
|
|
74
73
|
case 'DATE':
|
|
75
74
|
return h("div", { class: "col col--sd-12 col--tb-3 padding--small" }, loadingData ? h("place-holder", null) :
|
|
76
75
|
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 }));
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
+
import Application from "../../../../utils/Application";
|
|
2
3
|
function removeHandler(dataUnit) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Application.confirm("Exclusão de registro", "Tem certeza que deseja Remover?", null, true).then(ok => {
|
|
5
|
+
if (ok) {
|
|
6
|
+
dataUnit.remove();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
6
9
|
}
|
|
7
10
|
export const NavigationBar = ({ dataUnit: du, buttonProps, enabled }) => {
|
|
8
11
|
if (buttonProps.previousVisible
|
|
@@ -22,10 +22,10 @@ export class EzPopup {
|
|
|
22
22
|
h("div", { class: "popup__container" },
|
|
23
23
|
h("div", { class: "popup__content" },
|
|
24
24
|
h("div", { class: "popup__header" },
|
|
25
|
-
this.
|
|
26
|
-
h("div", { class: "title popup__title" }, this.
|
|
25
|
+
this.ezTitle ?
|
|
26
|
+
h("div", { class: "title popup__title" }, this.ezTitle)
|
|
27
27
|
: undefined,
|
|
28
|
-
h("button", { class: this.
|
|
28
|
+
h("button", { class: this.ezTitle ? "btn-close" : "btn-close btn-close--solo", onClick: () => { this.opened = false; this.ezChange.emit("CANCEL"); } })),
|
|
29
29
|
h("div", { class: "popup__expandable-content" },
|
|
30
30
|
h("slot", null))))))));
|
|
31
31
|
}
|
|
@@ -94,7 +94,7 @@ export class EzPopup {
|
|
|
94
94
|
"reflect": true,
|
|
95
95
|
"defaultValue": "false"
|
|
96
96
|
},
|
|
97
|
-
"
|
|
97
|
+
"ezTitle": {
|
|
98
98
|
"type": "string",
|
|
99
99
|
"mutable": false,
|
|
100
100
|
"complexType": {
|
|
@@ -108,7 +108,7 @@ export class EzPopup {
|
|
|
108
108
|
"tags": [],
|
|
109
109
|
"text": "Define se o t\u00EDtulo do componente."
|
|
110
110
|
},
|
|
111
|
-
"attribute": "title",
|
|
111
|
+
"attribute": "ez-title",
|
|
112
112
|
"reflect": false
|
|
113
113
|
}
|
|
114
114
|
}; }
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
--toast-z-index: var(--more-visible, 2);
|
|
3
|
+
--toast-color--secondary: var(--color--secondary, #383c45);
|
|
4
|
+
--toast-title--primary: var(--title--primary, #2b3a54);
|
|
5
|
+
--toast-space--small: var(--space--small, 6px);
|
|
6
|
+
--toast--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>');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.toast__container {
|
|
10
|
+
position: fixed;
|
|
11
|
+
display: flex;
|
|
12
|
+
bottom: 100px;
|
|
13
|
+
z-index: var(--toast-z-index);
|
|
14
|
+
left: 100px;
|
|
15
|
+
width: 30%;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
background-color: var(--toast-color--secondary);
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
align-items: center;
|
|
20
|
+
padding: 12px;
|
|
21
|
+
visibility: hidden;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.message__container {
|
|
25
|
+
font-family: "Sora", "Algerian";
|
|
26
|
+
text-shadow: 0 0 0 #353535, 0 0 1px transparent;
|
|
27
|
+
color: #FFFFFF;
|
|
28
|
+
font-size: 14px;
|
|
29
|
+
width: 90%;
|
|
30
|
+
overflow: hidden;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
text-overflow: ellipsis;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.message__conteiner--icon {
|
|
36
|
+
padding-left: var(--toast-space--small);
|
|
37
|
+
width: 80%;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.btn-close {
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: flex-end;
|
|
43
|
+
padding: 0;
|
|
44
|
+
outline: none;
|
|
45
|
+
width: 10%;
|
|
46
|
+
border: none;
|
|
47
|
+
background-color: unset;
|
|
48
|
+
cursor: pointer;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.btn-close::after {
|
|
52
|
+
content: '';
|
|
53
|
+
display: flex;
|
|
54
|
+
background-color: #FFFFFF;
|
|
55
|
+
width: 12px;
|
|
56
|
+
height: 12px;
|
|
57
|
+
-webkit-mask-image: var(--toast--close__image);
|
|
58
|
+
mask-image: var(--toast--close__image);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.toast__container--oppened {
|
|
62
|
+
animation: fadein 0.5s, fadeout 0.5s 3s;
|
|
63
|
+
visibility: visible;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
@-webkit-keyframes fadein {
|
|
67
|
+
from {
|
|
68
|
+
left: -100px;
|
|
69
|
+
opacity: 0;
|
|
70
|
+
}
|
|
71
|
+
to {
|
|
72
|
+
left: 100px;
|
|
73
|
+
opacity: 1;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@keyframes fadein {
|
|
78
|
+
from {
|
|
79
|
+
left: -100px;
|
|
80
|
+
opacity: 0;
|
|
81
|
+
}
|
|
82
|
+
to {
|
|
83
|
+
left: 100px;
|
|
84
|
+
opacity: 1;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@-webkit-keyframes fadeout {
|
|
89
|
+
from {
|
|
90
|
+
left: 100px;
|
|
91
|
+
opacity: 1;
|
|
92
|
+
}
|
|
93
|
+
to {
|
|
94
|
+
bottom: 0;
|
|
95
|
+
opacity: 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
@keyframes fadeout {
|
|
100
|
+
from {
|
|
101
|
+
left: 100px;
|
|
102
|
+
opacity: 1;
|
|
103
|
+
}
|
|
104
|
+
to {
|
|
105
|
+
bottom: 0;
|
|
106
|
+
opacity: 0;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Component, h, Prop, Method } from '@stencil/core';
|
|
2
|
+
export class EzToast {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Controla o tempo de exibição do componente em milissegundos.
|
|
6
|
+
*/
|
|
7
|
+
this.fadeTime = 5000;
|
|
8
|
+
/**
|
|
9
|
+
* Adiciona ícone de check no componente.
|
|
10
|
+
*/
|
|
11
|
+
this.useIcon = false;
|
|
12
|
+
}
|
|
13
|
+
async show() {
|
|
14
|
+
this.container.classList.add("toast__container--oppened");
|
|
15
|
+
this.container.style.animation = `fadein 0.5s, fadeout 0.5s ${this.fadeTime / 1000}s`;
|
|
16
|
+
setTimeout(() => {
|
|
17
|
+
this.container.classList.remove("toast__container--oppened");
|
|
18
|
+
this.container.style.animation = `none`;
|
|
19
|
+
}, this.fadeTime + 400);
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return (h("div", { ref: (el) => this.container = el, class: "toast__container" },
|
|
23
|
+
this.useIcon ?
|
|
24
|
+
h("slot", { name: "icon" })
|
|
25
|
+
: undefined,
|
|
26
|
+
h("div", { class: this.useIcon ? "message__container message__conteiner--icon" : "message__container", title: this.message },
|
|
27
|
+
" ",
|
|
28
|
+
this.message,
|
|
29
|
+
" "),
|
|
30
|
+
h("button", { class: "btn-close", onClick: () => { this.container.classList.remove("toast__container--oppened"); this.container.style.animation = `none`; } })));
|
|
31
|
+
}
|
|
32
|
+
static get is() { return "ez-toast"; }
|
|
33
|
+
static get encapsulation() { return "shadow"; }
|
|
34
|
+
static get originalStyleUrls() { return {
|
|
35
|
+
"$": ["ez-toast.css"]
|
|
36
|
+
}; }
|
|
37
|
+
static get styleUrls() { return {
|
|
38
|
+
"$": ["ez-toast.css"]
|
|
39
|
+
}; }
|
|
40
|
+
static get properties() { return {
|
|
41
|
+
"message": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"mutable": true,
|
|
44
|
+
"complexType": {
|
|
45
|
+
"original": "string",
|
|
46
|
+
"resolved": "string",
|
|
47
|
+
"references": {}
|
|
48
|
+
},
|
|
49
|
+
"required": false,
|
|
50
|
+
"optional": false,
|
|
51
|
+
"docs": {
|
|
52
|
+
"tags": [],
|
|
53
|
+
"text": "Mensagem exibida no componente."
|
|
54
|
+
},
|
|
55
|
+
"attribute": "message",
|
|
56
|
+
"reflect": false
|
|
57
|
+
},
|
|
58
|
+
"fadeTime": {
|
|
59
|
+
"type": "number",
|
|
60
|
+
"mutable": true,
|
|
61
|
+
"complexType": {
|
|
62
|
+
"original": "number",
|
|
63
|
+
"resolved": "number",
|
|
64
|
+
"references": {}
|
|
65
|
+
},
|
|
66
|
+
"required": false,
|
|
67
|
+
"optional": false,
|
|
68
|
+
"docs": {
|
|
69
|
+
"tags": [],
|
|
70
|
+
"text": "Controla o tempo de exibi\u00E7\u00E3o do componente em milissegundos."
|
|
71
|
+
},
|
|
72
|
+
"attribute": "fade-time",
|
|
73
|
+
"reflect": false,
|
|
74
|
+
"defaultValue": "5000"
|
|
75
|
+
},
|
|
76
|
+
"useIcon": {
|
|
77
|
+
"type": "boolean",
|
|
78
|
+
"mutable": true,
|
|
79
|
+
"complexType": {
|
|
80
|
+
"original": "boolean",
|
|
81
|
+
"resolved": "boolean",
|
|
82
|
+
"references": {}
|
|
83
|
+
},
|
|
84
|
+
"required": false,
|
|
85
|
+
"optional": false,
|
|
86
|
+
"docs": {
|
|
87
|
+
"tags": [],
|
|
88
|
+
"text": "Adiciona \u00EDcone de check no componente."
|
|
89
|
+
},
|
|
90
|
+
"attribute": "use-icon",
|
|
91
|
+
"reflect": false,
|
|
92
|
+
"defaultValue": "false"
|
|
93
|
+
}
|
|
94
|
+
}; }
|
|
95
|
+
static get methods() { return {
|
|
96
|
+
"show": {
|
|
97
|
+
"complexType": {
|
|
98
|
+
"signature": "() => Promise<void>",
|
|
99
|
+
"parameters": [],
|
|
100
|
+
"references": {
|
|
101
|
+
"Promise": {
|
|
102
|
+
"location": "global"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"return": "Promise<void>"
|
|
106
|
+
},
|
|
107
|
+
"docs": {
|
|
108
|
+
"text": "",
|
|
109
|
+
"tags": []
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}; }
|
|
113
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
export default class RemoteFile {
|
|
2
|
+
constructor(file) {
|
|
3
|
+
this.file = file;
|
|
4
|
+
this.size = file.size;
|
|
5
|
+
this.name = file.name;
|
|
6
|
+
}
|
|
7
|
+
abortUpload() {
|
|
8
|
+
if (this._uploadingXhr) {
|
|
9
|
+
this._aborted = true;
|
|
10
|
+
this._uploadingXhr.abort();
|
|
11
|
+
this._uploadingXhr = undefined;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
isUploading() {
|
|
15
|
+
return this._uploadingXhr !== undefined;
|
|
16
|
+
}
|
|
17
|
+
async upload(server, headers, updateCallBack) {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
const xhr = new XMLHttpRequest();
|
|
20
|
+
this._uploadingXhr = xhr;
|
|
21
|
+
this._aborted = false;
|
|
22
|
+
this.progress = 0;
|
|
23
|
+
xhr.upload.onprogress = (e) => {
|
|
24
|
+
const loaded = e.loaded;
|
|
25
|
+
const total = e.total;
|
|
26
|
+
this.progress = ~~((loaded / total) * 100);
|
|
27
|
+
updateCallBack(this, loaded, total);
|
|
28
|
+
};
|
|
29
|
+
xhr.onreadystatechange = () => {
|
|
30
|
+
if (xhr.readyState == 4) {
|
|
31
|
+
this._uploadingXhr = undefined;
|
|
32
|
+
const status = xhr.status;
|
|
33
|
+
if (!this._aborted) {
|
|
34
|
+
if (status === 0) {
|
|
35
|
+
reject("Servidor indisponível");
|
|
36
|
+
}
|
|
37
|
+
else if (status >= 500) {
|
|
38
|
+
reject("Erro inesperado no servidor");
|
|
39
|
+
}
|
|
40
|
+
else if (status >= 400) {
|
|
41
|
+
reject("Operação não permitida");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const response = xhr.response;
|
|
45
|
+
if (response) {
|
|
46
|
+
resolve(JSON.parse(response));
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
xhr.ontimeout = () => {
|
|
51
|
+
reject("Tempo limite de transferência atingido.");
|
|
52
|
+
};
|
|
53
|
+
const formData = new FormData();
|
|
54
|
+
formData.append("ARQUIVO", this.file, this.file.name);
|
|
55
|
+
xhr.open("POST", server, true);
|
|
56
|
+
if (headers) {
|
|
57
|
+
headers.forEach((value, key) => xhr.setRequestHeader(key, value));
|
|
58
|
+
}
|
|
59
|
+
xhr.send(formData);
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async delete(item, server, headers) {
|
|
63
|
+
return new Promise((resolve, reject) => {
|
|
64
|
+
const xhr = new XMLHttpRequest();
|
|
65
|
+
xhr.onreadystatechange = () => {
|
|
66
|
+
if (xhr.readyState == 4) {
|
|
67
|
+
if (xhr.status === 0) {
|
|
68
|
+
reject("Servidor indisponível");
|
|
69
|
+
}
|
|
70
|
+
else if (xhr.status >= 500) {
|
|
71
|
+
reject("Erro inesperado no servidor");
|
|
72
|
+
}
|
|
73
|
+
else if (xhr.status >= 400) {
|
|
74
|
+
reject("Operação não permitida");
|
|
75
|
+
}
|
|
76
|
+
resolve(true);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
xhr.ontimeout = () => {
|
|
80
|
+
reject("Tempo limite de remoção atingido.");
|
|
81
|
+
};
|
|
82
|
+
xhr.open("DELETE", server, true);
|
|
83
|
+
if (headers) {
|
|
84
|
+
headers.forEach((value, key) => xhr.setRequestHeader(key, value));
|
|
85
|
+
}
|
|
86
|
+
xhr.send(JSON.stringify(item));
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|