@praxisui/metadata-editor 8.0.0-beta.3 → 8.0.0-beta.30

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,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Injectable, inject, Component, Input, ViewEncapsulation, EventEmitter, DestroyRef, Output, signal, ENVIRONMENT_INITIALIZER } from '@angular/core';
3
- import * as i3 from '@angular/forms';
4
- import { FormControl, FormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
5
- import * as i3$1 from '@angular/common';
3
+ import * as i2 from '@angular/forms';
4
+ import { FormControl, FormGroup, ReactiveFormsModule, FormArray, FormBuilder, FormsModule } from '@angular/forms';
5
+ import * as i3 from '@angular/common';
6
6
  import { CommonModule } from '@angular/common';
7
7
  import { DynamicFieldLoaderDirective } from '@praxisui/dynamic-fields';
8
- import * as i2$1 from '@praxisui/core';
9
- import { FieldControlType, PraxisIconDirective, INLINE_FILTER_CONTROL_TYPES, resolveInlineFilterControlType, normalizeControlTypeToken, ComponentMetadataRegistry } from '@praxisui/core';
8
+ import * as i2$2 from '@praxisui/core';
9
+ import { FieldControlType, PraxisIconDirective, providePraxisI18n, PraxisI18nService, INLINE_FILTER_CONTROL_TYPES, resolveInlineFilterControlType, normalizeControlTypeToken, ComponentMetadataRegistry } from '@praxisui/core';
10
10
  import * as i5 from '@angular/material/expansion';
11
11
  import { MatExpansionModule } from '@angular/material/expansion';
12
12
  import * as i6 from '@angular/material/icon';
@@ -17,7 +17,7 @@ import * as i1 from '@angular/material/dialog';
17
17
  import { MatDialogRef, MatDialogModule } from '@angular/material/dialog';
18
18
  import * as i8 from '@angular/material/tooltip';
19
19
  import { MatTooltipModule } from '@angular/material/tooltip';
20
- import * as i2 from '@angular/material/list';
20
+ import * as i2$1 from '@angular/material/list';
21
21
  import { MatListModule } from '@angular/material/list';
22
22
  import { SETTINGS_PANEL_DATA } from '@praxisui/settings-panel';
23
23
  import { BehaviorSubject } from 'rxjs';
@@ -276,13 +276,13 @@ class DynamicFormFactoryService {
276
276
  }
277
277
  return result;
278
278
  }
279
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicFormFactoryService, deps: [{ token: i3.FormBuilder }, { token: ContextValidatorRegistryService }], target: i0.ɵɵFactoryTarget.Injectable });
279
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicFormFactoryService, deps: [{ token: i2.FormBuilder }, { token: ContextValidatorRegistryService }], target: i0.ɵɵFactoryTarget.Injectable });
280
280
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicFormFactoryService, providedIn: 'root' });
281
281
  }
282
282
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicFormFactoryService, decorators: [{
283
283
  type: Injectable,
284
284
  args: [{ providedIn: 'root' }]
285
- }], ctorParameters: () => [{ type: i3.FormBuilder }, { type: ContextValidatorRegistryService }] });
285
+ }], ctorParameters: () => [{ type: i2.FormBuilder }, { type: ContextValidatorRegistryService }] });
286
286
 
287
287
  class EditorComponentRegistryService {
288
288
  registry = new Map();
@@ -371,7 +371,7 @@ class RegexHelpDialogComponent {
371
371
  <div mat-dialog-actions>
372
372
  <button class="mat-mdc-button mdc-button" mat-dialog-close>Fechar</button>
373
373
  </div>
374
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i2.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i2.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "ngmodule", type: MatButtonModule }] });
374
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatDialogModule }, { kind: "directive", type: i1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "ngmodule", type: MatListModule }, { kind: "component", type: i2$1.MatNavList, selector: "mat-nav-list", exportAs: ["matNavList"] }, { kind: "component", type: i2$1.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "directive", type: i2$1.MatListItemLine, selector: "[matListItemLine]" }, { kind: "directive", type: i2$1.MatListItemTitle, selector: "[matListItemTitle]" }, { kind: "ngmodule", type: MatButtonModule }] });
375
375
  }
376
376
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: RegexHelpDialogComponent, decorators: [{
377
377
  type: Component,
@@ -530,6 +530,7 @@ class DynamicEditorRendererComponent {
530
530
  const order = [
531
531
  'geral',
532
532
  'apresent',
533
+ 'display',
533
534
  'valida',
534
535
  'formato',
535
536
  'comport',
@@ -594,7 +595,7 @@ class DynamicEditorRendererComponent {
594
595
  .replace(/[ñ]/g, 'n');
595
596
  if (normalized.includes('geral'))
596
597
  return 'widgets';
597
- if (normalized.includes('apresent'))
598
+ if (normalized.includes('apresent') || normalized.includes('display'))
598
599
  return 'slideshow';
599
600
  if (normalized.includes('dados') || normalized.includes('opcoes'))
600
601
  return 'list_alt';
@@ -683,7 +684,7 @@ class DynamicEditorRendererComponent {
683
684
  this.form?.markAsDirty();
684
685
  }
685
686
  }
686
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicEditorRendererComponent, deps: [{ token: i1.MatDialog }, { token: i2$1.IconPickerService }], target: i0.ɵɵFactoryTarget.Component });
687
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicEditorRendererComponent, deps: [{ token: i1.MatDialog }, { token: i2$2.IconPickerService }], target: i0.ɵɵFactoryTarget.Component });
687
688
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: DynamicEditorRendererComponent, isStandalone: true, selector: "praxis-dynamic-editor-renderer", inputs: { properties: "properties", form: "form" }, usesOnChanges: true, ngImport: i0, template: `
688
689
  <ng-template #item let-field="field" let-index="index" let-content="content">
689
690
  <div class="editor-item" [attr.data-control-type]="field.controlType">
@@ -753,7 +754,7 @@ class DynamicEditorRendererComponent {
753
754
  </mat-expansion-panel>
754
755
  </mat-accordion>
755
756
  </div>
756
- `, isInline: true, styles: [":host{display:block}.editor-surface{padding:8px 0 2px;border-radius:12px;background:transparent}.section-accordion{display:block}.section-card{margin:6px 0 8px;border-radius:12px;border:1px solid var(--md-sys-color-outline-variant);overflow:hidden}.section-card.mat-expanded{border-color:var(--md-sys-color-primary);box-shadow:0 2px 10px #0000000d}.section-card .mat-expansion-panel-body{background:var(--md-sys-color-surface-container-low)}.section-header{background:var(--md-sys-color-surface-container-low);border-bottom:1px solid var(--md-sys-color-outline-variant, var(--sicoob-stroke-medium));padding:2px 8px;min-height:32px;display:flex;align-items:center;color:var(--md-sys-color-on-surface)}.section-header .mat-expansion-panel-header-title,.section-header .mat-expansion-panel-header-description{display:flex;align-items:center;color:var(--md-sys-color-on-surface)}.section-title{display:inline-flex;align-items:center;gap:6px;font-weight:600;letter-spacing:.2px;color:var(--md-sys-color-on-surface);font-size:.9rem;line-height:1.2}.section-icon{color:var(--md-sys-color-primary, var(--md-sys-color-primary, #3f51b5));opacity:.9}.editor-row{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;margin-bottom:8px}.editor-row>praxis-field-shell{flex:1 1 100%;min-width:280px}.editor-row praxis-field-shell .mat-mdc-form-field{width:100%;margin-bottom:8px}.editor-row.row-inline>praxis-field-shell{flex:0 0 auto}.editor-row.row-2>praxis-field-shell{flex:1 1 calc(50% - 12px);min-width:260px}.editor-row.row-3>praxis-field-shell{flex:1 1 calc(33.333% - 12px);min-width:220px}.editor-row>praxis-field-shell[data-field-name=controlType],.editor-row>praxis-field-shell[data-field-name=label],.editor-row>praxis-field-shell[data-field-name=placeholder]{flex:1 1 calc(50% - 12px);min-width:300px}praxis-field-shell[data-field-name=label] .mdc-floating-label,praxis-field-shell[data-field-name=placeholder] .mdc-floating-label{font-weight:600}.editor-row>praxis-field-shell[data-field-name=prefix],.editor-row>praxis-field-shell[data-field-name=suffix]{flex:0 0 200px;min-width:160px}.editor-row>praxis-field-shell[data-field-name=prefixIcon],.editor-row>praxis-field-shell[data-field-name=suffixIcon],.editor-row>praxis-field-shell[data-field-name=prefixIconColor],.editor-row>praxis-field-shell[data-field-name=suffixIconColor]{flex:1 1 auto;min-width:160px}.editor-item{display:flex;align-items:flex-start;gap:4px}.editor-item>ng-container,.editor-item>praxis-field-shell{flex:1;min-width:0}.actions-container{display:flex;align-items:center;gap:0;margin-top:12px;flex-shrink:0}.decorator-btn{position:static;color:var(--md-sys-color-primary, #3f51b5);opacity:.6;transform:scale(.8);width:32px;height:32px;line-height:32px;padding:0}.decorator-btn:hover{opacity:1}.icon-picker-btn,.hint-btn,.hint-btn.has-icon-picker{right:auto}.editor-row .mat-mdc-form-field-subscript-wrapper mat-hint{display:none!important}.editor-row .mat-mdc-form-field-subscript-wrapper mat-error{display:block!important}praxis-field-shell[data-field-name=showCharCount] .mdc-switch{transform:scale(1.05)}praxis-field-shell[data-field-name=showCharCount] .mat-mdc-slide-toggle{font-weight:600}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-hint{display:flex;align-items:center;gap:8px;background:var(--md-sys-color-tertiary-container);border:1px solid var(--md-sys-color-tertiary);color:var(--md-sys-color-on-tertiary-container);padding:8px 10px;border-radius:6px;line-height:1.3;white-space:normal}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-hint:before{content:\"\\26a0\\fe0f\";display:inline-block}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-subscript-wrapper{margin-top:6px;margin-bottom:10px;min-height:auto}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field{margin-bottom:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: DynamicFieldLoaderDirective, selector: "[dynamicFieldLoader]", inputs: ["fields", "formGroup", "enableExternalControlBinding", "itemTemplate", "debugTrace", "debugTraceLabel", "readonlyMode", "disabledMode", "presentationMode", "visible", "canvasMode"], outputs: ["componentsCreated", "fieldCreated", "fieldDestroyed", "renderError", "canvasMouseEnter", "canvasMouseLeave", "canvasClick"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i5.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i5.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], encapsulation: i0.ViewEncapsulation.None });
757
+ `, isInline: true, styles: [":host{display:block}.editor-surface{padding:8px 0 2px;border-radius:12px;background:transparent}.section-accordion{display:block}.section-card{margin:6px 0 8px;border-radius:12px;border:1px solid var(--md-sys-color-outline-variant);overflow:hidden}.section-card.mat-expanded{border-color:var(--md-sys-color-primary);box-shadow:0 2px 10px #0000000d}.section-card .mat-expansion-panel-body{background:var(--md-sys-color-surface-container-low)}.section-header{background:var(--md-sys-color-surface-container-low);border-bottom:1px solid var(--md-sys-color-outline-variant, var(--sicoob-stroke-medium));padding:2px 8px;min-height:32px;display:flex;align-items:center;color:var(--md-sys-color-on-surface)}.section-header .mat-expansion-panel-header-title,.section-header .mat-expansion-panel-header-description{display:flex;align-items:center;color:var(--md-sys-color-on-surface)}.section-title{display:inline-flex;align-items:center;gap:6px;font-weight:600;letter-spacing:.2px;color:var(--md-sys-color-on-surface);font-size:.9rem;line-height:1.2}.section-icon{color:var(--md-sys-color-primary, var(--md-sys-color-primary, #3f51b5));opacity:.9}.editor-row{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;margin-bottom:8px}.editor-row>praxis-field-shell{flex:1 1 100%;min-width:280px}.editor-row praxis-field-shell .mat-mdc-form-field{width:100%;margin-bottom:8px}.editor-row.row-inline>praxis-field-shell{flex:0 0 auto}.editor-row.row-2>praxis-field-shell{flex:1 1 calc(50% - 12px);min-width:260px}.editor-row.row-3>praxis-field-shell{flex:1 1 calc(33.333% - 12px);min-width:220px}.editor-row>praxis-field-shell[data-field-name=controlType],.editor-row>praxis-field-shell[data-field-name=label],.editor-row>praxis-field-shell[data-field-name=placeholder]{flex:1 1 calc(50% - 12px);min-width:300px}praxis-field-shell[data-field-name=label] .mdc-floating-label,praxis-field-shell[data-field-name=placeholder] .mdc-floating-label{font-weight:600}.editor-row>praxis-field-shell[data-field-name=prefix],.editor-row>praxis-field-shell[data-field-name=suffix]{flex:0 0 200px;min-width:160px}.editor-row>praxis-field-shell[data-field-name=prefixIcon],.editor-row>praxis-field-shell[data-field-name=suffixIcon],.editor-row>praxis-field-shell[data-field-name=prefixIconColor],.editor-row>praxis-field-shell[data-field-name=suffixIconColor]{flex:1 1 auto;min-width:160px}.editor-item{display:flex;align-items:flex-start;gap:4px}.editor-item>ng-container,.editor-item>praxis-field-shell{flex:1;min-width:0}.actions-container{display:flex;align-items:center;gap:0;margin-top:12px;flex-shrink:0}.decorator-btn{position:static;color:var(--md-sys-color-primary, #3f51b5);opacity:.6;transform:scale(.8);width:32px;height:32px;line-height:32px;padding:0}.decorator-btn:hover{opacity:1}.icon-picker-btn,.hint-btn,.hint-btn.has-icon-picker{right:auto}.editor-row .mat-mdc-form-field-subscript-wrapper mat-hint{display:none!important}.editor-row .mat-mdc-form-field-subscript-wrapper mat-error{display:block!important}praxis-field-shell[data-field-name=showCharCount] .mdc-switch{transform:scale(1.05)}praxis-field-shell[data-field-name=showCharCount] .mat-mdc-slide-toggle{font-weight:600}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-hint{display:flex;align-items:center;gap:8px;background:var(--md-sys-color-tertiary-container);border:1px solid var(--md-sys-color-tertiary);color:var(--md-sys-color-on-tertiary-container);padding:8px 10px;border-radius:6px;line-height:1.3;white-space:normal}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-hint:before{content:\"\\26a0\\fe0f\";display:inline-block}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-subscript-wrapper{margin-top:6px;margin-bottom:10px;min-height:auto}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field{margin-bottom:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: DynamicFieldLoaderDirective, selector: "[dynamicFieldLoader]", inputs: ["fields", "formGroup", "enableExternalControlBinding", "itemTemplate", "debugTrace", "debugTraceLabel", "readonlyMode", "disabledMode", "presentationMode", "visible", "canvasMode"], outputs: ["componentsCreated", "fieldCreated", "fieldDestroyed", "renderError", "canvasMouseEnter", "canvasMouseLeave", "canvasClick", "canvasFocus"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "directive", type: i5.MatAccordion, selector: "mat-accordion", inputs: ["hideToggle", "displayMode", "togglePosition"], exportAs: ["matAccordion"] }, { kind: "component", type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i5.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatDialogModule }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }], encapsulation: i0.ViewEncapsulation.None });
757
758
  }
758
759
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicEditorRendererComponent, decorators: [{
759
760
  type: Component,
@@ -837,12 +838,837 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
837
838
  </mat-accordion>
838
839
  </div>
839
840
  `, styles: [":host{display:block}.editor-surface{padding:8px 0 2px;border-radius:12px;background:transparent}.section-accordion{display:block}.section-card{margin:6px 0 8px;border-radius:12px;border:1px solid var(--md-sys-color-outline-variant);overflow:hidden}.section-card.mat-expanded{border-color:var(--md-sys-color-primary);box-shadow:0 2px 10px #0000000d}.section-card .mat-expansion-panel-body{background:var(--md-sys-color-surface-container-low)}.section-header{background:var(--md-sys-color-surface-container-low);border-bottom:1px solid var(--md-sys-color-outline-variant, var(--sicoob-stroke-medium));padding:2px 8px;min-height:32px;display:flex;align-items:center;color:var(--md-sys-color-on-surface)}.section-header .mat-expansion-panel-header-title,.section-header .mat-expansion-panel-header-description{display:flex;align-items:center;color:var(--md-sys-color-on-surface)}.section-title{display:inline-flex;align-items:center;gap:6px;font-weight:600;letter-spacing:.2px;color:var(--md-sys-color-on-surface);font-size:.9rem;line-height:1.2}.section-icon{color:var(--md-sys-color-primary, var(--md-sys-color-primary, #3f51b5));opacity:.9}.editor-row{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;margin-bottom:8px}.editor-row>praxis-field-shell{flex:1 1 100%;min-width:280px}.editor-row praxis-field-shell .mat-mdc-form-field{width:100%;margin-bottom:8px}.editor-row.row-inline>praxis-field-shell{flex:0 0 auto}.editor-row.row-2>praxis-field-shell{flex:1 1 calc(50% - 12px);min-width:260px}.editor-row.row-3>praxis-field-shell{flex:1 1 calc(33.333% - 12px);min-width:220px}.editor-row>praxis-field-shell[data-field-name=controlType],.editor-row>praxis-field-shell[data-field-name=label],.editor-row>praxis-field-shell[data-field-name=placeholder]{flex:1 1 calc(50% - 12px);min-width:300px}praxis-field-shell[data-field-name=label] .mdc-floating-label,praxis-field-shell[data-field-name=placeholder] .mdc-floating-label{font-weight:600}.editor-row>praxis-field-shell[data-field-name=prefix],.editor-row>praxis-field-shell[data-field-name=suffix]{flex:0 0 200px;min-width:160px}.editor-row>praxis-field-shell[data-field-name=prefixIcon],.editor-row>praxis-field-shell[data-field-name=suffixIcon],.editor-row>praxis-field-shell[data-field-name=prefixIconColor],.editor-row>praxis-field-shell[data-field-name=suffixIconColor]{flex:1 1 auto;min-width:160px}.editor-item{display:flex;align-items:flex-start;gap:4px}.editor-item>ng-container,.editor-item>praxis-field-shell{flex:1;min-width:0}.actions-container{display:flex;align-items:center;gap:0;margin-top:12px;flex-shrink:0}.decorator-btn{position:static;color:var(--md-sys-color-primary, #3f51b5);opacity:.6;transform:scale(.8);width:32px;height:32px;line-height:32px;padding:0}.decorator-btn:hover{opacity:1}.icon-picker-btn,.hint-btn,.hint-btn.has-icon-picker{right:auto}.editor-row .mat-mdc-form-field-subscript-wrapper mat-hint{display:none!important}.editor-row .mat-mdc-form-field-subscript-wrapper mat-error{display:block!important}praxis-field-shell[data-field-name=showCharCount] .mdc-switch{transform:scale(1.05)}praxis-field-shell[data-field-name=showCharCount] .mat-mdc-slide-toggle{font-weight:600}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-hint{display:flex;align-items:center;gap:8px;background:var(--md-sys-color-tertiary-container);border:1px solid var(--md-sys-color-tertiary);color:var(--md-sys-color-on-tertiary-container);padding:8px 10px;border-radius:6px;line-height:1.3;white-space:normal}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-hint:before{content:\"\\26a0\\fe0f\";display:inline-block}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field-subscript-wrapper{margin-top:6px;margin-bottom:10px;min-height:auto}praxis-field-shell[data-field-name=controlType] .mat-mdc-form-field{margin-bottom:16px}\n"] }]
840
- }], ctorParameters: () => [{ type: i1.MatDialog }, { type: i2$1.IconPickerService }], propDecorators: { properties: [{
841
+ }], ctorParameters: () => [{ type: i1.MatDialog }, { type: i2$2.IconPickerService }], propDecorators: { properties: [{
841
842
  type: Input
842
843
  }], form: [{
843
844
  type: Input
844
845
  }] } });
845
846
 
847
+ const METADATA_EDITOR_EN_US = {
848
+ 'praxis.metadataEditor.arrayFields.section': 'Collection subfields',
849
+ 'praxis.metadataEditor.arrayFields.title': 'Subfields',
850
+ 'praxis.metadataEditor.arrayFields.add': 'Add subfield',
851
+ 'praxis.metadataEditor.arrayFields.duplicateNames': 'There are duplicate names: {{names}}',
852
+ 'praxis.metadataEditor.arrayFields.empty': 'No local subfields configured.',
853
+ 'praxis.metadataEditor.arrayFields.name': 'Name',
854
+ 'praxis.metadataEditor.arrayFields.nameRequired': 'Enter the subfield name.',
855
+ 'praxis.metadataEditor.arrayFields.nameDuplicated': 'This name is already used in the collection.',
856
+ 'praxis.metadataEditor.arrayFields.label': 'Label',
857
+ 'praxis.metadataEditor.arrayFields.controlType': 'Control',
858
+ 'praxis.metadataEditor.arrayFields.required': 'Required',
859
+ 'praxis.metadataEditor.arrayFields.moveUp': 'Move up',
860
+ 'praxis.metadataEditor.arrayFields.moveDown': 'Move down',
861
+ 'praxis.metadataEditor.arrayFields.duplicate': 'Duplicate',
862
+ 'praxis.metadataEditor.arrayFields.remove': 'Remove',
863
+ 'praxis.metadataEditor.arrayFields.removeBlocked': 'Remove references before deleting: {{references}}',
864
+ 'praxis.metadataEditor.arrayFields.refOnly': 'The item schema comes from itemSchemaRef; create local subfields only when you need an override.',
865
+ 'praxis.metadataEditor.arrayFields.overrideLocal': 'There is an itemSchemaRef and local subfields; local subfields work as an explicit override.',
866
+ 'praxis.metadataEditor.arrayFields.imported': 'Subfields imported. Review them before applying or saving.',
867
+ 'praxis.metadataEditor.arrayFields.localOnly': 'Local subfields will be saved in array.itemSchema.fields.',
868
+ 'praxis.metadataEditor.arrayFields.control.input': 'Text',
869
+ 'praxis.metadataEditor.arrayFields.control.textarea': 'Long text',
870
+ 'praxis.metadataEditor.arrayFields.control.numeric': 'Number',
871
+ 'praxis.metadataEditor.arrayFields.control.currency': 'Currency',
872
+ 'praxis.metadataEditor.arrayFields.control.email': 'Email',
873
+ 'praxis.metadataEditor.arrayFields.control.phone': 'Phone',
874
+ 'praxis.metadataEditor.arrayFields.control.select': 'Select',
875
+ 'praxis.metadataEditor.arrayFields.control.entityLookup': 'Entity lookup',
876
+ 'praxis.metadataEditor.arrayFields.control.toggle': 'Toggle',
877
+ 'praxis.metadataEditor.arrayFields.control.date': 'Date',
878
+ };
879
+
880
+ const METADATA_EDITOR_PT_BR = {
881
+ 'praxis.metadataEditor.arrayFields.section': 'Subcampos da cole\u00e7\u00e3o',
882
+ 'praxis.metadataEditor.arrayFields.title': 'Subcampos',
883
+ 'praxis.metadataEditor.arrayFields.add': 'Adicionar subcampo',
884
+ 'praxis.metadataEditor.arrayFields.duplicateNames': 'Existem nomes duplicados: {{names}}',
885
+ 'praxis.metadataEditor.arrayFields.empty': 'Nenhum subcampo local configurado.',
886
+ 'praxis.metadataEditor.arrayFields.name': 'Nome',
887
+ 'praxis.metadataEditor.arrayFields.nameRequired': 'Informe o nome do subcampo.',
888
+ 'praxis.metadataEditor.arrayFields.nameDuplicated': 'Este nome j\u00e1 est\u00e1 em uso na cole\u00e7\u00e3o.',
889
+ 'praxis.metadataEditor.arrayFields.label': 'Label',
890
+ 'praxis.metadataEditor.arrayFields.controlType': 'Controle',
891
+ 'praxis.metadataEditor.arrayFields.required': 'Obrigat\u00f3rio',
892
+ 'praxis.metadataEditor.arrayFields.moveUp': 'Subir',
893
+ 'praxis.metadataEditor.arrayFields.moveDown': 'Descer',
894
+ 'praxis.metadataEditor.arrayFields.duplicate': 'Duplicar',
895
+ 'praxis.metadataEditor.arrayFields.remove': 'Remover',
896
+ 'praxis.metadataEditor.arrayFields.removeBlocked': 'Remova as refer\u00eancias antes de excluir: {{references}}',
897
+ 'praxis.metadataEditor.arrayFields.refOnly': 'O schema do item vem do itemSchemaRef; crie subcampos locais apenas quando precisar de override.',
898
+ 'praxis.metadataEditor.arrayFields.overrideLocal': 'H\u00e1 um itemSchemaRef e subcampos locais; os subcampos locais funcionam como override expl\u00edcito.',
899
+ 'praxis.metadataEditor.arrayFields.imported': 'Subcampos importados. Revise antes de aplicar ou salvar.',
900
+ 'praxis.metadataEditor.arrayFields.localOnly': 'Subcampos locais ser\u00e3o salvos em array.itemSchema.fields.',
901
+ 'praxis.metadataEditor.arrayFields.control.input': 'Texto',
902
+ 'praxis.metadataEditor.arrayFields.control.textarea': 'Texto longo',
903
+ 'praxis.metadataEditor.arrayFields.control.numeric': 'N\u00famero',
904
+ 'praxis.metadataEditor.arrayFields.control.currency': 'Moeda',
905
+ 'praxis.metadataEditor.arrayFields.control.email': 'E-mail',
906
+ 'praxis.metadataEditor.arrayFields.control.phone': 'Telefone',
907
+ 'praxis.metadataEditor.arrayFields.control.select': 'Sele\u00e7\u00e3o',
908
+ 'praxis.metadataEditor.arrayFields.control.entityLookup': 'Busca de entidade',
909
+ 'praxis.metadataEditor.arrayFields.control.toggle': 'Liga/desliga',
910
+ 'praxis.metadataEditor.arrayFields.control.date': 'Data',
911
+ };
912
+
913
+ function createPraxisMetadataEditorI18nConfig(options = {}) {
914
+ const dictionaries = {
915
+ 'pt-BR': {
916
+ ...METADATA_EDITOR_PT_BR,
917
+ ...(options.dictionaries?.['pt-BR'] ?? {}),
918
+ },
919
+ 'en-US': {
920
+ ...METADATA_EDITOR_EN_US,
921
+ ...(options.dictionaries?.['en-US'] ?? {}),
922
+ },
923
+ };
924
+ for (const [locale, dictionary] of Object.entries(options.dictionaries ?? {})) {
925
+ if (locale === 'pt-BR' || locale === 'en-US') {
926
+ continue;
927
+ }
928
+ dictionaries[locale] = {
929
+ ...(dictionaries[locale] ?? {}),
930
+ ...dictionary,
931
+ };
932
+ }
933
+ return {
934
+ locale: options.locale,
935
+ fallbackLocale: options.fallbackLocale ?? 'pt-BR',
936
+ dictionaries,
937
+ };
938
+ }
939
+ const METADATA_EDITOR_I18N_CONFIG = createPraxisMetadataEditorI18nConfig();
940
+ function providePraxisMetadataEditorI18n(options = {}) {
941
+ return providePraxisI18n(createPraxisMetadataEditorI18nConfig(options));
942
+ }
943
+ function resolvePraxisMetadataEditorText(i18n, key, fallback) {
944
+ const namespacedKey = key.startsWith('praxis.metadataEditor.')
945
+ ? key
946
+ : `praxis.metadataEditor.${key}`;
947
+ return i18n.t(namespacedKey, undefined, fallback) || fallback;
948
+ }
949
+
950
+ class ArrayItemSchemaFieldsEditorComponent {
951
+ static nextInstanceId = 0;
952
+ control = null;
953
+ arrayControl = null;
954
+ formArray = new FormArray([]);
955
+ form = new FormGroup({ fields: this.formArray });
956
+ controlTypeOptions = [
957
+ FieldControlType.INPUT,
958
+ FieldControlType.TEXTAREA,
959
+ FieldControlType.NUMERIC_TEXT_BOX,
960
+ FieldControlType.CURRENCY_INPUT,
961
+ FieldControlType.EMAIL_INPUT,
962
+ FieldControlType.PHONE,
963
+ FieldControlType.SELECT,
964
+ FieldControlType.ENTITY_LOOKUP,
965
+ FieldControlType.TOGGLE,
966
+ FieldControlType.DATE_INPUT,
967
+ ];
968
+ schemaSourceState = 'local-only';
969
+ duplicateNames = [];
970
+ fb = inject(FormBuilder);
971
+ i18n = inject(PraxisI18nService);
972
+ instanceId = ++ArrayItemSchemaFieldsEditorComponent.nextInstanceId;
973
+ externalSubscription;
974
+ internalSubscription;
975
+ originalNames = [];
976
+ importedFieldsFingerprint = null;
977
+ hydrating = false;
978
+ get rows() {
979
+ return this.formArray.controls;
980
+ }
981
+ ngOnChanges(changes) {
982
+ if (changes['control']) {
983
+ this.externalSubscription?.unsubscribe();
984
+ this.hydrateFromControl();
985
+ this.externalSubscription = this.control?.valueChanges.subscribe(() => {
986
+ if (!this.hydrating) {
987
+ this.hydrateFromControl();
988
+ }
989
+ });
990
+ }
991
+ if (changes['arrayControl'] || changes['control']) {
992
+ this.updateSchemaSourceState();
993
+ }
994
+ }
995
+ ngOnDestroy() {
996
+ this.externalSubscription?.unsubscribe();
997
+ this.internalSubscription?.unsubscribe();
998
+ }
999
+ text(key, fallback, fallbackWithParams, params) {
1000
+ return this.i18n.t(key, params, fallbackWithParams ?? fallback);
1001
+ }
1002
+ controlTypeLabel(controlType) {
1003
+ const labels = {
1004
+ [FieldControlType.INPUT]: this.text('praxis.metadataEditor.arrayFields.control.input', 'Texto'),
1005
+ [FieldControlType.TEXTAREA]: this.text('praxis.metadataEditor.arrayFields.control.textarea', 'Texto longo'),
1006
+ [FieldControlType.NUMERIC_TEXT_BOX]: this.text('praxis.metadataEditor.arrayFields.control.numeric', 'N\u00famero'),
1007
+ [FieldControlType.CURRENCY_INPUT]: this.text('praxis.metadataEditor.arrayFields.control.currency', 'Moeda'),
1008
+ [FieldControlType.EMAIL_INPUT]: this.text('praxis.metadataEditor.arrayFields.control.email', 'E-mail'),
1009
+ [FieldControlType.PHONE]: this.text('praxis.metadataEditor.arrayFields.control.phone', 'Telefone'),
1010
+ [FieldControlType.SELECT]: this.text('praxis.metadataEditor.arrayFields.control.select', 'Sele\u00e7\u00e3o'),
1011
+ [FieldControlType.ENTITY_LOOKUP]: this.text('praxis.metadataEditor.arrayFields.control.entityLookup', 'Busca de entidade'),
1012
+ [FieldControlType.TOGGLE]: this.text('praxis.metadataEditor.arrayFields.control.toggle', 'Liga/desliga'),
1013
+ [FieldControlType.DATE_INPUT]: this.text('praxis.metadataEditor.arrayFields.control.date', 'Data'),
1014
+ };
1015
+ return labels[controlType] ?? controlType;
1016
+ }
1017
+ addField(seed = {}) {
1018
+ const fieldName = seed.name || this.nextAvailableName();
1019
+ this.formArray.push(this.createRow({
1020
+ ...seed,
1021
+ name: fieldName,
1022
+ label: seed.label || fieldName,
1023
+ controlType: seed.controlType || FieldControlType.INPUT,
1024
+ required: seed.required ?? false,
1025
+ }));
1026
+ this.originalNames.push(fieldName);
1027
+ this.syncToControl();
1028
+ }
1029
+ duplicateField(index) {
1030
+ const current = this.rowValue(index);
1031
+ if (!current)
1032
+ return;
1033
+ const nextName = this.nextAvailableName(`${current.name || 'field'}Copy`);
1034
+ this.addField({
1035
+ ...current,
1036
+ name: nextName,
1037
+ label: nextName,
1038
+ });
1039
+ }
1040
+ removeField(index) {
1041
+ const name = String(this.formArray.at(index)?.get('name')?.value || '').trim();
1042
+ if (this.isReferenced(name)) {
1043
+ return;
1044
+ }
1045
+ this.formArray.removeAt(index);
1046
+ this.originalNames.splice(index, 1);
1047
+ this.syncToControl();
1048
+ }
1049
+ moveField(index, delta) {
1050
+ const target = index + delta;
1051
+ if (target < 0 || target >= this.formArray.length)
1052
+ return;
1053
+ const row = this.formArray.at(index);
1054
+ this.formArray.removeAt(index);
1055
+ this.formArray.insert(target, row);
1056
+ const [originalName] = this.originalNames.splice(index, 1);
1057
+ this.originalNames.splice(target, 0, originalName);
1058
+ this.syncToControl();
1059
+ }
1060
+ onNameBlur(index) {
1061
+ const previous = this.originalNames[index];
1062
+ const next = String(this.formArray.at(index)?.get('name')?.value || '').trim();
1063
+ if (previous && !next && this.isReferenced(previous)) {
1064
+ this.formArray.at(index)?.get('name')?.setValue(previous, { emitEvent: false });
1065
+ this.syncToControl();
1066
+ return;
1067
+ }
1068
+ if (previous && next && previous !== next) {
1069
+ this.renameReferences(previous, next);
1070
+ this.originalNames[index] = next;
1071
+ }
1072
+ this.syncToControl();
1073
+ }
1074
+ importFieldsFromJson(raw) {
1075
+ try {
1076
+ const parsed = JSON.parse(String(raw || '').trim());
1077
+ if (!Array.isArray(parsed) ||
1078
+ parsed.some((entry) => !this.isImportableField(entry))) {
1079
+ return false;
1080
+ }
1081
+ this.replaceRows(parsed);
1082
+ this.schemaSourceState = 'imported';
1083
+ this.importedFieldsFingerprint = this.fieldsFingerprint();
1084
+ this.syncToControl();
1085
+ return true;
1086
+ }
1087
+ catch {
1088
+ return false;
1089
+ }
1090
+ }
1091
+ isImportableField(value) {
1092
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
1093
+ return false;
1094
+ }
1095
+ const raw = value;
1096
+ return typeof raw.name === 'string' && raw.name.trim().length > 0;
1097
+ }
1098
+ isNameDuplicated(index) {
1099
+ const name = String(this.formArray.at(index)?.get('name')?.value || '').trim();
1100
+ return !!name && this.duplicateNames.includes(name);
1101
+ }
1102
+ isNameInvalid(index) {
1103
+ const control = this.formArray.at(index)?.get('name');
1104
+ return !!control?.invalid;
1105
+ }
1106
+ nameErrorId(index) {
1107
+ return `praxis-array-field-name-error-${this.instanceId}-${index}`;
1108
+ }
1109
+ nameErrorDescribedBy(index) {
1110
+ return this.nameErrorMessage(index) ? this.nameErrorId(index) : null;
1111
+ }
1112
+ nameErrorMessage(index) {
1113
+ const control = this.formArray.at(index)?.get('name');
1114
+ if (!control?.errors) {
1115
+ return '';
1116
+ }
1117
+ if (control.errors['arrayFieldNameRequired']) {
1118
+ return this.text('praxis.metadataEditor.arrayFields.nameRequired', 'Informe o nome do subcampo.');
1119
+ }
1120
+ if (control.errors['arrayFieldNameDuplicated']) {
1121
+ return this.text('praxis.metadataEditor.arrayFields.nameDuplicated', 'Este nome j\u00e1 est\u00e1 em uso na cole\u00e7\u00e3o.');
1122
+ }
1123
+ return '';
1124
+ }
1125
+ isReferenced(fieldName) {
1126
+ return this.referencedBy(fieldName).length > 0;
1127
+ }
1128
+ removeTitle(fieldName) {
1129
+ const references = this.referencedBy(fieldName);
1130
+ if (!references.length) {
1131
+ return '';
1132
+ }
1133
+ return this.text('praxis.metadataEditor.arrayFields.removeBlocked', undefined, 'Remova as refer\u00eancias antes de excluir: {{references}}', { references: references.join(', ') });
1134
+ }
1135
+ schemaStateDescription() {
1136
+ switch (this.schemaSourceState) {
1137
+ case 'ref-only':
1138
+ return this.text('praxis.metadataEditor.arrayFields.refOnly', 'O schema do item vem do itemSchemaRef; crie subcampos locais apenas quando precisar de override.');
1139
+ case 'override-local':
1140
+ return this.text('praxis.metadataEditor.arrayFields.overrideLocal', 'H\u00e1 um itemSchemaRef e subcampos locais; os subcampos locais funcionam como override expl\u00edcito.');
1141
+ case 'imported':
1142
+ return this.text('praxis.metadataEditor.arrayFields.imported', 'Subcampos importados. Revise antes de aplicar ou salvar.');
1143
+ default:
1144
+ return this.text('praxis.metadataEditor.arrayFields.localOnly', 'Subcampos locais ser\u00e3o salvos em array.itemSchema.fields.');
1145
+ }
1146
+ }
1147
+ hydrateFromControl() {
1148
+ const fields = this.normalizeFields(this.control?.value);
1149
+ this.replaceRows(fields, false);
1150
+ this.updateSchemaSourceState();
1151
+ }
1152
+ replaceRows(fields, emit = true) {
1153
+ this.hydrating = true;
1154
+ this.internalSubscription?.unsubscribe();
1155
+ while (this.formArray.length) {
1156
+ this.formArray.removeAt(0, { emitEvent: false });
1157
+ }
1158
+ this.originalNames = [];
1159
+ for (const field of fields) {
1160
+ const normalized = this.normalizeField(field);
1161
+ this.formArray.push(this.createRow(normalized), { emitEvent: false });
1162
+ this.originalNames.push(normalized.name);
1163
+ }
1164
+ this.internalSubscription = this.formArray.valueChanges.subscribe(() => this.syncToControl());
1165
+ this.hydrating = false;
1166
+ this.updateFieldListValidity();
1167
+ if (emit) {
1168
+ this.syncToControl();
1169
+ }
1170
+ }
1171
+ createRow(field) {
1172
+ return this.fb.group({
1173
+ name: [field.name || ''],
1174
+ label: [field.label || field.name || ''],
1175
+ controlType: [field.controlType || FieldControlType.INPUT],
1176
+ required: [!!field.required],
1177
+ metadata: [this.clonePlainObject(field)],
1178
+ });
1179
+ }
1180
+ rowValue(index) {
1181
+ const row = this.formArray.at(index);
1182
+ return row ? this.normalizeField(row.getRawValue()) : null;
1183
+ }
1184
+ syncToControl() {
1185
+ if (this.hydrating || !this.control)
1186
+ return;
1187
+ const normalizedRows = this.formArray.controls.map((row) => this.normalizeField(row.getRawValue()));
1188
+ this.updateDuplicateNames(normalizedRows);
1189
+ const fields = normalizedRows.filter((field) => field.name);
1190
+ this.hydrating = true;
1191
+ this.control.setValue(fields, { emitEvent: true });
1192
+ this.control.markAsDirty();
1193
+ this.control.markAsTouched();
1194
+ this.hydrating = false;
1195
+ this.updateFieldListValidity(normalizedRows);
1196
+ this.updateSchemaSourceState();
1197
+ }
1198
+ normalizeFields(value) {
1199
+ if (Array.isArray(value)) {
1200
+ return value;
1201
+ }
1202
+ if (typeof value === 'string' && value.trim()) {
1203
+ try {
1204
+ const parsed = JSON.parse(value);
1205
+ return Array.isArray(parsed) ? parsed : [];
1206
+ }
1207
+ catch {
1208
+ return [];
1209
+ }
1210
+ }
1211
+ return [];
1212
+ }
1213
+ normalizeField(value) {
1214
+ const raw = (value && typeof value === 'object' ? value : {});
1215
+ const base = raw.metadata && typeof raw.metadata === 'object' && !Array.isArray(raw.metadata)
1216
+ ? this.clonePlainObject(raw.metadata)
1217
+ : this.clonePlainObject(raw);
1218
+ const name = String(raw.name ?? base.name ?? '').trim();
1219
+ return {
1220
+ ...base,
1221
+ name,
1222
+ label: String(raw.label ?? base.label ?? name ?? '').trim(),
1223
+ controlType: raw.controlType || base.controlType || FieldControlType.INPUT,
1224
+ required: raw.required === true,
1225
+ };
1226
+ }
1227
+ nextAvailableName(prefix = 'campo') {
1228
+ const existing = new Set(this.formArray.controls
1229
+ .map((row) => String(row.get('name')?.value || '').trim())
1230
+ .filter(Boolean));
1231
+ let index = 1;
1232
+ let candidate = prefix;
1233
+ while (existing.has(candidate)) {
1234
+ index += 1;
1235
+ candidate = `${prefix}${index}`;
1236
+ }
1237
+ return candidate;
1238
+ }
1239
+ updateDuplicateNames(fields) {
1240
+ const source = fields ?? this.formArray.controls.map((row) => this.normalizeField(row.getRawValue()));
1241
+ const seen = new Set();
1242
+ const duplicated = new Set();
1243
+ for (const field of source) {
1244
+ const name = String(field.name || '').trim();
1245
+ if (!name)
1246
+ continue;
1247
+ if (seen.has(name)) {
1248
+ duplicated.add(name);
1249
+ }
1250
+ seen.add(name);
1251
+ }
1252
+ this.duplicateNames = Array.from(duplicated);
1253
+ }
1254
+ updateFieldListValidity(fields = this.formArray.controls.map((row) => this.normalizeField(row.getRawValue()))) {
1255
+ this.updateDuplicateNames(fields);
1256
+ const duplicateSet = new Set(this.duplicateNames);
1257
+ const hasRequiredNameError = fields.some((field) => !String(field.name || '').trim());
1258
+ const hasDuplicateNameError = duplicateSet.size > 0;
1259
+ this.formArray.controls.forEach((row) => {
1260
+ const nameControl = row.get('name');
1261
+ const name = String(nameControl?.value || '').trim();
1262
+ this.setControlError(nameControl, 'arrayFieldNameRequired', !name);
1263
+ this.setControlError(nameControl, 'arrayFieldNameDuplicated', !!name && duplicateSet.has(name));
1264
+ });
1265
+ const errorPayload = hasDuplicateNameError ? { names: this.duplicateNames } : null;
1266
+ this.setControlError(this.control, 'arrayFieldNameRequired', hasRequiredNameError);
1267
+ this.setControlError(this.control, 'arrayFieldNameDuplicated', errorPayload);
1268
+ this.setControlError(this.formArray, 'arrayFieldNameRequired', hasRequiredNameError);
1269
+ this.setControlError(this.formArray, 'arrayFieldNameDuplicated', errorPayload);
1270
+ }
1271
+ setControlError(control, key, value) {
1272
+ if (!control)
1273
+ return;
1274
+ const errors = { ...(control.errors || {}) };
1275
+ const hasError = value !== null && value !== undefined && value !== false;
1276
+ if (hasError) {
1277
+ errors[key] = value === true ? true : value;
1278
+ }
1279
+ else {
1280
+ delete errors[key];
1281
+ }
1282
+ control.setErrors(Object.keys(errors).length ? errors : null);
1283
+ }
1284
+ updateSchemaSourceState() {
1285
+ const rawArray = this.arrayValue();
1286
+ const hasRef = typeof rawArray.itemSchemaRef === 'string' && rawArray.itemSchemaRef.trim().length > 0;
1287
+ const hasFields = this.formArray.length > 0;
1288
+ if (this.schemaSourceState === 'imported' &&
1289
+ hasFields &&
1290
+ this.importedFieldsFingerprint === this.fieldsFingerprint()) {
1291
+ return;
1292
+ }
1293
+ if (this.schemaSourceState === 'imported') {
1294
+ this.importedFieldsFingerprint = null;
1295
+ }
1296
+ this.schemaSourceState = hasRef && hasFields ? 'override-local' : hasRef ? 'ref-only' : 'local-only';
1297
+ }
1298
+ arrayValue() {
1299
+ const value = this.arrayControl?.value;
1300
+ return value && typeof value === 'object' ? value : {};
1301
+ }
1302
+ referencedBy(fieldName) {
1303
+ const name = String(fieldName || '').trim();
1304
+ if (!name)
1305
+ return [];
1306
+ const array = this.arrayValue();
1307
+ const references = [];
1308
+ if (array.itemIdentityField === name)
1309
+ references.push('itemIdentityField');
1310
+ if (this.uniqueByFields(array.collectionValidation?.uniqueBy).includes(name)) {
1311
+ references.push('collectionValidation.uniqueBy');
1312
+ }
1313
+ if (array.collectionValidation?.exactlyOne?.field === name) {
1314
+ references.push('collectionValidation.exactlyOne.field');
1315
+ }
1316
+ if (array.collectionValidation?.atLeastOne?.field === name) {
1317
+ references.push('collectionValidation.atLeastOne.field');
1318
+ }
1319
+ if (typeof array.itemTitleTemplate === 'string' && this.templateReferencesField(array.itemTitleTemplate, name)) {
1320
+ references.push('itemTitleTemplate');
1321
+ }
1322
+ return references;
1323
+ }
1324
+ renameReferences(previous, next) {
1325
+ if (!this.arrayControl || !previous || !next)
1326
+ return;
1327
+ const array = { ...this.arrayValue() };
1328
+ if (array.itemIdentityField === previous)
1329
+ array.itemIdentityField = next;
1330
+ const collectionValidation = array.collectionValidation && typeof array.collectionValidation === 'object'
1331
+ ? { ...array.collectionValidation }
1332
+ : undefined;
1333
+ if (collectionValidation) {
1334
+ if (Array.isArray(collectionValidation.uniqueBy)) {
1335
+ collectionValidation.uniqueBy = collectionValidation.uniqueBy.map((entry) => entry === previous ? next : entry);
1336
+ }
1337
+ else if (typeof collectionValidation.uniqueBy === 'string') {
1338
+ collectionValidation.uniqueBy = this.replaceUniqueByField(collectionValidation.uniqueBy, previous, next);
1339
+ }
1340
+ if (collectionValidation.exactlyOne?.field === previous) {
1341
+ collectionValidation.exactlyOne = { ...collectionValidation.exactlyOne, field: next };
1342
+ }
1343
+ if (collectionValidation.atLeastOne?.field === previous) {
1344
+ collectionValidation.atLeastOne = { ...collectionValidation.atLeastOne, field: next };
1345
+ }
1346
+ array.collectionValidation = collectionValidation;
1347
+ }
1348
+ if (typeof array.itemTitleTemplate === 'string') {
1349
+ array.itemTitleTemplate = array.itemTitleTemplate.replace(new RegExp(`{{\\s*${this.escapeRegExp(previous)}\\s*}}`, 'g'), `{{${next}}}`);
1350
+ }
1351
+ this.arrayControl.patchValue(array);
1352
+ this.arrayControl.markAsDirty();
1353
+ }
1354
+ uniqueByFields(value) {
1355
+ if (Array.isArray(value)) {
1356
+ return value.map((entry) => String(entry || '').trim()).filter(Boolean);
1357
+ }
1358
+ if (typeof value !== 'string') {
1359
+ return [];
1360
+ }
1361
+ const trimmed = value.trim();
1362
+ if (!trimmed) {
1363
+ return [];
1364
+ }
1365
+ try {
1366
+ const parsed = JSON.parse(trimmed);
1367
+ if (Array.isArray(parsed)) {
1368
+ return parsed.map((entry) => String(entry || '').trim()).filter(Boolean);
1369
+ }
1370
+ }
1371
+ catch { }
1372
+ return trimmed
1373
+ .split(/\r?\n|,/)
1374
+ .map((entry) => entry.trim())
1375
+ .filter(Boolean);
1376
+ }
1377
+ replaceUniqueByField(value, previous, next) {
1378
+ const trimmed = value.trim();
1379
+ if (!trimmed) {
1380
+ return value;
1381
+ }
1382
+ try {
1383
+ const parsed = JSON.parse(trimmed);
1384
+ if (Array.isArray(parsed)) {
1385
+ return JSON.stringify(parsed.map((entry) => String(entry || '').trim() === previous ? next : entry));
1386
+ }
1387
+ }
1388
+ catch { }
1389
+ return value
1390
+ .split(/(\r?\n|,)/)
1391
+ .map((entry) => entry.trim() === previous ? next : entry)
1392
+ .join('');
1393
+ }
1394
+ templateReferencesField(template, fieldName) {
1395
+ return new RegExp(`{{\\s*${this.escapeRegExp(fieldName)}\\s*}}`).test(template);
1396
+ }
1397
+ clonePlainObject(value) {
1398
+ return this.cloneMetadataValue(value, new WeakMap());
1399
+ }
1400
+ cloneMetadataValue(value, seen) {
1401
+ if (!value || typeof value !== 'object') {
1402
+ return value;
1403
+ }
1404
+ if (seen.has(value)) {
1405
+ return seen.get(value);
1406
+ }
1407
+ if (value instanceof Date) {
1408
+ return new Date(value.getTime());
1409
+ }
1410
+ if (value instanceof RegExp) {
1411
+ return new RegExp(value.source, value.flags);
1412
+ }
1413
+ if (Array.isArray(value)) {
1414
+ const clone = [];
1415
+ seen.set(value, clone);
1416
+ clone.push(...value.map((entry) => this.cloneMetadataValue(entry, seen)));
1417
+ return clone;
1418
+ }
1419
+ if (value instanceof Map) {
1420
+ const clone = new Map();
1421
+ seen.set(value, clone);
1422
+ value.forEach((entry, key) => {
1423
+ clone.set(this.cloneMetadataValue(key, seen), this.cloneMetadataValue(entry, seen));
1424
+ });
1425
+ return clone;
1426
+ }
1427
+ if (value instanceof Set) {
1428
+ const clone = new Set();
1429
+ seen.set(value, clone);
1430
+ value.forEach((entry) => clone.add(this.cloneMetadataValue(entry, seen)));
1431
+ return clone;
1432
+ }
1433
+ const prototype = Object.getPrototypeOf(value);
1434
+ if (prototype !== Object.prototype && prototype !== null) {
1435
+ return value;
1436
+ }
1437
+ const clone = {};
1438
+ seen.set(value, clone);
1439
+ for (const [key, entry] of Object.entries(value)) {
1440
+ clone[key] = this.cloneMetadataValue(entry, seen);
1441
+ }
1442
+ return clone;
1443
+ }
1444
+ fieldsFingerprint() {
1445
+ return JSON.stringify(this.formArray.controls.map((row) => this.normalizeField(row.getRawValue())));
1446
+ }
1447
+ escapeRegExp(value) {
1448
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1449
+ }
1450
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ArrayItemSchemaFieldsEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1451
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: ArrayItemSchemaFieldsEditorComponent, isStandalone: true, selector: "praxis-array-item-schema-fields-editor", inputs: { control: "control", arrayControl: "arrayControl" }, providers: [providePraxisMetadataEditorI18n()], usesOnChanges: true, ngImport: i0, template: `
1452
+ <section
1453
+ class="array-fields-editor"
1454
+ [attr.data-schema-source]="schemaSourceState"
1455
+ [attr.aria-label]="text('praxis.metadataEditor.arrayFields.section', 'Subcampos da cole\u00e7\u00e3o')"
1456
+ >
1457
+ <header class="array-fields-editor__header">
1458
+ <div>
1459
+ <h3>{{ text('praxis.metadataEditor.arrayFields.title', 'Subcampos') }}</h3>
1460
+ <p>
1461
+ {{ schemaStateDescription() }}
1462
+ </p>
1463
+ </div>
1464
+ <button type="button" class="array-fields-editor__primary" (click)="addField()">
1465
+ {{ text('praxis.metadataEditor.arrayFields.add', 'Adicionar subcampo') }}
1466
+ </button>
1467
+ </header>
1468
+
1469
+ <div
1470
+ class="array-fields-editor__warning"
1471
+ *ngIf="duplicateNames.length"
1472
+ role="alert"
1473
+ >
1474
+ {{
1475
+ text(
1476
+ 'praxis.metadataEditor.arrayFields.duplicateNames',
1477
+ undefined,
1478
+ 'Existem nomes duplicados: {{names}}',
1479
+ { names: duplicateNames.join(', ') }
1480
+ )
1481
+ }}
1482
+ </div>
1483
+
1484
+ <div
1485
+ class="array-fields-editor__empty"
1486
+ *ngIf="formArray.length === 0"
1487
+ >
1488
+ {{ text('praxis.metadataEditor.arrayFields.empty', 'Nenhum subcampo local configurado.') }}
1489
+ </div>
1490
+
1491
+ <div class="array-fields-editor__list" [formGroup]="form">
1492
+ <div
1493
+ class="array-fields-editor__row"
1494
+ *ngFor="let row of rows; let i = index"
1495
+ [formGroup]="row"
1496
+ >
1497
+ <label>
1498
+ <span>{{ text('praxis.metadataEditor.arrayFields.name', 'Nome') }}</span>
1499
+ <input
1500
+ type="text"
1501
+ formControlName="name"
1502
+ (blur)="onNameBlur(i)"
1503
+ [attr.aria-invalid]="isNameInvalid(i) ? 'true' : null"
1504
+ [attr.aria-describedby]="nameErrorDescribedBy(i)"
1505
+ />
1506
+ <span
1507
+ class="array-fields-editor__field-error"
1508
+ *ngIf="nameErrorMessage(i) as nameError"
1509
+ [id]="nameErrorId(i)"
1510
+ >
1511
+ {{ nameError }}
1512
+ </span>
1513
+ </label>
1514
+
1515
+ <label>
1516
+ <span>{{ text('praxis.metadataEditor.arrayFields.label', 'Label') }}</span>
1517
+ <input type="text" formControlName="label" />
1518
+ </label>
1519
+
1520
+ <label>
1521
+ <span>{{ text('praxis.metadataEditor.arrayFields.controlType', 'Controle') }}</span>
1522
+ <select formControlName="controlType">
1523
+ <option *ngFor="let option of controlTypeOptions" [value]="option">
1524
+ {{ controlTypeLabel(option) }}
1525
+ </option>
1526
+ </select>
1527
+ </label>
1528
+
1529
+ <label class="array-fields-editor__check">
1530
+ <input type="checkbox" formControlName="required" />
1531
+ <span>{{ text('praxis.metadataEditor.arrayFields.required', 'Obrigat\u00f3rio') }}</span>
1532
+ </label>
1533
+
1534
+ <div class="array-fields-editor__actions">
1535
+ <button type="button" (click)="moveField(i, -1)" [disabled]="i === 0">
1536
+ {{ text('praxis.metadataEditor.arrayFields.moveUp', 'Subir') }}
1537
+ </button>
1538
+ <button type="button" (click)="moveField(i, 1)" [disabled]="i === formArray.length - 1">
1539
+ {{ text('praxis.metadataEditor.arrayFields.moveDown', 'Descer') }}
1540
+ </button>
1541
+ <button type="button" (click)="duplicateField(i)">
1542
+ {{ text('praxis.metadataEditor.arrayFields.duplicate', 'Duplicar') }}
1543
+ </button>
1544
+ <button
1545
+ type="button"
1546
+ (click)="removeField(i)"
1547
+ [disabled]="isReferenced(row.get('name')?.value)"
1548
+ [title]="removeTitle(row.get('name')?.value)"
1549
+ >
1550
+ {{ text('praxis.metadataEditor.arrayFields.remove', 'Remover') }}
1551
+ </button>
1552
+ </div>
1553
+ </div>
1554
+ </div>
1555
+ </section>
1556
+ `, isInline: true, styles: [":host{display:block}.array-fields-editor{display:block;margin:10px 0 2px;padding:12px;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface)}.array-fields-editor__header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.array-fields-editor__header h3{margin:0 0 4px;font-size:1rem;line-height:1.25}.array-fields-editor__header p,.array-fields-editor__empty{margin:0;color:var(--md-sys-color-on-surface-variant);font-size:.875rem;line-height:1.35}.array-fields-editor__primary,.array-fields-editor button{border:1px solid var(--md-sys-color-outline-variant);border-radius:6px;background:var(--md-sys-color-surface);color:var(--md-sys-color-on-surface);cursor:pointer;min-height:32px;padding:5px 10px}.array-fields-editor__primary{border-color:var(--md-sys-color-primary);color:var(--md-sys-color-primary);font-weight:600;white-space:nowrap}.array-fields-editor button:disabled{cursor:not-allowed;opacity:.55}.array-fields-editor__warning{margin:8px 0 12px;padding:8px 10px;border:1px solid var(--md-sys-color-error);border-radius:6px;color:var(--md-sys-color-error);background:var(--md-sys-color-error-container)}.array-fields-editor__list{display:grid;gap:10px}.array-fields-editor__row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(160px,1.2fr) minmax(140px,.9fr) auto;gap:10px;align-items:end;padding:10px;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;background:var(--md-sys-color-surface)}.array-fields-editor label{display:grid;gap:4px;font-size:.8rem;font-weight:600}.array-fields-editor input[type=text],.array-fields-editor select{box-sizing:border-box;width:100%;min-height:34px;border:1px solid var(--md-sys-color-outline-variant);border-radius:6px;background:var(--md-sys-color-surface);color:var(--md-sys-color-on-surface);padding:5px 8px}.array-fields-editor input[aria-invalid=true]{border-color:var(--md-sys-color-error)}.array-fields-editor__field-error{color:var(--md-sys-color-error);font-size:.75rem;font-weight:500;line-height:1.3}.array-fields-editor__check{display:flex!important;align-items:center;gap:6px;min-height:34px}.array-fields-editor__actions{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:6px}@media(max-width:720px){.array-fields-editor__header,.array-fields-editor__row{display:grid;grid-template-columns:1fr}.array-fields-editor__primary{width:100%}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
1557
+ }
1558
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ArrayItemSchemaFieldsEditorComponent, decorators: [{
1559
+ type: Component,
1560
+ args: [{ selector: 'praxis-array-item-schema-fields-editor', standalone: true, imports: [CommonModule, ReactiveFormsModule], providers: [providePraxisMetadataEditorI18n()], template: `
1561
+ <section
1562
+ class="array-fields-editor"
1563
+ [attr.data-schema-source]="schemaSourceState"
1564
+ [attr.aria-label]="text('praxis.metadataEditor.arrayFields.section', 'Subcampos da cole\u00e7\u00e3o')"
1565
+ >
1566
+ <header class="array-fields-editor__header">
1567
+ <div>
1568
+ <h3>{{ text('praxis.metadataEditor.arrayFields.title', 'Subcampos') }}</h3>
1569
+ <p>
1570
+ {{ schemaStateDescription() }}
1571
+ </p>
1572
+ </div>
1573
+ <button type="button" class="array-fields-editor__primary" (click)="addField()">
1574
+ {{ text('praxis.metadataEditor.arrayFields.add', 'Adicionar subcampo') }}
1575
+ </button>
1576
+ </header>
1577
+
1578
+ <div
1579
+ class="array-fields-editor__warning"
1580
+ *ngIf="duplicateNames.length"
1581
+ role="alert"
1582
+ >
1583
+ {{
1584
+ text(
1585
+ 'praxis.metadataEditor.arrayFields.duplicateNames',
1586
+ undefined,
1587
+ 'Existem nomes duplicados: {{names}}',
1588
+ { names: duplicateNames.join(', ') }
1589
+ )
1590
+ }}
1591
+ </div>
1592
+
1593
+ <div
1594
+ class="array-fields-editor__empty"
1595
+ *ngIf="formArray.length === 0"
1596
+ >
1597
+ {{ text('praxis.metadataEditor.arrayFields.empty', 'Nenhum subcampo local configurado.') }}
1598
+ </div>
1599
+
1600
+ <div class="array-fields-editor__list" [formGroup]="form">
1601
+ <div
1602
+ class="array-fields-editor__row"
1603
+ *ngFor="let row of rows; let i = index"
1604
+ [formGroup]="row"
1605
+ >
1606
+ <label>
1607
+ <span>{{ text('praxis.metadataEditor.arrayFields.name', 'Nome') }}</span>
1608
+ <input
1609
+ type="text"
1610
+ formControlName="name"
1611
+ (blur)="onNameBlur(i)"
1612
+ [attr.aria-invalid]="isNameInvalid(i) ? 'true' : null"
1613
+ [attr.aria-describedby]="nameErrorDescribedBy(i)"
1614
+ />
1615
+ <span
1616
+ class="array-fields-editor__field-error"
1617
+ *ngIf="nameErrorMessage(i) as nameError"
1618
+ [id]="nameErrorId(i)"
1619
+ >
1620
+ {{ nameError }}
1621
+ </span>
1622
+ </label>
1623
+
1624
+ <label>
1625
+ <span>{{ text('praxis.metadataEditor.arrayFields.label', 'Label') }}</span>
1626
+ <input type="text" formControlName="label" />
1627
+ </label>
1628
+
1629
+ <label>
1630
+ <span>{{ text('praxis.metadataEditor.arrayFields.controlType', 'Controle') }}</span>
1631
+ <select formControlName="controlType">
1632
+ <option *ngFor="let option of controlTypeOptions" [value]="option">
1633
+ {{ controlTypeLabel(option) }}
1634
+ </option>
1635
+ </select>
1636
+ </label>
1637
+
1638
+ <label class="array-fields-editor__check">
1639
+ <input type="checkbox" formControlName="required" />
1640
+ <span>{{ text('praxis.metadataEditor.arrayFields.required', 'Obrigat\u00f3rio') }}</span>
1641
+ </label>
1642
+
1643
+ <div class="array-fields-editor__actions">
1644
+ <button type="button" (click)="moveField(i, -1)" [disabled]="i === 0">
1645
+ {{ text('praxis.metadataEditor.arrayFields.moveUp', 'Subir') }}
1646
+ </button>
1647
+ <button type="button" (click)="moveField(i, 1)" [disabled]="i === formArray.length - 1">
1648
+ {{ text('praxis.metadataEditor.arrayFields.moveDown', 'Descer') }}
1649
+ </button>
1650
+ <button type="button" (click)="duplicateField(i)">
1651
+ {{ text('praxis.metadataEditor.arrayFields.duplicate', 'Duplicar') }}
1652
+ </button>
1653
+ <button
1654
+ type="button"
1655
+ (click)="removeField(i)"
1656
+ [disabled]="isReferenced(row.get('name')?.value)"
1657
+ [title]="removeTitle(row.get('name')?.value)"
1658
+ >
1659
+ {{ text('praxis.metadataEditor.arrayFields.remove', 'Remover') }}
1660
+ </button>
1661
+ </div>
1662
+ </div>
1663
+ </div>
1664
+ </section>
1665
+ `, styles: [":host{display:block}.array-fields-editor{display:block;margin:10px 0 2px;padding:12px;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;background:var(--md-sys-color-surface-container-low);color:var(--md-sys-color-on-surface)}.array-fields-editor__header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.array-fields-editor__header h3{margin:0 0 4px;font-size:1rem;line-height:1.25}.array-fields-editor__header p,.array-fields-editor__empty{margin:0;color:var(--md-sys-color-on-surface-variant);font-size:.875rem;line-height:1.35}.array-fields-editor__primary,.array-fields-editor button{border:1px solid var(--md-sys-color-outline-variant);border-radius:6px;background:var(--md-sys-color-surface);color:var(--md-sys-color-on-surface);cursor:pointer;min-height:32px;padding:5px 10px}.array-fields-editor__primary{border-color:var(--md-sys-color-primary);color:var(--md-sys-color-primary);font-weight:600;white-space:nowrap}.array-fields-editor button:disabled{cursor:not-allowed;opacity:.55}.array-fields-editor__warning{margin:8px 0 12px;padding:8px 10px;border:1px solid var(--md-sys-color-error);border-radius:6px;color:var(--md-sys-color-error);background:var(--md-sys-color-error-container)}.array-fields-editor__list{display:grid;gap:10px}.array-fields-editor__row{display:grid;grid-template-columns:minmax(140px,1fr) minmax(160px,1.2fr) minmax(140px,.9fr) auto;gap:10px;align-items:end;padding:10px;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;background:var(--md-sys-color-surface)}.array-fields-editor label{display:grid;gap:4px;font-size:.8rem;font-weight:600}.array-fields-editor input[type=text],.array-fields-editor select{box-sizing:border-box;width:100%;min-height:34px;border:1px solid var(--md-sys-color-outline-variant);border-radius:6px;background:var(--md-sys-color-surface);color:var(--md-sys-color-on-surface);padding:5px 8px}.array-fields-editor input[aria-invalid=true]{border-color:var(--md-sys-color-error)}.array-fields-editor__field-error{color:var(--md-sys-color-error);font-size:.75rem;font-weight:500;line-height:1.3}.array-fields-editor__check{display:flex!important;align-items:center;gap:6px;min-height:34px}.array-fields-editor__actions{grid-column:1 / -1;display:flex;flex-wrap:wrap;gap:6px}@media(max-width:720px){.array-fields-editor__header,.array-fields-editor__row{display:grid;grid-template-columns:1fr}.array-fields-editor__primary{width:100%}}\n"] }]
1666
+ }], propDecorators: { control: [{
1667
+ type: Input
1668
+ }], arrayControl: [{
1669
+ type: Input
1670
+ }] } });
1671
+
846
1672
  const inputProperties = [
847
1673
  // Geral
848
1674
  { name: 'label', label: 'Label', editorType: 'text', placeholder: 'Rótulo do campo', group: 'Geral' },
@@ -1054,6 +1880,61 @@ const inputProperties = [
1054
1880
  { name: 'defaultValue', label: 'Valor padrão', editorType: 'text', group: 'Geral' },
1055
1881
  ];
1056
1882
 
1883
+ const arrayProperties = [
1884
+ { name: 'label', label: 'Label', editorType: 'text', group: 'Geral' },
1885
+ { name: 'hint', label: 'Hint', editorType: 'text', group: 'Geral' },
1886
+ { name: 'defaultValue', label: 'Valor inicial (JSON array)', editorType: 'textarea', group: 'Geral' },
1887
+ {
1888
+ name: 'array.itemType',
1889
+ label: 'Tipo do item',
1890
+ editorType: 'select',
1891
+ group: 'Colecao',
1892
+ defaultValue: 'object',
1893
+ options: [
1894
+ { value: 'object', text: 'Objeto' },
1895
+ ],
1896
+ },
1897
+ {
1898
+ name: 'array.mode',
1899
+ label: 'Modo',
1900
+ editorType: 'select',
1901
+ group: 'Colecao',
1902
+ defaultValue: 'cards',
1903
+ options: [
1904
+ { value: 'cards', text: 'Cards' },
1905
+ ],
1906
+ },
1907
+ { name: 'array.itemSchemaRef', label: 'Schema do item ($ref)', editorType: 'text', group: 'Colecao' },
1908
+ { name: 'array.itemIdentityField', label: 'Campo de identidade', editorType: 'text', group: 'Colecao' },
1909
+ { name: 'array.addLabel', label: 'Texto do botao adicionar', editorType: 'text', group: 'Colecao' },
1910
+ { name: 'array.emptyState', label: 'Texto vazio', editorType: 'text', group: 'Colecao' },
1911
+ { name: 'array.itemTitleTemplate', label: 'Template do titulo do item', editorType: 'text', group: 'Colecao', hint: 'Ex.: {{nome}} - {{cargo}}' },
1912
+ { name: 'array.minItems', label: 'Minimo de itens', editorType: 'number', group: 'Validacao' },
1913
+ { name: 'array.maxItems', label: 'Maximo de itens', editorType: 'number', group: 'Validacao' },
1914
+ {
1915
+ name: 'array.deleteMode',
1916
+ label: 'Modo de exclusao',
1917
+ editorType: 'select',
1918
+ group: 'Operacoes',
1919
+ defaultValue: 'removeFromPayload',
1920
+ options: [
1921
+ { value: 'removeFromPayload', text: 'Remover do payload' },
1922
+ ],
1923
+ },
1924
+ { name: 'array.operations.add', label: 'Permitir adicionar', editorType: 'checkbox', group: 'Operacoes', defaultValue: true },
1925
+ { name: 'array.operations.edit', label: 'Permitir editar', editorType: 'checkbox', group: 'Operacoes', defaultValue: true },
1926
+ { name: 'array.operations.remove', label: 'Permitir remover', editorType: 'checkbox', group: 'Operacoes', defaultValue: true },
1927
+ { name: 'array.collectionValidation.uniqueBy', label: 'Unico por campos', editorType: 'textarea', group: 'Validacao', hint: 'JSON array ou uma linha por campo. Ex.: ["email"]' },
1928
+ { name: 'array.collectionValidation.exactlyOne.field', label: 'Exatamente um: campo', editorType: 'text', group: 'Validacao' },
1929
+ { name: 'array.collectionValidation.exactlyOne.value', label: 'Exatamente um: valor tipado', editorType: 'text', group: 'Validacao', hint: 'Use true/false, numero ou texto. Ex.: true, 1, PRINCIPAL.' },
1930
+ { name: 'array.collectionValidation.exactlyOne.message', label: 'Mensagem: exatamente um', editorType: 'text', group: 'Validacao' },
1931
+ { name: 'array.collectionValidation.atLeastOne.field', label: 'Pelo menos um: campo', editorType: 'text', group: 'Validacao' },
1932
+ { name: 'array.collectionValidation.atLeastOne.value', label: 'Pelo menos um: valor tipado', editorType: 'text', group: 'Validacao', hint: 'Use true/false, numero ou texto. Ex.: true, 1, ACTIVE.' },
1933
+ { name: 'array.collectionValidation.atLeastOne.message', label: 'Mensagem: pelo menos um', editorType: 'text', group: 'Validacao' },
1934
+ { name: 'array.itemSchema.fields', label: 'Subcampos', editorType: 'field-list', group: 'Subcampos', hint: 'Lista FieldMetadata[] usada quando nao houver itemSchemaRef resolvido.' },
1935
+ { name: 'required', label: 'Obrigatorio', editorType: 'checkbox', group: 'Validacao' },
1936
+ ];
1937
+
1057
1938
  // Editor de metadados para componentes SELECT-like
1058
1939
  // Paridade com INPUT: grupos, linhas e propriedades canônicas
1059
1940
  const selectProperties = [
@@ -1150,69 +2031,908 @@ const selectProperties = [
1150
2031
  { name: 'clearButton.showOnlyWhenFilled', label: 'Clear: só quando preenchido', editorType: 'checkbox', group: 'Ações', row: 'clear.inline1', inline: true, hint: 'Exibe o botão apenas quando há valor.' },
1151
2032
  // 7) Aparência
1152
2033
  {
1153
- name: 'materialDesign.appearance',
1154
- label: 'Aparência',
2034
+ name: 'materialDesign.appearance',
2035
+ label: 'Aparência',
2036
+ editorType: 'select',
2037
+ group: 'Aparência',
2038
+ options: [
2039
+ { value: 'fill', text: 'Fill' },
2040
+ { value: 'outline', text: 'Outline' },
2041
+ ],
2042
+ },
2043
+ {
2044
+ name: 'materialDesign.color',
2045
+ label: 'Cor do tema',
2046
+ editorType: 'select',
2047
+ group: 'Aparência',
2048
+ options: [
2049
+ { value: 'primary', text: 'Primária' },
2050
+ { value: 'accent', text: 'Acento' },
2051
+ { value: 'warn', text: 'Alerta' },
2052
+ ],
2053
+ },
2054
+ {
2055
+ name: 'materialDesign.floatLabel',
2056
+ label: 'Comportamento do label',
2057
+ editorType: 'select',
2058
+ group: 'Aparência',
2059
+ options: [
2060
+ { value: 'auto', text: 'Auto' },
2061
+ { value: 'always', text: 'Sempre' },
2062
+ ],
2063
+ },
2064
+ {
2065
+ name: 'materialDesign.subscriptSizing',
2066
+ label: 'Subscript sizing',
2067
+ editorType: 'select',
2068
+ group: 'Aparência',
2069
+ options: [
2070
+ { value: 'fixed', text: 'Fixo' },
2071
+ { value: 'dynamic', text: 'Dinâmico' },
2072
+ ],
2073
+ },
2074
+ { name: 'inlineAutoSize.minWidth', label: 'Inline: largura mínima (desktop)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeDesktop', inline: true, hint: 'Largura mínima em px para desktop.' },
2075
+ { name: 'inlineAutoSize.maxWidth', label: 'Inline: largura máxima (desktop)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeDesktop', inline: true, hint: 'Largura máxima em px para desktop.' },
2076
+ { name: 'inlineAutoSize.minWidthMobile', label: 'Inline: largura mínima (mobile)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeMobile', inline: true, hint: 'Largura mínima em px para mobile.' },
2077
+ { name: 'inlineAutoSize.maxWidthMobile', label: 'Inline: largura máxima (mobile)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeMobile', inline: true, hint: 'Largura máxima em px para mobile.' },
2078
+ { name: 'materialDesign.hideRequiredMarker', label: 'Ocultar * obrigatório', editorType: 'checkbox', group: 'Aparência' },
2079
+ {
2080
+ name: 'errorStateMatcher',
2081
+ label: 'Estratégia de erro',
2082
+ editorType: 'select',
2083
+ group: 'Aparência',
2084
+ options: [
2085
+ { value: 'default', text: 'Padrão' },
2086
+ { value: 'showOnDirtyAndInvalid', text: 'Mostrar ao sujar e inválido' },
2087
+ { value: 'showOnSubmitted', text: 'Mostrar ao enviar' },
2088
+ { value: 'showImmediately', text: 'Mostrar imediatamente' },
2089
+ ],
2090
+ },
2091
+ // 8) Acessibilidade
2092
+ { name: 'ariaLabel', label: 'ARIA label', editorType: 'text', group: 'Acessibilidade', hint: 'Use quando não houver label visível.' },
2093
+ { name: 'ariaDescribedby', label: 'ARIA describedby', editorType: 'text', group: 'Acessibilidade', hint: 'IDs de ajuda/erro.' },
2094
+ { name: 'ariaLabelledby', label: 'ARIA labelledby', editorType: 'text', group: 'Acessibilidade', hint: 'ID de elemento que atua como label.' },
2095
+ { name: 'tabIndex', label: 'TabIndex', editorType: 'number', group: 'Acessibilidade' },
2096
+ { name: 'dataAttributes', label: 'Data attributes (JSON)', editorType: 'textarea', group: 'Acessibilidade', hint: '{ "testId": "select-a" }' },
2097
+ ];
2098
+
2099
+ function cloneProperty$7(prop) {
2100
+ return {
2101
+ ...prop,
2102
+ options: Array.isArray(prop.options)
2103
+ ? prop.options.map((opt) => typeof opt === 'object' && opt !== null ? { ...opt } : opt)
2104
+ : prop.options,
2105
+ };
2106
+ }
2107
+ function cloneEntityLookupBaseProperty(prop) {
2108
+ const cloned = cloneProperty$7(prop);
2109
+ if (cloned.name === 'multiple') {
2110
+ return {
2111
+ ...cloned,
2112
+ group: 'Selecao em colecao',
2113
+ hint: 'Ativa selecao governada de varias entidades no mesmo campo.',
2114
+ };
2115
+ }
2116
+ if (cloned.name === 'maxSelections') {
2117
+ return {
2118
+ ...cloned,
2119
+ group: 'Selecao em colecao',
2120
+ hint: 'Limite maximo de entidades selecionadas quando multiple=true.',
2121
+ };
2122
+ }
2123
+ return cloned;
2124
+ }
2125
+ const entityLookupProperties = [
2126
+ ...selectProperties.map((prop) => cloneEntityLookupBaseProperty(prop)),
2127
+ {
2128
+ name: 'payloadMode',
2129
+ label: 'Modo do payload',
2130
+ editorType: 'select',
2131
+ group: 'Selecao em colecao',
2132
+ options: [
2133
+ { value: 'id', text: 'id' },
2134
+ { value: 'entityRef', text: 'entityRef' },
2135
+ { value: 'ids', text: 'ids' },
2136
+ { value: 'entityRefs', text: 'entityRefs' },
2137
+ ],
2138
+ hint: 'Define o shape salvo no payload. O runtime resolve combinacoes invalidas conforme multiple.',
2139
+ },
2140
+ {
2141
+ name: 'optionSource.key',
2142
+ label: 'Option source key',
2143
+ editorType: 'text',
2144
+ group: 'Fonte de entidade',
2145
+ required: true,
2146
+ hint: 'Chave publicada pelo backend para filtrar e reidratar a entidade.',
2147
+ },
2148
+ {
2149
+ name: 'optionSource.type',
2150
+ label: 'Tipo da fonte',
2151
+ editorType: 'select',
2152
+ group: 'Fonte de entidade',
2153
+ defaultValue: 'RESOURCE_ENTITY',
2154
+ options: [
2155
+ { value: 'RESOURCE_ENTITY', text: 'RESOURCE_ENTITY' },
2156
+ { value: 'LIGHT_LOOKUP', text: 'LIGHT_LOOKUP' },
2157
+ ],
2158
+ hint: 'Use RESOURCE_ENTITY para entidades reais de dominio.',
2159
+ },
2160
+ {
2161
+ name: 'optionSource.entityKey',
2162
+ label: 'Entity key',
2163
+ editorType: 'text',
2164
+ group: 'Fonte de entidade',
2165
+ hint: 'Identificador semantico da entidade, por exemplo supplier, customer ou contract.',
2166
+ },
2167
+ {
2168
+ name: 'optionSource.resourcePath',
2169
+ label: 'Resource path',
2170
+ editorType: 'text',
2171
+ group: 'Fonte de entidade',
2172
+ hint: 'Caminho base do recurso que publica option-sources e by-ids.',
2173
+ },
2174
+ {
2175
+ name: 'optionSource.filterField',
2176
+ label: 'Campo de filtro principal',
2177
+ editorType: 'text',
2178
+ group: 'Fonte de entidade',
2179
+ hint: 'Campo usado por fontes derivadas quando houver filtro simples no backend.',
2180
+ },
2181
+ {
2182
+ name: 'optionSource.propertyPath',
2183
+ label: 'Property path',
2184
+ editorType: 'text',
2185
+ group: 'Fonte de entidade',
2186
+ hint: 'Caminho de propriedade usado por fontes derivadas ou projeções leves.',
2187
+ },
2188
+ {
2189
+ name: 'optionSource.valuePropertyPath',
2190
+ label: 'Campo de valor',
2191
+ editorType: 'text',
2192
+ group: 'Fonte de entidade',
2193
+ defaultValue: 'id',
2194
+ hint: 'Campo canonico salvo no payload do formulario.',
2195
+ },
2196
+ {
2197
+ name: 'optionSource.labelPropertyPath',
2198
+ label: 'Campo de label',
2199
+ editorType: 'text',
2200
+ group: 'Fonte de entidade',
2201
+ defaultValue: 'label',
2202
+ hint: 'Campo principal exibido para o usuario.',
2203
+ },
2204
+ {
2205
+ name: 'optionSource.codePropertyPath',
2206
+ label: 'Campo de codigo',
2207
+ editorType: 'text',
2208
+ group: 'Exibicao de entidade',
2209
+ hint: 'Codigo curto exibido antes do label, por exemplo FOR-8742.',
2210
+ },
2211
+ {
2212
+ name: 'optionSource.descriptionPropertyPaths',
2213
+ label: 'Campos de descricao',
2214
+ editorType: 'textarea',
2215
+ group: 'Exibicao de entidade',
2216
+ hint: 'JSON array ou uma linha por campo. Ex.: ["documentNumber", "city", "state"].',
2217
+ },
2218
+ {
2219
+ name: 'optionSource.statusPropertyPath',
2220
+ label: 'Campo de status',
2221
+ editorType: 'text',
2222
+ group: 'Exibicao de entidade',
2223
+ hint: 'Campo que informa status operacional da entidade.',
2224
+ },
2225
+ {
2226
+ name: 'optionSource.disabledPropertyPath',
2227
+ label: 'Campo disabled',
2228
+ editorType: 'text',
2229
+ group: 'Exibicao de entidade',
2230
+ hint: 'Campo booleano que indica bloqueio visual ou operacional da entidade.',
2231
+ },
2232
+ {
2233
+ name: 'optionSource.disabledReasonPropertyPath',
2234
+ label: 'Campo de motivo bloqueado',
2235
+ editorType: 'text',
2236
+ group: 'Exibicao de entidade',
2237
+ hint: 'Campo opcional com mensagem de bloqueio quando selectable=false.',
2238
+ },
2239
+ {
2240
+ name: 'optionSource.display.preset',
2241
+ label: 'Preset canonico',
2242
+ editorType: 'select',
2243
+ group: 'Display canonico',
2244
+ options: [
2245
+ { value: 'compact', text: 'compact' },
2246
+ { value: 'rich', text: 'rich' },
2247
+ { value: 'directory', text: 'directory' },
2248
+ { value: 'status', text: 'status' },
2249
+ { value: 'reference', text: 'reference' },
2250
+ { value: 'hierarchical', text: 'hierarchical' },
2251
+ ],
2252
+ hint: 'Intencao visual da entidade. Use directory para pessoas/equipes, reference para codigo + descricao e status quando o estado operacional for central.',
2253
+ },
2254
+ {
2255
+ name: 'optionSource.display.usage',
2256
+ label: 'Uso preferencial',
2257
+ editorType: 'select',
2258
+ group: 'Display canonico',
2259
+ options: [
2260
+ { value: 'form', text: 'form' },
2261
+ { value: 'filter', text: 'filter' },
2262
+ { value: 'table-cell', text: 'table-cell' },
2263
+ { value: 'dashboard', text: 'dashboard' },
2264
+ { value: 'wizard', text: 'wizard' },
2265
+ { value: 'review', text: 'review' },
2266
+ ],
2267
+ hint: 'Contexto principal de uso desta option-source sem amarrar a regra a um componente especifico.',
2268
+ },
2269
+ {
2270
+ name: 'optionSource.display.density',
2271
+ label: 'Densidade',
2272
+ editorType: 'select',
2273
+ group: 'Display canonico',
2274
+ options: [
2275
+ { value: 'compact', text: 'compact' },
2276
+ { value: 'comfortable', text: 'comfortable' },
2277
+ { value: 'rich', text: 'rich' },
2278
+ ],
2279
+ hint: 'Densidade preferencial para runtimes. Filtros costumam usar compact; formularios, comfortable; revisoes, rich.',
2280
+ },
2281
+ {
2282
+ name: 'optionSource.display.selectedLayout',
2283
+ label: 'Layout selecionado canonico',
2284
+ editorType: 'select',
2285
+ group: 'Display canonico',
2286
+ options: [
2287
+ { value: 'card', text: 'card' },
2288
+ { value: 'inline', text: 'inline' },
2289
+ { value: 'compact', text: 'compact' },
2290
+ { value: 'token', text: 'token' },
2291
+ ],
2292
+ hint: 'Layout preferencial do valor selecionado publicado pela option-source.',
2293
+ },
2294
+ {
2295
+ name: 'optionSource.display.resultLayout',
2296
+ label: 'Layout de resultados canonico',
2297
+ editorType: 'select',
2298
+ group: 'Display canonico',
2299
+ options: [
2300
+ { value: 'list', text: 'list' },
2301
+ { value: 'denseList', text: 'denseList' },
2302
+ { value: 'table', text: 'table' },
2303
+ { value: 'card', text: 'card' },
2304
+ ],
2305
+ hint: 'Layout preferencial da lista de resultados publicado pela option-source.',
2306
+ },
2307
+ {
2308
+ name: 'optionSource.display.primaryPropertyPath',
2309
+ label: 'Campo primario',
2310
+ editorType: 'text',
2311
+ group: 'Display canonico',
2312
+ hint: 'Campo semantico usado como titulo principal quando diferente de labelPropertyPath.',
2313
+ },
2314
+ {
2315
+ name: 'optionSource.display.fields',
2316
+ label: 'Campos ricos',
2317
+ editorType: 'textarea',
2318
+ group: 'Display canonico',
2319
+ hint: 'JSON array de subinformacoes ricas. Ex.: [{ "key": "role", "propertyPath": "cargo.nome", "label": "Cargo", "icon": "work", "presentation": "text", "tone": "neutral" }, { "key": "department", "propertyPath": "departamento.nome", "label": "Departamento", "icon": "groups", "presentation": "chip", "tone": "info" }].',
2320
+ },
2321
+ {
2322
+ name: 'optionSource.display.secondaryPropertyPaths',
2323
+ label: 'Campos secundarios canonicos',
2324
+ editorType: 'textarea',
2325
+ group: 'Display canonico',
2326
+ hint: 'JSON array ou uma linha por campo usado como subtitulo. Ex.: cargo.nome, departamento.nome.',
2327
+ },
2328
+ {
2329
+ name: 'optionSource.display.badgePropertyPaths',
2330
+ label: 'Campos de badges canonicos',
2331
+ editorType: 'textarea',
2332
+ group: 'Display canonico',
2333
+ hint: 'JSON array ou uma linha por campo materializado como badge/chip.',
2334
+ },
2335
+ {
2336
+ name: 'optionSource.display.avatarPropertyPath',
2337
+ label: 'Campo de avatar',
2338
+ editorType: 'text',
2339
+ group: 'Display canonico',
2340
+ hint: 'Campo usado para avatar/imagem; quando ausente, o runtime pode usar iniciais.',
2341
+ },
2342
+ {
2343
+ name: 'optionSource.display.showAvatar',
2344
+ label: 'Display: avatar',
2345
+ editorType: 'checkbox',
2346
+ group: 'Display canonico',
2347
+ },
2348
+ {
2349
+ name: 'optionSource.display.showCode',
2350
+ label: 'Display: codigo',
2351
+ editorType: 'checkbox',
2352
+ group: 'Display canonico',
2353
+ },
2354
+ {
2355
+ name: 'optionSource.display.showDescription',
2356
+ label: 'Display: descricao',
2357
+ editorType: 'checkbox',
2358
+ group: 'Display canonico',
2359
+ },
2360
+ {
2361
+ name: 'optionSource.display.showStatus',
2362
+ label: 'Display: status',
2363
+ editorType: 'checkbox',
2364
+ group: 'Display canonico',
2365
+ },
2366
+ {
2367
+ name: 'optionSource.display.showBadges',
2368
+ label: 'Display: badges',
2369
+ editorType: 'checkbox',
2370
+ group: 'Display canonico',
2371
+ },
2372
+ {
2373
+ name: 'optionSource.display.showDisabledReason',
2374
+ label: 'Display: motivo bloqueado',
2375
+ editorType: 'checkbox',
2376
+ group: 'Display canonico',
2377
+ },
2378
+ {
2379
+ name: 'optionSource.display.showResultCount',
2380
+ label: 'Display: contador de resultados',
2381
+ editorType: 'checkbox',
2382
+ group: 'Display canonico',
2383
+ },
2384
+ {
2385
+ name: 'optionSource.display.statusToneMap',
2386
+ label: 'Mapa canonico de tons',
2387
+ editorType: 'textarea',
2388
+ group: 'Display canonico',
2389
+ hint: 'JSON object. Ex.: { "ACTIVE": "success", "BLOCKED": "danger" }.',
2390
+ },
2391
+ {
2392
+ name: 'optionSource.display.badgeKeys',
2393
+ label: 'Chaves canonicas de badges',
2394
+ editorType: 'textarea',
2395
+ group: 'Display canonico',
2396
+ hint: 'JSON array ou uma linha por chave complementar de badge.',
2397
+ },
2398
+ {
2399
+ name: 'optionSource.display.maxVisibleBadges',
2400
+ label: 'Maximo canonico de badges',
2401
+ editorType: 'number',
2402
+ group: 'Display canonico',
2403
+ hint: 'Limite preferencial de badges antes de overflow.',
2404
+ },
2405
+ {
2406
+ name: 'selectedLayout',
2407
+ label: 'Layout selecionado',
2408
+ editorType: 'select',
2409
+ group: 'Exibicao de entidade',
2410
+ options: [
2411
+ { value: 'card', text: 'card' },
2412
+ { value: 'inline', text: 'inline' },
2413
+ { value: 'compact', text: 'compact' },
2414
+ { value: 'token', text: 'token' },
2415
+ ],
2416
+ hint: 'Layout do item selecionado no trigger ou card principal.',
2417
+ },
2418
+ {
2419
+ name: 'resultLayout',
2420
+ label: 'Layout dos resultados',
2421
+ editorType: 'select',
2422
+ group: 'Exibicao de entidade',
2423
+ options: [
2424
+ { value: 'list', text: 'list' },
2425
+ { value: 'denseList', text: 'denseList' },
2426
+ { value: 'table', text: 'table' },
2427
+ { value: 'card', text: 'card' },
2428
+ ],
2429
+ hint: 'Layout principal usado na lista inline e no dialog.',
2430
+ },
2431
+ {
2432
+ name: 'showCode',
2433
+ label: 'Mostrar codigo',
2434
+ editorType: 'checkbox',
2435
+ group: 'Exibicao de entidade',
2436
+ },
2437
+ {
2438
+ name: 'showDescription',
2439
+ label: 'Mostrar descricao',
2440
+ editorType: 'checkbox',
2441
+ group: 'Exibicao de entidade',
2442
+ },
2443
+ {
2444
+ name: 'showStatus',
2445
+ label: 'Mostrar status',
2446
+ editorType: 'checkbox',
2447
+ group: 'Exibicao de entidade',
2448
+ },
2449
+ {
2450
+ name: 'showAvatar',
2451
+ label: 'Mostrar avatar',
2452
+ editorType: 'checkbox',
2453
+ group: 'Exibicao de entidade',
2454
+ },
2455
+ {
2456
+ name: 'showBadges',
2457
+ label: 'Mostrar badges',
2458
+ editorType: 'checkbox',
2459
+ group: 'Exibicao de entidade',
2460
+ },
2461
+ {
2462
+ name: 'showDisabledReason',
2463
+ label: 'Mostrar motivo bloqueado',
2464
+ editorType: 'checkbox',
2465
+ group: 'Exibicao de entidade',
2466
+ },
2467
+ {
2468
+ name: 'showResultCount',
2469
+ label: 'Mostrar contador de resultados',
2470
+ editorType: 'checkbox',
2471
+ group: 'Exibicao de entidade',
2472
+ },
2473
+ {
2474
+ name: 'statusToneMap',
2475
+ label: 'Mapa de tons de status',
2476
+ editorType: 'textarea',
2477
+ group: 'Exibicao de entidade',
2478
+ hint: 'JSON object. Ex.: { \"ACTIVE\": \"success\", \"BLOCKED\": \"danger\" }.',
2479
+ },
2480
+ {
2481
+ name: 'badgeKeys',
2482
+ label: 'Chaves de badges',
2483
+ editorType: 'textarea',
2484
+ group: 'Exibicao de entidade',
2485
+ hint: 'JSON array ou uma linha por chave complementar de badge.',
2486
+ },
2487
+ {
2488
+ name: 'maxVisibleBadges',
2489
+ label: 'Maximo de badges visiveis',
2490
+ editorType: 'number',
2491
+ group: 'Exibicao de entidade',
2492
+ hint: 'Limita a quantidade de badges visiveis antes do overflow.',
2493
+ },
2494
+ {
2495
+ name: 'optionSource.searchPropertyPaths',
2496
+ label: 'Campos de busca',
2497
+ editorType: 'textarea',
2498
+ group: 'Busca',
2499
+ hint: 'JSON array ou uma linha por campo pesquisavel.',
2500
+ },
2501
+ {
2502
+ name: 'optionSource.searchMode',
2503
+ label: 'Modo de busca',
2504
+ editorType: 'select',
2505
+ group: 'Busca',
2506
+ options: [
2507
+ { value: 'contains', text: 'contains' },
2508
+ { value: 'startsWith', text: 'startsWith' },
2509
+ { value: 'exact', text: 'exact' },
2510
+ ],
2511
+ hint: 'Semantica de busca publicada pelo backend para esta fonte.',
2512
+ },
2513
+ {
2514
+ name: 'optionSource.pageSize',
2515
+ label: 'Tamanho da pagina',
2516
+ editorType: 'number',
2517
+ group: 'Busca',
2518
+ hint: 'Quantidade sugerida de resultados por pagina.',
2519
+ },
2520
+ {
2521
+ name: 'optionSource.includeIds',
2522
+ label: 'Incluir IDs selecionados',
2523
+ editorType: 'checkbox',
2524
+ group: 'Busca',
2525
+ defaultValue: true,
2526
+ hint: 'Mantem entidades ja selecionadas visiveis durante busca paginada.',
2527
+ },
2528
+ {
2529
+ name: 'optionSource.filtering.availableFilters',
2530
+ label: 'Filtros disponiveis',
2531
+ editorType: 'textarea',
2532
+ group: 'Busca',
2533
+ hint: 'JSON array de filtros estruturados. Ex.: [{ \"field\": \"status\", \"type\": \"enum\", \"operators\": [\"in\"] }].',
2534
+ },
2535
+ {
2536
+ name: 'optionSource.filtering.defaultFilters',
2537
+ label: 'Filtros padrao',
2538
+ editorType: 'textarea',
2539
+ group: 'Busca',
2540
+ hint: 'JSON object. Ex.: { \"status\": [\"ACTIVE\"] }.',
2541
+ },
2542
+ {
2543
+ name: 'optionSource.filtering.sortOptions',
2544
+ label: 'Ordenacoes disponiveis',
2545
+ editorType: 'textarea',
2546
+ group: 'Busca',
2547
+ hint: 'JSON array. Ex.: [{ \"key\": \"code:asc\", \"field\": \"code\", \"direction\": \"asc\", \"label\": \"Codigo\" }].',
2548
+ },
2549
+ {
2550
+ name: 'optionSource.filtering.defaultSort',
2551
+ label: 'Ordenacao padrao',
2552
+ editorType: 'text',
2553
+ group: 'Busca',
2554
+ hint: 'Chave default do sort declarada em sortOptions.',
2555
+ },
2556
+ {
2557
+ name: 'optionSource.filtering.quickFilterFields',
2558
+ label: 'Campos de filtro rapido',
2559
+ editorType: 'textarea',
2560
+ group: 'Busca',
2561
+ hint: 'JSON array ou uma linha por campo rapido no toolbar do lookup.',
2562
+ },
2563
+ {
2564
+ name: 'optionSource.filtering.searchPlaceholder',
2565
+ label: 'Placeholder canonico de busca',
2566
+ editorType: 'text',
2567
+ group: 'Busca',
2568
+ hint: 'Fallback do optionSource.filtering quando o campo nao sobrescreve searchPlaceholder.',
2569
+ },
2570
+ {
2571
+ name: 'optionSource.dependsOn',
2572
+ label: 'Dependencias',
2573
+ editorType: 'textarea',
2574
+ group: 'Dependencias',
2575
+ hint: 'JSON array ou uma linha por campo do formulario que filtra o lookup.',
2576
+ },
2577
+ {
2578
+ name: 'optionSource.dependencyFilterMap',
2579
+ label: 'Mapa de filtros',
2580
+ editorType: 'textarea',
2581
+ group: 'Dependencias',
2582
+ hint: 'JSON object. Ex.: { "empresaId": "companyId", "fornecedorId": "supplierId" }.',
2583
+ },
2584
+ {
2585
+ name: 'optionSource.selectionPolicy.statusPropertyPath',
2586
+ label: 'Politica: campo de status',
2587
+ editorType: 'text',
2588
+ group: 'Politica de selecao',
2589
+ hint: 'Campo usado para aplicar allowedStatuses ou blockedStatuses.',
2590
+ },
2591
+ {
2592
+ name: 'optionSource.selectionPolicy.selectablePropertyPath',
2593
+ label: 'Politica: campo selectable',
2594
+ editorType: 'text',
2595
+ group: 'Politica de selecao',
2596
+ hint: 'Campo booleano publicado pelo backend para indicar se a entidade pode ser selecionada.',
2597
+ },
2598
+ {
2599
+ name: 'optionSource.selectionPolicy.allowedStatuses',
2600
+ label: 'Status permitidos',
2601
+ editorType: 'textarea',
2602
+ group: 'Politica de selecao',
2603
+ hint: 'JSON array ou uma linha por status. Ex.: ACTIVE, SIGNED.',
2604
+ },
2605
+ {
2606
+ name: 'optionSource.selectionPolicy.blockedStatuses',
2607
+ label: 'Status bloqueados',
2608
+ editorType: 'textarea',
2609
+ group: 'Politica de selecao',
2610
+ hint: 'JSON array ou uma linha por status.',
2611
+ },
2612
+ {
2613
+ name: 'optionSource.selectionPolicy.disabledReasonTemplate',
2614
+ label: 'Template de motivo bloqueado',
2615
+ editorType: 'text',
2616
+ group: 'Politica de selecao',
2617
+ hint: 'Mensagem template exibida quando a entidade nao pode ser selecionada.',
2618
+ },
2619
+ {
2620
+ name: 'optionSource.selectionPolicy.validationMessageTemplate',
2621
+ label: 'Template de validacao',
2622
+ editorType: 'text',
2623
+ group: 'Politica de selecao',
2624
+ hint: 'Mensagem template usada em validacoes de selecao.',
2625
+ },
2626
+ {
2627
+ name: 'optionSource.selectionPolicy.allowRetainInvalidExistingValue',
2628
+ label: 'Manter valor invalido existente',
2629
+ editorType: 'checkbox',
2630
+ group: 'Politica de selecao',
2631
+ hint: 'Exibe entidade historica ja salva mesmo quando nao pode ser selecionada em novos registros.',
2632
+ },
2633
+ {
2634
+ name: 'optionSource.capabilities.filter',
2635
+ label: 'Capability: filter',
2636
+ editorType: 'checkbox',
2637
+ group: 'Capabilities',
2638
+ defaultValue: true,
2639
+ },
2640
+ {
2641
+ name: 'optionSource.capabilities.byIds',
2642
+ label: 'Capability: by-ids',
2643
+ editorType: 'checkbox',
2644
+ group: 'Capabilities',
2645
+ defaultValue: true,
2646
+ },
2647
+ {
2648
+ name: 'optionSource.capabilities.navigateToDetail',
2649
+ label: 'Capability: detalhe',
2650
+ editorType: 'checkbox',
2651
+ group: 'Capabilities',
2652
+ },
2653
+ {
2654
+ name: 'optionSource.capabilities.detail',
2655
+ label: 'Capability: endpoint de detalhe',
2656
+ editorType: 'checkbox',
2657
+ group: 'Capabilities',
2658
+ },
2659
+ {
2660
+ name: 'optionSource.capabilities.edit',
2661
+ label: 'Capability: editar',
2662
+ editorType: 'checkbox',
2663
+ group: 'Capabilities',
2664
+ },
2665
+ {
2666
+ name: 'optionSource.capabilities.create',
2667
+ label: 'Capability: criar',
2668
+ editorType: 'checkbox',
2669
+ group: 'Capabilities',
2670
+ },
2671
+ {
2672
+ name: 'optionSource.capabilities.multiSelect',
2673
+ label: 'Capability: multi-select',
2674
+ editorType: 'checkbox',
2675
+ group: 'Capabilities',
2676
+ },
2677
+ {
2678
+ name: 'optionSource.capabilities.recent',
2679
+ label: 'Capability: recentes',
2680
+ editorType: 'checkbox',
2681
+ group: 'Capabilities',
2682
+ },
2683
+ {
2684
+ name: 'optionSource.capabilities.favorites',
2685
+ label: 'Capability: favoritos',
2686
+ editorType: 'checkbox',
2687
+ group: 'Capabilities',
2688
+ },
2689
+ {
2690
+ name: 'optionSource.capabilities.auditSnapshot',
2691
+ label: 'Capability: snapshot de auditoria',
2692
+ editorType: 'checkbox',
2693
+ group: 'Capabilities',
2694
+ },
2695
+ {
2696
+ name: 'optionSource.detail.hrefTemplate',
2697
+ label: 'Template de detalhe',
2698
+ editorType: 'text',
2699
+ group: 'Navegacao',
2700
+ hint: 'Template de detalhe, por exemplo /contracts/{id}.',
2701
+ },
2702
+ {
2703
+ name: 'optionSource.detail.routeTemplate',
2704
+ label: 'Template de rota',
2705
+ editorType: 'text',
2706
+ group: 'Navegacao',
2707
+ hint: 'Template de rota de detalhe, por exemplo /contracts/:id.',
2708
+ },
2709
+ {
2710
+ name: 'optionSource.detail.openDetailMode',
2711
+ label: 'Modo de detalhe',
2712
+ editorType: 'select',
2713
+ group: 'Navegacao',
2714
+ options: [
2715
+ { value: 'samePage', text: 'samePage' },
2716
+ { value: 'newTab', text: 'newTab' },
2717
+ { value: 'drawer', text: 'Drawer' },
2718
+ { value: 'modal', text: 'Modal' },
2719
+ ],
2720
+ },
2721
+ {
2722
+ name: 'optionSource.detail.kind',
2723
+ label: 'Tipo de detalhe',
1155
2724
  editorType: 'select',
1156
- group: 'Aparência',
2725
+ group: 'Navegacao',
1157
2726
  options: [
1158
- { value: 'fill', text: 'Fill' },
1159
- { value: 'outline', text: 'Outline' },
2727
+ { value: 'surface', text: 'surface' },
2728
+ { value: 'route', text: 'route' },
2729
+ { value: 'href', text: 'href' },
1160
2730
  ],
2731
+ hint: 'Use surface como contrato canonico de plataforma; route/href ficam como fallback legado.',
1161
2732
  },
1162
2733
  {
1163
- name: 'materialDesign.color',
1164
- label: 'Cor do tema',
2734
+ name: 'optionSource.detail.surfaceId',
2735
+ label: 'Surface de detalhe',
2736
+ editorType: 'text',
2737
+ group: 'Navegacao',
2738
+ hint: 'Id da surface item-level preferida. Ex.: view, detail.',
2739
+ },
2740
+ {
2741
+ name: 'optionSource.detail.presentation',
2742
+ label: 'Apresentacao da surface',
1165
2743
  editorType: 'select',
1166
- group: 'Aparência',
2744
+ group: 'Navegacao',
1167
2745
  options: [
1168
- { value: 'primary', text: 'Primária' },
1169
- { value: 'accent', text: 'Acento' },
1170
- { value: 'warn', text: 'Alerta' },
2746
+ { value: 'drawer', text: 'Drawer' },
2747
+ { value: 'modal', text: 'Modal' },
1171
2748
  ],
2749
+ hint: 'Como o runtime deve materializar a surface de detalhe.',
1172
2750
  },
1173
2751
  {
1174
- name: 'materialDesign.floatLabel',
1175
- label: 'Comportamento do label',
2752
+ name: 'optionSource.detail.preferredWidget',
2753
+ label: 'Widget preferido',
2754
+ editorType: 'text',
2755
+ group: 'Navegacao',
2756
+ hint: 'Hint semantico para autoria/discovery. Ex.: praxis-dynamic-form.',
2757
+ },
2758
+ {
2759
+ name: 'optionSource.detail.mode',
2760
+ label: 'Modo da surface',
1176
2761
  editorType: 'select',
1177
- group: 'Aparência',
2762
+ group: 'Navegacao',
1178
2763
  options: [
1179
- { value: 'auto', text: 'Auto' },
1180
- { value: 'always', text: 'Sempre' },
2764
+ { value: 'view', text: 'view' },
2765
+ { value: 'edit', text: 'edit' },
2766
+ { value: 'create', text: 'create' },
1181
2767
  ],
2768
+ hint: 'Modo semantico da surface de detalhe.',
1182
2769
  },
1183
2770
  {
1184
- name: 'materialDesign.subscriptSizing',
1185
- label: 'Subscript sizing',
2771
+ name: 'optionSource.create.hrefTemplate',
2772
+ label: 'Template create href',
2773
+ editorType: 'text',
2774
+ group: 'Navegacao',
2775
+ hint: 'Template opcional de criacao publicado pelo optionSource.',
2776
+ },
2777
+ {
2778
+ name: 'optionSource.create.routeTemplate',
2779
+ label: 'Template create route',
2780
+ editorType: 'text',
2781
+ group: 'Navegacao',
2782
+ hint: 'Rota opcional de criacao, por exemplo /suppliers/new.',
2783
+ },
2784
+ {
2785
+ name: 'optionSource.create.openMode',
2786
+ label: 'Modo de create',
1186
2787
  editorType: 'select',
1187
- group: 'Aparência',
2788
+ group: 'Navegacao',
1188
2789
  options: [
1189
- { value: 'fixed', text: 'Fixo' },
1190
- { value: 'dynamic', text: 'Dinâmico' },
2790
+ { value: 'samePage', text: 'samePage' },
2791
+ { value: 'newTab', text: 'newTab' },
2792
+ { value: 'drawer', text: 'Drawer' },
2793
+ { value: 'modal', text: 'Modal' },
1191
2794
  ],
1192
2795
  },
1193
- { name: 'inlineAutoSize.minWidth', label: 'Inline: largura mínima (desktop)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeDesktop', inline: true, hint: 'Largura mínima em px para desktop.' },
1194
- { name: 'inlineAutoSize.maxWidth', label: 'Inline: largura máxima (desktop)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeDesktop', inline: true, hint: 'Largura máxima em px para desktop.' },
1195
- { name: 'inlineAutoSize.minWidthMobile', label: 'Inline: largura mínima (mobile)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeMobile', inline: true, hint: 'Largura mínima em px para mobile.' },
1196
- { name: 'inlineAutoSize.maxWidthMobile', label: 'Inline: largura máxima (mobile)', editorType: 'number', group: 'Aparência', row: 'appearance.inlineAutoSizeMobile', inline: true, hint: 'Largura máxima em px para mobile.' },
1197
- { name: 'materialDesign.hideRequiredMarker', label: 'Ocultar * obrigatório', editorType: 'checkbox', group: 'Aparência' },
1198
2796
  {
1199
- name: 'errorStateMatcher',
1200
- label: 'Estratégia de erro',
2797
+ name: 'dialog.enabled',
2798
+ label: 'Dialog habilitado',
2799
+ editorType: 'checkbox',
2800
+ group: 'Dialogo avancado',
2801
+ },
2802
+ {
2803
+ name: 'dialog.title',
2804
+ label: 'Titulo do dialog',
2805
+ editorType: 'text',
2806
+ group: 'Dialogo avancado',
2807
+ },
2808
+ {
2809
+ name: 'dialog.size',
2810
+ label: 'Tamanho do dialog',
1201
2811
  editorType: 'select',
1202
- group: 'Aparência',
2812
+ group: 'Dialogo avancado',
1203
2813
  options: [
1204
- { value: 'default', text: 'Padrão' },
1205
- { value: 'showOnDirtyAndInvalid', text: 'Mostrar ao sujar e inválido' },
1206
- { value: 'showOnSubmitted', text: 'Mostrar ao enviar' },
1207
- { value: 'showImmediately', text: 'Mostrar imediatamente' },
2814
+ { value: 'sm', text: 'sm' },
2815
+ { value: 'md', text: 'md' },
2816
+ { value: 'lg', text: 'lg' },
2817
+ { value: 'xl', text: 'xl' },
2818
+ { value: 'full', text: 'full' },
1208
2819
  ],
1209
2820
  },
1210
- // 8) Acessibilidade
1211
- { name: 'ariaLabel', label: 'ARIA label', editorType: 'text', group: 'Acessibilidade', hint: 'Use quando não houver label visível.' },
1212
- { name: 'ariaDescribedby', label: 'ARIA describedby', editorType: 'text', group: 'Acessibilidade', hint: 'IDs de ajuda/erro.' },
1213
- { name: 'ariaLabelledby', label: 'ARIA labelledby', editorType: 'text', group: 'Acessibilidade', hint: 'ID de elemento que atua como label.' },
1214
- { name: 'tabIndex', label: 'TabIndex', editorType: 'number', group: 'Acessibilidade' },
1215
- { name: 'dataAttributes', label: 'Data attributes (JSON)', editorType: 'textarea', group: 'Acessibilidade', hint: '{ "testId": "select-a" }' },
2821
+ {
2822
+ name: 'dialog.previewPanel',
2823
+ label: 'Preview panel',
2824
+ editorType: 'checkbox',
2825
+ group: 'Dialogo avancado',
2826
+ },
2827
+ {
2828
+ name: 'dialog.allowColumnChooser',
2829
+ label: 'Permitir seletor de colunas',
2830
+ editorType: 'checkbox',
2831
+ group: 'Dialogo avancado',
2832
+ },
2833
+ {
2834
+ name: 'dialog.allowSavedViews',
2835
+ label: 'Permitir views salvas',
2836
+ editorType: 'checkbox',
2837
+ group: 'Dialogo avancado',
2838
+ },
2839
+ {
2840
+ name: 'dialog.resultColumns',
2841
+ label: 'Colunas do resultado',
2842
+ editorType: 'textarea',
2843
+ group: 'Dialogo avancado',
2844
+ hint: 'JSON array. Ex.: [{ \"field\": \"code\", \"label\": \"Codigo\", \"kind\": \"code\", \"width\": \"140px\" }].',
2845
+ },
2846
+ {
2847
+ name: 'dialog.openActionLabel',
2848
+ label: 'Label abrir dialog',
2849
+ editorType: 'text',
2850
+ group: 'Dialogo avancado',
2851
+ },
2852
+ {
2853
+ name: 'dialog.applyActionLabel',
2854
+ label: 'Label aplicar dialog',
2855
+ editorType: 'text',
2856
+ group: 'Dialogo avancado',
2857
+ },
2858
+ {
2859
+ name: 'dialog.cancelActionLabel',
2860
+ label: 'Label cancelar dialog',
2861
+ editorType: 'text',
2862
+ group: 'Dialogo avancado',
2863
+ },
2864
+ {
2865
+ name: 'detailActionLabel',
2866
+ label: 'Label detalhe',
2867
+ editorType: 'text',
2868
+ group: 'Acoes do lookup',
2869
+ },
2870
+ {
2871
+ name: 'changeActionLabel',
2872
+ label: 'Label trocar',
2873
+ editorType: 'text',
2874
+ group: 'Acoes do lookup',
2875
+ },
2876
+ {
2877
+ name: 'copyCodeActionLabel',
2878
+ label: 'Label copiar codigo',
2879
+ editorType: 'text',
2880
+ group: 'Acoes do lookup',
2881
+ },
2882
+ {
2883
+ name: 'copyIdActionLabel',
2884
+ label: 'Label copiar ID',
2885
+ editorType: 'text',
2886
+ group: 'Acoes do lookup',
2887
+ },
2888
+ {
2889
+ name: 'createActionLabel',
2890
+ label: 'Label criar',
2891
+ editorType: 'text',
2892
+ group: 'Acoes do lookup',
2893
+ },
2894
+ {
2895
+ name: 'clearActionLabel',
2896
+ label: 'Label limpar',
2897
+ editorType: 'text',
2898
+ group: 'Acoes do lookup',
2899
+ },
2900
+ {
2901
+ name: 'actions.showDetail',
2902
+ label: 'Acao: detalhe',
2903
+ editorType: 'checkbox',
2904
+ group: 'Acoes do lookup',
2905
+ },
2906
+ {
2907
+ name: 'actions.showChange',
2908
+ label: 'Acao: trocar',
2909
+ editorType: 'checkbox',
2910
+ group: 'Acoes do lookup',
2911
+ },
2912
+ {
2913
+ name: 'actions.showCopyCode',
2914
+ label: 'Acao: copiar codigo',
2915
+ editorType: 'checkbox',
2916
+ group: 'Acoes do lookup',
2917
+ },
2918
+ {
2919
+ name: 'actions.showCopyId',
2920
+ label: 'Acao: copiar ID',
2921
+ editorType: 'checkbox',
2922
+ group: 'Acoes do lookup',
2923
+ },
2924
+ {
2925
+ name: 'actions.showCreate',
2926
+ label: 'Acao: criar',
2927
+ editorType: 'checkbox',
2928
+ group: 'Acoes do lookup',
2929
+ },
2930
+ {
2931
+ name: 'actions.showClear',
2932
+ label: 'Acao: limpar',
2933
+ editorType: 'checkbox',
2934
+ group: 'Acoes do lookup',
2935
+ },
1216
2936
  ];
1217
2937
 
1218
2938
  const transferListProperties = [
@@ -3134,6 +4854,18 @@ const sliderProperties = [
3134
4854
  // Formato/Comportamento
3135
4855
  { name: 'step', label: 'Step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento entre valores (ex.: 1, 0.5). Combine com min/max.' },
3136
4856
  { name: 'thumbLabel', label: 'Thumb label', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Exibe valor sobre o thumb ao arrastar.' },
4857
+ { name: 'valueLabelDisplay', label: 'Value label', editorType: 'select', group: 'Formato/Comportamento', options: [
4858
+ { value: 'off', text: 'Desligado' },
4859
+ { value: 'auto', text: 'Ao interagir' },
4860
+ { value: 'on', text: 'Sempre visivel' },
4861
+ ], hint: 'Controla quando o valor aparece no thumb.' },
4862
+ { name: 'valueLabelFormat', label: 'Formato do valor', editorType: 'select', group: 'Formato/Comportamento', options: [
4863
+ { value: 'number', text: 'Numero' },
4864
+ { value: 'percent', text: 'Percentual' },
4865
+ { value: 'currency', text: 'Moeda' },
4866
+ { value: 'compact', text: 'Compacto' },
4867
+ { value: 'storage', text: 'Armazenamento' },
4868
+ ], hint: 'Formatter declarativo para labels e aria-valuetext.' },
3137
4869
  { name: 'vertical', label: 'Vertical', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'fmt.flags', inline: true, hint: 'Altera para eixo Y.' },
3138
4870
  { name: 'invert', label: 'Inverter', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'fmt.flags', inline: true, hint: 'Inverte direção (direita→esquerda).' },
3139
4871
  { name: 'showTicks', label: 'Ticks', editorType: 'select', group: 'Formato/Comportamento', options: [
@@ -3141,6 +4873,26 @@ const sliderProperties = [
3141
4873
  { value: true, text: 'Com ticks' },
3142
4874
  { value: 'auto', text: 'Auto' },
3143
4875
  ], hint: 'Marcas na trilha; auto calcula com base no step.' },
4876
+ { name: 'marks', label: 'Marcadores (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"value":0,"label":"Baixo"},{"value":100,"label":"Alto","tone":"danger"}].' },
4877
+ { name: 'semanticBands', label: 'Bandas semanticas (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"start":0,"end":40,"label":"Saudavel","tone":"success"}].' },
4878
+ { name: 'distribution', label: 'Distribuicao (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON ou config de histograma compacto. Ex.: {"colorMode":"gradient","bins":[4,8,16,12,6]}.' },
4879
+ { name: 'track', label: 'Track', editorType: 'select', group: 'Formato/Comportamento', options: [
4880
+ { value: 'normal', text: 'Normal' },
4881
+ { value: 'inverted', text: 'Invertido' },
4882
+ { value: 'none', text: 'Sem track ativo' },
4883
+ ], hint: 'Apresentacao visual do track.' },
4884
+ { name: 'size', label: 'Tamanho', editorType: 'select', group: 'Formato/Comportamento', options: [
4885
+ { value: 'small', text: 'Pequeno' },
4886
+ { value: 'medium', text: 'Medio' },
4887
+ { value: 'large', text: 'Grande' },
4888
+ ], hint: 'Densidade visual do slider.' },
4889
+ { name: 'scale', label: 'Escala', editorType: 'select', group: 'Formato/Comportamento', options: [
4890
+ { value: 'linear', text: 'Linear' },
4891
+ { value: 'percent', text: 'Percentual' },
4892
+ { value: 'log', text: 'Logaritmica' },
4893
+ { value: 'pow2', text: 'Potencia 2' },
4894
+ ], hint: 'Escala declarativa para dominios nao lineares.' },
4895
+ { name: 'shiftStep', label: 'Shift step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento acelerado para teclado.' },
3144
4896
  { name: 'discrete', label: 'Discreto', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Exibe ticks/labels fixos para valores discretos.' },
3145
4897
  // Validação
3146
4898
  { name: 'min', label: 'Mínimo', editorType: 'number', group: 'Validação', row: 'val.minmax', inline: true },
@@ -3180,11 +4932,44 @@ const rangeSliderProperties = [
3180
4932
  ], hint: 'Escolha faixa para dois marcadores.' },
3181
4933
  { name: 'step', label: 'Step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento entre valores (ex.: 1, 0.5). Combine com min/max.' },
3182
4934
  { name: 'thumbLabel', label: 'Thumb label', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Exibe o valor sobre o thumb ao arrastar.' },
4935
+ { name: 'valueLabelDisplay', label: 'Value label', editorType: 'select', group: 'Formato/Comportamento', options: [
4936
+ { value: 'off', text: 'Desligado' },
4937
+ { value: 'auto', text: 'Ao interagir' },
4938
+ { value: 'on', text: 'Sempre visivel' },
4939
+ ], hint: 'Controla quando o valor aparece no thumb.' },
4940
+ { name: 'valueLabelFormat', label: 'Formato do valor', editorType: 'select', group: 'Formato/Comportamento', options: [
4941
+ { value: 'number', text: 'Numero' },
4942
+ { value: 'percent', text: 'Percentual' },
4943
+ { value: 'currency', text: 'Moeda' },
4944
+ { value: 'compact', text: 'Compacto' },
4945
+ { value: 'storage', text: 'Armazenamento' },
4946
+ ], hint: 'Formatter declarativo para labels e aria-valuetext.' },
3183
4947
  { name: 'showTicks', label: 'Ticks', editorType: 'select', group: 'Formato/Comportamento', options: [
3184
4948
  { value: false, text: 'Sem ticks' },
3185
4949
  { value: true, text: 'Com ticks' },
3186
4950
  { value: 'auto', text: 'Auto' },
3187
4951
  ], hint: 'Marcas na trilha; auto calcula com base no step.' },
4952
+ { name: 'marks', label: 'Marcadores (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"value":0,"label":"Min"},{"value":100,"label":"Max","tone":"danger"}].' },
4953
+ { name: 'semanticBands', label: 'Bandas semanticas (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"start":0,"end":40,"label":"Baixo","tone":"success"}].' },
4954
+ { name: 'distribution', label: 'Distribuicao (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON ou config de histograma compacto. Ex.: {"colorMode":"gradient","bins":[4,8,16,12,6]}.' },
4955
+ { name: 'track', label: 'Track', editorType: 'select', group: 'Formato/Comportamento', options: [
4956
+ { value: 'normal', text: 'Normal' },
4957
+ { value: 'inverted', text: 'Invertido' },
4958
+ { value: 'none', text: 'Sem track ativo' },
4959
+ ], hint: 'Apresentacao visual do track.' },
4960
+ { name: 'size', label: 'Tamanho', editorType: 'select', group: 'Formato/Comportamento', options: [
4961
+ { value: 'small', text: 'Pequeno' },
4962
+ { value: 'medium', text: 'Medio' },
4963
+ { value: 'large', text: 'Grande' },
4964
+ ], hint: 'Densidade visual do slider.' },
4965
+ { name: 'scale', label: 'Escala', editorType: 'select', group: 'Formato/Comportamento', options: [
4966
+ { value: 'linear', text: 'Linear' },
4967
+ { value: 'percent', text: 'Percentual' },
4968
+ { value: 'log', text: 'Logaritmica' },
4969
+ { value: 'pow2', text: 'Potencia 2' },
4970
+ ], hint: 'Escala declarativa para dominios nao lineares.' },
4971
+ { name: 'shiftStep', label: 'Shift step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento acelerado para teclado.' },
4972
+ { name: 'disableThumbSwap', label: 'Bloquear troca dos thumbs', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Mantem start/end sem permitir inversao visual no modo range.' },
3188
4973
  { name: 'discrete', label: 'Discreto', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Mostra valor fixo por tick; use com showTicks.' },
3189
4974
  { name: 'readonly', label: 'Somente leitura', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.state', inline: true, hint: 'Mantém o valor renderizado sem permitir ajuste do slider.' },
3190
4975
  { name: 'disabled', label: 'Desabilitado', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.state', inline: true, hint: 'Desativa arraste, foco e presets rápidos.' },
@@ -5323,7 +7108,7 @@ const INLINE_FILTER_EDITOR_PROPERTIES_BY_CONTROL_TYPE = Object.freeze({
5323
7108
  [INLINE_FILTER_CONTROL_TYPES.SELECT]: selectProperties,
5324
7109
  [INLINE_FILTER_CONTROL_TYPES.SEARCHABLE_SELECT]: selectProperties,
5325
7110
  [INLINE_FILTER_CONTROL_TYPES.ASYNC_SELECT]: selectProperties,
5326
- [INLINE_FILTER_CONTROL_TYPES.ENTITY_LOOKUP]: selectProperties,
7111
+ [INLINE_FILTER_CONTROL_TYPES.ENTITY_LOOKUP]: entityLookupProperties,
5327
7112
  [INLINE_FILTER_CONTROL_TYPES.AUTOCOMPLETE]: selectProperties,
5328
7113
  [INLINE_FILTER_CONTROL_TYPES.MULTI_SELECT]: selectProperties,
5329
7114
  [INLINE_FILTER_CONTROL_TYPES.INPUT]: inputProperties,
@@ -5366,6 +7151,7 @@ class FieldMetadataEditorComponent {
5366
7151
  cancel = new EventEmitter();
5367
7152
  form;
5368
7153
  normalizedProps = [];
7154
+ renderedProps = [];
5369
7155
  initialSnapshot = null;
5370
7156
  baselineReady = false;
5371
7157
  // Lista de tipos suportados no editor (curada para os tipos com config disponível)
@@ -5380,10 +7166,12 @@ class FieldMetadataEditorComponent {
5380
7166
  { value: FieldControlType.URL_INPUT, label: 'URL' },
5381
7167
  { value: FieldControlType.SEARCH_INPUT, label: 'Busca' },
5382
7168
  { value: FieldControlType.PHONE, label: 'Telefone' },
7169
+ { value: FieldControlType.ARRAY_INPUT, label: 'Colecao editavel' },
5383
7170
  { value: FieldControlType.SELECT, label: 'Seleção (Select)' },
5384
7171
  { value: FieldControlType.MULTI_SELECT, label: 'Seleção múltipla' },
5385
7172
  { value: FieldControlType.SEARCHABLE_SELECT, label: 'Seleção buscável' },
5386
7173
  { value: FieldControlType.ASYNC_SELECT, label: 'Seleção assíncrona' },
7174
+ { value: FieldControlType.ENTITY_LOOKUP, label: 'Entity Lookup' },
5387
7175
  { value: FieldControlType.AUTO_COMPLETE, label: 'Auto-completar' },
5388
7176
  { value: FieldControlType.SELECTION_LIST, label: 'Lista de seleção' },
5389
7177
  { value: FieldControlType.TREE_SELECT, label: 'Árvore (Tree Select)' },
@@ -5471,9 +7259,12 @@ class FieldMetadataEditorComponent {
5471
7259
  return inlineProps;
5472
7260
  if (controlType === FieldControlType.INPUT)
5473
7261
  return inputProperties;
7262
+ if (controlType === FieldControlType.ARRAY_INPUT)
7263
+ return arrayProperties;
7264
+ if (controlTypeToken === 'entitylookup')
7265
+ return entityLookupProperties;
5474
7266
  if (controlTypeToken === 'searchableselect' ||
5475
- controlTypeToken === 'asyncselect' ||
5476
- controlTypeToken === 'entitylookup')
7267
+ controlTypeToken === 'asyncselect')
5477
7268
  return selectProperties;
5478
7269
  if (controlType === FieldControlType.NUMERIC_TEXT_BOX)
5479
7270
  return numberProperties;
@@ -5518,6 +7309,8 @@ class FieldMetadataEditorComponent {
5518
7309
  controlType === FieldControlType.AUTO_COMPLETE ||
5519
7310
  controlType === FieldControlType.SELECTION_LIST)
5520
7311
  return selectProperties;
7312
+ if (controlType === FieldControlType.ENTITY_LOOKUP)
7313
+ return entityLookupProperties;
5521
7314
  if (controlType === FieldControlType.TEXTAREA)
5522
7315
  return textareaProperties;
5523
7316
  if (controlType === FieldControlType.TRANSFER_LIST)
@@ -5594,11 +7387,14 @@ class FieldMetadataEditorComponent {
5594
7387
  this.registry.register(this.controlType, inputProperties);
5595
7388
  props = inputProperties;
5596
7389
  }
7390
+ else if (controlTypeToken === 'entitylookup') {
7391
+ this.registry.register(this.controlType, entityLookupProperties);
7392
+ props = entityLookupProperties;
7393
+ }
5597
7394
  else if (
5598
7395
  // Aliases for select-like
5599
7396
  controlTypeToken === 'searchableselect' ||
5600
- controlTypeToken === 'asyncselect' ||
5601
- controlTypeToken === 'entitylookup') {
7397
+ controlTypeToken === 'asyncselect') {
5602
7398
  this.registry.register(this.controlType, selectProperties);
5603
7399
  props = selectProperties;
5604
7400
  }
@@ -5683,6 +7479,10 @@ class FieldMetadataEditorComponent {
5683
7479
  this.registry.register(this.controlType, selectProperties);
5684
7480
  props = selectProperties;
5685
7481
  }
7482
+ else if (this.controlType === FieldControlType.ENTITY_LOOKUP) {
7483
+ this.registry.register(this.controlType, entityLookupProperties);
7484
+ props = entityLookupProperties;
7485
+ }
5686
7486
  else if (this.controlType === FieldControlType.TEXTAREA) {
5687
7487
  this.registry.register(this.controlType, textareaProperties);
5688
7488
  props = textareaProperties;
@@ -5814,6 +7614,7 @@ class FieldMetadataEditorComponent {
5814
7614
  }
5815
7615
  }
5816
7616
  catch { }
7617
+ this.renderedProps = this.buildRenderedProps(this.normalizedProps);
5817
7618
  // Register contextual validators for INPUT/TEXTAREA (minLength <= maxLength)
5818
7619
  if (this.controlType === FieldControlType.INPUT ||
5819
7620
  this.controlType === FieldControlType.TEXTAREA) {
@@ -5844,7 +7645,7 @@ class FieldMetadataEditorComponent {
5844
7645
  const name = p?.name;
5845
7646
  if (!name)
5846
7647
  continue;
5847
- const val = getByPath(this.seed, name);
7648
+ const val = this.toEditorControlValue(p, getByPath(this.seed, name));
5848
7649
  // Preserve false/0; skip only null/undefined
5849
7650
  if (val !== undefined && val !== null) {
5850
7651
  this.factory.setValueByPath(this.form, name, val);
@@ -6028,6 +7829,9 @@ class FieldMetadataEditorComponent {
6028
7829
  });
6029
7830
  }
6030
7831
  apply() {
7832
+ if (!this.canEmitSettingsValue()) {
7833
+ return;
7834
+ }
6031
7835
  const raw = this.factory.extractPatch(this.form);
6032
7836
  const patch = this.buildDeltaPatch(raw, this.initialSnapshot);
6033
7837
  this.normalizeKnownTextareaPatchValues(patch);
@@ -6055,6 +7859,9 @@ class FieldMetadataEditorComponent {
6055
7859
  }
6056
7860
  // Settings Panel value provider API
6057
7861
  getSettingsValue() {
7862
+ if (!this.canEmitSettingsValue()) {
7863
+ return {};
7864
+ }
6058
7865
  const raw = this.factory.extractPatch(this.form);
6059
7866
  const patch = this.buildDeltaPatch(raw, this.initialSnapshot);
6060
7867
  this.normalizeKnownTextareaPatchValues(patch);
@@ -6154,6 +7961,127 @@ class FieldMetadataEditorComponent {
6154
7961
  patch.links = parsedLinks;
6155
7962
  }
6156
7963
  }
7964
+ this.normalizeEntityLookupPatchValues(patch);
7965
+ this.normalizeArrayPatchValues(patch);
7966
+ }
7967
+ normalizeEntityLookupPatchValues(patch) {
7968
+ const optionSource = patch?.optionSource;
7969
+ if (optionSource && typeof optionSource === 'object') {
7970
+ this.normalizeStringListProperty(optionSource, 'descriptionPropertyPaths');
7971
+ this.normalizeStringListProperty(optionSource, 'searchPropertyPaths');
7972
+ this.normalizeStringListProperty(optionSource, 'dependsOn');
7973
+ this.normalizeJsonObjectProperty(optionSource, 'dependencyFilterMap');
7974
+ this.normalizeJsonObjectProperty(optionSource, 'create');
7975
+ const selectionPolicy = optionSource.selectionPolicy;
7976
+ if (selectionPolicy && typeof selectionPolicy === 'object') {
7977
+ this.normalizeStringListProperty(selectionPolicy, 'allowedStatuses');
7978
+ this.normalizeStringListProperty(selectionPolicy, 'blockedStatuses');
7979
+ }
7980
+ const filtering = optionSource.filtering;
7981
+ if (filtering && typeof filtering === 'object') {
7982
+ this.normalizeJsonArrayProperty(filtering, 'availableFilters');
7983
+ this.normalizeJsonObjectProperty(filtering, 'defaultFilters');
7984
+ this.normalizeJsonArrayProperty(filtering, 'sortOptions');
7985
+ this.normalizeStringListProperty(filtering, 'quickFilterFields');
7986
+ }
7987
+ const display = optionSource.display;
7988
+ if (display && typeof display === 'object') {
7989
+ this.normalizeJsonArrayProperty(display, 'fields');
7990
+ this.normalizeStringListProperty(display, 'secondaryPropertyPaths');
7991
+ this.normalizeStringListProperty(display, 'badgePropertyPaths');
7992
+ this.normalizeStringListProperty(display, 'badgeKeys');
7993
+ this.normalizeJsonObjectProperty(display, 'statusToneMap');
7994
+ }
7995
+ }
7996
+ this.normalizeStringListProperty(patch, 'badgeKeys');
7997
+ this.normalizeJsonObjectProperty(patch, 'statusToneMap');
7998
+ const dialog = patch?.dialog;
7999
+ if (dialog && typeof dialog === 'object') {
8000
+ this.normalizeJsonArrayProperty(dialog, 'resultColumns');
8001
+ }
8002
+ }
8003
+ normalizeStringListProperty(target, key) {
8004
+ if (!target || typeof target !== 'object' || typeof target[key] !== 'string') {
8005
+ return;
8006
+ }
8007
+ const parsed = this.parseStringListTextarea(target[key]);
8008
+ if (parsed) {
8009
+ target[key] = parsed;
8010
+ }
8011
+ }
8012
+ normalizeJsonObjectProperty(target, key) {
8013
+ if (!target || typeof target !== 'object' || typeof target[key] !== 'string') {
8014
+ return;
8015
+ }
8016
+ const parsed = this.tryParseJson(String(target[key]).trim());
8017
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
8018
+ target[key] = parsed;
8019
+ }
8020
+ }
8021
+ normalizeJsonArrayProperty(target, key) {
8022
+ if (!target || typeof target !== 'object' || typeof target[key] !== 'string') {
8023
+ return;
8024
+ }
8025
+ const parsed = this.parseArrayTextarea(target[key]);
8026
+ if (parsed) {
8027
+ target[key] = parsed;
8028
+ }
8029
+ }
8030
+ normalizeArrayPatchValues(patch) {
8031
+ const arrayPatch = patch?.array;
8032
+ if (!arrayPatch || typeof arrayPatch !== 'object') {
8033
+ return;
8034
+ }
8035
+ const collectionValidation = arrayPatch.collectionValidation;
8036
+ if (collectionValidation &&
8037
+ typeof collectionValidation === 'object' &&
8038
+ typeof collectionValidation.uniqueBy === 'string') {
8039
+ const parsedUniqueBy = this.parseStringListTextarea(collectionValidation.uniqueBy);
8040
+ if (parsedUniqueBy) {
8041
+ collectionValidation.uniqueBy = parsedUniqueBy;
8042
+ }
8043
+ }
8044
+ this.normalizeArrayCountRuleValue(collectionValidation?.exactlyOne);
8045
+ this.normalizeArrayCountRuleValue(collectionValidation?.atLeastOne);
8046
+ const itemSchema = arrayPatch.itemSchema;
8047
+ if (itemSchema &&
8048
+ typeof itemSchema === 'object' &&
8049
+ typeof itemSchema.fields === 'string') {
8050
+ const parsedFields = this.parseArrayTextarea(itemSchema.fields);
8051
+ if (parsedFields) {
8052
+ itemSchema.fields = parsedFields;
8053
+ }
8054
+ }
8055
+ if (typeof patch.defaultValue === 'string') {
8056
+ const parsedDefaultValue = this.parseArrayTextarea(patch.defaultValue);
8057
+ if (parsedDefaultValue) {
8058
+ patch.defaultValue = parsedDefaultValue;
8059
+ }
8060
+ }
8061
+ }
8062
+ normalizeArrayCountRuleValue(rule) {
8063
+ if (!rule || typeof rule !== 'object' || typeof rule.value !== 'string') {
8064
+ return;
8065
+ }
8066
+ const raw = rule.value.trim();
8067
+ if (!raw) {
8068
+ return;
8069
+ }
8070
+ try {
8071
+ rule.value = JSON.parse(raw);
8072
+ }
8073
+ catch {
8074
+ rule.value = raw;
8075
+ }
8076
+ }
8077
+ toEditorControlValue(prop, value) {
8078
+ if (prop?.editorType === 'textarea' &&
8079
+ value !== undefined &&
8080
+ value !== null &&
8081
+ typeof value !== 'string') {
8082
+ return JSON.stringify(value, null, 2);
8083
+ }
8084
+ return value;
6157
8085
  }
6158
8086
  /**
6159
8087
  * Interpreta textarea como lista simples de strings:
@@ -6207,7 +8135,11 @@ class FieldMetadataEditorComponent {
6207
8135
  }
6208
8136
  }
6209
8137
  reset() {
6210
- this.form.reset(this.factory.extractPatch(this.form));
8138
+ const snapshot = this.cloneSnapshot(this.initialSnapshot ?? this.form.getRawValue());
8139
+ this.form.reset(snapshot);
8140
+ this.form.markAsPristine();
8141
+ this.form.markAsUntouched();
8142
+ this.form.updateValueAndValidity({ emitEvent: true });
6211
8143
  this.isDirty$.next(false);
6212
8144
  }
6213
8145
  onControlTypeChange(next) {
@@ -6225,28 +8157,162 @@ class FieldMetadataEditorComponent {
6225
8157
  const missingSharedProps = fieldSubmitProperties.filter((prop) => !propNames.has(prop.name));
6226
8158
  return missingSharedProps.length ? [...props, ...missingSharedProps] : props;
6227
8159
  }
8160
+ get isArrayEditor() {
8161
+ return this.controlType === FieldControlType.ARRAY_INPUT;
8162
+ }
8163
+ buildRenderedProps(props) {
8164
+ if (!this.isArrayEditor) {
8165
+ return props;
8166
+ }
8167
+ return (props || []).filter((prop) => prop?.name !== 'array.itemSchema.fields');
8168
+ }
8169
+ cloneSnapshot(value) {
8170
+ return this.cloneMetadataValue(value, new WeakMap());
8171
+ }
8172
+ cloneMetadataValue(value, seen) {
8173
+ if (!value || typeof value !== 'object') {
8174
+ return value;
8175
+ }
8176
+ if (seen.has(value)) {
8177
+ return seen.get(value);
8178
+ }
8179
+ if (value instanceof Date) {
8180
+ return new Date(value.getTime());
8181
+ }
8182
+ if (value instanceof RegExp) {
8183
+ return new RegExp(value.source, value.flags);
8184
+ }
8185
+ if (Array.isArray(value)) {
8186
+ const clone = [];
8187
+ seen.set(value, clone);
8188
+ clone.push(...value.map((entry) => this.cloneMetadataValue(entry, seen)));
8189
+ return clone;
8190
+ }
8191
+ if (value instanceof Map) {
8192
+ const clone = new Map();
8193
+ seen.set(value, clone);
8194
+ value.forEach((entry, key) => {
8195
+ clone.set(this.cloneMetadataValue(key, seen), this.cloneMetadataValue(entry, seen));
8196
+ });
8197
+ return clone;
8198
+ }
8199
+ if (value instanceof Set) {
8200
+ const clone = new Set();
8201
+ seen.set(value, clone);
8202
+ value.forEach((entry) => clone.add(this.cloneMetadataValue(entry, seen)));
8203
+ return clone;
8204
+ }
8205
+ const prototype = Object.getPrototypeOf(value);
8206
+ if (prototype !== Object.prototype && prototype !== null) {
8207
+ return value;
8208
+ }
8209
+ const clone = {};
8210
+ seen.set(value, clone);
8211
+ for (const [key, entry] of Object.entries(value)) {
8212
+ clone[key] = this.cloneMetadataValue(entry, seen);
8213
+ }
8214
+ return clone;
8215
+ }
8216
+ canEmitSettingsValue() {
8217
+ this.validateArrayItemSchemaFields();
8218
+ this.form.updateValueAndValidity({ emitEvent: true });
8219
+ const valid = this.form.valid;
8220
+ this.isValid$.next(valid);
8221
+ if (!valid) {
8222
+ this.form.markAllAsTouched();
8223
+ }
8224
+ return valid;
8225
+ }
8226
+ validateArrayItemSchemaFields() {
8227
+ if (!this.isArrayEditor) {
8228
+ return;
8229
+ }
8230
+ const control = this.form.get('array.itemSchema.fields');
8231
+ if (!control) {
8232
+ return;
8233
+ }
8234
+ const value = control.value;
8235
+ const fields = Array.isArray(value)
8236
+ ? value
8237
+ : typeof value === 'string' && value.trim()
8238
+ ? this.parseArrayItemFields(value)
8239
+ : [];
8240
+ const seen = new Set();
8241
+ const duplicated = new Set();
8242
+ let hasEmptyName = false;
8243
+ for (const field of fields) {
8244
+ const name = String(field?.name || '').trim();
8245
+ if (!name) {
8246
+ hasEmptyName = true;
8247
+ continue;
8248
+ }
8249
+ if (seen.has(name)) {
8250
+ duplicated.add(name);
8251
+ }
8252
+ seen.add(name);
8253
+ }
8254
+ this.setControlError(control, 'arrayFieldNameRequired', hasEmptyName);
8255
+ this.setControlError(control, 'arrayFieldNameDuplicated', duplicated.size ? { names: Array.from(duplicated) } : null);
8256
+ }
8257
+ parseArrayItemFields(value) {
8258
+ try {
8259
+ const parsed = JSON.parse(value);
8260
+ return Array.isArray(parsed) ? parsed : [];
8261
+ }
8262
+ catch {
8263
+ return [];
8264
+ }
8265
+ }
8266
+ setControlError(control, key, value) {
8267
+ const errors = { ...(control.errors || {}) };
8268
+ const hasError = value !== null && value !== undefined && value !== false;
8269
+ if (hasError) {
8270
+ errors[key] = value === true ? true : value;
8271
+ }
8272
+ else {
8273
+ delete errors[key];
8274
+ }
8275
+ control.setErrors(Object.keys(errors).length ? errors : null);
8276
+ }
6228
8277
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: FieldMetadataEditorComponent, deps: [{ token: ConfigRegistryService }, { token: SchemaNormalizerService }, { token: DynamicFormFactoryService }, { token: ContextValidatorRegistryService }], target: i0.ɵɵFactoryTarget.Component });
6229
8278
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.17", type: FieldMetadataEditorComponent, isStandalone: true, selector: "praxis-field-metadata-editor", inputs: { controlType: "controlType", seed: "seed" }, outputs: { applied: "applied", cancel: "cancel" }, ngImport: i0, template: `
6230
8279
  <div class="p-3" *ngIf="form">
6231
8280
  <praxis-dynamic-editor-renderer
6232
- [properties]="normalizedProps"
8281
+ [properties]="renderedProps"
6233
8282
  [form]="form"
6234
8283
  ></praxis-dynamic-editor-renderer>
8284
+
8285
+ <praxis-array-item-schema-fields-editor
8286
+ *ngIf="isArrayEditor"
8287
+ [control]="form.get('array.itemSchema.fields')"
8288
+ [arrayControl]="form.get('array')"
8289
+ ></praxis-array-item-schema-fields-editor>
6235
8290
  </div>
6236
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: DynamicEditorRendererComponent, selector: "praxis-dynamic-editor-renderer", inputs: ["properties", "form"] }] });
8291
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: DynamicEditorRendererComponent, selector: "praxis-dynamic-editor-renderer", inputs: ["properties", "form"] }, { kind: "component", type: ArrayItemSchemaFieldsEditorComponent, selector: "praxis-array-item-schema-fields-editor", inputs: ["control", "arrayControl"] }] });
6237
8292
  }
6238
8293
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: FieldMetadataEditorComponent, decorators: [{
6239
8294
  type: Component,
6240
8295
  args: [{
6241
8296
  selector: 'praxis-field-metadata-editor',
6242
8297
  standalone: true,
6243
- imports: [CommonModule, ReactiveFormsModule, DynamicEditorRendererComponent],
8298
+ imports: [
8299
+ CommonModule,
8300
+ ReactiveFormsModule,
8301
+ DynamicEditorRendererComponent,
8302
+ ArrayItemSchemaFieldsEditorComponent,
8303
+ ],
6244
8304
  template: `
6245
8305
  <div class="p-3" *ngIf="form">
6246
8306
  <praxis-dynamic-editor-renderer
6247
- [properties]="normalizedProps"
8307
+ [properties]="renderedProps"
6248
8308
  [form]="form"
6249
8309
  ></praxis-dynamic-editor-renderer>
8310
+
8311
+ <praxis-array-item-schema-fields-editor
8312
+ *ngIf="isArrayEditor"
8313
+ [control]="form.get('array.itemSchema.fields')"
8314
+ [arrayControl]="form.get('array')"
8315
+ ></praxis-array-item-schema-fields-editor>
6250
8316
  </div>
6251
8317
  `,
6252
8318
  }]
@@ -6267,15 +8333,19 @@ class CascadeRulesService {
6267
8333
  return map;
6268
8334
  }
6269
8335
  hydrateRule(field) {
6270
- const deps = field.dependencyFields;
8336
+ const deps = (field.dependencyFields ??
8337
+ field.optionSource?.dependsOn);
6271
8338
  if (!deps || deps.length === 0)
6272
8339
  return null;
8340
+ const dependencyFilterMap = field.dependencyFilterMap ??
8341
+ field.optionSource?.dependencyFilterMap ??
8342
+ null;
6273
8343
  const vm = {
6274
8344
  targetField: field.name,
6275
8345
  dependencyFields: [...deps],
6276
8346
  enableDependencyCascade: field.enableDependencyCascade === false ? false : true,
6277
8347
  resetOnDependentChange: !!field.resetOnDependentChange,
6278
- dependencyFilterMap: field.dependencyFilterMap || null,
8348
+ dependencyFilterMap,
6279
8349
  dependencyValuePath: field.dependencyValuePath || null,
6280
8350
  dependencyMergeStrategy: field.dependencyMergeStrategy || 'merge',
6281
8351
  dependencyDebounceMs: field.dependencyDebounceMs != null
@@ -6956,7 +9026,7 @@ class CascadeManagerTabComponent {
6956
9026
  </div>
6957
9027
  </div>
6958
9028
  </div>
6959
- `, isInline: true, styles: [":host{display:block}.cm-root{display:grid;grid-template-columns:320px 1fr;gap:16px;min-height:420px}.cm-left{border-right:1px solid var(--md-sys-color-outline-variant);padding-right:8px}.cm-search{width:100%;margin-bottom:8px}.cm-right{padding-left:8px}.field-item{display:flex;align-items:center;justify-content:space-between;padding:8px 6px;cursor:pointer;border-radius:10px;transition:background .12s ease,border .12s ease;border:1px solid transparent}.field-item:hover{background:var(--md-sys-color-surface-container-high)}.field-item.selected{background:var(--md-sys-color-surface-container-highest);border-color:var(--md-sys-color-outline-variant)}.rule-badges{display:inline-flex;gap:6px}.rule-badge{font-size:11px;padding:2px 8px;border-radius:999px;font-weight:600}.b-active{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}.b-manual{background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface-variant)}.b-immediate{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}.b-conflict{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}.cm-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.rules-empty{opacity:.8;font-style:italic;padding:8px 0;color:var(--md-sys-color-on-surface-variant)}.rule-row{display:grid;grid-template-columns:1fr auto;align-items:center;padding:10px 0;border-bottom:1px dashed var(--md-sys-color-outline-variant)}.rule-actions button{margin-left:4px}.banner{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);padding:10px 12px;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;margin-bottom:10px;display:flex;gap:8px;align-items:center}.import-panel{background:var(--md-sys-color-surface-container-high);border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;padding:10px;margin-bottom:10px}.full{width:100%}.form-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.form-grid{display:grid;gap:12px;padding:8px 0}.map-table{width:100%;border-collapse:collapse}.map-table th,.map-table td{padding:8px;border-bottom:1px dashed var(--md-sys-color-outline-variant)}.kbd{font-family:monospace;background:var(--md-sys-color-surface-container-highest);padding:0 6px;border-radius:4px;color:var(--md-sys-color-on-surface-variant)}.panel-surface{background:var(--md-sys-color-surface-container-high);border:1px solid var(--md-sys-color-outline-variant);border-radius:10px;box-shadow:var(--md-sys-elevation-level1, none);margin-bottom:12px}.panel-stack{display:grid;gap:12px;margin:12px 0}.stack-panel{background:var(--md-sys-color-surface-container-high);border:1px solid var(--md-sys-color-outline-variant);border-radius:10px;box-shadow:var(--md-sys-elevation-level1, none)}.stack-panel .mat-expansion-panel-content{padding:0 16px 12px}.panel-header{display:flex;align-items:center;gap:8px}.preview-box{background:var(--md-sys-color-surface-container-low);border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;padding:8px;color:var(--md-sys-color-on-surface)}.help-icon-button{--mdc-icon-button-state-layer-size: 28px;--mdc-icon-button-icon-size: 18px;width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;margin-right:-4px}.help-icon-button mat-icon{font-size:18px;width:18px;height:18px}.mat-mdc-form-field-icon-suffix{align-self:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i5$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "ngmodule", type: MatListModule }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i8$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i8$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i5.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i11.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i11.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i11.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i12.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i12.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i13.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i13.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i13.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }] });
9029
+ `, isInline: true, styles: [":host{display:block}.cm-root{display:grid;grid-template-columns:320px 1fr;gap:16px;min-height:420px}.cm-left{border-right:1px solid var(--md-sys-color-outline-variant);padding-right:8px}.cm-search{width:100%;margin-bottom:8px}.cm-right{padding-left:8px}.field-item{display:flex;align-items:center;justify-content:space-between;padding:8px 6px;cursor:pointer;border-radius:10px;transition:background .12s ease,border .12s ease;border:1px solid transparent}.field-item:hover{background:var(--md-sys-color-surface-container-high)}.field-item.selected{background:var(--md-sys-color-surface-container-highest);border-color:var(--md-sys-color-outline-variant)}.rule-badges{display:inline-flex;gap:6px}.rule-badge{font-size:11px;padding:2px 8px;border-radius:999px;font-weight:600}.b-active{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}.b-manual{background:var(--md-sys-color-surface-container-high);color:var(--md-sys-color-on-surface-variant)}.b-immediate{background:var(--md-sys-color-secondary-container);color:var(--md-sys-color-on-secondary-container)}.b-conflict{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}.cm-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.rules-empty{opacity:.8;font-style:italic;padding:8px 0;color:var(--md-sys-color-on-surface-variant)}.rule-row{display:grid;grid-template-columns:1fr auto;align-items:center;padding:10px 0;border-bottom:1px dashed var(--md-sys-color-outline-variant)}.rule-actions button{margin-left:4px}.banner{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container);padding:10px 12px;border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;margin-bottom:10px;display:flex;gap:8px;align-items:center}.import-panel{background:var(--md-sys-color-surface-container-high);border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;padding:10px;margin-bottom:10px}.full{width:100%}.form-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.form-grid{display:grid;gap:12px;padding:8px 0}.map-table{width:100%;border-collapse:collapse}.map-table th,.map-table td{padding:8px;border-bottom:1px dashed var(--md-sys-color-outline-variant)}.kbd{font-family:monospace;background:var(--md-sys-color-surface-container-highest);padding:0 6px;border-radius:4px;color:var(--md-sys-color-on-surface-variant)}.panel-surface{background:var(--md-sys-color-surface-container-high);border:1px solid var(--md-sys-color-outline-variant);border-radius:10px;box-shadow:var(--md-sys-elevation-level1, none);margin-bottom:12px}.panel-stack{display:grid;gap:12px;margin:12px 0}.stack-panel{background:var(--md-sys-color-surface-container-high);border:1px solid var(--md-sys-color-outline-variant);border-radius:10px;box-shadow:var(--md-sys-elevation-level1, none)}.stack-panel .mat-expansion-panel-content{padding:0 16px 12px}.panel-header{display:flex;align-items:center;gap:8px}.preview-box{background:var(--md-sys-color-surface-container-low);border:1px solid var(--md-sys-color-outline-variant);border-radius:8px;padding:8px;color:var(--md-sys-color-on-surface)}.help-icon-button{--mdc-icon-button-state-layer-size: 28px;--mdc-icon-button-icon-size: 18px;width:28px;height:28px;padding:0;display:inline-flex;align-items:center;justify-content:center;margin-right:-4px}.help-icon-button mat-icon{font-size:18px;width:18px;height:18px}.mat-mdc-form-field-icon-suffix{align-self:center}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i6.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5$1.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i5$1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i8.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "directive", type: i7.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: i7.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i7.MatLabel, selector: "mat-label" }, { kind: "directive", type: i7.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatChipsModule }, { kind: "ngmodule", type: MatListModule }, { kind: "ngmodule", type: MatDividerModule }, { kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i8$1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i8$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "ngmodule", type: MatExpansionModule }, { kind: "component", type: i5.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i5.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i5.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "ngmodule", type: MatMenuModule }, { kind: "component", type: i11.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i11.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i11.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "ngmodule", type: MatAutocompleteModule }, { kind: "component", type: i12.MatAutocomplete, selector: "mat-autocomplete", inputs: ["aria-label", "aria-labelledby", "displayWith", "autoActiveFirstOption", "autoSelectActiveOption", "requireSelection", "panelWidth", "disableRipple", "class", "hideSingleSelectionIndicator"], outputs: ["optionSelected", "opened", "closed", "optionActivated"], exportAs: ["matAutocomplete"] }, { kind: "directive", type: i12.MatAutocompleteTrigger, selector: "input[matAutocomplete], textarea[matAutocomplete]", inputs: ["matAutocomplete", "matAutocompletePosition", "matAutocompleteConnectedTo", "autocomplete", "matAutocompleteDisabled"], exportAs: ["matAutocompleteTrigger"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i13.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i13.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i13.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: PraxisIconDirective, selector: "mat-icon[praxisIcon]", inputs: ["praxisIcon"] }] });
6960
9030
  }
6961
9031
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: CascadeManagerTabComponent, decorators: [{
6962
9032
  type: Component,
@@ -7293,6 +9363,388 @@ const METADATA_EDITOR_AI_CAPABILITY_CATALOG = {
7293
9363
  enums: {},
7294
9364
  };
7295
9365
 
9366
+ const fieldMetadataPropertySchema = {
9367
+ type: 'object',
9368
+ required: ['path', 'value'],
9369
+ properties: {
9370
+ path: {
9371
+ enum: [
9372
+ 'name',
9373
+ 'label',
9374
+ 'description',
9375
+ 'controlType',
9376
+ 'placeholder',
9377
+ 'defaultValue',
9378
+ 'group',
9379
+ 'order',
9380
+ 'required',
9381
+ 'disabled',
9382
+ 'readOnly',
9383
+ 'hidden',
9384
+ 'source',
9385
+ 'transient',
9386
+ 'submitPolicy',
9387
+ 'hint',
9388
+ 'helpText',
9389
+ 'tooltip',
9390
+ 'options',
9391
+ 'optionSource',
9392
+ 'validators',
9393
+ 'conditionalRequired',
9394
+ 'conditionalDisplay',
9395
+ 'visibleIn',
9396
+ 'ariaLabel',
9397
+ 'ariaDescribedBy',
9398
+ ],
9399
+ },
9400
+ value: {},
9401
+ merge: { type: 'boolean' },
9402
+ },
9403
+ };
9404
+ const optionSourceSchema = {
9405
+ type: 'object',
9406
+ minProperties: 1,
9407
+ properties: {
9408
+ kind: { enum: ['static', 'remote', 'resource', 'lookup'] },
9409
+ resource: { type: 'string' },
9410
+ endpoint: { type: 'string' },
9411
+ valueField: { type: 'string' },
9412
+ labelField: { type: 'string' },
9413
+ dependsOn: { type: 'string' },
9414
+ dependencyFilterMap: { type: 'object' },
9415
+ display: {
9416
+ type: 'object',
9417
+ properties: {
9418
+ preset: { enum: ['compact', 'rich', 'directory', 'status', 'reference', 'hierarchical'] },
9419
+ usage: { enum: ['form', 'filter', 'table-cell', 'dashboard', 'wizard', 'review'] },
9420
+ density: { enum: ['compact', 'comfortable', 'rich'] },
9421
+ selectedLayout: { enum: ['card', 'inline', 'compact', 'token'] },
9422
+ resultLayout: { enum: ['list', 'denseList', 'table', 'card'] },
9423
+ primaryPropertyPath: { type: 'string' },
9424
+ fields: { type: 'array' },
9425
+ secondaryPropertyPaths: { type: 'array' },
9426
+ badgePropertyPaths: { type: 'array' },
9427
+ statusToneMap: { type: 'object' },
9428
+ },
9429
+ },
9430
+ detail: {
9431
+ type: 'object',
9432
+ properties: {
9433
+ kind: { enum: ['surface', 'route', 'href'] },
9434
+ surfaceId: { type: 'string' },
9435
+ presentation: { enum: ['drawer', 'modal'] },
9436
+ preferredWidget: { type: 'string' },
9437
+ mode: { enum: ['view', 'edit', 'create'] },
9438
+ },
9439
+ },
9440
+ options: { type: 'array' },
9441
+ },
9442
+ };
9443
+ const cascadeSchema = {
9444
+ type: 'object',
9445
+ required: ['dependentField'],
9446
+ properties: {
9447
+ dependentField: { type: 'string' },
9448
+ sourceField: { type: 'string' },
9449
+ strategy: { enum: ['replace', 'merge'] },
9450
+ debounceMs: { type: 'number' },
9451
+ loadMode: { enum: ['immediate', 'manual', 'respectLoadOn'] },
9452
+ dependencyFilterMap: { type: 'object' },
9453
+ optionSource: {
9454
+ type: 'object',
9455
+ properties: {
9456
+ kind: { enum: ['static', 'remote', 'resource', 'lookup'] },
9457
+ resource: { type: 'string' },
9458
+ endpoint: { type: 'string' },
9459
+ dependsOn: { type: 'string' },
9460
+ dependencyFilterMap: { type: 'object' },
9461
+ },
9462
+ },
9463
+ },
9464
+ };
9465
+ const PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST = {
9466
+ schemaVersion: '1.0.0',
9467
+ componentId: 'praxis-metadata-editor',
9468
+ ownerPackage: '@praxisui/metadata-editor',
9469
+ configSchemaId: 'FieldMetadata',
9470
+ manifestVersion: '1.0.0',
9471
+ runtimeInputs: [
9472
+ { name: 'controlType', type: 'FieldControlType', description: 'Canonical control type used to resolve editor property coverage.' },
9473
+ { name: 'seed', type: 'Partial<FieldMetadata | FieldDefinition>', description: 'Initial canonical field metadata used to hydrate the editor.' },
9474
+ { name: 'fields', type: 'Array<FieldMetadata | FieldDefinition>', description: 'Available fields used by cascade authoring and context validation.' },
9475
+ { name: 'properties', type: 'EditorProperty[]', description: 'Renderer property catalog resolved from ConfigRegistryService.' },
9476
+ { name: 'form', type: 'FormGroup', description: 'Dynamic form generated from canonical editor properties by DynamicFormFactoryService.' },
9477
+ ],
9478
+ editableTargets: [
9479
+ { kind: 'fieldMetadata', resolver: 'field-metadata-json-path', description: 'Canonical FieldMetadata root and property paths.' },
9480
+ { kind: 'controlType', resolver: 'dynamic-fields-control-type-discovery', description: 'Control type selected from dynamic-fields discovery and editor config registry.' },
9481
+ { kind: 'optionSource', resolver: 'field-metadata-option-source', description: 'Canonical option source including backend x-ui option source fields where applicable.' },
9482
+ { kind: 'cascade', resolver: 'metadata-editor-cascade-rules', description: 'Cascade dependencies and dependency filter mappings edited through CascadeManagerTab.' },
9483
+ { kind: 'renderer', resolver: 'metadata-editor-renderer-property', description: 'Dynamic editor renderer property coverage and editor component mapping.' },
9484
+ { kind: 'validation', resolver: 'field-metadata-validation-rules', description: 'Field validation rules and contextual validators.' },
9485
+ { kind: 'contextHint', resolver: 'metadata-editor-context-hints', description: 'Authoring hints, help text and contextual guidance for metadata editors.' },
9486
+ { kind: 'normalization', resolver: 'metadata-editor-schema-normalizer', description: 'Schema normalization and seed hydration rules.' },
9487
+ ],
9488
+ operations: [
9489
+ {
9490
+ operationId: 'fieldMetadata.property.set',
9491
+ title: 'Set FieldMetadata property',
9492
+ scope: 'fieldMetadataPath',
9493
+ targetKind: 'fieldMetadata',
9494
+ target: { kind: 'fieldMetadata', resolver: 'field-metadata-json-path', ambiguityPolicy: 'fail', required: true },
9495
+ inputSchema: fieldMetadataPropertySchema,
9496
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-field-property-set', handlerContract: {
9497
+ reads: ['fieldMetadata', 'fieldMetadataPath', 'SchemaNormalizerService'],
9498
+ writes: ['fieldMetadata'],
9499
+ identityKeys: ['field.name', 'path'],
9500
+ inputSchema: fieldMetadataPropertySchema,
9501
+ failureModes: ['unknown-field-metadata-path', 'non-canonical-shape', 'readonly-field', 'normalization-failed'],
9502
+ description: 'Sets a canonical FieldMetadata property through a governed metadata path and re-runs schema normalization.',
9503
+ } }],
9504
+ destructive: false,
9505
+ requiresConfirmation: false,
9506
+ validators: ['field-metadata-shape-canonical', 'field-path-supported-by-editor', 'metadata-round-trip'],
9507
+ affectedPaths: ['fieldMetadata'],
9508
+ submissionImpact: 'affects-schema-backed-data',
9509
+ preconditions: ['field-metadata-loaded'],
9510
+ },
9511
+ {
9512
+ operationId: 'controlType.set',
9513
+ title: 'Set control type',
9514
+ scope: 'controlType',
9515
+ targetKind: 'controlType',
9516
+ target: { kind: 'controlType', resolver: 'dynamic-fields-control-type-discovery', ambiguityPolicy: 'fail', required: true },
9517
+ inputSchema: {
9518
+ type: 'object',
9519
+ required: ['controlType'],
9520
+ properties: {
9521
+ controlType: { type: 'string' },
9522
+ preserveCompatibleProperties: { type: 'boolean' },
9523
+ },
9524
+ },
9525
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-control-type-set', handlerContract: {
9526
+ reads: ['FieldControlType', 'ConfigRegistryService', 'dynamic-fields-discovery', 'fieldMetadata'],
9527
+ writes: ['fieldMetadata.controlType', 'properties', 'normalizedSeed'],
9528
+ identityKeys: ['field.name', 'controlType'],
9529
+ inputSchema: { type: 'object', required: ['controlType'], properties: { controlType: { type: 'string' }, preserveCompatibleProperties: { type: 'boolean' } } },
9530
+ failureModes: ['control-type-not-discovered', 'editor-coverage-missing', 'incompatible-metadata-preservation'],
9531
+ description: 'Changes control type only when dynamic-fields discovery and metadata-editor config registry both expose renderer/editor coverage.',
9532
+ } }],
9533
+ destructive: false,
9534
+ requiresConfirmation: false,
9535
+ validators: ['control-type-exists-in-discovery', 'editor-coverage-exists', 'metadata-round-trip'],
9536
+ affectedPaths: ['fieldMetadata.controlType', 'properties', 'normalizedSeed'],
9537
+ submissionImpact: 'affects-schema-backed-data',
9538
+ preconditions: ['dynamic-fields-discovery-loaded'],
9539
+ },
9540
+ {
9541
+ operationId: 'optionSource.configure',
9542
+ title: 'Configure option source',
9543
+ scope: 'dataBinding',
9544
+ targetKind: 'optionSource',
9545
+ target: { kind: 'optionSource', resolver: 'field-metadata-option-source', ambiguityPolicy: 'fail', required: false },
9546
+ inputSchema: optionSourceSchema,
9547
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-option-source-configure', handlerContract: {
9548
+ reads: ['fieldMetadata.optionSource', 'backend.x-ui.optionSource', 'SchemaNormalizerService'],
9549
+ writes: ['fieldMetadata.optionSource'],
9550
+ identityKeys: ['field.name', 'optionSource.kind', 'optionSource.resource'],
9551
+ inputSchema: optionSourceSchema,
9552
+ failureModes: ['invalid-option-source-kind', 'remote-source-missing-governed-resource', 'dependency-filter-map-invalid'],
9553
+ description: 'Configures canonical optionSource fields while preserving backend x-ui dependsOn and dependencyFilterMap semantics.',
9554
+ } }],
9555
+ destructive: false,
9556
+ requiresConfirmation: false,
9557
+ validators: ['option-source-shape-canonical', 'remote-option-source-governed', 'cascade-backend-shape-preserved', 'metadata-round-trip'],
9558
+ affectedPaths: ['fieldMetadata.optionSource'],
9559
+ submissionImpact: 'affects-remote-binding',
9560
+ preconditions: ['field-metadata-loaded'],
9561
+ },
9562
+ {
9563
+ operationId: 'cascade.configure',
9564
+ title: 'Configure cascade rule',
9565
+ scope: 'interaction',
9566
+ targetKind: 'cascade',
9567
+ target: { kind: 'cascade', resolver: 'metadata-editor-cascade-rules', ambiguityPolicy: 'fail', required: false },
9568
+ inputSchema: cascadeSchema,
9569
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-cascade-configure', handlerContract: {
9570
+ reads: ['CascadeManagerTabComponent', 'CascadeRulesService', 'fields', 'fieldMetadata.optionSource', 'fieldMetadata.dependencyFields', 'fieldMetadata.dependencyFilterMap'],
9571
+ writes: ['fieldMetadata.dependencyFields', 'fieldMetadata.enableDependencyCascade', 'fieldMetadata.resetOnDependentChange', 'fieldMetadata.dependencyFilterMap', 'fieldMetadata.dependencyValuePath', 'fieldMetadata.dependencyMergeStrategy', 'fieldMetadata.dependencyDebounceMs', 'fieldMetadata.dependencyLoadOnChange', 'fieldMetadata.optionSource.dependsOn', 'fieldMetadata.optionSource.dependencyFilterMap'],
9572
+ identityKeys: ['dependentField', 'sourceField'],
9573
+ inputSchema: cascadeSchema,
9574
+ failureModes: ['dependent-field-not-found', 'source-field-not-found', 'cascade-cycle-detected', 'dependency-filter-map-invalid'],
9575
+ description: 'Applies cascade dependencies through CascadeRulesService using the metadata-editor save contract while preserving backend x-ui optionSource dependency semantics during hydration.',
9576
+ } }],
9577
+ destructive: false,
9578
+ requiresConfirmation: false,
9579
+ validators: ['cascade-fields-exist', 'cascade-cycle-free', 'cascade-backend-shape-preserved', 'option-source-shape-canonical', 'remote-option-source-governed', 'metadata-round-trip'],
9580
+ affectedPaths: ['fieldMetadata.dependencyFields', 'fieldMetadata.enableDependencyCascade', 'fieldMetadata.resetOnDependentChange', 'fieldMetadata.dependencyFilterMap', 'fieldMetadata.dependencyValuePath', 'fieldMetadata.dependencyMergeStrategy', 'fieldMetadata.dependencyDebounceMs', 'fieldMetadata.dependencyLoadOnChange', 'fieldMetadata.optionSource.dependsOn', 'fieldMetadata.optionSource.dependencyFilterMap'],
9581
+ submissionImpact: 'affects-remote-binding',
9582
+ preconditions: ['field-list-loaded'],
9583
+ },
9584
+ {
9585
+ operationId: 'renderer.configure',
9586
+ title: 'Configure renderer coverage',
9587
+ scope: 'editorCoverage',
9588
+ targetKind: 'renderer',
9589
+ target: { kind: 'renderer', resolver: 'metadata-editor-renderer-property', ambiguityPolicy: 'fail', required: true },
9590
+ inputSchema: {
9591
+ type: 'object',
9592
+ required: ['propertyName', 'editorType'],
9593
+ properties: {
9594
+ propertyName: { type: 'string' },
9595
+ editorType: { type: 'string' },
9596
+ group: { type: 'string' },
9597
+ required: { type: 'boolean' },
9598
+ options: { type: 'array' },
9599
+ },
9600
+ },
9601
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-renderer-configure', handlerContract: {
9602
+ reads: ['DynamicEditorRendererComponent', 'EditorComponentRegistryService', 'ConfigRegistryService', 'EditorProperty'],
9603
+ writes: ['properties', 'editorCoverage'],
9604
+ identityKeys: ['controlType', 'propertyName'],
9605
+ inputSchema: { type: 'object', required: ['propertyName', 'editorType'], properties: { propertyName: { type: 'string' }, editorType: { type: 'string' }, group: { type: 'string' } } },
9606
+ failureModes: ['editor-type-not-registered', 'property-not-covered', 'json-only-coverage-not-accepted'],
9607
+ description: 'Configures visual renderer coverage for a metadata property and rejects JSON-only support for required visual authoring.',
9608
+ } }],
9609
+ destructive: false,
9610
+ requiresConfirmation: false,
9611
+ validators: ['renderer-editor-type-registered', 'visual-editor-coverage-required', 'editor-coverage-exists', 'metadata-round-trip'],
9612
+ affectedPaths: ['properties', 'editorCoverage'],
9613
+ submissionImpact: 'config-only',
9614
+ preconditions: ['config-registry-loaded'],
9615
+ },
9616
+ {
9617
+ operationId: 'validationRule.add',
9618
+ title: 'Add validation rule',
9619
+ scope: 'fieldMetadataPath',
9620
+ targetKind: 'validation',
9621
+ target: { kind: 'validation', resolver: 'field-metadata-validation-rules', ambiguityPolicy: 'fail', required: false },
9622
+ inputSchema: {
9623
+ type: 'object',
9624
+ required: ['rule'],
9625
+ properties: {
9626
+ rule: { type: 'object' },
9627
+ message: { type: 'string' },
9628
+ contextValidatorId: { type: 'string' },
9629
+ },
9630
+ },
9631
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-validation-rule-add', handlerContract: {
9632
+ reads: ['fieldMetadata.validators', 'ContextValidatorRegistryService', 'DynamicFormFactoryService'],
9633
+ writes: ['fieldMetadata.validators'],
9634
+ identityKeys: ['field.name', 'rule.type', 'contextValidatorId'],
9635
+ inputSchema: { type: 'object', required: ['rule'], properties: { rule: { type: 'object' }, message: { type: 'string' }, contextValidatorId: { type: 'string' } } },
9636
+ failureModes: ['validation-rule-invalid', 'context-validator-not-registered', 'duplicate-validation-rule'],
9637
+ description: 'Adds a canonical validation rule and verifies contextual validator availability before persistence.',
9638
+ } }],
9639
+ destructive: false,
9640
+ requiresConfirmation: false,
9641
+ validators: ['validation-rule-canonical', 'context-validator-registered', 'metadata-round-trip'],
9642
+ affectedPaths: ['fieldMetadata.validators'],
9643
+ submissionImpact: 'affects-submission',
9644
+ preconditions: ['field-metadata-loaded'],
9645
+ },
9646
+ {
9647
+ operationId: 'contextHint.set',
9648
+ title: 'Set metadata context hint',
9649
+ scope: 'meta',
9650
+ targetKind: 'contextHint',
9651
+ target: { kind: 'contextHint', resolver: 'metadata-editor-context-hints', ambiguityPolicy: 'fail', required: false },
9652
+ inputSchema: {
9653
+ type: 'object',
9654
+ required: ['hintPath', 'value'],
9655
+ properties: {
9656
+ hintPath: { enum: ['hint', 'helpText', 'description', 'tooltip', 'ariaLabel', 'ariaDescribedBy'] },
9657
+ value: {},
9658
+ localeKey: { type: 'string' },
9659
+ },
9660
+ },
9661
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-context-hint-set', handlerContract: {
9662
+ reads: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy', 'metadata-editor-i18n'],
9663
+ writes: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy'],
9664
+ identityKeys: ['field.name', 'hintPath'],
9665
+ inputSchema: { type: 'object', required: ['hintPath', 'value'], properties: { hintPath: { enum: ['hint', 'helpText', 'description', 'tooltip', 'ariaLabel', 'ariaDescribedBy'] }, value: {}, localeKey: { type: 'string' } } },
9666
+ failureModes: ['hint-path-not-canonical', 'hint-value-not-serializable', 'i18n-key-missing'],
9667
+ description: 'Sets structured FieldMetadata hint/help/accessibility text through canonical metadata paths and metadata-editor i18n constraints.',
9668
+ } }],
9669
+ destructive: false,
9670
+ requiresConfirmation: false,
9671
+ validators: ['context-hint-shape-canonical', 'context-hint-i18n-compatible', 'metadata-round-trip'],
9672
+ affectedPaths: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy'],
9673
+ submissionImpact: 'visual-only',
9674
+ preconditions: ['field-metadata-loaded'],
9675
+ },
9676
+ {
9677
+ operationId: 'normalization.apply',
9678
+ title: 'Apply schema normalization',
9679
+ scope: 'runtimeCoverage',
9680
+ targetKind: 'normalization',
9681
+ target: { kind: 'normalization', resolver: 'metadata-editor-schema-normalizer', ambiguityPolicy: 'fail', required: false },
9682
+ inputSchema: {
9683
+ type: 'object',
9684
+ properties: {
9685
+ mode: { enum: ['hydrate-seed', 'coerce-types', 'apply-defaults', 'preserve-advanced-properties'] },
9686
+ preserveUnknownCanonicalFields: { type: 'boolean' },
9687
+ },
9688
+ },
9689
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-normalization-apply', handlerContract: {
9690
+ reads: ['SchemaNormalizerService', 'fieldMetadata', 'properties', 'DynamicFormFactoryService'],
9691
+ writes: ['normalizedSeed', 'form', 'fieldMetadata'],
9692
+ identityKeys: ['field.name', 'controlType', 'mode'],
9693
+ inputSchema: { type: 'object', properties: { mode: { enum: ['hydrate-seed', 'coerce-types', 'apply-defaults', 'preserve-advanced-properties'] }, preserveUnknownCanonicalFields: { type: 'boolean' } } },
9694
+ failureModes: ['normalizer-missing', 'type-coercion-failed', 'advanced-property-lost', 'runtime-editor-drift'],
9695
+ description: 'Runs metadata-editor schema normalization while preserving canonical advanced FieldMetadata properties and editor/runtime round-trip.',
9696
+ } }],
9697
+ destructive: false,
9698
+ requiresConfirmation: false,
9699
+ validators: ['normalization-preserves-canonical-fields', 'runtime-editor-round-trip', 'metadata-round-trip'],
9700
+ affectedPaths: ['normalizedSeed', 'form', 'fieldMetadata'],
9701
+ submissionImpact: 'config-only',
9702
+ preconditions: ['field-metadata-loaded', 'editor-properties-loaded'],
9703
+ },
9704
+ ],
9705
+ validators: [
9706
+ { validatorId: 'field-metadata-shape-canonical', level: 'error', code: 'METADATA_FIELD_SHAPE_CANONICAL', description: 'Edited metadata must remain compatible with canonical FieldMetadata.' },
9707
+ { validatorId: 'field-path-supported-by-editor', level: 'error', code: 'METADATA_FIELD_PATH_SUPPORTED', description: 'Edited paths must be supported by visual editor coverage or explicitly delegated.' },
9708
+ { validatorId: 'control-type-exists-in-discovery', level: 'error', code: 'METADATA_CONTROL_TYPE_DISCOVERED', description: 'Control type must exist in dynamic-fields discovery.' },
9709
+ { validatorId: 'editor-coverage-exists', level: 'error', code: 'METADATA_EDITOR_COVERAGE_EXISTS', description: 'Control type and property must have metadata-editor coverage.' },
9710
+ { validatorId: 'option-source-shape-canonical', level: 'error', code: 'METADATA_OPTION_SOURCE_CANONICAL', description: 'Option source must use canonical FieldMetadata/x-ui shape.' },
9711
+ { validatorId: 'remote-option-source-governed', level: 'error', code: 'METADATA_REMOTE_OPTION_SOURCE_GOVERNED', description: 'Remote option sources must resolve through governed resource or endpoint metadata.' },
9712
+ { validatorId: 'cascade-fields-exist', level: 'error', code: 'METADATA_CASCADE_FIELDS_EXIST', description: 'Cascade source and dependent fields must exist.' },
9713
+ { validatorId: 'cascade-cycle-free', level: 'error', code: 'METADATA_CASCADE_CYCLE_FREE', description: 'Cascade dependencies must not create cycles.' },
9714
+ { validatorId: 'cascade-backend-shape-preserved', level: 'error', code: 'METADATA_CASCADE_BACKEND_SHAPE_PRESERVED', description: 'Cascade config must preserve x-ui optionSource dependsOn and dependencyFilterMap semantics.' },
9715
+ { validatorId: 'renderer-editor-type-registered', level: 'error', code: 'METADATA_RENDERER_TYPE_REGISTERED', description: 'Renderer editor type must be registered.' },
9716
+ { validatorId: 'visual-editor-coverage-required', level: 'error', code: 'METADATA_VISUAL_COVERAGE_REQUIRED', description: 'JSON-only support is not accepted for required visual authoring coverage.' },
9717
+ { validatorId: 'validation-rule-canonical', level: 'error', code: 'METADATA_VALIDATION_RULE_CANONICAL', description: 'Validation rule must use canonical metadata shape.' },
9718
+ { validatorId: 'context-validator-registered', level: 'error', code: 'METADATA_CONTEXT_VALIDATOR_REGISTERED', description: 'Contextual validator must be registered before use.' },
9719
+ { validatorId: 'context-hint-shape-canonical', level: 'error', code: 'METADATA_CONTEXT_HINT_CANONICAL', description: 'Context hints must remain structured metadata, not free-form host-only strings.' },
9720
+ { validatorId: 'context-hint-i18n-compatible', level: 'warning', code: 'METADATA_CONTEXT_HINT_I18N_COMPATIBLE', description: 'Authoring hint text must remain compatible with metadata-editor i18n.' },
9721
+ { validatorId: 'normalization-preserves-canonical-fields', level: 'error', code: 'METADATA_NORMALIZATION_PRESERVES_FIELDS', description: 'Normalization must not drop canonical advanced FieldMetadata properties.' },
9722
+ { validatorId: 'runtime-editor-round-trip', level: 'error', code: 'METADATA_RUNTIME_EDITOR_ROUND_TRIP', description: 'Runtime and editor must consume the same normalized metadata shape.' },
9723
+ { validatorId: 'metadata-round-trip', level: 'error', code: 'METADATA_ROUND_TRIP', description: 'Open, edit, apply/save, reopen and runtime consume must preserve metadata.' },
9724
+ ],
9725
+ roundTripRequirements: [
9726
+ 'FieldMetadata is the canonical edited document shape; backend x-ui-derived metadata must not be rewritten into host-only aliases.',
9727
+ 'Control type changes require both dynamic-fields discovery and metadata-editor visual coverage.',
9728
+ 'Option source cascades preserve x-ui optionSource.dependsOn and optionSource.dependencyFilterMap semantics.',
9729
+ 'JSON-only support is incomplete when visual editor coverage is required.',
9730
+ 'Schema normalization must preserve advanced canonical properties through open, edit, apply/save, reopen and runtime consumption.',
9731
+ ],
9732
+ examples: [
9733
+ { id: 'set-label', request: 'Set this field label to Customer name.', operationId: 'fieldMetadata.property.set', params: { path: 'label', value: 'Customer name' }, isPositive: true },
9734
+ { id: 'set-control-type', request: 'Change this field to a select control.', operationId: 'controlType.set', params: { controlType: 'select', preserveCompatibleProperties: true }, isPositive: true },
9735
+ { id: 'configure-remote-options', request: 'Load options from the customers resource using id and name.', operationId: 'optionSource.configure', params: { kind: 'resource', resource: 'customers', valueField: 'id', labelField: 'name' }, isPositive: true },
9736
+ { id: 'configure-cascade', request: 'Filter city options when state changes.', operationId: 'cascade.configure', params: { dependentField: 'city', sourceField: 'state', dependencyFilterMap: { stateId: 'state.id' } }, isPositive: true },
9737
+ { id: 'configure-renderer', request: 'Expose placeholder in the visual editor as a text field.', operationId: 'renderer.configure', params: { propertyName: 'placeholder', editorType: 'text', group: 'Presentation' }, isPositive: true },
9738
+ { id: 'add-required-validation', request: 'Make this field required with a validation message.', operationId: 'validationRule.add', params: { rule: { type: 'required' }, message: 'Required field' }, isPositive: true },
9739
+ { id: 'set-context-hint', request: 'Add a contextual hint for sales users.', operationId: 'contextHint.set', params: { hintPath: 'helpText', value: 'Use the legal customer name.' }, isPositive: true },
9740
+ { id: 'normalize-seed', request: 'Normalize this imported field metadata while preserving advanced properties.', operationId: 'normalization.apply', params: { mode: 'preserve-advanced-properties', preserveUnknownCanonicalFields: true }, isPositive: true },
9741
+ { id: 'reject-unknown-control', request: 'Use an unknown control type named magic-picker.', operationId: 'controlType.set', params: { controlType: 'magic-picker' }, isPositive: false },
9742
+ { id: 'reject-json-only-coverage', request: 'Support this field only by editing raw JSON.', operationId: 'renderer.configure', params: { propertyName: 'optionSource', editorType: 'json' }, isPositive: false },
9743
+ { id: 'reject-cascade-cycle', request: 'Make field A depend on B and B depend on A.', operationId: 'cascade.configure', params: { dependentField: 'a', sourceField: 'b' }, isPositive: false },
9744
+ { id: 'reject-host-only-option-source', request: 'Save a host-only URL string as the option source.', operationId: 'optionSource.configure', params: { kind: 'remote', endpoint: 'local-only://options' }, isPositive: false },
9745
+ ],
9746
+ };
9747
+
7296
9748
  /** Metadata for Praxis Metadata Editor component */
7297
9749
  const PRAXIS_METADATA_EDITOR_COMPONENT_METADATA = {
7298
9750
  id: 'praxis-metadata-editor',
@@ -7347,4 +9799,4 @@ function providePraxisMetadataEditorMetadata() {
7347
9799
  * Generated bundle index. Do not edit.
7348
9800
  */
7349
9801
 
7350
- export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, PRAXIS_METADATA_EDITOR_COMPONENT_METADATA, SchemaNormalizerService, providePraxisMetadataEditorMetadata };
9802
+ export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST, PRAXIS_METADATA_EDITOR_COMPONENT_METADATA, SchemaNormalizerService, providePraxisMetadataEditorMetadata };