ngx-axis-appforge 0.0.30 → 0.0.31

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.
@@ -59,7 +59,7 @@ declare class TreeSelector extends ValueAccess<TreeSelectorOptions> {
59
59
  readonly changeOn: (option: NzCascaderOption, level: number) => boolean;
60
60
  writeValue(value: any): void;
61
61
  private buildTreeData;
62
- private initComponentValue;
62
+ private valueToComponentValue;
63
63
  nodeClick(e: NzFormatEmitEvent): void;
64
64
  private treeNodeToValue;
65
65
  private fullArrayToValue;
@@ -1614,7 +1614,7 @@ class Design extends ValueAccess {
1614
1614
  this.chooseComponentTags.set(tags);
1615
1615
  this.chooseComponentVisible.set(true);
1616
1616
  return this.chooseComponentSubject.asObservable()
1617
- .pipe(take(1), map((example) => this.replaceExampleId(example.options)), switchMap(options => options ? from(this.loader.loadComponent(`${options.component}/design`)).pipe(map(config => ({ options, config }))) : of({})));
1617
+ .pipe(take(1), map((example) => example ? this.replaceExampleId(example.options) : null), switchMap(options => options ? from(this.loader.loadComponent(`${options.component}/design`)).pipe(map(config => ({ options, config }))) : of({})));
1618
1618
  }
1619
1619
  genNewComponentId(component, offset = 1, existsIds) {
1620
1620
  let id;
@@ -1667,9 +1667,14 @@ class Design extends ValueAccess {
1667
1667
  const idMap = new Map();
1668
1668
  this.buildIdMap(example, idMap);
1669
1669
  let exampleStr = JSON.stringify(example);
1670
- idMap.forEach((newId, oldId) => {
1671
- exampleStr = exampleStr.replaceAll(oldId, newId);
1672
- });
1670
+ while (idMap.size > 0) {
1671
+ idMap.forEach((newId, oldId) => {
1672
+ if (!idMap.has(newId)) {
1673
+ exampleStr = exampleStr.replaceAll(oldId, newId);
1674
+ idMap.delete(oldId);
1675
+ }
1676
+ });
1677
+ }
1673
1678
  return JSON.parse(exampleStr);
1674
1679
  }
1675
1680
  buildIdMap(obj, idMap, offsetMap = new Map()) {
@@ -1677,7 +1682,9 @@ class Design extends ValueAccess {
1677
1682
  const offset = (offsetMap.get(obj.component) ?? 0) + 1;
1678
1683
  const res = this.genNewComponentId(obj.component, offset, new Set(idMap.values()));
1679
1684
  offsetMap.set(obj.component, res.offset);
1680
- idMap.set(obj.id, res.id);
1685
+ if (obj.id != res.id) {
1686
+ idMap.set(obj.id, res.id);
1687
+ }
1681
1688
  }
1682
1689
  if (obj) {
1683
1690
  if (Array.isArray(obj)) {