@wavemaker/angular-codegen 11.0.1-next.139250 → 11.0.1-next.139251

Sign up to get free protection for your applications and to get access to all the features.
@@ -68,7 +68,7 @@
68
68
  "tslib": "^2.0.0",
69
69
  "x2js": "3.2.6",
70
70
  "zone.js": "~0.10.3",
71
- "@wavemaker/app-ng-runtime": "11.0.1-next.139250"
71
+ "@wavemaker/app-ng-runtime": "11.0.1-next.139251"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@ampproject/rollup-plugin-closure-compiler": "0.8.5",
@@ -17619,9 +17619,15 @@ function $parseExpr(expr, defOnly) {
17619
17619
  }
17620
17620
  // fallback to generate function in runtime. This will break if CSP is enabled
17621
17621
  if (!boundFn) {
17622
- // If CSP enabled, avoid multiple browser errors. [What do we say to death, NOT TODAY!]
17622
+ // If CSP enabled, function def not found from the generated fn expressions for the page.
17623
+ // Handle bind expressions used internally inside WM components. e.g. wmAnchor used inside nav.comp.html
17623
17624
  if (isCSPEnabled()) {
17624
- boundFn = noop;
17625
+ boundFn = function (ctx, locals) {
17626
+ // handle internal bindings for wm widgets used inside a component
17627
+ let _ctx = Object.assign({}, locals);
17628
+ Object.setPrototypeOf(_ctx, ctx);
17629
+ return _.get(_ctx, expr);
17630
+ };
17625
17631
  }
17626
17632
  else {
17627
17633
  const parser = new Parser$1(new Lexer);
@@ -17672,6 +17678,23 @@ function $parseExpr(expr, defOnly) {
17672
17678
  exprFnCache.set(expr, boundFn);
17673
17679
  return boundFn;
17674
17680
  }
17681
+ function simpleFunctionEvaluator(expr, ctx, locals) {
17682
+ let _ctx = Object.assign({}, locals);
17683
+ Object.setPrototypeOf(_ctx, ctx);
17684
+ let parts = expr.split('(');
17685
+ let fnName = parts[0];
17686
+ let computedFn = _.get(ctx, fnName);
17687
+ if (computedFn) {
17688
+ let args = parts[1].replace(')', '');
17689
+ args = args.split(',');
17690
+ let computedArgs = [];
17691
+ args.forEach((arg) => {
17692
+ arg = arg && arg.trim();
17693
+ computedArgs.push(_.get(_ctx, arg));
17694
+ });
17695
+ return computedFn.bind(_ctx)(...computedArgs);
17696
+ }
17697
+ }
17675
17698
  function $parseEvent(expr, defOnly) {
17676
17699
  if (!isString(expr)) {
17677
17700
  return noop;
@@ -17690,7 +17713,7 @@ function $parseEvent(expr, defOnly) {
17690
17713
  // fallback to generate function in runtime. This will break if CSP is enabled
17691
17714
  if (!fn) {
17692
17715
  if (isCSPEnabled()) {
17693
- fn = noop;
17716
+ fn = simpleFunctionEvaluator.bind(undefined, expr);
17694
17717
  }
17695
17718
  else {
17696
17719
  const parser = new Parser$1(new Lexer);
@@ -42703,9 +42703,15 @@ function $parseExpr(expr, defOnly) {
42703
42703
  }
42704
42704
  // fallback to generate function in runtime. This will break if CSP is enabled
42705
42705
  if (!boundFn) {
42706
- // If CSP enabled, avoid multiple browser errors. [What do we say to death, NOT TODAY!]
42706
+ // If CSP enabled, function def not found from the generated fn expressions for the page.
42707
+ // Handle bind expressions used internally inside WM components. e.g. wmAnchor used inside nav.comp.html
42707
42708
  if (isCSPEnabled()) {
42708
- boundFn = noop$1$1;
42709
+ boundFn = function (ctx, locals) {
42710
+ // handle internal bindings for wm widgets used inside a component
42711
+ let _ctx = Object.assign({}, locals);
42712
+ Object.setPrototypeOf(_ctx, ctx);
42713
+ return _.get(_ctx, expr);
42714
+ };
42709
42715
  }
42710
42716
  else {
42711
42717
  const parser = new Parser$1(new Lexer);
@@ -42756,6 +42762,23 @@ function $parseExpr(expr, defOnly) {
42756
42762
  exprFnCache.set(expr, boundFn);
42757
42763
  return boundFn;
42758
42764
  }
42765
+ function simpleFunctionEvaluator(expr, ctx, locals) {
42766
+ let _ctx = Object.assign({}, locals);
42767
+ Object.setPrototypeOf(_ctx, ctx);
42768
+ let parts = expr.split('(');
42769
+ let fnName = parts[0];
42770
+ let computedFn = _.get(ctx, fnName);
42771
+ if (computedFn) {
42772
+ let args = parts[1].replace(')', '');
42773
+ args = args.split(',');
42774
+ let computedArgs = [];
42775
+ args.forEach((arg) => {
42776
+ arg = arg && arg.trim();
42777
+ computedArgs.push(_.get(_ctx, arg));
42778
+ });
42779
+ return computedFn.bind(_ctx)(...computedArgs);
42780
+ }
42781
+ }
42759
42782
  function $parseEvent(expr, defOnly) {
42760
42783
  if (!isString$1(expr)) {
42761
42784
  return noop$1$1;
@@ -42774,7 +42797,7 @@ function $parseEvent(expr, defOnly) {
42774
42797
  // fallback to generate function in runtime. This will break if CSP is enabled
42775
42798
  if (!fn) {
42776
42799
  if (isCSPEnabled()) {
42777
- fn = noop$1$1;
42800
+ fn = simpleFunctionEvaluator.bind(undefined, expr);
42778
42801
  }
42779
42802
  else {
42780
42803
  const parser = new Parser$1(new Lexer);
@@ -38691,9 +38691,15 @@ function $parseExpr(expr, defOnly) {
38691
38691
  }
38692
38692
  // fallback to generate function in runtime. This will break if CSP is enabled
38693
38693
  if (!boundFn) {
38694
- // If CSP enabled, avoid multiple browser errors. [What do we say to death, NOT TODAY!]
38694
+ // If CSP enabled, function def not found from the generated fn expressions for the page.
38695
+ // Handle bind expressions used internally inside WM components. e.g. wmAnchor used inside nav.comp.html
38695
38696
  if (isCSPEnabled()) {
38696
- boundFn = noop$1$1;
38697
+ boundFn = function (ctx, locals) {
38698
+ // handle internal bindings for wm widgets used inside a component
38699
+ let _ctx = Object.assign({}, locals);
38700
+ Object.setPrototypeOf(_ctx, ctx);
38701
+ return _.get(_ctx, expr);
38702
+ };
38697
38703
  }
38698
38704
  else {
38699
38705
  const parser = new Parser$1(new Lexer);
@@ -38744,6 +38750,23 @@ function $parseExpr(expr, defOnly) {
38744
38750
  exprFnCache.set(expr, boundFn);
38745
38751
  return boundFn;
38746
38752
  }
38753
+ function simpleFunctionEvaluator(expr, ctx, locals) {
38754
+ let _ctx = Object.assign({}, locals);
38755
+ Object.setPrototypeOf(_ctx, ctx);
38756
+ let parts = expr.split('(');
38757
+ let fnName = parts[0];
38758
+ let computedFn = _.get(ctx, fnName);
38759
+ if (computedFn) {
38760
+ let args = parts[1].replace(')', '');
38761
+ args = args.split(',');
38762
+ let computedArgs = [];
38763
+ args.forEach((arg) => {
38764
+ arg = arg && arg.trim();
38765
+ computedArgs.push(_.get(_ctx, arg));
38766
+ });
38767
+ return computedFn.bind(_ctx)(...computedArgs);
38768
+ }
38769
+ }
38747
38770
  function $parseEvent(expr, defOnly) {
38748
38771
  if (!isString$1(expr)) {
38749
38772
  return noop$1$1;
@@ -38762,7 +38785,7 @@ function $parseEvent(expr, defOnly) {
38762
38785
  // fallback to generate function in runtime. This will break if CSP is enabled
38763
38786
  if (!fn) {
38764
38787
  if (isCSPEnabled()) {
38765
- fn = noop$1$1;
38788
+ fn = simpleFunctionEvaluator.bind(undefined, expr);
38766
38789
  }
38767
38790
  else {
38768
38791
  const parser = new Parser$1(new Lexer);
@@ -38691,9 +38691,15 @@ function $parseExpr(expr, defOnly) {
38691
38691
  }
38692
38692
  // fallback to generate function in runtime. This will break if CSP is enabled
38693
38693
  if (!boundFn) {
38694
- // If CSP enabled, avoid multiple browser errors. [What do we say to death, NOT TODAY!]
38694
+ // If CSP enabled, function def not found from the generated fn expressions for the page.
38695
+ // Handle bind expressions used internally inside WM components. e.g. wmAnchor used inside nav.comp.html
38695
38696
  if (isCSPEnabled()) {
38696
- boundFn = noop$1$1;
38697
+ boundFn = function (ctx, locals) {
38698
+ // handle internal bindings for wm widgets used inside a component
38699
+ let _ctx = Object.assign({}, locals);
38700
+ Object.setPrototypeOf(_ctx, ctx);
38701
+ return _.get(_ctx, expr);
38702
+ };
38697
38703
  }
38698
38704
  else {
38699
38705
  const parser = new Parser$1(new Lexer);
@@ -38744,6 +38750,23 @@ function $parseExpr(expr, defOnly) {
38744
38750
  exprFnCache.set(expr, boundFn);
38745
38751
  return boundFn;
38746
38752
  }
38753
+ function simpleFunctionEvaluator(expr, ctx, locals) {
38754
+ let _ctx = Object.assign({}, locals);
38755
+ Object.setPrototypeOf(_ctx, ctx);
38756
+ let parts = expr.split('(');
38757
+ let fnName = parts[0];
38758
+ let computedFn = _.get(ctx, fnName);
38759
+ if (computedFn) {
38760
+ let args = parts[1].replace(')', '');
38761
+ args = args.split(',');
38762
+ let computedArgs = [];
38763
+ args.forEach((arg) => {
38764
+ arg = arg && arg.trim();
38765
+ computedArgs.push(_.get(_ctx, arg));
38766
+ });
38767
+ return computedFn.bind(_ctx)(...computedArgs);
38768
+ }
38769
+ }
38747
38770
  function $parseEvent(expr, defOnly) {
38748
38771
  if (!isString$1(expr)) {
38749
38772
  return noop$1$1;
@@ -38762,7 +38785,7 @@ function $parseEvent(expr, defOnly) {
38762
38785
  // fallback to generate function in runtime. This will break if CSP is enabled
38763
38786
  if (!fn) {
38764
38787
  if (isCSPEnabled()) {
38765
- fn = noop$1$1;
38788
+ fn = simpleFunctionEvaluator.bind(undefined, expr);
38766
38789
  }
38767
38790
  else {
38768
38791
  const parser = new Parser$1(new Lexer);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.0.1-next.139250",
3
+ "version": "11.0.1-next.139251",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {