nx-lecom-helper 1.0.0 → 1.0.2
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/nxLecom-helper.umd.js +4 -35
- package/package.json +5 -2
|
@@ -1,42 +1,11 @@
|
|
|
1
1
|
(function (global) {
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
|
-
if (global.
|
|
4
|
+
if (global.NxLecomHelper) return;
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function init(options) {
|
|
9
|
-
options = options || {};
|
|
10
|
-
if (typeof options.debug === "boolean") _state.debug = options.debug;
|
|
11
|
-
log("init ok", { version: _state.version });
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function log(...args) {
|
|
15
|
-
if (_state.debug && global.console) console.log("[LecomHelper]", ...args);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function get(obj, path, defaultValue) {
|
|
19
|
-
if (!obj || !path) return defaultValue;
|
|
20
|
-
const parts = String(path).split(".");
|
|
21
|
-
let cur = obj;
|
|
22
|
-
for (const p of parts) {
|
|
23
|
-
if (cur && Object.prototype.hasOwnProperty.call(cur, p)) cur = cur[p];
|
|
24
|
-
else return defaultValue;
|
|
25
|
-
}
|
|
26
|
-
return cur ?? defaultValue;
|
|
6
|
+
function alertTest(message) {
|
|
7
|
+
alert(message || "NxLecomHelper funcionando!");
|
|
27
8
|
}
|
|
28
9
|
|
|
29
|
-
|
|
30
|
-
const val = String(get(gridRow, fieldName, "") || "");
|
|
31
|
-
return val.includes(needle);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const api = Object.freeze({ init, get, gridContains, version: _state.version });
|
|
35
|
-
|
|
36
|
-
Object.defineProperty(global, "LecomHelper", {
|
|
37
|
-
value: api,
|
|
38
|
-
writable: false,
|
|
39
|
-
configurable: false
|
|
40
|
-
});
|
|
10
|
+
global.NxLecomHelper = Object.freeze({ alertTest });
|
|
41
11
|
})(typeof window !== "undefined" ? window : this);
|
|
42
|
-
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nx-lecom-helper",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Utilitários JS para BPM Lecom (API global)",
|
|
5
5
|
"main": "dist/nxLecom-helper.umd.js",
|
|
6
6
|
"files": [
|
|
@@ -11,5 +11,8 @@
|
|
|
11
11
|
"author": {
|
|
12
12
|
"name": "Thiago Costa",
|
|
13
13
|
"email": "thiago.costa@nexum.com.br"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"nx-lecom-helper": "^1.0.1"
|
|
14
17
|
}
|
|
15
|
-
}
|
|
18
|
+
}
|