@wavemaker/app-ng-runtime 11.5.0-next.141087 → 11.5.0-next.141089

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.
@@ -950,6 +950,37 @@ class BaseComponent {
950
950
  this.__cloneable__ = false;
951
951
  this.$attrs = new Map();
952
952
  this.isMuted = false;
953
+ this.findParentlView = (lView) => {
954
+ //console.log("---*************--widgetType--*************---", this.widgetType);
955
+ let parentlView = lView[3];
956
+ if (typeof lView[1] === "boolean") { // this is lContainer, not lView if this is boolean
957
+ return this.findParentlView(parentlView);
958
+ }
959
+ let componentType = lView[1]["type"];
960
+ if (this.widgetType === "wm-button") {
961
+ if (componentType === 0 || componentType === 1) {
962
+ let p = lView[8];
963
+ // ts-ignore
964
+ if (p.constructor.name === 'DialogComponent') {
965
+ return this.findParentlView(parentlView);
966
+ }
967
+ else {
968
+ return p;
969
+ }
970
+ }
971
+ else { // when componentType == 2, then fetch parent again
972
+ return this.findParentlView(parentlView);
973
+ }
974
+ }
975
+ else {
976
+ if (componentType === 0 || componentType === 1) {
977
+ return lView[8];
978
+ }
979
+ else { // when componentType == 2, then fetch parent again
980
+ return this.findParentlView(parentlView);
981
+ }
982
+ }
983
+ };
953
984
  const elementRef = inj.get(ElementRef);
954
985
  this.nativeElement = elementRef.nativeElement;
955
986
  //making the code compatible in both the JIT and AOT modes
@@ -962,21 +993,7 @@ class BaseComponent {
962
993
  // this.viewParent = _viewParent || (this.viewContainerRef as any).parentInjector._lView[8];
963
994
  // https://github.com/angular/angular/blob/main/packages/core/src/render3/interfaces/view.ts
964
995
  let lView = this.inj._lView;
965
- const getParentlView = (lView) => {
966
- //console.log("---*************--widgetType--*************---", this.widgetType);
967
- let parentlView = lView[3];
968
- if (typeof lView[1] === "boolean") { // this is lContainer, not lView if this is boolean
969
- return getParentlView(parentlView);
970
- }
971
- let componentType = lView[1]["type"];
972
- if (componentType === 0 || componentType === 1) {
973
- return lView[8];
974
- }
975
- else { // when componentType == 2, then fetch parent again
976
- return getParentlView(parentlView);
977
- }
978
- };
979
- this.viewParent = getParentlView(lView) || this.viewParentApp;
996
+ this.viewParent = lView[8] === null ? this.viewParentApp : this.findParentlView(lView);
980
997
  //console.log("---*************--context--*************---", lView[8]);
981
998
  this.context = this.inj._lView[8];
982
999
  this.displayType = config.displayType || DISPLAY_TYPE.BLOCK;
@@ -1306,6 +1323,7 @@ class BaseComponent {
1306
1323
  * If the attribute is a bound expression, register a watch on the expression
1307
1324
  */
1308
1325
  processAttr(attrName, attrValue) {
1326
+ // console.log("====attrName=====", attrName, "=====typeof attrname=====", typeof attrName, "-----attrValue----", attrValue);
1309
1327
  const { 0: propName, 1: type, 2: meta, length } = attrName.split('.');
1310
1328
  if (type === 'bind') {
1311
1329
  // if the show property is bound, set the initial value to false
@@ -1979,8 +1997,9 @@ class PartialContainerDirective {
1979
1997
  const componentFactory = await this.partialRefProvider.getComponentFactoryRef(nv, ComponentType.PARTIAL, { prefab: prefabName });
1980
1998
  if (componentFactory) {
1981
1999
  const instanceRef = this.vcRef.createComponent(componentFactory, 0, this.inj);
1982
- if (instanceRef && instanceRef['_component'] && prefabName) {
1983
- instanceRef['_component'].prefabName = prefabName;
2000
+ if (instanceRef && instanceRef['instance'] && prefabName) {
2001
+ // @ts-ignore
2002
+ instanceRef['instance'].prefabName = prefabName;
1984
2003
  }
1985
2004
  if (!this.$target) {
1986
2005
  this.$target = this.elRef.nativeElement.querySelector('[partial-container-target]') || this.elRef.nativeElement;