@sankhyalabs/ezui 1.1.104 → 1.1.107
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/{AssetsUtils-69356e76.js → AssetsUtils-697927e8.js} +52 -52
- package/dist/cjs/{FloatingManager-6cfeb947.js → FloatingManager-751368a8.js} +121 -121
- package/dist/cjs/{UnitMetadata-4b90ead3.js → UnitMetadata-de809a4b.js} +1305 -1305
- package/dist/cjs/ez-calendar_16.cjs.entry.js +89 -75
- package/dist/cjs/ez-dialog.cjs.entry.js +1 -1
- package/dist/cjs/ez-grid.cjs.entry.js +20 -2
- package/dist/cjs/ez-modal_2.cjs.entry.js +2 -2
- package/dist/cjs/ez-popover.cjs.entry.js +2 -2
- package/dist/cjs/ez-toast.cjs.entry.js +8 -4
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ez-check/ez-check.js +3 -0
- package/dist/collection/components/ez-dialog/ez-dialog.css +1 -1
- package/dist/collection/components/ez-form/ez-form.js +8 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/CheckBox.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/ComboBox.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/DateInput.tpl.js +3 -3
- package/dist/collection/components/ez-form/fieldbuilder/tpl/FileInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/NumberInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/SearchInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextArea.tpl.js +1 -1
- package/dist/collection/components/ez-form/fieldbuilder/tpl/TextInput.tpl.js +1 -1
- package/dist/collection/components/ez-form/structure/FormSheet.js +2 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +20 -2
- package/dist/collection/components/ez-text-area/ez-text-area.css +1 -1
- package/dist/collection/components/ez-text-area/ez-text-area.js +1 -1
- package/dist/collection/components/ez-text-input/ez-text-input.css +1 -2
- package/dist/collection/components/ez-toast/ez-toast.css +8 -2
- package/dist/collection/components/ez-toast/ez-toast.js +27 -8
- package/dist/collection/utils/ApplicationUtils.js +6 -1
- package/dist/custom-elements/index.js +1624 -1588
- package/dist/esm/{AssetsUtils-0e207bec.js → AssetsUtils-f75711ac.js} +52 -52
- package/dist/esm/{FloatingManager-bb90ef41.js → FloatingManager-ee1f7fdf.js} +121 -121
- package/dist/esm/{UnitMetadata-8951d803.js → UnitMetadata-d300ae38.js} +1305 -1305
- package/dist/esm/ez-calendar_16.entry.js +89 -75
- package/dist/esm/ez-dialog.entry.js +1 -1
- package/dist/esm/ez-grid.entry.js +20 -2
- package/dist/esm/ez-modal_2.entry.js +2 -2
- package/dist/esm/ez-popover.entry.js +2 -2
- package/dist/esm/ez-toast.entry.js +8 -4
- 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-e06e47f1.entry.js → p-24ff7d92.entry.js} +1 -1
- package/dist/ezui/{p-18c00d88.entry.js → p-3e6fa4ca.entry.js} +1 -1
- package/dist/ezui/{p-ec7c1b86.js → p-47cf74f0.js} +0 -0
- package/dist/ezui/p-780fbe22.entry.js +1 -0
- package/dist/ezui/p-81fc41a5.js +1 -0
- package/dist/ezui/p-9ea5b22e.entry.js +1 -0
- package/dist/ezui/{p-ddd0ef12.js → p-b05feb1f.js} +0 -0
- package/dist/ezui/{p-7294c815.entry.js → p-c451d6e6.entry.js} +1 -1
- package/dist/ezui/{p-da0f5393.entry.js → p-db1797d7.entry.js} +26 -26
- package/dist/types/components/ez-form/ez-form.d.ts +1 -0
- package/dist/types/components/ez-toast/ez-toast.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/dist/types/utils/ApplicationUtils.d.ts +5 -1
- package/package.json +1 -1
- package/dist/ezui/p-2259c926.entry.js +0 -1
- package/dist/ezui/p-b217f40b.entry.js +0 -1
- package/dist/ezui/p-c6760545.js +0 -1
|
@@ -2,58 +2,58 @@
|
|
|
2
2
|
|
|
3
3
|
const index = require('./index-88286449.js');
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* Classe com utiliários comuns para Strings.
|
|
7
|
-
*/
|
|
8
|
-
class StringUtils {
|
|
9
|
-
/**
|
|
10
|
-
* Verifica se a string está vazia.
|
|
11
|
-
* Valores null e undefined são considerados como vazio.
|
|
12
|
-
*
|
|
13
|
-
* @param value String para ser validada.
|
|
14
|
-
*/
|
|
15
|
-
static isEmpty(value) {
|
|
16
|
-
if (value == undefined || value === null) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
value = value.toString();
|
|
20
|
-
value = value.trim();
|
|
21
|
-
if (value.length === 0) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
return false;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Remove acentos de vogais, substitui Ç por c e retorna a string em caixa alta.
|
|
28
|
-
*
|
|
29
|
-
* @param value String para ser transformada.
|
|
30
|
-
*/
|
|
31
|
-
static replaceAccentuatedChars(text) {
|
|
32
|
-
text = text.toUpperCase();
|
|
33
|
-
text = text.replace(/[À]/, "A");
|
|
34
|
-
text = text.replace(/[Á]/, "A");
|
|
35
|
-
text = text.replace(/[Â]/, "A");
|
|
36
|
-
text = text.replace(/[Ã]/, "A");
|
|
37
|
-
text = text.replace(/[Ä]/, "A");
|
|
38
|
-
text = text.replace(/[È]/, "E");
|
|
39
|
-
text = text.replace(/[É]/, "E");
|
|
40
|
-
text = text.replace(/[Ê]/, "E");
|
|
41
|
-
text = text.replace(/[Ë]/, "E");
|
|
42
|
-
text = text.replace(/[Ì]/, "I");
|
|
43
|
-
text = text.replace(/[Í]/, "I");
|
|
44
|
-
text = text.replace(/[Î]/, "I");
|
|
45
|
-
text = text.replace(/[Ï]/, "I");
|
|
46
|
-
text = text.replace(/[Ò]/, "O");
|
|
47
|
-
text = text.replace(/[Ó]/, "O");
|
|
48
|
-
text = text.replace(/[Ô]/, "O");
|
|
49
|
-
text = text.replace(/[Ö]/, "O");
|
|
50
|
-
text = text.replace(/[Ù]/, "U");
|
|
51
|
-
text = text.replace(/[Ú]/, "U");
|
|
52
|
-
text = text.replace(/[Û]/, "U");
|
|
53
|
-
text = text.replace(/[Ü]/, "U");
|
|
54
|
-
text = text.replace(/[Ç]/, "C");
|
|
55
|
-
return text.replace(/[^a-z0-9]/gi, '');
|
|
56
|
-
}
|
|
5
|
+
/**
|
|
6
|
+
* Classe com utiliários comuns para Strings.
|
|
7
|
+
*/
|
|
8
|
+
class StringUtils {
|
|
9
|
+
/**
|
|
10
|
+
* Verifica se a string está vazia.
|
|
11
|
+
* Valores null e undefined são considerados como vazio.
|
|
12
|
+
*
|
|
13
|
+
* @param value String para ser validada.
|
|
14
|
+
*/
|
|
15
|
+
static isEmpty(value) {
|
|
16
|
+
if (value == undefined || value === null) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
value = value.toString();
|
|
20
|
+
value = value.trim();
|
|
21
|
+
if (value.length === 0) {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Remove acentos de vogais, substitui Ç por c e retorna a string em caixa alta.
|
|
28
|
+
*
|
|
29
|
+
* @param value String para ser transformada.
|
|
30
|
+
*/
|
|
31
|
+
static replaceAccentuatedChars(text) {
|
|
32
|
+
text = text.toUpperCase();
|
|
33
|
+
text = text.replace(/[À]/, "A");
|
|
34
|
+
text = text.replace(/[Á]/, "A");
|
|
35
|
+
text = text.replace(/[Â]/, "A");
|
|
36
|
+
text = text.replace(/[Ã]/, "A");
|
|
37
|
+
text = text.replace(/[Ä]/, "A");
|
|
38
|
+
text = text.replace(/[È]/, "E");
|
|
39
|
+
text = text.replace(/[É]/, "E");
|
|
40
|
+
text = text.replace(/[Ê]/, "E");
|
|
41
|
+
text = text.replace(/[Ë]/, "E");
|
|
42
|
+
text = text.replace(/[Ì]/, "I");
|
|
43
|
+
text = text.replace(/[Í]/, "I");
|
|
44
|
+
text = text.replace(/[Î]/, "I");
|
|
45
|
+
text = text.replace(/[Ï]/, "I");
|
|
46
|
+
text = text.replace(/[Ò]/, "O");
|
|
47
|
+
text = text.replace(/[Ó]/, "O");
|
|
48
|
+
text = text.replace(/[Ô]/, "O");
|
|
49
|
+
text = text.replace(/[Ö]/, "O");
|
|
50
|
+
text = text.replace(/[Ù]/, "U");
|
|
51
|
+
text = text.replace(/[Ú]/, "U");
|
|
52
|
+
text = text.replace(/[Û]/, "U");
|
|
53
|
+
text = text.replace(/[Ü]/, "U");
|
|
54
|
+
text = text.replace(/[Ç]/, "C");
|
|
55
|
+
return text.replace(/[^a-z0-9]/gi, '');
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
const getSpritePath = (sprite) => `${getContextAssetsPath("../assets/actions-sprite.svg")}#${sprite}`;
|
|
@@ -1,126 +1,126 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
class FloatingEntry {
|
|
4
|
-
constructor(parent, content, opts) {
|
|
5
|
-
try {
|
|
6
|
-
this.weakRefParent = new WeakRef(parent);
|
|
7
|
-
this.weakRefContent = new WeakRef(content);
|
|
8
|
-
}
|
|
9
|
-
catch (error) {
|
|
10
|
-
this.strongRefParent = parent;
|
|
11
|
-
this.strongRefContent = content;
|
|
12
|
-
}
|
|
13
|
-
this.options = opts;
|
|
14
|
-
}
|
|
15
|
-
get parent() {
|
|
16
|
-
if (this.weakRefParent) {
|
|
17
|
-
return this.weakRefParent.deref();
|
|
18
|
-
}
|
|
19
|
-
return this.strongRefParent;
|
|
20
|
-
}
|
|
21
|
-
get content() {
|
|
22
|
-
if (this.weakRefContent) {
|
|
23
|
-
return this.weakRefContent.deref();
|
|
24
|
-
}
|
|
25
|
-
return this.strongRefContent;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
class FloatingManager {
|
|
29
|
-
static init() {
|
|
30
|
-
FloatingManager.entries = [];
|
|
31
|
-
document.addEventListener('mousedown', FloatingManager.handleDocumentEvent);
|
|
32
|
-
document.addEventListener('keydown', FloatingManager.handleKeyboardEvent);
|
|
33
|
-
FloatingManager.initialized = true;
|
|
34
|
-
}
|
|
35
|
-
static innerClick(container, node) {
|
|
36
|
-
if (container.contains(node)) {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
if (container.shadowRoot && container.shadowRoot.contains(node)) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
static doClose(id, entry, target) {
|
|
45
|
-
if (!target || entry.options.autoClose) {
|
|
46
|
-
const parent = entry.parent;
|
|
47
|
-
const content = entry.content;
|
|
48
|
-
if (parent && content) {
|
|
49
|
-
const innerClickFunction = entry.options.innerClickTest ? entry.options.innerClickTest : FloatingManager.innerClick;
|
|
50
|
-
if (!target || !innerClickFunction(content, target)) {
|
|
51
|
-
content.remove();
|
|
52
|
-
delete FloatingManager.entries[id];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
delete FloatingManager.entries[id];
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
static handleDocumentEvent(event) {
|
|
61
|
-
FloatingManager.entries.forEach((entry, index) => {
|
|
62
|
-
FloatingManager.doClose(index, entry, event.composedPath()[0]);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
static handleKeyboardEvent(event) {
|
|
66
|
-
if (event.key === 'Escape') {
|
|
67
|
-
for (let index = FloatingManager.entries.length; index >= 0; index--) {
|
|
68
|
-
const entry = FloatingManager.entries[index];
|
|
69
|
-
if (entry) {
|
|
70
|
-
FloatingManager.close(index);
|
|
71
|
-
break;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
static applyStyle(element, propertyName, value) {
|
|
77
|
-
if (value) {
|
|
78
|
-
element.style.setProperty(propertyName, value);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
static getFloatIndex(content, parent) {
|
|
82
|
-
for (let index = 0; index < FloatingManager.entries.length; index++) {
|
|
83
|
-
const entry = FloatingManager.entries[index];
|
|
84
|
-
if (entry && content === entry.content && parent === entry.parent) {
|
|
85
|
-
return index;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
return -1;
|
|
89
|
-
}
|
|
90
|
-
static isFloating(id) {
|
|
91
|
-
return FloatingManager.entries[id] !== undefined;
|
|
92
|
-
}
|
|
93
|
-
static float(content, parent, options = { autoClose: true }) {
|
|
94
|
-
if (!FloatingManager.initialized) {
|
|
95
|
-
FloatingManager.init();
|
|
96
|
-
}
|
|
97
|
-
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
98
|
-
if (alreadyFloatingIndex > -1) {
|
|
99
|
-
return alreadyFloatingIndex;
|
|
100
|
-
}
|
|
101
|
-
content.style.position = 'absolute';
|
|
102
|
-
FloatingManager.applyStyle(content, "top", options.top);
|
|
103
|
-
FloatingManager.applyStyle(content, "left", options.left);
|
|
104
|
-
FloatingManager.applyStyle(content, "right", options.right);
|
|
105
|
-
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
106
|
-
parent.appendChild(content);
|
|
107
|
-
FloatingManager.entries.push(new FloatingEntry(parent, content, options));
|
|
108
|
-
return FloatingManager.entries.length - 1;
|
|
109
|
-
}
|
|
110
|
-
static updateFloatPosition(content, parent, options = { autoClose: true }) {
|
|
111
|
-
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
112
|
-
if (alreadyFloatingIndex > -1) {
|
|
113
|
-
FloatingManager.applyStyle(content, "top", options.top);
|
|
114
|
-
FloatingManager.applyStyle(content, "left", options.left);
|
|
115
|
-
FloatingManager.applyStyle(content, "right", options.right);
|
|
116
|
-
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
static close(id) {
|
|
120
|
-
if (FloatingManager.entries[id]) {
|
|
121
|
-
FloatingManager.doClose(id, FloatingManager.entries[id], undefined);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
3
|
+
class FloatingEntry {
|
|
4
|
+
constructor(parent, content, opts) {
|
|
5
|
+
try {
|
|
6
|
+
this.weakRefParent = new WeakRef(parent);
|
|
7
|
+
this.weakRefContent = new WeakRef(content);
|
|
8
|
+
}
|
|
9
|
+
catch (error) {
|
|
10
|
+
this.strongRefParent = parent;
|
|
11
|
+
this.strongRefContent = content;
|
|
12
|
+
}
|
|
13
|
+
this.options = opts;
|
|
14
|
+
}
|
|
15
|
+
get parent() {
|
|
16
|
+
if (this.weakRefParent) {
|
|
17
|
+
return this.weakRefParent.deref();
|
|
18
|
+
}
|
|
19
|
+
return this.strongRefParent;
|
|
20
|
+
}
|
|
21
|
+
get content() {
|
|
22
|
+
if (this.weakRefContent) {
|
|
23
|
+
return this.weakRefContent.deref();
|
|
24
|
+
}
|
|
25
|
+
return this.strongRefContent;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
class FloatingManager {
|
|
29
|
+
static init() {
|
|
30
|
+
FloatingManager.entries = [];
|
|
31
|
+
document.addEventListener('mousedown', FloatingManager.handleDocumentEvent);
|
|
32
|
+
document.addEventListener('keydown', FloatingManager.handleKeyboardEvent);
|
|
33
|
+
FloatingManager.initialized = true;
|
|
34
|
+
}
|
|
35
|
+
static innerClick(container, node) {
|
|
36
|
+
if (container.contains(node)) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
if (container.shadowRoot && container.shadowRoot.contains(node)) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
static doClose(id, entry, target) {
|
|
45
|
+
if (!target || entry.options.autoClose) {
|
|
46
|
+
const parent = entry.parent;
|
|
47
|
+
const content = entry.content;
|
|
48
|
+
if (parent && content) {
|
|
49
|
+
const innerClickFunction = entry.options.innerClickTest ? entry.options.innerClickTest : FloatingManager.innerClick;
|
|
50
|
+
if (!target || !innerClickFunction(content, target)) {
|
|
51
|
+
content.remove();
|
|
52
|
+
delete FloatingManager.entries[id];
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
delete FloatingManager.entries[id];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
static handleDocumentEvent(event) {
|
|
61
|
+
FloatingManager.entries.forEach((entry, index) => {
|
|
62
|
+
FloatingManager.doClose(index, entry, event.composedPath()[0]);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
static handleKeyboardEvent(event) {
|
|
66
|
+
if (event.key === 'Escape') {
|
|
67
|
+
for (let index = FloatingManager.entries.length; index >= 0; index--) {
|
|
68
|
+
const entry = FloatingManager.entries[index];
|
|
69
|
+
if (entry) {
|
|
70
|
+
FloatingManager.close(index);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
static applyStyle(element, propertyName, value) {
|
|
77
|
+
if (value) {
|
|
78
|
+
element.style.setProperty(propertyName, value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
static getFloatIndex(content, parent) {
|
|
82
|
+
for (let index = 0; index < FloatingManager.entries.length; index++) {
|
|
83
|
+
const entry = FloatingManager.entries[index];
|
|
84
|
+
if (entry && content === entry.content && parent === entry.parent) {
|
|
85
|
+
return index;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return -1;
|
|
89
|
+
}
|
|
90
|
+
static isFloating(id) {
|
|
91
|
+
return FloatingManager.entries[id] !== undefined;
|
|
92
|
+
}
|
|
93
|
+
static float(content, parent, options = { autoClose: true }) {
|
|
94
|
+
if (!FloatingManager.initialized) {
|
|
95
|
+
FloatingManager.init();
|
|
96
|
+
}
|
|
97
|
+
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
98
|
+
if (alreadyFloatingIndex > -1) {
|
|
99
|
+
return alreadyFloatingIndex;
|
|
100
|
+
}
|
|
101
|
+
content.style.position = 'absolute';
|
|
102
|
+
FloatingManager.applyStyle(content, "top", options.top);
|
|
103
|
+
FloatingManager.applyStyle(content, "left", options.left);
|
|
104
|
+
FloatingManager.applyStyle(content, "right", options.right);
|
|
105
|
+
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
106
|
+
parent.appendChild(content);
|
|
107
|
+
FloatingManager.entries.push(new FloatingEntry(parent, content, options));
|
|
108
|
+
return FloatingManager.entries.length - 1;
|
|
109
|
+
}
|
|
110
|
+
static updateFloatPosition(content, parent, options = { autoClose: true }) {
|
|
111
|
+
const alreadyFloatingIndex = FloatingManager.getFloatIndex(content, parent);
|
|
112
|
+
if (alreadyFloatingIndex > -1) {
|
|
113
|
+
FloatingManager.applyStyle(content, "top", options.top);
|
|
114
|
+
FloatingManager.applyStyle(content, "left", options.left);
|
|
115
|
+
FloatingManager.applyStyle(content, "right", options.right);
|
|
116
|
+
FloatingManager.applyStyle(content, "bottom", options.bottom);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
static close(id) {
|
|
120
|
+
if (FloatingManager.entries[id]) {
|
|
121
|
+
FloatingManager.doClose(id, FloatingManager.entries[id], undefined);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
exports.FloatingManager = FloatingManager;
|