@denevads/dnv-smo 1.1.0 → 1.1.1

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.
@@ -33,6 +33,10 @@ export interface Notify {
33
33
  destion: string;
34
34
  value: any;
35
35
  }
36
+ export interface NotifyEditor {
37
+ formInputs?: any[];
38
+ behaviors?: any[];
39
+ }
36
40
  export interface GetRecursosByCodigo {
37
41
  recursos?: Recurso[];
38
42
  }
package/dist/smo.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, DatasourceMap, ValorCalendario } from "./interfaces/callbacks";
1
+ import { setDatasource, variable, location, DataSalida, ExecFunction, Notify, start, NotifyEditor, GetRecursosByCodigo, GetRecursos, GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, DatasourceMap, ValorCalendario } from "./interfaces/callbacks";
2
2
  import { Subject } from 'rxjs';
3
3
  export declare class SMO {
4
4
  vars: any;
@@ -82,6 +82,7 @@ declare class smoCallBacks {
82
82
  ejecutaFuncion(data: ExecFunction): void;
83
83
  addObserver(data: string): void;
84
84
  notify(data: Notify): void;
85
+ notifyEditor(data: NotifyEditor): void;
85
86
  playOnceChannelByTrigger(trigger: string): void;
86
87
  stopPlayOnceChannelByTrigger(): void;
87
88
  playOnceChannel(codigoCanal: string): void;
package/dist/smo.js CHANGED
@@ -18,7 +18,7 @@ var SMO = /** @class */ (function () {
18
18
  var _this = this;
19
19
  var match, pl = /\+/g, search = /([^&=]+)=?([^&]*)/g, decode = function (s) {
20
20
  return decodeURIComponent(s.replace(pl, " "));
21
- }, query = window.location.search.substring(1);
21
+ }, query = window.location.href.slice(window.location.href.indexOf("?") + 1);
22
22
  while (match = search.exec(query)) {
23
23
  this.vars[decode(match[1])] = decode(match[2]);
24
24
  }
@@ -539,6 +539,17 @@ var smoCallBacks = /** @class */ (function () {
539
539
  idSmo: this.smo.id
540
540
  }, this.smo.vars.idSmo);
541
541
  };
542
+ smoCallBacks.prototype.notifyEditor = function (data) {
543
+ /*data ={
544
+ destino: "fruta",
545
+ value: "{'fruta':'manzana', 'color':'roja'}"
546
+ } */
547
+ parent.postMessage({
548
+ target: "Dnv.smoCallbacks.notifyEditor",
549
+ objData: data,
550
+ idSmo: this.smo.id
551
+ }, "*");
552
+ };
542
553
  smoCallBacks.prototype.playOnceChannelByTrigger = function (trigger) {
543
554
  this.smo.utils.sendToParent({
544
555
  target: "Dnv.smoCallbacks.playOnceChannelByTrigger",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@denevads/dnv-smo",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "SMO module",
5
5
  "main": "./src/index.js",
6
6
  "types": "./src/index.d.ts",
@@ -37,6 +37,10 @@ export interface Notify{
37
37
  destion:string,
38
38
  value:any
39
39
  }
40
+ export interface NotifyEditor{
41
+ formInputs?: any[],
42
+ behaviors?:any[]
43
+ }
40
44
  export interface GetRecursosByCodigo {
41
45
  recursos?: Recurso[];
42
46
  }
package/src/smo.ts CHANGED
@@ -7,6 +7,7 @@ import {
7
7
  Notify,
8
8
  start,
9
9
  dispose,
10
+ NotifyEditor,
10
11
  GetRecursosByCodigo,
11
12
  GetRecursos,
12
13
  GetRecursosRelleno, GetRecursosMetadatos, RecursosMetadato, Datasource, DatasourceMap, ValorCalendario
@@ -39,10 +40,12 @@ export class SMO {
39
40
  decode = function(s:string) {
40
41
  return decodeURIComponent(s.replace(pl, " "));
41
42
  },
42
- query = window.location.search.substring(1);
43
+ query = window.location.href.slice(window.location.href.indexOf("?") + 1);
44
+
43
45
  while (match = search.exec(query)) {
44
46
  this.vars[decode(match[1])] = decode(match[2]);
45
47
  }
48
+
46
49
  //console.log("vars->",JSON.stringify(this.vars));
47
50
  // @ts-ignore
48
51
  //console.log( "resultados " +window.objJS != undefined + " " + window !== window.parent + " " + this.vars.ontop != undefined + " " + this.vars.ontop != "");
@@ -563,6 +566,17 @@ class smoCallBacks{
563
566
 
564
567
  }, this.smo.vars.idSmo);
565
568
  }
569
+ notifyEditor(data:NotifyEditor):void {
570
+ /*data ={
571
+ destino: "fruta",
572
+ value: "{'fruta':'manzana', 'color':'roja'}"
573
+ } */
574
+ parent.postMessage({
575
+ target: "Dnv.smoCallbacks.notifyEditor",
576
+ objData: data,
577
+ idSmo: this.smo.id
578
+ }, "*");
579
+ }
566
580
  playOnceChannelByTrigger(trigger:string):void {
567
581
  this.smo.utils.sendToParent({
568
582
  target: "Dnv.smoCallbacks.playOnceChannelByTrigger",