@sankhyalabs/ezui 4.11.3 → 4.12.0
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/ApplicationUtils-8cc2f37b.js +161 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -1
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +2 -2
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -1
- package/dist/cjs/ez-form.cjs.entry.js +1 -1
- package/dist/cjs/ez-text-edit.cjs.entry.js +1 -1
- package/dist/cjs/ez-upload.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ez-collapsible-box/ez-collapsible-box.css +0 -1
- package/dist/collection/utils/ApplicationUtils.js +28 -0
- package/dist/custom-elements/index.js +93 -1
- package/dist/esm/ApplicationUtils-19857f60.js +159 -0
- package/dist/esm/ez-actions-button.entry.js +1 -1
- package/dist/esm/ez-collapsible-box.entry.js +2 -2
- package/dist/esm/ez-combo-box.entry.js +1 -1
- package/dist/esm/ez-form.entry.js +1 -1
- package/dist/esm/ez-text-edit.entry.js +1 -1
- package/dist/esm/ez-upload.entry.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/{p-4f9931d8.entry.js → p-22b106d7.entry.js} +1 -1
- package/dist/ezui/{p-5844ec15.entry.js → p-370ad5c9.entry.js} +1 -1
- package/dist/ezui/p-41ce6f98.js +1 -0
- package/dist/ezui/{p-b8281997.entry.js → p-60e30f92.entry.js} +1 -1
- package/dist/ezui/{p-a98176cb.entry.js → p-709067e4.entry.js} +1 -1
- package/dist/ezui/{p-9feb7d03.entry.js → p-805ee4c2.entry.js} +1 -1
- package/dist/ezui/{p-be09b541.entry.js → p-ea5a5236.entry.js} +1 -1
- package/dist/types/utils/ApplicationUtils.d.ts +12 -1
- package/package.json +3 -1
- package/dist/cjs/ApplicationUtils-d71aed06.js +0 -69
- package/dist/esm/ApplicationUtils-3d870a53.js +0 -67
- package/dist/ezui/p-ab2a3006.js +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { D as DialogType } from './DialogType-54a62731.js';
|
|
2
|
-
|
|
3
|
-
class ApplicationUtils {
|
|
4
|
-
static async showDialog(title, message, icon = null, confirm, dialogType = DialogType.DEFAULT, options) {
|
|
5
|
-
if (options) {
|
|
6
|
-
options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
|
|
7
|
-
}
|
|
8
|
-
return new Promise(resolve => {
|
|
9
|
-
let dialog = document.querySelector("ez-dialog");
|
|
10
|
-
if (!dialog) {
|
|
11
|
-
dialog = document.createElement("ez-dialog");
|
|
12
|
-
window.document.body.appendChild(dialog);
|
|
13
|
-
}
|
|
14
|
-
dialog.show(title, message, dialogType, confirm, icon, options.labelCancel, options.labelConfirm, options.btnConfirmDanger, options.beforeClose).then(ok => resolve(ok));
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
static async alert(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
|
|
18
|
-
return ApplicationUtils.showDialog(title, message, icon, false, DialogType.WARN, options);
|
|
19
|
-
}
|
|
20
|
-
static async error(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
|
|
21
|
-
return ApplicationUtils.showDialog(title, message, icon, false, DialogType.CRITICAL, options);
|
|
22
|
-
}
|
|
23
|
-
static async success(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
|
|
24
|
-
return ApplicationUtils.showDialog(title, message, icon, false, DialogType.SUCCESS, options);
|
|
25
|
-
}
|
|
26
|
-
static async confirm(title, message, icon = null, dialogType = DialogType.WARN, options = ApplicationUtils.defaultMessageOptions) {
|
|
27
|
-
return ApplicationUtils.showDialog(title, message, icon, true, dialogType, options);
|
|
28
|
-
}
|
|
29
|
-
static async message(title, message, icon = null, options = ApplicationUtils.defaultMessageOptions) {
|
|
30
|
-
return ApplicationUtils.showDialog(title, message, icon, false, DialogType.DEFAULT, options);
|
|
31
|
-
}
|
|
32
|
-
static async info(message, options = ApplicationUtils.defaultMessageOptions) {
|
|
33
|
-
if (options !== ApplicationUtils.defaultMessageOptions) {
|
|
34
|
-
options = Object.assign(Object.assign({}, ApplicationUtils.defaultMessageOptions), options);
|
|
35
|
-
}
|
|
36
|
-
let useIcon = false;
|
|
37
|
-
let toast = document.querySelector("ez-toast");
|
|
38
|
-
if (!toast) {
|
|
39
|
-
toast = document.createElement("ez-toast");
|
|
40
|
-
const icon = document.createElement("ez-icon");
|
|
41
|
-
icon.className = "ez-margin-right--small";
|
|
42
|
-
icon.slot = "icon";
|
|
43
|
-
icon.style.setProperty("--ez-icon--color", "var(--color--success)");
|
|
44
|
-
toast.appendChild(icon);
|
|
45
|
-
window.document.body.appendChild(toast);
|
|
46
|
-
}
|
|
47
|
-
if (options.iconName) {
|
|
48
|
-
const iconElem = toast.querySelector("ez-icon");
|
|
49
|
-
if (iconElem) {
|
|
50
|
-
iconElem.iconName = options.iconName;
|
|
51
|
-
useIcon = true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
useIcon = false;
|
|
56
|
-
}
|
|
57
|
-
toast.show(message, 5000, useIcon, options.canClose);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
ApplicationUtils.defaultMessageOptions = {
|
|
61
|
-
canClose: true,
|
|
62
|
-
labelCancel: 'Não',
|
|
63
|
-
labelConfirm: 'Sim',
|
|
64
|
-
btnConfirmDanger: false
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
export { ApplicationUtils as A };
|
package/dist/ezui/p-ab2a3006.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{D as e}from"./p-ab574d59.js";class n{static async showDialog(t,c,s=null,o,a=e.DEFAULT,l){return l&&(l=Object.assign(Object.assign({},n.defaultMessageOptions),l)),new Promise((e=>{let n=document.querySelector("ez-dialog");n||(n=document.createElement("ez-dialog"),window.document.body.appendChild(n)),n.show(t,c,a,o,s,l.labelCancel,l.labelConfirm,l.btnConfirmDanger,l.beforeClose).then((n=>e(n)))}))}static async alert(t,c,s=null,o=n.defaultMessageOptions){return n.showDialog(t,c,s,!1,e.WARN,o)}static async error(t,c,s=null,o=n.defaultMessageOptions){return n.showDialog(t,c,s,!1,e.CRITICAL,o)}static async success(t,c,s=null,o=n.defaultMessageOptions){return n.showDialog(t,c,s,!1,e.SUCCESS,o)}static async confirm(t,c,s=null,o=e.WARN,a=n.defaultMessageOptions){return n.showDialog(t,c,s,!0,o,a)}static async message(t,c,s=null,o=n.defaultMessageOptions){return n.showDialog(t,c,s,!1,e.DEFAULT,o)}static async info(e,t=n.defaultMessageOptions){t!==n.defaultMessageOptions&&(t=Object.assign(Object.assign({},n.defaultMessageOptions),t));let c=!1,s=document.querySelector("ez-toast");if(!s){s=document.createElement("ez-toast");const e=document.createElement("ez-icon");e.className="ez-margin-right--small",e.slot="icon",e.style.setProperty("--ez-icon--color","var(--color--success)"),s.appendChild(e),window.document.body.appendChild(s)}if(t.iconName){const e=s.querySelector("ez-icon");e&&(e.iconName=t.iconName,c=!0)}else c=!1;s.show(e,5e3,c,t.canClose)}}n.defaultMessageOptions={canClose:!0,labelCancel:"Não",labelConfirm:"Sim",btnConfirmDanger:!1};export{n as A}
|