@denevads/dnv-smo 1.0.26 → 1.0.28
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/.idea/denevads_dnv-smo.iml +1 -1
- package/dist/dist.rar +0 -0
- package/dist/dist.zip +0 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -17
- package/dist/interfaces/callbacks.d.ts +65 -65
- package/dist/interfaces/callbacks.js +2 -2
- package/dist/smo.d.ts +168 -168
- package/dist/smo.js +805 -796
- package/package.json +1 -1
- package/src/smo.ts +29 -23
package/package.json
CHANGED
package/src/smo.ts
CHANGED
|
@@ -11,10 +11,7 @@ import {
|
|
|
11
11
|
GetRecursosRelleno
|
|
12
12
|
} from "./interfaces/callbacks";
|
|
13
13
|
import {interval, Subject, Subscription} from 'rxjs';
|
|
14
|
-
|
|
15
|
-
external:ObjJSType;
|
|
16
|
-
objJS:ObjJSType;
|
|
17
|
-
}
|
|
14
|
+
|
|
18
15
|
// @ts-ignore
|
|
19
16
|
|
|
20
17
|
export class SMO {
|
|
@@ -46,7 +43,9 @@ export class SMO {
|
|
|
46
43
|
this.vars[decode(match[1])] = decode(match[2]);
|
|
47
44
|
}
|
|
48
45
|
// @ts-ignore
|
|
49
|
-
if(window.objJS){
|
|
46
|
+
if(window.objJS && window.self === window.top){
|
|
47
|
+
// @ts-ignore
|
|
48
|
+
console.log("Existe objJS en window -->" + JSON.stringify(window.objJS));
|
|
50
49
|
// @ts-ignore
|
|
51
50
|
window.sendToIframefromNet = (target, iframeID, objData) => {
|
|
52
51
|
console.log("sendToIframefromNet->",JSON.stringify(target));
|
|
@@ -58,10 +57,8 @@ export class SMO {
|
|
|
58
57
|
this.events.checkHealthPrinter.next(objData);
|
|
59
58
|
break;
|
|
60
59
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
60
|
}
|
|
64
|
-
|
|
61
|
+
// @ts-ignore
|
|
65
62
|
window.external = {
|
|
66
63
|
// @ts-ignore
|
|
67
64
|
URLNext: window.objJS.urlNext,
|
|
@@ -129,6 +126,7 @@ export class SMO {
|
|
|
129
126
|
CheckHealth: window.objJS.checkHealth
|
|
130
127
|
};
|
|
131
128
|
}else{
|
|
129
|
+
console.log("No existe objJS en window");
|
|
132
130
|
if (this.vars.idSmo) {
|
|
133
131
|
this.id = this.vars.idSmo;
|
|
134
132
|
if(this.vars["LowPower"] == "true" && (this.vars["url"] != undefined || this.vars["LocalData"] != undefined)){
|
|
@@ -152,6 +150,7 @@ export class SMO {
|
|
|
152
150
|
return;
|
|
153
151
|
}
|
|
154
152
|
console.warn("No idSmo found in URL");
|
|
153
|
+
return;
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
if (this.vars.idSmo) {
|
|
@@ -192,7 +191,7 @@ export class SMO {
|
|
|
192
191
|
return;
|
|
193
192
|
}
|
|
194
193
|
if(func ==SMO_EVENT_TYPE.updatefromsalida){
|
|
195
|
-
selft.updatefromsalida(e.data.
|
|
194
|
+
selft.updatefromsalida(e.data.objData);
|
|
196
195
|
return;
|
|
197
196
|
}
|
|
198
197
|
if(func == SMO_EVENT_TYPE.getRecursosByCodigo){
|
|
@@ -743,38 +742,45 @@ class Utils{
|
|
|
743
742
|
window.parent.postMessage(obj, dest);
|
|
744
743
|
}
|
|
745
744
|
setJsonObj(xml: any) {
|
|
746
|
-
let
|
|
745
|
+
let jsonObj = {} as any;
|
|
746
|
+
|
|
747
747
|
if (xml.nodeType == 1) { // Element
|
|
748
748
|
if (xml.attributes.length > 0) {
|
|
749
|
-
|
|
749
|
+
jsonObj["attributes"] = {};
|
|
750
750
|
for (let j = 0; j < xml.attributes.length; j++) {
|
|
751
751
|
let attribute = xml.attributes.item(j);
|
|
752
|
-
|
|
752
|
+
jsonObj["attributes"][attribute.nodeName] = attribute.nodeValue;
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
755
|
} else if (xml.nodeType == 3) { // Text
|
|
756
|
-
|
|
756
|
+
jsonObj = xml.nodeValue.trim();
|
|
757
757
|
} else if (xml.nodeType == 4) { // CDATA
|
|
758
|
-
|
|
758
|
+
jsonObj = xml.nodeValue.trim();
|
|
759
759
|
}
|
|
760
|
+
|
|
760
761
|
if (xml.hasChildNodes()) {
|
|
761
762
|
for (let i = 0; i < xml.childNodes.length; i++) {
|
|
762
|
-
let item = xml.childNodes
|
|
763
|
+
let item = xml.childNodes[i];
|
|
763
764
|
let nodeName = item.nodeName;
|
|
764
|
-
|
|
765
|
-
|
|
765
|
+
|
|
766
|
+
if (nodeName == "#text" && item.nodeType == 3) {
|
|
767
|
+
jsonObj = item.nodeValue.trim();
|
|
768
|
+
}else if (nodeName == "#cdata-section" && (item.nodeType == 4 || item.nodeType == 3)) { //Para que quede bonito
|
|
769
|
+
jsonObj["cdata"] = this.setJsonObj(item);
|
|
770
|
+
} else if (typeof jsonObj[nodeName] === "undefined") {
|
|
771
|
+
jsonObj[nodeName] = this.setJsonObj(item);
|
|
766
772
|
} else {
|
|
767
|
-
if (
|
|
768
|
-
|
|
769
|
-
js_obj[nodeName] = [];
|
|
770
|
-
js_obj[nodeName].push(old);
|
|
773
|
+
if (!Array.isArray(jsonObj[nodeName])) {
|
|
774
|
+
jsonObj[nodeName] = [jsonObj[nodeName]];
|
|
771
775
|
}
|
|
772
|
-
|
|
776
|
+
jsonObj[nodeName].push(this.setJsonObj(item));
|
|
773
777
|
}
|
|
774
778
|
}
|
|
775
779
|
}
|
|
776
|
-
|
|
780
|
+
|
|
781
|
+
return jsonObj;
|
|
777
782
|
}
|
|
783
|
+
|
|
778
784
|
dataToJSON(data:setDatasource):any {
|
|
779
785
|
try {
|
|
780
786
|
var parser = new DOMParser();
|