@praxisui/dynamic-form 9.0.5-rc.37 → 9.0.5-rc.38

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-08-19T01:49:06.767Z",
3
+ "generatedAt": "2026-08-19T02:54:26.311Z",
4
4
  "packageName": "@praxisui/dynamic-form",
5
- "packageVersion": "9.0.5-rc.37",
5
+ "packageVersion": "9.0.5-rc.38",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
8
  "componentCount": 2,
@@ -17553,7 +17553,7 @@ class PraxisDynamicForm {
17553
17553
  this.debugLog('[PDF] settingsPanel.open(FieldMetadataEditor)', { fieldName, composedTitle });
17554
17554
  }
17555
17555
  catch { }
17556
- const ref = this.settingsPanel.open({
17556
+ const ref = this.settingsPanel.openChild({
17557
17557
  id: `field-meta.${this.formId}.${fieldName}`,
17558
17558
  title: composedTitle,
17559
17559
  titleIcon,
@@ -17656,14 +17656,14 @@ class PraxisDynamicForm {
17656
17656
  return;
17657
17657
  Promise.resolve().then(function () { return rowEditor_component; }).then((m) => {
17658
17658
  const { RowEditorComponent } = m;
17659
- const ref = this.settingsPanel.open({
17659
+ const ref = this.settingsPanel.openChild({
17660
17660
  id: `row.${this.formId || 'form'}.${row.id}`,
17661
17661
  title: 'Configurar Linha',
17662
17662
  titleIcon: 'view_stream',
17663
17663
  content: { component: RowEditorComponent, inputs: { row } },
17664
17664
  });
17665
- ref.applied$.pipe(takeUntil(this.destroy$)).subscribe(() => this.cdr.detectChanges());
17666
- ref.saved$.pipe(takeUntil(this.destroy$)).subscribe(() => this.cdr.detectChanges());
17665
+ ref.applied$.pipe(takeUntil(this.destroy$)).subscribe((value) => this.applyRowEditorValue(row, value));
17666
+ ref.saved$.pipe(takeUntil(this.destroy$)).subscribe((value) => this.applyRowEditorValue(row, value));
17667
17667
  });
17668
17668
  }
17669
17669
  openColumnEditor(column) {
@@ -17671,14 +17671,14 @@ class PraxisDynamicForm {
17671
17671
  return;
17672
17672
  Promise.resolve().then(function () { return columnEditor_component; }).then((m) => {
17673
17673
  const { ColumnEditorComponent } = m;
17674
- const ref = this.settingsPanel.open({
17674
+ const ref = this.settingsPanel.openChild({
17675
17675
  id: `column.${this.formId || 'form'}.${column.id}`,
17676
17676
  title: 'Configurar Coluna',
17677
17677
  titleIcon: 'view_column',
17678
17678
  content: { component: ColumnEditorComponent, inputs: { column } },
17679
17679
  });
17680
- ref.applied$.pipe(takeUntil(this.destroy$)).subscribe(() => this.cdr.detectChanges());
17681
- ref.saved$.pipe(takeUntil(this.destroy$)).subscribe(() => this.cdr.detectChanges());
17680
+ ref.applied$.pipe(takeUntil(this.destroy$)).subscribe((value) => this.applyColumnEditorValue(column, value));
17681
+ ref.saved$.pipe(takeUntil(this.destroy$)).subscribe((value) => this.applyColumnEditorValue(column, value));
17682
17682
  });
17683
17683
  }
17684
17684
  openSectionEditor(section, focusTarget) {
@@ -17686,7 +17686,7 @@ class PraxisDynamicForm {
17686
17686
  return;
17687
17687
  Promise.resolve().then(function () { return sectionEditor_component; }).then((m) => {
17688
17688
  const { SectionEditorComponent } = m;
17689
- const ref = this.settingsPanel.open({
17689
+ const ref = this.settingsPanel.openChild({
17690
17690
  id: `section.${this.formId || 'form'}.${section.id}`,
17691
17691
  title: section.title || 'Configurar seção',
17692
17692
  titleIcon: 'view_agenda',
@@ -17703,6 +17703,60 @@ class PraxisDynamicForm {
17703
17703
  });
17704
17704
  });
17705
17705
  }
17706
+ applyRowEditorValue(row, value) {
17707
+ this.applyNestedLayoutEditorValue('row', row, value);
17708
+ }
17709
+ applyColumnEditorValue(column, value) {
17710
+ this.applyNestedLayoutEditorValue('column', column, value);
17711
+ }
17712
+ applyNestedLayoutEditorValue(kind, target, value) {
17713
+ if (!target || !value || typeof value !== 'object')
17714
+ return;
17715
+ const sourceSections = this.config?.sections || [];
17716
+ let targetPosition;
17717
+ for (let sectionIndex = 0; sectionIndex < sourceSections.length; sectionIndex++) {
17718
+ const section = sourceSections[sectionIndex];
17719
+ for (let rowIndex = 0; rowIndex < (section.rows || []).length; rowIndex++) {
17720
+ const row = section.rows[rowIndex];
17721
+ if (kind === 'row' &&
17722
+ (row === target || (!!row?.id && !!target?.id && row.id === target.id))) {
17723
+ targetPosition = { sectionIndex, rowIndex };
17724
+ break;
17725
+ }
17726
+ if (kind === 'column') {
17727
+ const columnIndex = (row.columns || []).findIndex((candidate) => candidate === target ||
17728
+ (!!candidate?.id && !!target?.id && candidate.id === target.id));
17729
+ if (columnIndex >= 0) {
17730
+ targetPosition = { sectionIndex, rowIndex, columnIndex };
17731
+ break;
17732
+ }
17733
+ }
17734
+ }
17735
+ if (targetPosition)
17736
+ break;
17737
+ }
17738
+ if (!targetPosition)
17739
+ return;
17740
+ const sections = structuredClone(sourceSections);
17741
+ const positionedRow = sections[targetPosition.sectionIndex].rows[targetPosition.rowIndex];
17742
+ if (kind === 'row') {
17743
+ sections[targetPosition.sectionIndex].rows[targetPosition.rowIndex] = {
17744
+ ...positionedRow,
17745
+ ...structuredClone(value),
17746
+ };
17747
+ }
17748
+ else {
17749
+ const columnIndex = targetPosition.columnIndex;
17750
+ positionedRow.columns[columnIndex] = {
17751
+ ...positionedRow.columns[columnIndex],
17752
+ ...structuredClone(value),
17753
+ };
17754
+ }
17755
+ this.config = { ...this.config, sections };
17756
+ this.configChange.emit(this.config);
17757
+ this.emitConfigPatchChange();
17758
+ this.cdr.detectChanges();
17759
+ }
17706
17760
  applySectionEditorValue(section, value) {
17707
17761
  if (!section || !value || typeof value !== 'object') {
17708
17762
  this.cdr.detectChanges();
@@ -22774,7 +22828,7 @@ class SectionConfiguratorComponent {
22774
22828
  const SectionEditorComponent = m.SectionEditorComponent;
22775
22829
  if (!SectionEditorComponent)
22776
22830
  return;
22777
- const ref = this.settingsPanel.open({
22831
+ const ref = this.settingsPanel.openChild({
22778
22832
  id: `layout.section.${this.section.id || this.sectionIndex}`,
22779
22833
  title: this.section.title || `Seção ${this.sectionIndex + 1}`,
22780
22834
  titleIcon: 'view_agenda',
@@ -22783,8 +22837,8 @@ class SectionConfiguratorComponent {
22783
22837
  inputs: { section: this.section, fieldMetadata: this.fieldMetadata },
22784
22838
  },
22785
22839
  });
22786
- ref.applied$?.subscribe(() => this.onSectionUpdated());
22787
- ref.saved$?.subscribe(() => this.onSectionUpdated());
22840
+ ref.applied$?.subscribe((value) => this.onSectionUpdated(value));
22841
+ ref.saved$?.subscribe((value) => this.onSectionUpdated(value));
22788
22842
  });
22789
22843
  }
22790
22844
  getSectionHeaderPreview() {
@@ -23376,7 +23430,7 @@ class LayoutEditorComponent {
23376
23430
  this.applyFieldMetadataPatch(fieldName, patch);
23377
23431
  };
23378
23432
  const title = this.t('field.editMetadataTitle').replace('{field}', field.label || field.name);
23379
- const ref = this.settingsPanel.open({
23433
+ const ref = this.settingsPanel.openChild({
23380
23434
  id: `layout.fieldMetadata.${fieldName}`,
23381
23435
  title,
23382
23436
  titleIcon: 'edit_note',
@@ -23426,7 +23480,7 @@ class LayoutEditorComponent {
23426
23480
  if (!section?.id || !row?.id || !column?.id || item?.kind !== 'richContent') {
23427
23481
  return;
23428
23482
  }
23429
- const ref = this.settingsPanel.open({
23483
+ const ref = this.settingsPanel.openChild({
23430
23484
  id: `layout.richContent.${section.id}.${row.id}.${column.id}.${item.id}`,
23431
23485
  title: this.t('visualBlock.editTitle'),
23432
23486
  titleIcon: 'notes',
@@ -30961,16 +31015,45 @@ class PraxisDynamicFormConfigEditor {
30961
31015
  return;
30962
31016
  Promise.resolve().then(function () { return columnEditor_component; }).then((m) => {
30963
31017
  const { ColumnEditorComponent } = m;
30964
- const ref = this.settingsPanel.open({
31018
+ const ref = this.settingsPanel.openChild({
30965
31019
  id: `column.${this.formId || 'form'}.${column.id}`,
30966
31020
  title: this.tx('config.layout.columnEditor.title', 'Configurar Coluna'),
30967
31021
  titleIcon: 'view_column',
30968
31022
  content: { component: ColumnEditorComponent, inputs: { column } },
30969
31023
  });
30970
- ref.applied$.pipe(takeUntil(this.destroy$)).subscribe(() => this.cdr.detectChanges());
30971
- ref.saved$.pipe(takeUntil(this.destroy$)).subscribe(() => this.cdr.detectChanges());
31024
+ ref.applied$.pipe(takeUntil(this.destroy$)).subscribe((value) => this.applyColumnEditorValue(column, value));
31025
+ ref.saved$.pipe(takeUntil(this.destroy$)).subscribe((value) => this.applyColumnEditorValue(column, value));
30972
31026
  });
30973
31027
  }
31028
+ applyColumnEditorValue(column, value) {
31029
+ if (!column || !value || typeof value !== 'object')
31030
+ return;
31031
+ const sourceSections = this.editedConfig.sections || [];
31032
+ let targetPosition;
31033
+ for (let sectionIndex = 0; sectionIndex < sourceSections.length; sectionIndex++) {
31034
+ const section = sourceSections[sectionIndex];
31035
+ for (let rowIndex = 0; rowIndex < (section.rows || []).length; rowIndex++) {
31036
+ const row = section.rows[rowIndex];
31037
+ const index = (row.columns || []).findIndex((candidate) => candidate === column || (!!candidate?.id && !!column?.id && candidate.id === column.id));
31038
+ if (index >= 0) {
31039
+ targetPosition = { sectionIndex, rowIndex, columnIndex: index };
31040
+ break;
31041
+ }
31042
+ }
31043
+ if (targetPosition)
31044
+ break;
31045
+ }
31046
+ if (!targetPosition)
31047
+ return;
31048
+ const sections = structuredClone(sourceSections);
31049
+ const row = sections[targetPosition.sectionIndex].rows[targetPosition.rowIndex];
31050
+ row.columns[targetPosition.columnIndex] = {
31051
+ ...row.columns[targetPosition.columnIndex],
31052
+ ...structuredClone(value),
31053
+ };
31054
+ this.onConfigChange({ ...this.editedConfig, sections });
31055
+ this.cdr.detectChanges();
31056
+ }
30974
31057
  // Cascatas: aplicar patch granular aos campos
30975
31058
  onCascadeApply(patch) {
30976
31059
  const fields = this.editedConfig.fieldMetadata || [];
@@ -32968,7 +33051,7 @@ class SectionEditorComponent {
32968
33051
  this.fb = fb;
32969
33052
  this.data = data;
32970
33053
  this.iconPicker = iconPicker;
32971
- this.section = this.data.section;
33054
+ this.section = structuredClone(this.data.section);
32972
33055
  this.fieldMetadata = this.data.fieldMetadata || this.fieldMetadata;
32973
33056
  }
32974
33057
  ngOnInit() {
@@ -34925,7 +35008,7 @@ class RowEditorComponent {
34925
35008
  constructor(fb, data) {
34926
35009
  this.fb = fb;
34927
35010
  this.data = data;
34928
- this.row = data.row;
35011
+ this.row = structuredClone(data.row);
34929
35012
  }
34930
35013
  ngOnInit() {
34931
35014
  const r = this.data.row;
@@ -34950,7 +35033,6 @@ class RowEditorComponent {
34950
35033
  }
34951
35034
  catch { }
34952
35035
  this.form.valueChanges.pipe(takeUntil(this.destroy$)).subscribe(() => {
34953
- Object.assign(this.data.row, this.form.value);
34954
35036
  let dirty = true;
34955
35037
  try {
34956
35038
  const nowSig = JSON.stringify(this.form.getRawValue());
@@ -34966,7 +35048,7 @@ class RowEditorComponent {
34966
35048
  this.destroy$.complete();
34967
35049
  }
34968
35050
  getSettingsValue() {
34969
- return this.form.value;
35051
+ return { ...this.row, ...this.form.getRawValue() };
34970
35052
  }
34971
35053
  displayValue(value, fallback) {
34972
35054
  if (value === null || value === undefined)
@@ -35300,7 +35382,7 @@ class ColumnEditorComponent {
35300
35382
  constructor(fb, data) {
35301
35383
  this.fb = fb;
35302
35384
  this.data = data;
35303
- this.column = data.column;
35385
+ this.column = structuredClone(data.column);
35304
35386
  }
35305
35387
  ngOnInit() {
35306
35388
  const col = this.data.column;
@@ -35361,10 +35443,10 @@ class ColumnEditorComponent {
35361
35443
  this.destroy$.complete();
35362
35444
  }
35363
35445
  applyChanges() {
35364
- Object.assign(this.data.column, this.form.value);
35446
+ this.column = { ...this.column, ...this.form.getRawValue() };
35365
35447
  }
35366
35448
  getSettingsValue() {
35367
- return this.form.value;
35449
+ return { ...this.column, ...this.form.getRawValue() };
35368
35450
  }
35369
35451
  onBreakpointChange(bp) {
35370
35452
  this.previewBreakpoint = bp;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praxisui/dynamic-form",
3
- "version": "9.0.5-rc.37",
3
+ "version": "9.0.5-rc.38",
4
4
  "description": "Angular dynamic form engine for Praxis UI: metadata-driven forms, hooks, and services integrating @praxisui/* packages.",
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0",
@@ -9,13 +9,13 @@
9
9
  "@angular/forms": "^21.0.0",
10
10
  "@angular/material": "^21.0.0",
11
11
  "@angular/router": "^21.0.0",
12
- "@praxisui/ai": "^9.0.5-rc.37",
13
- "@praxisui/dynamic-fields": "^9.0.5-rc.37",
14
- "@praxisui/metadata-editor": "^9.0.5-rc.37",
15
- "@praxisui/rich-content": "^9.0.5-rc.37",
16
- "@praxisui/settings-panel": "^9.0.5-rc.37",
17
- "@praxisui/visual-builder": "^9.0.5-rc.37",
18
- "@praxisui/core": "^9.0.5-rc.37",
12
+ "@praxisui/ai": "^9.0.5-rc.38",
13
+ "@praxisui/dynamic-fields": "^9.0.5-rc.38",
14
+ "@praxisui/metadata-editor": "^9.0.5-rc.38",
15
+ "@praxisui/rich-content": "^9.0.5-rc.38",
16
+ "@praxisui/settings-panel": "^9.0.5-rc.38",
17
+ "@praxisui/visual-builder": "^9.0.5-rc.38",
18
+ "@praxisui/core": "^9.0.5-rc.38",
19
19
  "rxjs": "^7.8.0"
20
20
  },
21
21
  "dependencies": {
@@ -1358,6 +1358,9 @@ declare class PraxisDynamicForm implements OnInit, OnChanges, OnDestroy {
1358
1358
  private openRowEditor;
1359
1359
  private openColumnEditor;
1360
1360
  openSectionEditor(section: any, focusTarget?: 'title' | 'description'): void;
1361
+ private applyRowEditorValue;
1362
+ private applyColumnEditorValue;
1363
+ private applyNestedLayoutEditorValue;
1361
1364
  private applySectionEditorValue;
1362
1365
  private resolveControlTypeEditorial;
1363
1366
  private getControlTypeIcon;
@@ -1789,6 +1792,7 @@ declare class PraxisDynamicFormConfigEditor implements SettingsValueProvider, On
1789
1792
  ngOnDestroy(): void;
1790
1793
  onLayoutSelect(event: any): void;
1791
1794
  private openColumnEditor;
1795
+ private applyColumnEditorValue;
1792
1796
  onCascadeApply(patch: Record<string, Partial<FieldDefinition>>): void;
1793
1797
  private syncCascadeManagerFields;
1794
1798
  private stripLegacy;