@masterteam/form-builder 0.0.44 → 0.0.45

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.
@@ -1964,6 +1964,8 @@ class FBPreviewForm {
1964
1964
  previewInfo = this.facade.previewInfo;
1965
1965
  moduleType = this.facade.moduleType;
1966
1966
  builderModuleId = this.facade.moduleId;
1967
+ parentModuleType = this.facade.parentModuleType;
1968
+ builderParentModuleId = this.facade.parentModuleId;
1967
1969
  formConfiguration = this.facade.formConfiguration;
1968
1970
  moduleKey = computed(() => {
1969
1971
  const previewModuleKey = this.previewInfo()?.moduleKey?.trim();
@@ -1992,16 +1994,19 @@ class FBPreviewForm {
1992
1994
  return undefined;
1993
1995
  }, ...(ngDevMode ? [{ debugName: "previewModuleId" }] : /* istanbul ignore next */ []));
1994
1996
  previewLevelId = computed(() => {
1995
- if (this.moduleType() === 'module') {
1996
- return undefined;
1997
- }
1998
1997
  const previewLevelId = this.previewInfo()?.levelId;
1999
1998
  if (previewLevelId != null) {
2000
1999
  return previewLevelId;
2001
2000
  }
2001
+ // A level scope's own builder module id IS the level id; a module scope's
2002
+ // level id is its parent level (parentModuleId). `process-form-load` needs
2003
+ // the owning level id in both cases, so derive it rather than dropping it.
2002
2004
  if (this.moduleType() === 'level') {
2003
2005
  return this.builderModuleId() ?? undefined;
2004
2006
  }
2007
+ if (this.moduleType() === 'module' && this.parentModuleType() === 'level') {
2008
+ return this.builderParentModuleId() ?? undefined;
2009
+ }
2005
2010
  return undefined;
2006
2011
  }, ...(ngDevMode ? [{ debugName: "previewLevelId" }] : /* istanbul ignore next */ []));
2007
2012
  renderMode = computed(() => {