@praxisui/metadata-editor 8.0.0-beta.2 → 8.0.0-beta.20

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
- import { Injectable, inject, Component, Input, ViewEncapsulation, EventEmitter, DestroyRef, Output, signal } 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';
2
+ import { Injectable, inject, Component, Input, ViewEncapsulation, EventEmitter, DestroyRef, Output, signal, ENVIRONMENT_INITIALIZER } from '@angular/core';
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 } 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,
@@ -683,7 +683,7 @@ class DynamicEditorRendererComponent {
683
683
  this.form?.markAsDirty();
684
684
  }
685
685
  }
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 });
686
+ 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
687
  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
688
  <ng-template #item let-field="field" let-index="index" let-content="content">
689
689
  <div class="editor-item" [attr.data-control-type]="field.controlType">
@@ -753,7 +753,7 @@ class DynamicEditorRendererComponent {
753
753
  </mat-expansion-panel>
754
754
  </mat-accordion>
755
755
  </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 });
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.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"] }, { 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
757
  }
758
758
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: DynamicEditorRendererComponent, decorators: [{
759
759
  type: Component,
@@ -837,12 +837,837 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImpo
837
837
  </mat-accordion>
838
838
  </div>
839
839
  `, 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: [{
840
+ }], ctorParameters: () => [{ type: i1.MatDialog }, { type: i2$2.IconPickerService }], propDecorators: { properties: [{
841
841
  type: Input
842
842
  }], form: [{
843
843
  type: Input
844
844
  }] } });
845
845
 
846
+ const METADATA_EDITOR_EN_US = {
847
+ 'praxis.metadataEditor.arrayFields.section': 'Collection subfields',
848
+ 'praxis.metadataEditor.arrayFields.title': 'Subfields',
849
+ 'praxis.metadataEditor.arrayFields.add': 'Add subfield',
850
+ 'praxis.metadataEditor.arrayFields.duplicateNames': 'There are duplicate names: {{names}}',
851
+ 'praxis.metadataEditor.arrayFields.empty': 'No local subfields configured.',
852
+ 'praxis.metadataEditor.arrayFields.name': 'Name',
853
+ 'praxis.metadataEditor.arrayFields.nameRequired': 'Enter the subfield name.',
854
+ 'praxis.metadataEditor.arrayFields.nameDuplicated': 'This name is already used in the collection.',
855
+ 'praxis.metadataEditor.arrayFields.label': 'Label',
856
+ 'praxis.metadataEditor.arrayFields.controlType': 'Control',
857
+ 'praxis.metadataEditor.arrayFields.required': 'Required',
858
+ 'praxis.metadataEditor.arrayFields.moveUp': 'Move up',
859
+ 'praxis.metadataEditor.arrayFields.moveDown': 'Move down',
860
+ 'praxis.metadataEditor.arrayFields.duplicate': 'Duplicate',
861
+ 'praxis.metadataEditor.arrayFields.remove': 'Remove',
862
+ 'praxis.metadataEditor.arrayFields.removeBlocked': 'Remove references before deleting: {{references}}',
863
+ 'praxis.metadataEditor.arrayFields.refOnly': 'The item schema comes from itemSchemaRef; create local subfields only when you need an override.',
864
+ 'praxis.metadataEditor.arrayFields.overrideLocal': 'There is an itemSchemaRef and local subfields; local subfields work as an explicit override.',
865
+ 'praxis.metadataEditor.arrayFields.imported': 'Subfields imported. Review them before applying or saving.',
866
+ 'praxis.metadataEditor.arrayFields.localOnly': 'Local subfields will be saved in array.itemSchema.fields.',
867
+ 'praxis.metadataEditor.arrayFields.control.input': 'Text',
868
+ 'praxis.metadataEditor.arrayFields.control.textarea': 'Long text',
869
+ 'praxis.metadataEditor.arrayFields.control.numeric': 'Number',
870
+ 'praxis.metadataEditor.arrayFields.control.currency': 'Currency',
871
+ 'praxis.metadataEditor.arrayFields.control.email': 'Email',
872
+ 'praxis.metadataEditor.arrayFields.control.phone': 'Phone',
873
+ 'praxis.metadataEditor.arrayFields.control.select': 'Select',
874
+ 'praxis.metadataEditor.arrayFields.control.entityLookup': 'Entity lookup',
875
+ 'praxis.metadataEditor.arrayFields.control.toggle': 'Toggle',
876
+ 'praxis.metadataEditor.arrayFields.control.date': 'Date',
877
+ };
878
+
879
+ const METADATA_EDITOR_PT_BR = {
880
+ 'praxis.metadataEditor.arrayFields.section': 'Subcampos da cole\u00e7\u00e3o',
881
+ 'praxis.metadataEditor.arrayFields.title': 'Subcampos',
882
+ 'praxis.metadataEditor.arrayFields.add': 'Adicionar subcampo',
883
+ 'praxis.metadataEditor.arrayFields.duplicateNames': 'Existem nomes duplicados: {{names}}',
884
+ 'praxis.metadataEditor.arrayFields.empty': 'Nenhum subcampo local configurado.',
885
+ 'praxis.metadataEditor.arrayFields.name': 'Nome',
886
+ 'praxis.metadataEditor.arrayFields.nameRequired': 'Informe o nome do subcampo.',
887
+ 'praxis.metadataEditor.arrayFields.nameDuplicated': 'Este nome j\u00e1 est\u00e1 em uso na cole\u00e7\u00e3o.',
888
+ 'praxis.metadataEditor.arrayFields.label': 'Label',
889
+ 'praxis.metadataEditor.arrayFields.controlType': 'Controle',
890
+ 'praxis.metadataEditor.arrayFields.required': 'Obrigat\u00f3rio',
891
+ 'praxis.metadataEditor.arrayFields.moveUp': 'Subir',
892
+ 'praxis.metadataEditor.arrayFields.moveDown': 'Descer',
893
+ 'praxis.metadataEditor.arrayFields.duplicate': 'Duplicar',
894
+ 'praxis.metadataEditor.arrayFields.remove': 'Remover',
895
+ 'praxis.metadataEditor.arrayFields.removeBlocked': 'Remova as refer\u00eancias antes de excluir: {{references}}',
896
+ 'praxis.metadataEditor.arrayFields.refOnly': 'O schema do item vem do itemSchemaRef; crie subcampos locais apenas quando precisar de override.',
897
+ 'praxis.metadataEditor.arrayFields.overrideLocal': 'H\u00e1 um itemSchemaRef e subcampos locais; os subcampos locais funcionam como override expl\u00edcito.',
898
+ 'praxis.metadataEditor.arrayFields.imported': 'Subcampos importados. Revise antes de aplicar ou salvar.',
899
+ 'praxis.metadataEditor.arrayFields.localOnly': 'Subcampos locais ser\u00e3o salvos em array.itemSchema.fields.',
900
+ 'praxis.metadataEditor.arrayFields.control.input': 'Texto',
901
+ 'praxis.metadataEditor.arrayFields.control.textarea': 'Texto longo',
902
+ 'praxis.metadataEditor.arrayFields.control.numeric': 'N\u00famero',
903
+ 'praxis.metadataEditor.arrayFields.control.currency': 'Moeda',
904
+ 'praxis.metadataEditor.arrayFields.control.email': 'E-mail',
905
+ 'praxis.metadataEditor.arrayFields.control.phone': 'Telefone',
906
+ 'praxis.metadataEditor.arrayFields.control.select': 'Sele\u00e7\u00e3o',
907
+ 'praxis.metadataEditor.arrayFields.control.entityLookup': 'Busca de entidade',
908
+ 'praxis.metadataEditor.arrayFields.control.toggle': 'Liga/desliga',
909
+ 'praxis.metadataEditor.arrayFields.control.date': 'Data',
910
+ };
911
+
912
+ function createPraxisMetadataEditorI18nConfig(options = {}) {
913
+ const dictionaries = {
914
+ 'pt-BR': {
915
+ ...METADATA_EDITOR_PT_BR,
916
+ ...(options.dictionaries?.['pt-BR'] ?? {}),
917
+ },
918
+ 'en-US': {
919
+ ...METADATA_EDITOR_EN_US,
920
+ ...(options.dictionaries?.['en-US'] ?? {}),
921
+ },
922
+ };
923
+ for (const [locale, dictionary] of Object.entries(options.dictionaries ?? {})) {
924
+ if (locale === 'pt-BR' || locale === 'en-US') {
925
+ continue;
926
+ }
927
+ dictionaries[locale] = {
928
+ ...(dictionaries[locale] ?? {}),
929
+ ...dictionary,
930
+ };
931
+ }
932
+ return {
933
+ locale: options.locale,
934
+ fallbackLocale: options.fallbackLocale ?? 'pt-BR',
935
+ dictionaries,
936
+ };
937
+ }
938
+ const METADATA_EDITOR_I18N_CONFIG = createPraxisMetadataEditorI18nConfig();
939
+ function providePraxisMetadataEditorI18n(options = {}) {
940
+ return providePraxisI18n(createPraxisMetadataEditorI18nConfig(options));
941
+ }
942
+ function resolvePraxisMetadataEditorText(i18n, key, fallback) {
943
+ const namespacedKey = key.startsWith('praxis.metadataEditor.')
944
+ ? key
945
+ : `praxis.metadataEditor.${key}`;
946
+ return i18n.t(namespacedKey, undefined, fallback) || fallback;
947
+ }
948
+
949
+ class ArrayItemSchemaFieldsEditorComponent {
950
+ static nextInstanceId = 0;
951
+ control = null;
952
+ arrayControl = null;
953
+ formArray = new FormArray([]);
954
+ form = new FormGroup({ fields: this.formArray });
955
+ controlTypeOptions = [
956
+ FieldControlType.INPUT,
957
+ FieldControlType.TEXTAREA,
958
+ FieldControlType.NUMERIC_TEXT_BOX,
959
+ FieldControlType.CURRENCY_INPUT,
960
+ FieldControlType.EMAIL_INPUT,
961
+ FieldControlType.PHONE,
962
+ FieldControlType.SELECT,
963
+ FieldControlType.ENTITY_LOOKUP,
964
+ FieldControlType.TOGGLE,
965
+ FieldControlType.DATE_INPUT,
966
+ ];
967
+ schemaSourceState = 'local-only';
968
+ duplicateNames = [];
969
+ fb = inject(FormBuilder);
970
+ i18n = inject(PraxisI18nService);
971
+ instanceId = ++ArrayItemSchemaFieldsEditorComponent.nextInstanceId;
972
+ externalSubscription;
973
+ internalSubscription;
974
+ originalNames = [];
975
+ importedFieldsFingerprint = null;
976
+ hydrating = false;
977
+ get rows() {
978
+ return this.formArray.controls;
979
+ }
980
+ ngOnChanges(changes) {
981
+ if (changes['control']) {
982
+ this.externalSubscription?.unsubscribe();
983
+ this.hydrateFromControl();
984
+ this.externalSubscription = this.control?.valueChanges.subscribe(() => {
985
+ if (!this.hydrating) {
986
+ this.hydrateFromControl();
987
+ }
988
+ });
989
+ }
990
+ if (changes['arrayControl'] || changes['control']) {
991
+ this.updateSchemaSourceState();
992
+ }
993
+ }
994
+ ngOnDestroy() {
995
+ this.externalSubscription?.unsubscribe();
996
+ this.internalSubscription?.unsubscribe();
997
+ }
998
+ text(key, fallback, fallbackWithParams, params) {
999
+ return this.i18n.t(key, params, fallbackWithParams ?? fallback);
1000
+ }
1001
+ controlTypeLabel(controlType) {
1002
+ const labels = {
1003
+ [FieldControlType.INPUT]: this.text('praxis.metadataEditor.arrayFields.control.input', 'Texto'),
1004
+ [FieldControlType.TEXTAREA]: this.text('praxis.metadataEditor.arrayFields.control.textarea', 'Texto longo'),
1005
+ [FieldControlType.NUMERIC_TEXT_BOX]: this.text('praxis.metadataEditor.arrayFields.control.numeric', 'N\u00famero'),
1006
+ [FieldControlType.CURRENCY_INPUT]: this.text('praxis.metadataEditor.arrayFields.control.currency', 'Moeda'),
1007
+ [FieldControlType.EMAIL_INPUT]: this.text('praxis.metadataEditor.arrayFields.control.email', 'E-mail'),
1008
+ [FieldControlType.PHONE]: this.text('praxis.metadataEditor.arrayFields.control.phone', 'Telefone'),
1009
+ [FieldControlType.SELECT]: this.text('praxis.metadataEditor.arrayFields.control.select', 'Sele\u00e7\u00e3o'),
1010
+ [FieldControlType.ENTITY_LOOKUP]: this.text('praxis.metadataEditor.arrayFields.control.entityLookup', 'Busca de entidade'),
1011
+ [FieldControlType.TOGGLE]: this.text('praxis.metadataEditor.arrayFields.control.toggle', 'Liga/desliga'),
1012
+ [FieldControlType.DATE_INPUT]: this.text('praxis.metadataEditor.arrayFields.control.date', 'Data'),
1013
+ };
1014
+ return labels[controlType] ?? controlType;
1015
+ }
1016
+ addField(seed = {}) {
1017
+ const fieldName = seed.name || this.nextAvailableName();
1018
+ this.formArray.push(this.createRow({
1019
+ ...seed,
1020
+ name: fieldName,
1021
+ label: seed.label || fieldName,
1022
+ controlType: seed.controlType || FieldControlType.INPUT,
1023
+ required: seed.required ?? false,
1024
+ }));
1025
+ this.originalNames.push(fieldName);
1026
+ this.syncToControl();
1027
+ }
1028
+ duplicateField(index) {
1029
+ const current = this.rowValue(index);
1030
+ if (!current)
1031
+ return;
1032
+ const nextName = this.nextAvailableName(`${current.name || 'field'}Copy`);
1033
+ this.addField({
1034
+ ...current,
1035
+ name: nextName,
1036
+ label: nextName,
1037
+ });
1038
+ }
1039
+ removeField(index) {
1040
+ const name = String(this.formArray.at(index)?.get('name')?.value || '').trim();
1041
+ if (this.isReferenced(name)) {
1042
+ return;
1043
+ }
1044
+ this.formArray.removeAt(index);
1045
+ this.originalNames.splice(index, 1);
1046
+ this.syncToControl();
1047
+ }
1048
+ moveField(index, delta) {
1049
+ const target = index + delta;
1050
+ if (target < 0 || target >= this.formArray.length)
1051
+ return;
1052
+ const row = this.formArray.at(index);
1053
+ this.formArray.removeAt(index);
1054
+ this.formArray.insert(target, row);
1055
+ const [originalName] = this.originalNames.splice(index, 1);
1056
+ this.originalNames.splice(target, 0, originalName);
1057
+ this.syncToControl();
1058
+ }
1059
+ onNameBlur(index) {
1060
+ const previous = this.originalNames[index];
1061
+ const next = String(this.formArray.at(index)?.get('name')?.value || '').trim();
1062
+ if (previous && !next && this.isReferenced(previous)) {
1063
+ this.formArray.at(index)?.get('name')?.setValue(previous, { emitEvent: false });
1064
+ this.syncToControl();
1065
+ return;
1066
+ }
1067
+ if (previous && next && previous !== next) {
1068
+ this.renameReferences(previous, next);
1069
+ this.originalNames[index] = next;
1070
+ }
1071
+ this.syncToControl();
1072
+ }
1073
+ importFieldsFromJson(raw) {
1074
+ try {
1075
+ const parsed = JSON.parse(String(raw || '').trim());
1076
+ if (!Array.isArray(parsed) ||
1077
+ parsed.some((entry) => !this.isImportableField(entry))) {
1078
+ return false;
1079
+ }
1080
+ this.replaceRows(parsed);
1081
+ this.schemaSourceState = 'imported';
1082
+ this.importedFieldsFingerprint = this.fieldsFingerprint();
1083
+ this.syncToControl();
1084
+ return true;
1085
+ }
1086
+ catch {
1087
+ return false;
1088
+ }
1089
+ }
1090
+ isImportableField(value) {
1091
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
1092
+ return false;
1093
+ }
1094
+ const raw = value;
1095
+ return typeof raw.name === 'string' && raw.name.trim().length > 0;
1096
+ }
1097
+ isNameDuplicated(index) {
1098
+ const name = String(this.formArray.at(index)?.get('name')?.value || '').trim();
1099
+ return !!name && this.duplicateNames.includes(name);
1100
+ }
1101
+ isNameInvalid(index) {
1102
+ const control = this.formArray.at(index)?.get('name');
1103
+ return !!control?.invalid;
1104
+ }
1105
+ nameErrorId(index) {
1106
+ return `praxis-array-field-name-error-${this.instanceId}-${index}`;
1107
+ }
1108
+ nameErrorDescribedBy(index) {
1109
+ return this.nameErrorMessage(index) ? this.nameErrorId(index) : null;
1110
+ }
1111
+ nameErrorMessage(index) {
1112
+ const control = this.formArray.at(index)?.get('name');
1113
+ if (!control?.errors) {
1114
+ return '';
1115
+ }
1116
+ if (control.errors['arrayFieldNameRequired']) {
1117
+ return this.text('praxis.metadataEditor.arrayFields.nameRequired', 'Informe o nome do subcampo.');
1118
+ }
1119
+ if (control.errors['arrayFieldNameDuplicated']) {
1120
+ return this.text('praxis.metadataEditor.arrayFields.nameDuplicated', 'Este nome j\u00e1 est\u00e1 em uso na cole\u00e7\u00e3o.');
1121
+ }
1122
+ return '';
1123
+ }
1124
+ isReferenced(fieldName) {
1125
+ return this.referencedBy(fieldName).length > 0;
1126
+ }
1127
+ removeTitle(fieldName) {
1128
+ const references = this.referencedBy(fieldName);
1129
+ if (!references.length) {
1130
+ return '';
1131
+ }
1132
+ return this.text('praxis.metadataEditor.arrayFields.removeBlocked', undefined, 'Remova as refer\u00eancias antes de excluir: {{references}}', { references: references.join(', ') });
1133
+ }
1134
+ schemaStateDescription() {
1135
+ switch (this.schemaSourceState) {
1136
+ case 'ref-only':
1137
+ return this.text('praxis.metadataEditor.arrayFields.refOnly', 'O schema do item vem do itemSchemaRef; crie subcampos locais apenas quando precisar de override.');
1138
+ case 'override-local':
1139
+ return this.text('praxis.metadataEditor.arrayFields.overrideLocal', 'H\u00e1 um itemSchemaRef e subcampos locais; os subcampos locais funcionam como override expl\u00edcito.');
1140
+ case 'imported':
1141
+ return this.text('praxis.metadataEditor.arrayFields.imported', 'Subcampos importados. Revise antes de aplicar ou salvar.');
1142
+ default:
1143
+ return this.text('praxis.metadataEditor.arrayFields.localOnly', 'Subcampos locais ser\u00e3o salvos em array.itemSchema.fields.');
1144
+ }
1145
+ }
1146
+ hydrateFromControl() {
1147
+ const fields = this.normalizeFields(this.control?.value);
1148
+ this.replaceRows(fields, false);
1149
+ this.updateSchemaSourceState();
1150
+ }
1151
+ replaceRows(fields, emit = true) {
1152
+ this.hydrating = true;
1153
+ this.internalSubscription?.unsubscribe();
1154
+ while (this.formArray.length) {
1155
+ this.formArray.removeAt(0, { emitEvent: false });
1156
+ }
1157
+ this.originalNames = [];
1158
+ for (const field of fields) {
1159
+ const normalized = this.normalizeField(field);
1160
+ this.formArray.push(this.createRow(normalized), { emitEvent: false });
1161
+ this.originalNames.push(normalized.name);
1162
+ }
1163
+ this.internalSubscription = this.formArray.valueChanges.subscribe(() => this.syncToControl());
1164
+ this.hydrating = false;
1165
+ this.updateFieldListValidity();
1166
+ if (emit) {
1167
+ this.syncToControl();
1168
+ }
1169
+ }
1170
+ createRow(field) {
1171
+ return this.fb.group({
1172
+ name: [field.name || ''],
1173
+ label: [field.label || field.name || ''],
1174
+ controlType: [field.controlType || FieldControlType.INPUT],
1175
+ required: [!!field.required],
1176
+ metadata: [this.clonePlainObject(field)],
1177
+ });
1178
+ }
1179
+ rowValue(index) {
1180
+ const row = this.formArray.at(index);
1181
+ return row ? this.normalizeField(row.getRawValue()) : null;
1182
+ }
1183
+ syncToControl() {
1184
+ if (this.hydrating || !this.control)
1185
+ return;
1186
+ const normalizedRows = this.formArray.controls.map((row) => this.normalizeField(row.getRawValue()));
1187
+ this.updateDuplicateNames(normalizedRows);
1188
+ const fields = normalizedRows.filter((field) => field.name);
1189
+ this.hydrating = true;
1190
+ this.control.setValue(fields, { emitEvent: true });
1191
+ this.control.markAsDirty();
1192
+ this.control.markAsTouched();
1193
+ this.hydrating = false;
1194
+ this.updateFieldListValidity(normalizedRows);
1195
+ this.updateSchemaSourceState();
1196
+ }
1197
+ normalizeFields(value) {
1198
+ if (Array.isArray(value)) {
1199
+ return value;
1200
+ }
1201
+ if (typeof value === 'string' && value.trim()) {
1202
+ try {
1203
+ const parsed = JSON.parse(value);
1204
+ return Array.isArray(parsed) ? parsed : [];
1205
+ }
1206
+ catch {
1207
+ return [];
1208
+ }
1209
+ }
1210
+ return [];
1211
+ }
1212
+ normalizeField(value) {
1213
+ const raw = (value && typeof value === 'object' ? value : {});
1214
+ const base = raw.metadata && typeof raw.metadata === 'object' && !Array.isArray(raw.metadata)
1215
+ ? this.clonePlainObject(raw.metadata)
1216
+ : this.clonePlainObject(raw);
1217
+ const name = String(raw.name ?? base.name ?? '').trim();
1218
+ return {
1219
+ ...base,
1220
+ name,
1221
+ label: String(raw.label ?? base.label ?? name ?? '').trim(),
1222
+ controlType: raw.controlType || base.controlType || FieldControlType.INPUT,
1223
+ required: raw.required === true,
1224
+ };
1225
+ }
1226
+ nextAvailableName(prefix = 'campo') {
1227
+ const existing = new Set(this.formArray.controls
1228
+ .map((row) => String(row.get('name')?.value || '').trim())
1229
+ .filter(Boolean));
1230
+ let index = 1;
1231
+ let candidate = prefix;
1232
+ while (existing.has(candidate)) {
1233
+ index += 1;
1234
+ candidate = `${prefix}${index}`;
1235
+ }
1236
+ return candidate;
1237
+ }
1238
+ updateDuplicateNames(fields) {
1239
+ const source = fields ?? this.formArray.controls.map((row) => this.normalizeField(row.getRawValue()));
1240
+ const seen = new Set();
1241
+ const duplicated = new Set();
1242
+ for (const field of source) {
1243
+ const name = String(field.name || '').trim();
1244
+ if (!name)
1245
+ continue;
1246
+ if (seen.has(name)) {
1247
+ duplicated.add(name);
1248
+ }
1249
+ seen.add(name);
1250
+ }
1251
+ this.duplicateNames = Array.from(duplicated);
1252
+ }
1253
+ updateFieldListValidity(fields = this.formArray.controls.map((row) => this.normalizeField(row.getRawValue()))) {
1254
+ this.updateDuplicateNames(fields);
1255
+ const duplicateSet = new Set(this.duplicateNames);
1256
+ const hasRequiredNameError = fields.some((field) => !String(field.name || '').trim());
1257
+ const hasDuplicateNameError = duplicateSet.size > 0;
1258
+ this.formArray.controls.forEach((row) => {
1259
+ const nameControl = row.get('name');
1260
+ const name = String(nameControl?.value || '').trim();
1261
+ this.setControlError(nameControl, 'arrayFieldNameRequired', !name);
1262
+ this.setControlError(nameControl, 'arrayFieldNameDuplicated', !!name && duplicateSet.has(name));
1263
+ });
1264
+ const errorPayload = hasDuplicateNameError ? { names: this.duplicateNames } : null;
1265
+ this.setControlError(this.control, 'arrayFieldNameRequired', hasRequiredNameError);
1266
+ this.setControlError(this.control, 'arrayFieldNameDuplicated', errorPayload);
1267
+ this.setControlError(this.formArray, 'arrayFieldNameRequired', hasRequiredNameError);
1268
+ this.setControlError(this.formArray, 'arrayFieldNameDuplicated', errorPayload);
1269
+ }
1270
+ setControlError(control, key, value) {
1271
+ if (!control)
1272
+ return;
1273
+ const errors = { ...(control.errors || {}) };
1274
+ const hasError = value !== null && value !== undefined && value !== false;
1275
+ if (hasError) {
1276
+ errors[key] = value === true ? true : value;
1277
+ }
1278
+ else {
1279
+ delete errors[key];
1280
+ }
1281
+ control.setErrors(Object.keys(errors).length ? errors : null);
1282
+ }
1283
+ updateSchemaSourceState() {
1284
+ const rawArray = this.arrayValue();
1285
+ const hasRef = typeof rawArray.itemSchemaRef === 'string' && rawArray.itemSchemaRef.trim().length > 0;
1286
+ const hasFields = this.formArray.length > 0;
1287
+ if (this.schemaSourceState === 'imported' &&
1288
+ hasFields &&
1289
+ this.importedFieldsFingerprint === this.fieldsFingerprint()) {
1290
+ return;
1291
+ }
1292
+ if (this.schemaSourceState === 'imported') {
1293
+ this.importedFieldsFingerprint = null;
1294
+ }
1295
+ this.schemaSourceState = hasRef && hasFields ? 'override-local' : hasRef ? 'ref-only' : 'local-only';
1296
+ }
1297
+ arrayValue() {
1298
+ const value = this.arrayControl?.value;
1299
+ return value && typeof value === 'object' ? value : {};
1300
+ }
1301
+ referencedBy(fieldName) {
1302
+ const name = String(fieldName || '').trim();
1303
+ if (!name)
1304
+ return [];
1305
+ const array = this.arrayValue();
1306
+ const references = [];
1307
+ if (array.itemIdentityField === name)
1308
+ references.push('itemIdentityField');
1309
+ if (this.uniqueByFields(array.collectionValidation?.uniqueBy).includes(name)) {
1310
+ references.push('collectionValidation.uniqueBy');
1311
+ }
1312
+ if (array.collectionValidation?.exactlyOne?.field === name) {
1313
+ references.push('collectionValidation.exactlyOne.field');
1314
+ }
1315
+ if (array.collectionValidation?.atLeastOne?.field === name) {
1316
+ references.push('collectionValidation.atLeastOne.field');
1317
+ }
1318
+ if (typeof array.itemTitleTemplate === 'string' && this.templateReferencesField(array.itemTitleTemplate, name)) {
1319
+ references.push('itemTitleTemplate');
1320
+ }
1321
+ return references;
1322
+ }
1323
+ renameReferences(previous, next) {
1324
+ if (!this.arrayControl || !previous || !next)
1325
+ return;
1326
+ const array = { ...this.arrayValue() };
1327
+ if (array.itemIdentityField === previous)
1328
+ array.itemIdentityField = next;
1329
+ const collectionValidation = array.collectionValidation && typeof array.collectionValidation === 'object'
1330
+ ? { ...array.collectionValidation }
1331
+ : undefined;
1332
+ if (collectionValidation) {
1333
+ if (Array.isArray(collectionValidation.uniqueBy)) {
1334
+ collectionValidation.uniqueBy = collectionValidation.uniqueBy.map((entry) => entry === previous ? next : entry);
1335
+ }
1336
+ else if (typeof collectionValidation.uniqueBy === 'string') {
1337
+ collectionValidation.uniqueBy = this.replaceUniqueByField(collectionValidation.uniqueBy, previous, next);
1338
+ }
1339
+ if (collectionValidation.exactlyOne?.field === previous) {
1340
+ collectionValidation.exactlyOne = { ...collectionValidation.exactlyOne, field: next };
1341
+ }
1342
+ if (collectionValidation.atLeastOne?.field === previous) {
1343
+ collectionValidation.atLeastOne = { ...collectionValidation.atLeastOne, field: next };
1344
+ }
1345
+ array.collectionValidation = collectionValidation;
1346
+ }
1347
+ if (typeof array.itemTitleTemplate === 'string') {
1348
+ array.itemTitleTemplate = array.itemTitleTemplate.replace(new RegExp(`{{\\s*${this.escapeRegExp(previous)}\\s*}}`, 'g'), `{{${next}}}`);
1349
+ }
1350
+ this.arrayControl.patchValue(array);
1351
+ this.arrayControl.markAsDirty();
1352
+ }
1353
+ uniqueByFields(value) {
1354
+ if (Array.isArray(value)) {
1355
+ return value.map((entry) => String(entry || '').trim()).filter(Boolean);
1356
+ }
1357
+ if (typeof value !== 'string') {
1358
+ return [];
1359
+ }
1360
+ const trimmed = value.trim();
1361
+ if (!trimmed) {
1362
+ return [];
1363
+ }
1364
+ try {
1365
+ const parsed = JSON.parse(trimmed);
1366
+ if (Array.isArray(parsed)) {
1367
+ return parsed.map((entry) => String(entry || '').trim()).filter(Boolean);
1368
+ }
1369
+ }
1370
+ catch { }
1371
+ return trimmed
1372
+ .split(/\r?\n|,/)
1373
+ .map((entry) => entry.trim())
1374
+ .filter(Boolean);
1375
+ }
1376
+ replaceUniqueByField(value, previous, next) {
1377
+ const trimmed = value.trim();
1378
+ if (!trimmed) {
1379
+ return value;
1380
+ }
1381
+ try {
1382
+ const parsed = JSON.parse(trimmed);
1383
+ if (Array.isArray(parsed)) {
1384
+ return JSON.stringify(parsed.map((entry) => String(entry || '').trim() === previous ? next : entry));
1385
+ }
1386
+ }
1387
+ catch { }
1388
+ return value
1389
+ .split(/(\r?\n|,)/)
1390
+ .map((entry) => entry.trim() === previous ? next : entry)
1391
+ .join('');
1392
+ }
1393
+ templateReferencesField(template, fieldName) {
1394
+ return new RegExp(`{{\\s*${this.escapeRegExp(fieldName)}\\s*}}`).test(template);
1395
+ }
1396
+ clonePlainObject(value) {
1397
+ return this.cloneMetadataValue(value, new WeakMap());
1398
+ }
1399
+ cloneMetadataValue(value, seen) {
1400
+ if (!value || typeof value !== 'object') {
1401
+ return value;
1402
+ }
1403
+ if (seen.has(value)) {
1404
+ return seen.get(value);
1405
+ }
1406
+ if (value instanceof Date) {
1407
+ return new Date(value.getTime());
1408
+ }
1409
+ if (value instanceof RegExp) {
1410
+ return new RegExp(value.source, value.flags);
1411
+ }
1412
+ if (Array.isArray(value)) {
1413
+ const clone = [];
1414
+ seen.set(value, clone);
1415
+ clone.push(...value.map((entry) => this.cloneMetadataValue(entry, seen)));
1416
+ return clone;
1417
+ }
1418
+ if (value instanceof Map) {
1419
+ const clone = new Map();
1420
+ seen.set(value, clone);
1421
+ value.forEach((entry, key) => {
1422
+ clone.set(this.cloneMetadataValue(key, seen), this.cloneMetadataValue(entry, seen));
1423
+ });
1424
+ return clone;
1425
+ }
1426
+ if (value instanceof Set) {
1427
+ const clone = new Set();
1428
+ seen.set(value, clone);
1429
+ value.forEach((entry) => clone.add(this.cloneMetadataValue(entry, seen)));
1430
+ return clone;
1431
+ }
1432
+ const prototype = Object.getPrototypeOf(value);
1433
+ if (prototype !== Object.prototype && prototype !== null) {
1434
+ return value;
1435
+ }
1436
+ const clone = {};
1437
+ seen.set(value, clone);
1438
+ for (const [key, entry] of Object.entries(value)) {
1439
+ clone[key] = this.cloneMetadataValue(entry, seen);
1440
+ }
1441
+ return clone;
1442
+ }
1443
+ fieldsFingerprint() {
1444
+ return JSON.stringify(this.formArray.controls.map((row) => this.normalizeField(row.getRawValue())));
1445
+ }
1446
+ escapeRegExp(value) {
1447
+ return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1448
+ }
1449
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ArrayItemSchemaFieldsEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1450
+ 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: `
1451
+ <section
1452
+ class="array-fields-editor"
1453
+ [attr.data-schema-source]="schemaSourceState"
1454
+ [attr.aria-label]="text('praxis.metadataEditor.arrayFields.section', 'Subcampos da cole\u00e7\u00e3o')"
1455
+ >
1456
+ <header class="array-fields-editor__header">
1457
+ <div>
1458
+ <h3>{{ text('praxis.metadataEditor.arrayFields.title', 'Subcampos') }}</h3>
1459
+ <p>
1460
+ {{ schemaStateDescription() }}
1461
+ </p>
1462
+ </div>
1463
+ <button type="button" class="array-fields-editor__primary" (click)="addField()">
1464
+ {{ text('praxis.metadataEditor.arrayFields.add', 'Adicionar subcampo') }}
1465
+ </button>
1466
+ </header>
1467
+
1468
+ <div
1469
+ class="array-fields-editor__warning"
1470
+ *ngIf="duplicateNames.length"
1471
+ role="alert"
1472
+ >
1473
+ {{
1474
+ text(
1475
+ 'praxis.metadataEditor.arrayFields.duplicateNames',
1476
+ undefined,
1477
+ 'Existem nomes duplicados: {{names}}',
1478
+ { names: duplicateNames.join(', ') }
1479
+ )
1480
+ }}
1481
+ </div>
1482
+
1483
+ <div
1484
+ class="array-fields-editor__empty"
1485
+ *ngIf="formArray.length === 0"
1486
+ >
1487
+ {{ text('praxis.metadataEditor.arrayFields.empty', 'Nenhum subcampo local configurado.') }}
1488
+ </div>
1489
+
1490
+ <div class="array-fields-editor__list" [formGroup]="form">
1491
+ <div
1492
+ class="array-fields-editor__row"
1493
+ *ngFor="let row of rows; let i = index"
1494
+ [formGroup]="row"
1495
+ >
1496
+ <label>
1497
+ <span>{{ text('praxis.metadataEditor.arrayFields.name', 'Nome') }}</span>
1498
+ <input
1499
+ type="text"
1500
+ formControlName="name"
1501
+ (blur)="onNameBlur(i)"
1502
+ [attr.aria-invalid]="isNameInvalid(i) ? 'true' : null"
1503
+ [attr.aria-describedby]="nameErrorDescribedBy(i)"
1504
+ />
1505
+ <span
1506
+ class="array-fields-editor__field-error"
1507
+ *ngIf="nameErrorMessage(i) as nameError"
1508
+ [id]="nameErrorId(i)"
1509
+ >
1510
+ {{ nameError }}
1511
+ </span>
1512
+ </label>
1513
+
1514
+ <label>
1515
+ <span>{{ text('praxis.metadataEditor.arrayFields.label', 'Label') }}</span>
1516
+ <input type="text" formControlName="label" />
1517
+ </label>
1518
+
1519
+ <label>
1520
+ <span>{{ text('praxis.metadataEditor.arrayFields.controlType', 'Controle') }}</span>
1521
+ <select formControlName="controlType">
1522
+ <option *ngFor="let option of controlTypeOptions" [value]="option">
1523
+ {{ controlTypeLabel(option) }}
1524
+ </option>
1525
+ </select>
1526
+ </label>
1527
+
1528
+ <label class="array-fields-editor__check">
1529
+ <input type="checkbox" formControlName="required" />
1530
+ <span>{{ text('praxis.metadataEditor.arrayFields.required', 'Obrigat\u00f3rio') }}</span>
1531
+ </label>
1532
+
1533
+ <div class="array-fields-editor__actions">
1534
+ <button type="button" (click)="moveField(i, -1)" [disabled]="i === 0">
1535
+ {{ text('praxis.metadataEditor.arrayFields.moveUp', 'Subir') }}
1536
+ </button>
1537
+ <button type="button" (click)="moveField(i, 1)" [disabled]="i === formArray.length - 1">
1538
+ {{ text('praxis.metadataEditor.arrayFields.moveDown', 'Descer') }}
1539
+ </button>
1540
+ <button type="button" (click)="duplicateField(i)">
1541
+ {{ text('praxis.metadataEditor.arrayFields.duplicate', 'Duplicar') }}
1542
+ </button>
1543
+ <button
1544
+ type="button"
1545
+ (click)="removeField(i)"
1546
+ [disabled]="isReferenced(row.get('name')?.value)"
1547
+ [title]="removeTitle(row.get('name')?.value)"
1548
+ >
1549
+ {{ text('praxis.metadataEditor.arrayFields.remove', 'Remover') }}
1550
+ </button>
1551
+ </div>
1552
+ </div>
1553
+ </div>
1554
+ </section>
1555
+ `, 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"] }] });
1556
+ }
1557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: ArrayItemSchemaFieldsEditorComponent, decorators: [{
1558
+ type: Component,
1559
+ args: [{ selector: 'praxis-array-item-schema-fields-editor', standalone: true, imports: [CommonModule, ReactiveFormsModule], providers: [providePraxisMetadataEditorI18n()], template: `
1560
+ <section
1561
+ class="array-fields-editor"
1562
+ [attr.data-schema-source]="schemaSourceState"
1563
+ [attr.aria-label]="text('praxis.metadataEditor.arrayFields.section', 'Subcampos da cole\u00e7\u00e3o')"
1564
+ >
1565
+ <header class="array-fields-editor__header">
1566
+ <div>
1567
+ <h3>{{ text('praxis.metadataEditor.arrayFields.title', 'Subcampos') }}</h3>
1568
+ <p>
1569
+ {{ schemaStateDescription() }}
1570
+ </p>
1571
+ </div>
1572
+ <button type="button" class="array-fields-editor__primary" (click)="addField()">
1573
+ {{ text('praxis.metadataEditor.arrayFields.add', 'Adicionar subcampo') }}
1574
+ </button>
1575
+ </header>
1576
+
1577
+ <div
1578
+ class="array-fields-editor__warning"
1579
+ *ngIf="duplicateNames.length"
1580
+ role="alert"
1581
+ >
1582
+ {{
1583
+ text(
1584
+ 'praxis.metadataEditor.arrayFields.duplicateNames',
1585
+ undefined,
1586
+ 'Existem nomes duplicados: {{names}}',
1587
+ { names: duplicateNames.join(', ') }
1588
+ )
1589
+ }}
1590
+ </div>
1591
+
1592
+ <div
1593
+ class="array-fields-editor__empty"
1594
+ *ngIf="formArray.length === 0"
1595
+ >
1596
+ {{ text('praxis.metadataEditor.arrayFields.empty', 'Nenhum subcampo local configurado.') }}
1597
+ </div>
1598
+
1599
+ <div class="array-fields-editor__list" [formGroup]="form">
1600
+ <div
1601
+ class="array-fields-editor__row"
1602
+ *ngFor="let row of rows; let i = index"
1603
+ [formGroup]="row"
1604
+ >
1605
+ <label>
1606
+ <span>{{ text('praxis.metadataEditor.arrayFields.name', 'Nome') }}</span>
1607
+ <input
1608
+ type="text"
1609
+ formControlName="name"
1610
+ (blur)="onNameBlur(i)"
1611
+ [attr.aria-invalid]="isNameInvalid(i) ? 'true' : null"
1612
+ [attr.aria-describedby]="nameErrorDescribedBy(i)"
1613
+ />
1614
+ <span
1615
+ class="array-fields-editor__field-error"
1616
+ *ngIf="nameErrorMessage(i) as nameError"
1617
+ [id]="nameErrorId(i)"
1618
+ >
1619
+ {{ nameError }}
1620
+ </span>
1621
+ </label>
1622
+
1623
+ <label>
1624
+ <span>{{ text('praxis.metadataEditor.arrayFields.label', 'Label') }}</span>
1625
+ <input type="text" formControlName="label" />
1626
+ </label>
1627
+
1628
+ <label>
1629
+ <span>{{ text('praxis.metadataEditor.arrayFields.controlType', 'Controle') }}</span>
1630
+ <select formControlName="controlType">
1631
+ <option *ngFor="let option of controlTypeOptions" [value]="option">
1632
+ {{ controlTypeLabel(option) }}
1633
+ </option>
1634
+ </select>
1635
+ </label>
1636
+
1637
+ <label class="array-fields-editor__check">
1638
+ <input type="checkbox" formControlName="required" />
1639
+ <span>{{ text('praxis.metadataEditor.arrayFields.required', 'Obrigat\u00f3rio') }}</span>
1640
+ </label>
1641
+
1642
+ <div class="array-fields-editor__actions">
1643
+ <button type="button" (click)="moveField(i, -1)" [disabled]="i === 0">
1644
+ {{ text('praxis.metadataEditor.arrayFields.moveUp', 'Subir') }}
1645
+ </button>
1646
+ <button type="button" (click)="moveField(i, 1)" [disabled]="i === formArray.length - 1">
1647
+ {{ text('praxis.metadataEditor.arrayFields.moveDown', 'Descer') }}
1648
+ </button>
1649
+ <button type="button" (click)="duplicateField(i)">
1650
+ {{ text('praxis.metadataEditor.arrayFields.duplicate', 'Duplicar') }}
1651
+ </button>
1652
+ <button
1653
+ type="button"
1654
+ (click)="removeField(i)"
1655
+ [disabled]="isReferenced(row.get('name')?.value)"
1656
+ [title]="removeTitle(row.get('name')?.value)"
1657
+ >
1658
+ {{ text('praxis.metadataEditor.arrayFields.remove', 'Remover') }}
1659
+ </button>
1660
+ </div>
1661
+ </div>
1662
+ </div>
1663
+ </section>
1664
+ `, 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"] }]
1665
+ }], propDecorators: { control: [{
1666
+ type: Input
1667
+ }], arrayControl: [{
1668
+ type: Input
1669
+ }] } });
1670
+
846
1671
  const inputProperties = [
847
1672
  // Geral
848
1673
  { name: 'label', label: 'Label', editorType: 'text', placeholder: 'Rótulo do campo', group: 'Geral' },
@@ -1054,6 +1879,61 @@ const inputProperties = [
1054
1879
  { name: 'defaultValue', label: 'Valor padrão', editorType: 'text', group: 'Geral' },
1055
1880
  ];
1056
1881
 
1882
+ const arrayProperties = [
1883
+ { name: 'label', label: 'Label', editorType: 'text', group: 'Geral' },
1884
+ { name: 'hint', label: 'Hint', editorType: 'text', group: 'Geral' },
1885
+ { name: 'defaultValue', label: 'Valor inicial (JSON array)', editorType: 'textarea', group: 'Geral' },
1886
+ {
1887
+ name: 'array.itemType',
1888
+ label: 'Tipo do item',
1889
+ editorType: 'select',
1890
+ group: 'Colecao',
1891
+ defaultValue: 'object',
1892
+ options: [
1893
+ { value: 'object', text: 'Objeto' },
1894
+ ],
1895
+ },
1896
+ {
1897
+ name: 'array.mode',
1898
+ label: 'Modo',
1899
+ editorType: 'select',
1900
+ group: 'Colecao',
1901
+ defaultValue: 'cards',
1902
+ options: [
1903
+ { value: 'cards', text: 'Cards' },
1904
+ ],
1905
+ },
1906
+ { name: 'array.itemSchemaRef', label: 'Schema do item ($ref)', editorType: 'text', group: 'Colecao' },
1907
+ { name: 'array.itemIdentityField', label: 'Campo de identidade', editorType: 'text', group: 'Colecao' },
1908
+ { name: 'array.addLabel', label: 'Texto do botao adicionar', editorType: 'text', group: 'Colecao' },
1909
+ { name: 'array.emptyState', label: 'Texto vazio', editorType: 'text', group: 'Colecao' },
1910
+ { name: 'array.itemTitleTemplate', label: 'Template do titulo do item', editorType: 'text', group: 'Colecao', hint: 'Ex.: {{nome}} - {{cargo}}' },
1911
+ { name: 'array.minItems', label: 'Minimo de itens', editorType: 'number', group: 'Validacao' },
1912
+ { name: 'array.maxItems', label: 'Maximo de itens', editorType: 'number', group: 'Validacao' },
1913
+ {
1914
+ name: 'array.deleteMode',
1915
+ label: 'Modo de exclusao',
1916
+ editorType: 'select',
1917
+ group: 'Operacoes',
1918
+ defaultValue: 'removeFromPayload',
1919
+ options: [
1920
+ { value: 'removeFromPayload', text: 'Remover do payload' },
1921
+ ],
1922
+ },
1923
+ { name: 'array.operations.add', label: 'Permitir adicionar', editorType: 'checkbox', group: 'Operacoes', defaultValue: true },
1924
+ { name: 'array.operations.edit', label: 'Permitir editar', editorType: 'checkbox', group: 'Operacoes', defaultValue: true },
1925
+ { name: 'array.operations.remove', label: 'Permitir remover', editorType: 'checkbox', group: 'Operacoes', defaultValue: true },
1926
+ { name: 'array.collectionValidation.uniqueBy', label: 'Unico por campos', editorType: 'textarea', group: 'Validacao', hint: 'JSON array ou uma linha por campo. Ex.: ["email"]' },
1927
+ { name: 'array.collectionValidation.exactlyOne.field', label: 'Exatamente um: campo', editorType: 'text', group: 'Validacao' },
1928
+ { 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.' },
1929
+ { name: 'array.collectionValidation.exactlyOne.message', label: 'Mensagem: exatamente um', editorType: 'text', group: 'Validacao' },
1930
+ { name: 'array.collectionValidation.atLeastOne.field', label: 'Pelo menos um: campo', editorType: 'text', group: 'Validacao' },
1931
+ { 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.' },
1932
+ { name: 'array.collectionValidation.atLeastOne.message', label: 'Mensagem: pelo menos um', editorType: 'text', group: 'Validacao' },
1933
+ { name: 'array.itemSchema.fields', label: 'Subcampos', editorType: 'field-list', group: 'Subcampos', hint: 'Lista FieldMetadata[] usada quando nao houver itemSchemaRef resolvido.' },
1934
+ { name: 'required', label: 'Obrigatorio', editorType: 'checkbox', group: 'Validacao' },
1935
+ ];
1936
+
1057
1937
  // Editor de metadados para componentes SELECT-like
1058
1938
  // Paridade com INPUT: grupos, linhas e propriedades canônicas
1059
1939
  const selectProperties = [
@@ -1131,88 +2011,719 @@ const selectProperties = [
1131
2011
  { value: 'manual', text: 'Manual (Connections disparam)' },
1132
2012
  ]
1133
2013
  },
1134
- // 4) Formato/Comportamento
1135
- { name: 'selectAll', label: 'Selecionar todos', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline1', inline: true, hint: 'Exibe opção para selecionar tudo (somente multiple).' },
1136
- { name: 'searchable', label: 'Buscável', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline1', inline: true, hint: 'Mostra campo de busca; em remoto, filtra na API.' },
1137
- { name: 'searchPlaceholder', label: 'Placeholder da busca', editorType: 'text', group: 'Formato/Comportamento', hint: 'Texto do campo de busca no popover/lista.' },
1138
- { name: 'maxSelections', label: 'Máximo de seleções', editorType: 'number', group: 'Formato/Comportamento', hint: 'Limite de itens quando multiple=true.' },
1139
- { name: 'readonly', label: 'Somente leitura', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline2', inline: true, hint: 'Mantém o valor visível sem permitir interação.' },
1140
- { name: 'disabled', label: 'Desabilitado', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline2', inline: true, hint: 'Desativa interação, foco e ações do trigger.' },
1141
- // 5) Validação
1142
- { name: 'required', label: 'Obrigatório', editorType: 'checkbox', group: 'Validação' },
1143
- { name: 'validators.requiredMessage', label: 'Mensagem: obrigatório', editorType: 'text', group: 'Validação' },
1144
- // 6) Ações (Clear)
1145
- { name: 'clearButton.enabled', label: 'Clear: habilitar', editorType: 'checkbox', group: 'Ações', row: 'clear.inline1', inline: true, hint: 'Mostra botão para limpar seleção.' },
1146
- { name: 'clearButton.icon', label: 'Clear: ícone', editorType: 'text', group: 'Ações', row: 'clear.inline2', hint: "Material Symbols (ex.: mi:clear). Use o seletor ao lado para buscar." },
1147
- { name: 'clearButton.iconColor', label: 'Clear: cor do ícone', editorType: 'color', group: 'Ações', row: 'clear.inline2', hint: 'Tema (primary/accent/warn) ou cor CSS (ex.: #496ddb, rgb(73,109,219), red).' },
1148
- { name: 'clearButton.tooltip', label: 'Clear: tooltip', editorType: 'text', group: 'Ações', row: 'clear.inline2' },
1149
- { name: 'clearButton.ariaLabel', label: 'Clear: aria-label', editorType: 'text', group: 'Ações', row: 'clear.inline2', hint: 'Obrigatório quando não houver texto visível.' },
1150
- { 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
- // 7) Aparência
2014
+ // 4) Formato/Comportamento
2015
+ { name: 'selectAll', label: 'Selecionar todos', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline1', inline: true, hint: 'Exibe opção para selecionar tudo (somente multiple).' },
2016
+ { name: 'searchable', label: 'Buscável', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline1', inline: true, hint: 'Mostra campo de busca; em remoto, filtra na API.' },
2017
+ { name: 'searchPlaceholder', label: 'Placeholder da busca', editorType: 'text', group: 'Formato/Comportamento', hint: 'Texto do campo de busca no popover/lista.' },
2018
+ { name: 'maxSelections', label: 'Máximo de seleções', editorType: 'number', group: 'Formato/Comportamento', hint: 'Limite de itens quando multiple=true.' },
2019
+ { name: 'readonly', label: 'Somente leitura', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline2', inline: true, hint: 'Mantém o valor visível sem permitir interação.' },
2020
+ { name: 'disabled', label: 'Desabilitado', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.inline2', inline: true, hint: 'Desativa interação, foco e ações do trigger.' },
2021
+ // 5) Validação
2022
+ { name: 'required', label: 'Obrigatório', editorType: 'checkbox', group: 'Validação' },
2023
+ { name: 'validators.requiredMessage', label: 'Mensagem: obrigatório', editorType: 'text', group: 'Validação' },
2024
+ // 6) Ações (Clear)
2025
+ { name: 'clearButton.enabled', label: 'Clear: habilitar', editorType: 'checkbox', group: 'Ações', row: 'clear.inline1', inline: true, hint: 'Mostra botão para limpar seleção.' },
2026
+ { name: 'clearButton.icon', label: 'Clear: ícone', editorType: 'text', group: 'Ações', row: 'clear.inline2', hint: "Material Symbols (ex.: mi:clear). Use o seletor ao lado para buscar." },
2027
+ { name: 'clearButton.iconColor', label: 'Clear: cor do ícone', editorType: 'color', group: 'Ações', row: 'clear.inline2', hint: 'Tema (primary/accent/warn) ou cor CSS (ex.: #496ddb, rgb(73,109,219), red).' },
2028
+ { name: 'clearButton.tooltip', label: 'Clear: tooltip', editorType: 'text', group: 'Ações', row: 'clear.inline2' },
2029
+ { name: 'clearButton.ariaLabel', label: 'Clear: aria-label', editorType: 'text', group: 'Ações', row: 'clear.inline2', hint: 'Obrigatório quando não houver texto visível.' },
2030
+ { 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.' },
2031
+ // 7) Aparência
2032
+ {
2033
+ name: 'materialDesign.appearance',
2034
+ label: 'Aparência',
2035
+ editorType: 'select',
2036
+ group: 'Aparência',
2037
+ options: [
2038
+ { value: 'fill', text: 'Fill' },
2039
+ { value: 'outline', text: 'Outline' },
2040
+ ],
2041
+ },
2042
+ {
2043
+ name: 'materialDesign.color',
2044
+ label: 'Cor do tema',
2045
+ editorType: 'select',
2046
+ group: 'Aparência',
2047
+ options: [
2048
+ { value: 'primary', text: 'Primária' },
2049
+ { value: 'accent', text: 'Acento' },
2050
+ { value: 'warn', text: 'Alerta' },
2051
+ ],
2052
+ },
2053
+ {
2054
+ name: 'materialDesign.floatLabel',
2055
+ label: 'Comportamento do label',
2056
+ editorType: 'select',
2057
+ group: 'Aparência',
2058
+ options: [
2059
+ { value: 'auto', text: 'Auto' },
2060
+ { value: 'always', text: 'Sempre' },
2061
+ ],
2062
+ },
2063
+ {
2064
+ name: 'materialDesign.subscriptSizing',
2065
+ label: 'Subscript sizing',
2066
+ editorType: 'select',
2067
+ group: 'Aparência',
2068
+ options: [
2069
+ { value: 'fixed', text: 'Fixo' },
2070
+ { value: 'dynamic', text: 'Dinâmico' },
2071
+ ],
2072
+ },
2073
+ { 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.' },
2074
+ { 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.' },
2075
+ { 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.' },
2076
+ { 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.' },
2077
+ { name: 'materialDesign.hideRequiredMarker', label: 'Ocultar * obrigatório', editorType: 'checkbox', group: 'Aparência' },
2078
+ {
2079
+ name: 'errorStateMatcher',
2080
+ label: 'Estratégia de erro',
2081
+ editorType: 'select',
2082
+ group: 'Aparência',
2083
+ options: [
2084
+ { value: 'default', text: 'Padrão' },
2085
+ { value: 'showOnDirtyAndInvalid', text: 'Mostrar ao sujar e inválido' },
2086
+ { value: 'showOnSubmitted', text: 'Mostrar ao enviar' },
2087
+ { value: 'showImmediately', text: 'Mostrar imediatamente' },
2088
+ ],
2089
+ },
2090
+ // 8) Acessibilidade
2091
+ { name: 'ariaLabel', label: 'ARIA label', editorType: 'text', group: 'Acessibilidade', hint: 'Use quando não houver label visível.' },
2092
+ { name: 'ariaDescribedby', label: 'ARIA describedby', editorType: 'text', group: 'Acessibilidade', hint: 'IDs de ajuda/erro.' },
2093
+ { name: 'ariaLabelledby', label: 'ARIA labelledby', editorType: 'text', group: 'Acessibilidade', hint: 'ID de elemento que atua como label.' },
2094
+ { name: 'tabIndex', label: 'TabIndex', editorType: 'number', group: 'Acessibilidade' },
2095
+ { name: 'dataAttributes', label: 'Data attributes (JSON)', editorType: 'textarea', group: 'Acessibilidade', hint: '{ "testId": "select-a" }' },
2096
+ ];
2097
+
2098
+ function cloneProperty$7(prop) {
2099
+ return {
2100
+ ...prop,
2101
+ options: Array.isArray(prop.options)
2102
+ ? prop.options.map((opt) => typeof opt === 'object' && opt !== null ? { ...opt } : opt)
2103
+ : prop.options,
2104
+ };
2105
+ }
2106
+ function cloneEntityLookupBaseProperty(prop) {
2107
+ const cloned = cloneProperty$7(prop);
2108
+ if (cloned.name === 'multiple') {
2109
+ return {
2110
+ ...cloned,
2111
+ group: 'Selecao em colecao',
2112
+ hint: 'Ativa selecao governada de varias entidades no mesmo campo.',
2113
+ };
2114
+ }
2115
+ if (cloned.name === 'maxSelections') {
2116
+ return {
2117
+ ...cloned,
2118
+ group: 'Selecao em colecao',
2119
+ hint: 'Limite maximo de entidades selecionadas quando multiple=true.',
2120
+ };
2121
+ }
2122
+ return cloned;
2123
+ }
2124
+ const entityLookupProperties = [
2125
+ ...selectProperties.map((prop) => cloneEntityLookupBaseProperty(prop)),
2126
+ {
2127
+ name: 'payloadMode',
2128
+ label: 'Modo do payload',
2129
+ editorType: 'select',
2130
+ group: 'Selecao em colecao',
2131
+ options: [
2132
+ { value: 'id', text: 'id' },
2133
+ { value: 'entityRef', text: 'entityRef' },
2134
+ { value: 'ids', text: 'ids' },
2135
+ { value: 'entityRefs', text: 'entityRefs' },
2136
+ ],
2137
+ hint: 'Define o shape salvo no payload. O runtime resolve combinacoes invalidas conforme multiple.',
2138
+ },
2139
+ {
2140
+ name: 'allowDuplicates',
2141
+ label: 'Permitir duplicados',
2142
+ editorType: 'checkbox',
2143
+ group: 'Selecao em colecao',
2144
+ hint: 'Permite repetir a mesma entidade na colecao quando o runtime suportar esse comportamento.',
2145
+ },
2146
+ {
2147
+ name: 'optionSource.key',
2148
+ label: 'Option source key',
2149
+ editorType: 'text',
2150
+ group: 'Fonte de entidade',
2151
+ required: true,
2152
+ hint: 'Chave publicada pelo backend para filtrar e reidratar a entidade.',
2153
+ },
2154
+ {
2155
+ name: 'optionSource.type',
2156
+ label: 'Tipo da fonte',
2157
+ editorType: 'select',
2158
+ group: 'Fonte de entidade',
2159
+ defaultValue: 'RESOURCE_ENTITY',
2160
+ options: [
2161
+ { value: 'RESOURCE_ENTITY', text: 'RESOURCE_ENTITY' },
2162
+ { value: 'LIGHT_LOOKUP', text: 'LIGHT_LOOKUP' },
2163
+ ],
2164
+ hint: 'Use RESOURCE_ENTITY para entidades reais de dominio.',
2165
+ },
2166
+ {
2167
+ name: 'optionSource.entityKey',
2168
+ label: 'Entity key',
2169
+ editorType: 'text',
2170
+ group: 'Fonte de entidade',
2171
+ hint: 'Identificador semantico da entidade, por exemplo supplier, customer ou contract.',
2172
+ },
2173
+ {
2174
+ name: 'optionSource.resourcePath',
2175
+ label: 'Resource path',
2176
+ editorType: 'text',
2177
+ group: 'Fonte de entidade',
2178
+ hint: 'Caminho base do recurso que publica option-sources e by-ids.',
2179
+ },
2180
+ {
2181
+ name: 'optionSource.filterField',
2182
+ label: 'Campo de filtro principal',
2183
+ editorType: 'text',
2184
+ group: 'Fonte de entidade',
2185
+ hint: 'Campo usado por fontes derivadas quando houver filtro simples no backend.',
2186
+ },
2187
+ {
2188
+ name: 'optionSource.propertyPath',
2189
+ label: 'Property path',
2190
+ editorType: 'text',
2191
+ group: 'Fonte de entidade',
2192
+ hint: 'Caminho de propriedade usado por fontes derivadas ou projeções leves.',
2193
+ },
2194
+ {
2195
+ name: 'optionSource.valuePropertyPath',
2196
+ label: 'Campo de valor',
2197
+ editorType: 'text',
2198
+ group: 'Fonte de entidade',
2199
+ defaultValue: 'id',
2200
+ hint: 'Campo canonico salvo no payload do formulario.',
2201
+ },
2202
+ {
2203
+ name: 'optionSource.labelPropertyPath',
2204
+ label: 'Campo de label',
2205
+ editorType: 'text',
2206
+ group: 'Fonte de entidade',
2207
+ defaultValue: 'label',
2208
+ hint: 'Campo principal exibido para o usuario.',
2209
+ },
2210
+ {
2211
+ name: 'optionSource.codePropertyPath',
2212
+ label: 'Campo de codigo',
2213
+ editorType: 'text',
2214
+ group: 'Exibicao de entidade',
2215
+ hint: 'Codigo curto exibido antes do label, por exemplo FOR-8742.',
2216
+ },
2217
+ {
2218
+ name: 'optionSource.descriptionPropertyPaths',
2219
+ label: 'Campos de descricao',
2220
+ editorType: 'textarea',
2221
+ group: 'Exibicao de entidade',
2222
+ hint: 'JSON array ou uma linha por campo. Ex.: ["documentNumber", "city", "state"].',
2223
+ },
2224
+ {
2225
+ name: 'optionSource.statusPropertyPath',
2226
+ label: 'Campo de status',
2227
+ editorType: 'text',
2228
+ group: 'Exibicao de entidade',
2229
+ hint: 'Campo que informa status operacional da entidade.',
2230
+ },
2231
+ {
2232
+ name: 'optionSource.disabledPropertyPath',
2233
+ label: 'Campo disabled',
2234
+ editorType: 'text',
2235
+ group: 'Exibicao de entidade',
2236
+ hint: 'Campo booleano que indica bloqueio visual ou operacional da entidade.',
2237
+ },
2238
+ {
2239
+ name: 'optionSource.disabledReasonPropertyPath',
2240
+ label: 'Campo de motivo bloqueado',
2241
+ editorType: 'text',
2242
+ group: 'Exibicao de entidade',
2243
+ hint: 'Campo opcional com mensagem de bloqueio quando selectable=false.',
2244
+ },
2245
+ {
2246
+ name: 'selectedLayout',
2247
+ label: 'Layout selecionado',
2248
+ editorType: 'select',
2249
+ group: 'Exibicao de entidade',
2250
+ options: [
2251
+ { value: 'card', text: 'card' },
2252
+ { value: 'inline', text: 'inline' },
2253
+ { value: 'compact', text: 'compact' },
2254
+ { value: 'token', text: 'token' },
2255
+ ],
2256
+ hint: 'Layout do item selecionado no trigger ou card principal.',
2257
+ },
2258
+ {
2259
+ name: 'resultLayout',
2260
+ label: 'Layout dos resultados',
2261
+ editorType: 'select',
2262
+ group: 'Exibicao de entidade',
2263
+ options: [
2264
+ { value: 'list', text: 'list' },
2265
+ { value: 'denseList', text: 'denseList' },
2266
+ { value: 'table', text: 'table' },
2267
+ { value: 'card', text: 'card' },
2268
+ ],
2269
+ hint: 'Layout principal usado na lista inline e no dialog.',
2270
+ },
2271
+ {
2272
+ name: 'showCode',
2273
+ label: 'Mostrar codigo',
2274
+ editorType: 'checkbox',
2275
+ group: 'Exibicao de entidade',
2276
+ },
2277
+ {
2278
+ name: 'showDescription',
2279
+ label: 'Mostrar descricao',
2280
+ editorType: 'checkbox',
2281
+ group: 'Exibicao de entidade',
2282
+ },
2283
+ {
2284
+ name: 'showStatus',
2285
+ label: 'Mostrar status',
2286
+ editorType: 'checkbox',
2287
+ group: 'Exibicao de entidade',
2288
+ },
2289
+ {
2290
+ name: 'showAvatar',
2291
+ label: 'Mostrar avatar',
2292
+ editorType: 'checkbox',
2293
+ group: 'Exibicao de entidade',
2294
+ },
2295
+ {
2296
+ name: 'showBadges',
2297
+ label: 'Mostrar badges',
2298
+ editorType: 'checkbox',
2299
+ group: 'Exibicao de entidade',
2300
+ },
2301
+ {
2302
+ name: 'showDisabledReason',
2303
+ label: 'Mostrar motivo bloqueado',
2304
+ editorType: 'checkbox',
2305
+ group: 'Exibicao de entidade',
2306
+ },
2307
+ {
2308
+ name: 'showResultCount',
2309
+ label: 'Mostrar contador de resultados',
2310
+ editorType: 'checkbox',
2311
+ group: 'Exibicao de entidade',
2312
+ },
2313
+ {
2314
+ name: 'statusToneMap',
2315
+ label: 'Mapa de tons de status',
2316
+ editorType: 'textarea',
2317
+ group: 'Exibicao de entidade',
2318
+ hint: 'JSON object. Ex.: { \"ACTIVE\": \"success\", \"BLOCKED\": \"danger\" }.',
2319
+ },
2320
+ {
2321
+ name: 'badgeKeys',
2322
+ label: 'Chaves de badges',
2323
+ editorType: 'textarea',
2324
+ group: 'Exibicao de entidade',
2325
+ hint: 'JSON array ou uma linha por chave complementar de badge.',
2326
+ },
2327
+ {
2328
+ name: 'maxVisibleBadges',
2329
+ label: 'Maximo de badges visiveis',
2330
+ editorType: 'number',
2331
+ group: 'Exibicao de entidade',
2332
+ hint: 'Limita a quantidade de badges visiveis antes do overflow.',
2333
+ },
2334
+ {
2335
+ name: 'optionSource.searchPropertyPaths',
2336
+ label: 'Campos de busca',
2337
+ editorType: 'textarea',
2338
+ group: 'Busca',
2339
+ hint: 'JSON array ou uma linha por campo pesquisavel.',
2340
+ },
2341
+ {
2342
+ name: 'optionSource.searchMode',
2343
+ label: 'Modo de busca',
2344
+ editorType: 'select',
2345
+ group: 'Busca',
2346
+ options: [
2347
+ { value: 'contains', text: 'contains' },
2348
+ { value: 'startsWith', text: 'startsWith' },
2349
+ { value: 'exact', text: 'exact' },
2350
+ ],
2351
+ hint: 'Semantica de busca publicada pelo backend para esta fonte.',
2352
+ },
2353
+ {
2354
+ name: 'optionSource.pageSize',
2355
+ label: 'Tamanho da pagina',
2356
+ editorType: 'number',
2357
+ group: 'Busca',
2358
+ hint: 'Quantidade sugerida de resultados por pagina.',
2359
+ },
2360
+ {
2361
+ name: 'optionSource.includeIds',
2362
+ label: 'Incluir IDs selecionados',
2363
+ editorType: 'checkbox',
2364
+ group: 'Busca',
2365
+ defaultValue: true,
2366
+ hint: 'Mantem entidades ja selecionadas visiveis durante busca paginada.',
2367
+ },
2368
+ {
2369
+ name: 'optionSource.filtering.availableFilters',
2370
+ label: 'Filtros disponiveis',
2371
+ editorType: 'textarea',
2372
+ group: 'Busca',
2373
+ hint: 'JSON array de filtros estruturados. Ex.: [{ \"field\": \"status\", \"type\": \"enum\", \"operators\": [\"in\"] }].',
2374
+ },
2375
+ {
2376
+ name: 'optionSource.filtering.defaultFilters',
2377
+ label: 'Filtros padrao',
2378
+ editorType: 'textarea',
2379
+ group: 'Busca',
2380
+ hint: 'JSON object. Ex.: { \"status\": [\"ACTIVE\"] }.',
2381
+ },
2382
+ {
2383
+ name: 'optionSource.filtering.sortOptions',
2384
+ label: 'Ordenacoes disponiveis',
2385
+ editorType: 'textarea',
2386
+ group: 'Busca',
2387
+ hint: 'JSON array. Ex.: [{ \"key\": \"code:asc\", \"field\": \"code\", \"direction\": \"asc\", \"label\": \"Codigo\" }].',
2388
+ },
2389
+ {
2390
+ name: 'optionSource.filtering.defaultSort',
2391
+ label: 'Ordenacao padrao',
2392
+ editorType: 'text',
2393
+ group: 'Busca',
2394
+ hint: 'Chave default do sort declarada em sortOptions.',
2395
+ },
2396
+ {
2397
+ name: 'optionSource.filtering.quickFilterFields',
2398
+ label: 'Campos de filtro rapido',
2399
+ editorType: 'textarea',
2400
+ group: 'Busca',
2401
+ hint: 'JSON array ou uma linha por campo rapido no toolbar do lookup.',
2402
+ },
2403
+ {
2404
+ name: 'optionSource.filtering.searchPlaceholder',
2405
+ label: 'Placeholder canonico de busca',
2406
+ editorType: 'text',
2407
+ group: 'Busca',
2408
+ hint: 'Fallback do optionSource.filtering quando o campo nao sobrescreve searchPlaceholder.',
2409
+ },
2410
+ {
2411
+ name: 'optionSource.dependsOn',
2412
+ label: 'Dependencias',
2413
+ editorType: 'textarea',
2414
+ group: 'Dependencias',
2415
+ hint: 'JSON array ou uma linha por campo do formulario que filtra o lookup.',
2416
+ },
2417
+ {
2418
+ name: 'optionSource.dependencyFilterMap',
2419
+ label: 'Mapa de filtros',
2420
+ editorType: 'textarea',
2421
+ group: 'Dependencias',
2422
+ hint: 'JSON object. Ex.: { "empresaId": "companyId", "fornecedorId": "supplierId" }.',
2423
+ },
2424
+ {
2425
+ name: 'optionSource.selectionPolicy.statusPropertyPath',
2426
+ label: 'Politica: campo de status',
2427
+ editorType: 'text',
2428
+ group: 'Politica de selecao',
2429
+ hint: 'Campo usado para aplicar allowedStatuses ou blockedStatuses.',
2430
+ },
2431
+ {
2432
+ name: 'optionSource.selectionPolicy.selectablePropertyPath',
2433
+ label: 'Politica: campo selectable',
2434
+ editorType: 'text',
2435
+ group: 'Politica de selecao',
2436
+ hint: 'Campo booleano publicado pelo backend para indicar se a entidade pode ser selecionada.',
2437
+ },
2438
+ {
2439
+ name: 'optionSource.selectionPolicy.allowedStatuses',
2440
+ label: 'Status permitidos',
2441
+ editorType: 'textarea',
2442
+ group: 'Politica de selecao',
2443
+ hint: 'JSON array ou uma linha por status. Ex.: ACTIVE, SIGNED.',
2444
+ },
2445
+ {
2446
+ name: 'optionSource.selectionPolicy.blockedStatuses',
2447
+ label: 'Status bloqueados',
2448
+ editorType: 'textarea',
2449
+ group: 'Politica de selecao',
2450
+ hint: 'JSON array ou uma linha por status.',
2451
+ },
2452
+ {
2453
+ name: 'optionSource.selectionPolicy.disabledReasonTemplate',
2454
+ label: 'Template de motivo bloqueado',
2455
+ editorType: 'text',
2456
+ group: 'Politica de selecao',
2457
+ hint: 'Mensagem template exibida quando a entidade nao pode ser selecionada.',
2458
+ },
2459
+ {
2460
+ name: 'optionSource.selectionPolicy.validationMessageTemplate',
2461
+ label: 'Template de validacao',
2462
+ editorType: 'text',
2463
+ group: 'Politica de selecao',
2464
+ hint: 'Mensagem template usada em validacoes de selecao.',
2465
+ },
2466
+ {
2467
+ name: 'optionSource.selectionPolicy.allowRetainInvalidExistingValue',
2468
+ label: 'Manter valor invalido existente',
2469
+ editorType: 'checkbox',
2470
+ group: 'Politica de selecao',
2471
+ hint: 'Exibe entidade historica ja salva mesmo quando nao pode ser selecionada em novos registros.',
2472
+ },
2473
+ {
2474
+ name: 'optionSource.capabilities.filter',
2475
+ label: 'Capability: filter',
2476
+ editorType: 'checkbox',
2477
+ group: 'Capabilities',
2478
+ defaultValue: true,
2479
+ },
2480
+ {
2481
+ name: 'optionSource.capabilities.byIds',
2482
+ label: 'Capability: by-ids',
2483
+ editorType: 'checkbox',
2484
+ group: 'Capabilities',
2485
+ defaultValue: true,
2486
+ },
2487
+ {
2488
+ name: 'optionSource.capabilities.navigateToDetail',
2489
+ label: 'Capability: detalhe',
2490
+ editorType: 'checkbox',
2491
+ group: 'Capabilities',
2492
+ },
2493
+ {
2494
+ name: 'optionSource.capabilities.detail',
2495
+ label: 'Capability: endpoint de detalhe',
2496
+ editorType: 'checkbox',
2497
+ group: 'Capabilities',
2498
+ },
2499
+ {
2500
+ name: 'optionSource.capabilities.edit',
2501
+ label: 'Capability: editar',
2502
+ editorType: 'checkbox',
2503
+ group: 'Capabilities',
2504
+ },
2505
+ {
2506
+ name: 'optionSource.capabilities.create',
2507
+ label: 'Capability: criar',
2508
+ editorType: 'checkbox',
2509
+ group: 'Capabilities',
2510
+ },
2511
+ {
2512
+ name: 'optionSource.capabilities.multiSelect',
2513
+ label: 'Capability: multi-select',
2514
+ editorType: 'checkbox',
2515
+ group: 'Capabilities',
2516
+ },
2517
+ {
2518
+ name: 'optionSource.capabilities.recent',
2519
+ label: 'Capability: recentes',
2520
+ editorType: 'checkbox',
2521
+ group: 'Capabilities',
2522
+ },
2523
+ {
2524
+ name: 'optionSource.capabilities.favorites',
2525
+ label: 'Capability: favoritos',
2526
+ editorType: 'checkbox',
2527
+ group: 'Capabilities',
2528
+ },
2529
+ {
2530
+ name: 'optionSource.capabilities.auditSnapshot',
2531
+ label: 'Capability: snapshot de auditoria',
2532
+ editorType: 'checkbox',
2533
+ group: 'Capabilities',
2534
+ },
2535
+ {
2536
+ name: 'optionSource.detail.hrefTemplate',
2537
+ label: 'Template de detalhe',
2538
+ editorType: 'text',
2539
+ group: 'Navegacao',
2540
+ hint: 'Template de detalhe, por exemplo /contracts/{id}.',
2541
+ },
1152
2542
  {
1153
- name: 'materialDesign.appearance',
1154
- label: 'Aparência',
1155
- editorType: 'select',
1156
- group: 'Aparência',
1157
- options: [
1158
- { value: 'fill', text: 'Fill' },
1159
- { value: 'outline', text: 'Outline' },
1160
- ],
2543
+ name: 'optionSource.detail.routeTemplate',
2544
+ label: 'Template de rota',
2545
+ editorType: 'text',
2546
+ group: 'Navegacao',
2547
+ hint: 'Template de rota de detalhe, por exemplo /contracts/:id.',
1161
2548
  },
1162
2549
  {
1163
- name: 'materialDesign.color',
1164
- label: 'Cor do tema',
2550
+ name: 'optionSource.detail.openDetailMode',
2551
+ label: 'Modo de detalhe',
1165
2552
  editorType: 'select',
1166
- group: 'Aparência',
2553
+ group: 'Navegacao',
1167
2554
  options: [
1168
- { value: 'primary', text: 'Primária' },
1169
- { value: 'accent', text: 'Acento' },
1170
- { value: 'warn', text: 'Alerta' },
2555
+ { value: 'samePage', text: 'samePage' },
2556
+ { value: 'newTab', text: 'newTab' },
2557
+ { value: 'drawer', text: 'Drawer' },
2558
+ { value: 'modal', text: 'Modal' },
1171
2559
  ],
1172
2560
  },
1173
2561
  {
1174
- name: 'materialDesign.floatLabel',
1175
- label: 'Comportamento do label',
1176
- editorType: 'select',
1177
- group: 'Aparência',
1178
- options: [
1179
- { value: 'auto', text: 'Auto' },
1180
- { value: 'always', text: 'Sempre' },
1181
- ],
2562
+ name: 'optionSource.create.hrefTemplate',
2563
+ label: 'Template create href',
2564
+ editorType: 'text',
2565
+ group: 'Navegacao',
2566
+ hint: 'Template opcional de criacao publicado pelo optionSource.',
1182
2567
  },
1183
2568
  {
1184
- name: 'materialDesign.subscriptSizing',
1185
- label: 'Subscript sizing',
2569
+ name: 'optionSource.create.routeTemplate',
2570
+ label: 'Template create route',
2571
+ editorType: 'text',
2572
+ group: 'Navegacao',
2573
+ hint: 'Rota opcional de criacao, por exemplo /suppliers/new.',
2574
+ },
2575
+ {
2576
+ name: 'optionSource.create.openMode',
2577
+ label: 'Modo de create',
1186
2578
  editorType: 'select',
1187
- group: 'Aparência',
2579
+ group: 'Navegacao',
1188
2580
  options: [
1189
- { value: 'fixed', text: 'Fixo' },
1190
- { value: 'dynamic', text: 'Dinâmico' },
2581
+ { value: 'samePage', text: 'samePage' },
2582
+ { value: 'newTab', text: 'newTab' },
2583
+ { value: 'drawer', text: 'Drawer' },
2584
+ { value: 'modal', text: 'Modal' },
1191
2585
  ],
1192
2586
  },
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
2587
  {
1199
- name: 'errorStateMatcher',
1200
- label: 'Estratégia de erro',
2588
+ name: 'dialog.enabled',
2589
+ label: 'Dialog habilitado',
2590
+ editorType: 'checkbox',
2591
+ group: 'Dialogo avancado',
2592
+ },
2593
+ {
2594
+ name: 'dialog.title',
2595
+ label: 'Titulo do dialog',
2596
+ editorType: 'text',
2597
+ group: 'Dialogo avancado',
2598
+ },
2599
+ {
2600
+ name: 'dialog.size',
2601
+ label: 'Tamanho do dialog',
1201
2602
  editorType: 'select',
1202
- group: 'Aparência',
2603
+ group: 'Dialogo avancado',
1203
2604
  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' },
2605
+ { value: 'sm', text: 'sm' },
2606
+ { value: 'md', text: 'md' },
2607
+ { value: 'lg', text: 'lg' },
2608
+ { value: 'xl', text: 'xl' },
2609
+ { value: 'full', text: 'full' },
1208
2610
  ],
1209
2611
  },
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" }' },
2612
+ {
2613
+ name: 'dialog.previewPanel',
2614
+ label: 'Preview panel',
2615
+ editorType: 'checkbox',
2616
+ group: 'Dialogo avancado',
2617
+ },
2618
+ {
2619
+ name: 'dialog.allowColumnChooser',
2620
+ label: 'Permitir seletor de colunas',
2621
+ editorType: 'checkbox',
2622
+ group: 'Dialogo avancado',
2623
+ },
2624
+ {
2625
+ name: 'dialog.allowSavedViews',
2626
+ label: 'Permitir views salvas',
2627
+ editorType: 'checkbox',
2628
+ group: 'Dialogo avancado',
2629
+ },
2630
+ {
2631
+ name: 'dialog.resultColumns',
2632
+ label: 'Colunas do resultado',
2633
+ editorType: 'textarea',
2634
+ group: 'Dialogo avancado',
2635
+ hint: 'JSON array. Ex.: [{ \"field\": \"code\", \"label\": \"Codigo\", \"kind\": \"code\", \"width\": \"140px\" }].',
2636
+ },
2637
+ {
2638
+ name: 'dialog.openActionLabel',
2639
+ label: 'Label abrir dialog',
2640
+ editorType: 'text',
2641
+ group: 'Dialogo avancado',
2642
+ },
2643
+ {
2644
+ name: 'dialog.applyActionLabel',
2645
+ label: 'Label aplicar dialog',
2646
+ editorType: 'text',
2647
+ group: 'Dialogo avancado',
2648
+ },
2649
+ {
2650
+ name: 'dialog.cancelActionLabel',
2651
+ label: 'Label cancelar dialog',
2652
+ editorType: 'text',
2653
+ group: 'Dialogo avancado',
2654
+ },
2655
+ {
2656
+ name: 'detailActionLabel',
2657
+ label: 'Label detalhe',
2658
+ editorType: 'text',
2659
+ group: 'Acoes do lookup',
2660
+ },
2661
+ {
2662
+ name: 'changeActionLabel',
2663
+ label: 'Label trocar',
2664
+ editorType: 'text',
2665
+ group: 'Acoes do lookup',
2666
+ },
2667
+ {
2668
+ name: 'copyCodeActionLabel',
2669
+ label: 'Label copiar codigo',
2670
+ editorType: 'text',
2671
+ group: 'Acoes do lookup',
2672
+ },
2673
+ {
2674
+ name: 'copyIdActionLabel',
2675
+ label: 'Label copiar ID',
2676
+ editorType: 'text',
2677
+ group: 'Acoes do lookup',
2678
+ },
2679
+ {
2680
+ name: 'createActionLabel',
2681
+ label: 'Label criar',
2682
+ editorType: 'text',
2683
+ group: 'Acoes do lookup',
2684
+ },
2685
+ {
2686
+ name: 'clearActionLabel',
2687
+ label: 'Label limpar',
2688
+ editorType: 'text',
2689
+ group: 'Acoes do lookup',
2690
+ },
2691
+ {
2692
+ name: 'actions.showDetail',
2693
+ label: 'Acao: detalhe',
2694
+ editorType: 'checkbox',
2695
+ group: 'Acoes do lookup',
2696
+ },
2697
+ {
2698
+ name: 'actions.showChange',
2699
+ label: 'Acao: trocar',
2700
+ editorType: 'checkbox',
2701
+ group: 'Acoes do lookup',
2702
+ },
2703
+ {
2704
+ name: 'actions.showCopyCode',
2705
+ label: 'Acao: copiar codigo',
2706
+ editorType: 'checkbox',
2707
+ group: 'Acoes do lookup',
2708
+ },
2709
+ {
2710
+ name: 'actions.showCopyId',
2711
+ label: 'Acao: copiar ID',
2712
+ editorType: 'checkbox',
2713
+ group: 'Acoes do lookup',
2714
+ },
2715
+ {
2716
+ name: 'actions.showCreate',
2717
+ label: 'Acao: criar',
2718
+ editorType: 'checkbox',
2719
+ group: 'Acoes do lookup',
2720
+ },
2721
+ {
2722
+ name: 'actions.showClear',
2723
+ label: 'Acao: limpar',
2724
+ editorType: 'checkbox',
2725
+ group: 'Acoes do lookup',
2726
+ },
1216
2727
  ];
1217
2728
 
1218
2729
  const transferListProperties = [
@@ -3134,6 +4645,18 @@ const sliderProperties = [
3134
4645
  // Formato/Comportamento
3135
4646
  { name: 'step', label: 'Step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento entre valores (ex.: 1, 0.5). Combine com min/max.' },
3136
4647
  { name: 'thumbLabel', label: 'Thumb label', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Exibe valor sobre o thumb ao arrastar.' },
4648
+ { name: 'valueLabelDisplay', label: 'Value label', editorType: 'select', group: 'Formato/Comportamento', options: [
4649
+ { value: 'off', text: 'Desligado' },
4650
+ { value: 'auto', text: 'Ao interagir' },
4651
+ { value: 'on', text: 'Sempre visivel' },
4652
+ ], hint: 'Controla quando o valor aparece no thumb.' },
4653
+ { name: 'valueLabelFormat', label: 'Formato do valor', editorType: 'select', group: 'Formato/Comportamento', options: [
4654
+ { value: 'number', text: 'Numero' },
4655
+ { value: 'percent', text: 'Percentual' },
4656
+ { value: 'currency', text: 'Moeda' },
4657
+ { value: 'compact', text: 'Compacto' },
4658
+ { value: 'storage', text: 'Armazenamento' },
4659
+ ], hint: 'Formatter declarativo para labels e aria-valuetext.' },
3137
4660
  { name: 'vertical', label: 'Vertical', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'fmt.flags', inline: true, hint: 'Altera para eixo Y.' },
3138
4661
  { name: 'invert', label: 'Inverter', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'fmt.flags', inline: true, hint: 'Inverte direção (direita→esquerda).' },
3139
4662
  { name: 'showTicks', label: 'Ticks', editorType: 'select', group: 'Formato/Comportamento', options: [
@@ -3141,6 +4664,26 @@ const sliderProperties = [
3141
4664
  { value: true, text: 'Com ticks' },
3142
4665
  { value: 'auto', text: 'Auto' },
3143
4666
  ], hint: 'Marcas na trilha; auto calcula com base no step.' },
4667
+ { name: 'marks', label: 'Marcadores (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"value":0,"label":"Baixo"},{"value":100,"label":"Alto","tone":"danger"}].' },
4668
+ { name: 'semanticBands', label: 'Bandas semanticas (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"start":0,"end":40,"label":"Saudavel","tone":"success"}].' },
4669
+ { 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]}.' },
4670
+ { name: 'track', label: 'Track', editorType: 'select', group: 'Formato/Comportamento', options: [
4671
+ { value: 'normal', text: 'Normal' },
4672
+ { value: 'inverted', text: 'Invertido' },
4673
+ { value: 'none', text: 'Sem track ativo' },
4674
+ ], hint: 'Apresentacao visual do track.' },
4675
+ { name: 'size', label: 'Tamanho', editorType: 'select', group: 'Formato/Comportamento', options: [
4676
+ { value: 'small', text: 'Pequeno' },
4677
+ { value: 'medium', text: 'Medio' },
4678
+ { value: 'large', text: 'Grande' },
4679
+ ], hint: 'Densidade visual do slider.' },
4680
+ { name: 'scale', label: 'Escala', editorType: 'select', group: 'Formato/Comportamento', options: [
4681
+ { value: 'linear', text: 'Linear' },
4682
+ { value: 'percent', text: 'Percentual' },
4683
+ { value: 'log', text: 'Logaritmica' },
4684
+ { value: 'pow2', text: 'Potencia 2' },
4685
+ ], hint: 'Escala declarativa para dominios nao lineares.' },
4686
+ { name: 'shiftStep', label: 'Shift step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento acelerado para teclado.' },
3144
4687
  { name: 'discrete', label: 'Discreto', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Exibe ticks/labels fixos para valores discretos.' },
3145
4688
  // Validação
3146
4689
  { name: 'min', label: 'Mínimo', editorType: 'number', group: 'Validação', row: 'val.minmax', inline: true },
@@ -3180,11 +4723,44 @@ const rangeSliderProperties = [
3180
4723
  ], hint: 'Escolha faixa para dois marcadores.' },
3181
4724
  { name: 'step', label: 'Step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento entre valores (ex.: 1, 0.5). Combine com min/max.' },
3182
4725
  { name: 'thumbLabel', label: 'Thumb label', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Exibe o valor sobre o thumb ao arrastar.' },
4726
+ { name: 'valueLabelDisplay', label: 'Value label', editorType: 'select', group: 'Formato/Comportamento', options: [
4727
+ { value: 'off', text: 'Desligado' },
4728
+ { value: 'auto', text: 'Ao interagir' },
4729
+ { value: 'on', text: 'Sempre visivel' },
4730
+ ], hint: 'Controla quando o valor aparece no thumb.' },
4731
+ { name: 'valueLabelFormat', label: 'Formato do valor', editorType: 'select', group: 'Formato/Comportamento', options: [
4732
+ { value: 'number', text: 'Numero' },
4733
+ { value: 'percent', text: 'Percentual' },
4734
+ { value: 'currency', text: 'Moeda' },
4735
+ { value: 'compact', text: 'Compacto' },
4736
+ { value: 'storage', text: 'Armazenamento' },
4737
+ ], hint: 'Formatter declarativo para labels e aria-valuetext.' },
3183
4738
  { name: 'showTicks', label: 'Ticks', editorType: 'select', group: 'Formato/Comportamento', options: [
3184
4739
  { value: false, text: 'Sem ticks' },
3185
4740
  { value: true, text: 'Com ticks' },
3186
4741
  { value: 'auto', text: 'Auto' },
3187
4742
  ], hint: 'Marcas na trilha; auto calcula com base no step.' },
4743
+ { name: 'marks', label: 'Marcadores (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"value":0,"label":"Min"},{"value":100,"label":"Max","tone":"danger"}].' },
4744
+ { name: 'semanticBands', label: 'Bandas semanticas (JSON)', editorType: 'textarea', group: 'Formato/Comportamento', hint: 'Array JSON. Ex.: [{"start":0,"end":40,"label":"Baixo","tone":"success"}].' },
4745
+ { 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]}.' },
4746
+ { name: 'track', label: 'Track', editorType: 'select', group: 'Formato/Comportamento', options: [
4747
+ { value: 'normal', text: 'Normal' },
4748
+ { value: 'inverted', text: 'Invertido' },
4749
+ { value: 'none', text: 'Sem track ativo' },
4750
+ ], hint: 'Apresentacao visual do track.' },
4751
+ { name: 'size', label: 'Tamanho', editorType: 'select', group: 'Formato/Comportamento', options: [
4752
+ { value: 'small', text: 'Pequeno' },
4753
+ { value: 'medium', text: 'Medio' },
4754
+ { value: 'large', text: 'Grande' },
4755
+ ], hint: 'Densidade visual do slider.' },
4756
+ { name: 'scale', label: 'Escala', editorType: 'select', group: 'Formato/Comportamento', options: [
4757
+ { value: 'linear', text: 'Linear' },
4758
+ { value: 'percent', text: 'Percentual' },
4759
+ { value: 'log', text: 'Logaritmica' },
4760
+ { value: 'pow2', text: 'Potencia 2' },
4761
+ ], hint: 'Escala declarativa para dominios nao lineares.' },
4762
+ { name: 'shiftStep', label: 'Shift step', editorType: 'number', group: 'Formato/Comportamento', hint: 'Incremento acelerado para teclado.' },
4763
+ { name: 'disableThumbSwap', label: 'Bloquear troca dos thumbs', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Mantem start/end sem permitir inversao visual no modo range.' },
3188
4764
  { name: 'discrete', label: 'Discreto', editorType: 'checkbox', group: 'Formato/Comportamento', hint: 'Mostra valor fixo por tick; use com showTicks.' },
3189
4765
  { 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
4766
  { name: 'disabled', label: 'Desabilitado', editorType: 'checkbox', group: 'Formato/Comportamento', row: 'comp.state', inline: true, hint: 'Desativa arraste, foco e presets rápidos.' },
@@ -5323,7 +6899,7 @@ const INLINE_FILTER_EDITOR_PROPERTIES_BY_CONTROL_TYPE = Object.freeze({
5323
6899
  [INLINE_FILTER_CONTROL_TYPES.SELECT]: selectProperties,
5324
6900
  [INLINE_FILTER_CONTROL_TYPES.SEARCHABLE_SELECT]: selectProperties,
5325
6901
  [INLINE_FILTER_CONTROL_TYPES.ASYNC_SELECT]: selectProperties,
5326
- [INLINE_FILTER_CONTROL_TYPES.ENTITY_LOOKUP]: selectProperties,
6902
+ [INLINE_FILTER_CONTROL_TYPES.ENTITY_LOOKUP]: entityLookupProperties,
5327
6903
  [INLINE_FILTER_CONTROL_TYPES.AUTOCOMPLETE]: selectProperties,
5328
6904
  [INLINE_FILTER_CONTROL_TYPES.MULTI_SELECT]: selectProperties,
5329
6905
  [INLINE_FILTER_CONTROL_TYPES.INPUT]: inputProperties,
@@ -5366,6 +6942,7 @@ class FieldMetadataEditorComponent {
5366
6942
  cancel = new EventEmitter();
5367
6943
  form;
5368
6944
  normalizedProps = [];
6945
+ renderedProps = [];
5369
6946
  initialSnapshot = null;
5370
6947
  baselineReady = false;
5371
6948
  // Lista de tipos suportados no editor (curada para os tipos com config disponível)
@@ -5380,10 +6957,12 @@ class FieldMetadataEditorComponent {
5380
6957
  { value: FieldControlType.URL_INPUT, label: 'URL' },
5381
6958
  { value: FieldControlType.SEARCH_INPUT, label: 'Busca' },
5382
6959
  { value: FieldControlType.PHONE, label: 'Telefone' },
6960
+ { value: FieldControlType.ARRAY_INPUT, label: 'Colecao editavel' },
5383
6961
  { value: FieldControlType.SELECT, label: 'Seleção (Select)' },
5384
6962
  { value: FieldControlType.MULTI_SELECT, label: 'Seleção múltipla' },
5385
6963
  { value: FieldControlType.SEARCHABLE_SELECT, label: 'Seleção buscável' },
5386
6964
  { value: FieldControlType.ASYNC_SELECT, label: 'Seleção assíncrona' },
6965
+ { value: FieldControlType.ENTITY_LOOKUP, label: 'Entity Lookup' },
5387
6966
  { value: FieldControlType.AUTO_COMPLETE, label: 'Auto-completar' },
5388
6967
  { value: FieldControlType.SELECTION_LIST, label: 'Lista de seleção' },
5389
6968
  { value: FieldControlType.TREE_SELECT, label: 'Árvore (Tree Select)' },
@@ -5471,9 +7050,12 @@ class FieldMetadataEditorComponent {
5471
7050
  return inlineProps;
5472
7051
  if (controlType === FieldControlType.INPUT)
5473
7052
  return inputProperties;
7053
+ if (controlType === FieldControlType.ARRAY_INPUT)
7054
+ return arrayProperties;
7055
+ if (controlTypeToken === 'entitylookup')
7056
+ return entityLookupProperties;
5474
7057
  if (controlTypeToken === 'searchableselect' ||
5475
- controlTypeToken === 'asyncselect' ||
5476
- controlTypeToken === 'entitylookup')
7058
+ controlTypeToken === 'asyncselect')
5477
7059
  return selectProperties;
5478
7060
  if (controlType === FieldControlType.NUMERIC_TEXT_BOX)
5479
7061
  return numberProperties;
@@ -5518,6 +7100,8 @@ class FieldMetadataEditorComponent {
5518
7100
  controlType === FieldControlType.AUTO_COMPLETE ||
5519
7101
  controlType === FieldControlType.SELECTION_LIST)
5520
7102
  return selectProperties;
7103
+ if (controlType === FieldControlType.ENTITY_LOOKUP)
7104
+ return entityLookupProperties;
5521
7105
  if (controlType === FieldControlType.TEXTAREA)
5522
7106
  return textareaProperties;
5523
7107
  if (controlType === FieldControlType.TRANSFER_LIST)
@@ -5594,11 +7178,14 @@ class FieldMetadataEditorComponent {
5594
7178
  this.registry.register(this.controlType, inputProperties);
5595
7179
  props = inputProperties;
5596
7180
  }
7181
+ else if (controlTypeToken === 'entitylookup') {
7182
+ this.registry.register(this.controlType, entityLookupProperties);
7183
+ props = entityLookupProperties;
7184
+ }
5597
7185
  else if (
5598
7186
  // Aliases for select-like
5599
7187
  controlTypeToken === 'searchableselect' ||
5600
- controlTypeToken === 'asyncselect' ||
5601
- controlTypeToken === 'entitylookup') {
7188
+ controlTypeToken === 'asyncselect') {
5602
7189
  this.registry.register(this.controlType, selectProperties);
5603
7190
  props = selectProperties;
5604
7191
  }
@@ -5683,6 +7270,10 @@ class FieldMetadataEditorComponent {
5683
7270
  this.registry.register(this.controlType, selectProperties);
5684
7271
  props = selectProperties;
5685
7272
  }
7273
+ else if (this.controlType === FieldControlType.ENTITY_LOOKUP) {
7274
+ this.registry.register(this.controlType, entityLookupProperties);
7275
+ props = entityLookupProperties;
7276
+ }
5686
7277
  else if (this.controlType === FieldControlType.TEXTAREA) {
5687
7278
  this.registry.register(this.controlType, textareaProperties);
5688
7279
  props = textareaProperties;
@@ -5814,6 +7405,7 @@ class FieldMetadataEditorComponent {
5814
7405
  }
5815
7406
  }
5816
7407
  catch { }
7408
+ this.renderedProps = this.buildRenderedProps(this.normalizedProps);
5817
7409
  // Register contextual validators for INPUT/TEXTAREA (minLength <= maxLength)
5818
7410
  if (this.controlType === FieldControlType.INPUT ||
5819
7411
  this.controlType === FieldControlType.TEXTAREA) {
@@ -5844,7 +7436,7 @@ class FieldMetadataEditorComponent {
5844
7436
  const name = p?.name;
5845
7437
  if (!name)
5846
7438
  continue;
5847
- const val = getByPath(this.seed, name);
7439
+ const val = this.toEditorControlValue(p, getByPath(this.seed, name));
5848
7440
  // Preserve false/0; skip only null/undefined
5849
7441
  if (val !== undefined && val !== null) {
5850
7442
  this.factory.setValueByPath(this.form, name, val);
@@ -6028,6 +7620,9 @@ class FieldMetadataEditorComponent {
6028
7620
  });
6029
7621
  }
6030
7622
  apply() {
7623
+ if (!this.canEmitSettingsValue()) {
7624
+ return;
7625
+ }
6031
7626
  const raw = this.factory.extractPatch(this.form);
6032
7627
  const patch = this.buildDeltaPatch(raw, this.initialSnapshot);
6033
7628
  this.normalizeKnownTextareaPatchValues(patch);
@@ -6055,6 +7650,9 @@ class FieldMetadataEditorComponent {
6055
7650
  }
6056
7651
  // Settings Panel value provider API
6057
7652
  getSettingsValue() {
7653
+ if (!this.canEmitSettingsValue()) {
7654
+ return {};
7655
+ }
6058
7656
  const raw = this.factory.extractPatch(this.form);
6059
7657
  const patch = this.buildDeltaPatch(raw, this.initialSnapshot);
6060
7658
  this.normalizeKnownTextareaPatchValues(patch);
@@ -6154,6 +7752,119 @@ class FieldMetadataEditorComponent {
6154
7752
  patch.links = parsedLinks;
6155
7753
  }
6156
7754
  }
7755
+ this.normalizeEntityLookupPatchValues(patch);
7756
+ this.normalizeArrayPatchValues(patch);
7757
+ }
7758
+ normalizeEntityLookupPatchValues(patch) {
7759
+ const optionSource = patch?.optionSource;
7760
+ if (optionSource && typeof optionSource === 'object') {
7761
+ this.normalizeStringListProperty(optionSource, 'descriptionPropertyPaths');
7762
+ this.normalizeStringListProperty(optionSource, 'searchPropertyPaths');
7763
+ this.normalizeStringListProperty(optionSource, 'dependsOn');
7764
+ this.normalizeJsonObjectProperty(optionSource, 'dependencyFilterMap');
7765
+ this.normalizeJsonObjectProperty(optionSource, 'create');
7766
+ const selectionPolicy = optionSource.selectionPolicy;
7767
+ if (selectionPolicy && typeof selectionPolicy === 'object') {
7768
+ this.normalizeStringListProperty(selectionPolicy, 'allowedStatuses');
7769
+ this.normalizeStringListProperty(selectionPolicy, 'blockedStatuses');
7770
+ }
7771
+ const filtering = optionSource.filtering;
7772
+ if (filtering && typeof filtering === 'object') {
7773
+ this.normalizeJsonArrayProperty(filtering, 'availableFilters');
7774
+ this.normalizeJsonObjectProperty(filtering, 'defaultFilters');
7775
+ this.normalizeJsonArrayProperty(filtering, 'sortOptions');
7776
+ this.normalizeStringListProperty(filtering, 'quickFilterFields');
7777
+ }
7778
+ }
7779
+ this.normalizeStringListProperty(patch, 'badgeKeys');
7780
+ this.normalizeJsonObjectProperty(patch, 'statusToneMap');
7781
+ const dialog = patch?.dialog;
7782
+ if (dialog && typeof dialog === 'object') {
7783
+ this.normalizeJsonArrayProperty(dialog, 'resultColumns');
7784
+ }
7785
+ }
7786
+ normalizeStringListProperty(target, key) {
7787
+ if (!target || typeof target !== 'object' || typeof target[key] !== 'string') {
7788
+ return;
7789
+ }
7790
+ const parsed = this.parseStringListTextarea(target[key]);
7791
+ if (parsed) {
7792
+ target[key] = parsed;
7793
+ }
7794
+ }
7795
+ normalizeJsonObjectProperty(target, key) {
7796
+ if (!target || typeof target !== 'object' || typeof target[key] !== 'string') {
7797
+ return;
7798
+ }
7799
+ const parsed = this.tryParseJson(String(target[key]).trim());
7800
+ if (parsed && typeof parsed === 'object' && !Array.isArray(parsed)) {
7801
+ target[key] = parsed;
7802
+ }
7803
+ }
7804
+ normalizeJsonArrayProperty(target, key) {
7805
+ if (!target || typeof target !== 'object' || typeof target[key] !== 'string') {
7806
+ return;
7807
+ }
7808
+ const parsed = this.parseArrayTextarea(target[key]);
7809
+ if (parsed) {
7810
+ target[key] = parsed;
7811
+ }
7812
+ }
7813
+ normalizeArrayPatchValues(patch) {
7814
+ const arrayPatch = patch?.array;
7815
+ if (!arrayPatch || typeof arrayPatch !== 'object') {
7816
+ return;
7817
+ }
7818
+ const collectionValidation = arrayPatch.collectionValidation;
7819
+ if (collectionValidation &&
7820
+ typeof collectionValidation === 'object' &&
7821
+ typeof collectionValidation.uniqueBy === 'string') {
7822
+ const parsedUniqueBy = this.parseStringListTextarea(collectionValidation.uniqueBy);
7823
+ if (parsedUniqueBy) {
7824
+ collectionValidation.uniqueBy = parsedUniqueBy;
7825
+ }
7826
+ }
7827
+ this.normalizeArrayCountRuleValue(collectionValidation?.exactlyOne);
7828
+ this.normalizeArrayCountRuleValue(collectionValidation?.atLeastOne);
7829
+ const itemSchema = arrayPatch.itemSchema;
7830
+ if (itemSchema &&
7831
+ typeof itemSchema === 'object' &&
7832
+ typeof itemSchema.fields === 'string') {
7833
+ const parsedFields = this.parseArrayTextarea(itemSchema.fields);
7834
+ if (parsedFields) {
7835
+ itemSchema.fields = parsedFields;
7836
+ }
7837
+ }
7838
+ if (typeof patch.defaultValue === 'string') {
7839
+ const parsedDefaultValue = this.parseArrayTextarea(patch.defaultValue);
7840
+ if (parsedDefaultValue) {
7841
+ patch.defaultValue = parsedDefaultValue;
7842
+ }
7843
+ }
7844
+ }
7845
+ normalizeArrayCountRuleValue(rule) {
7846
+ if (!rule || typeof rule !== 'object' || typeof rule.value !== 'string') {
7847
+ return;
7848
+ }
7849
+ const raw = rule.value.trim();
7850
+ if (!raw) {
7851
+ return;
7852
+ }
7853
+ try {
7854
+ rule.value = JSON.parse(raw);
7855
+ }
7856
+ catch {
7857
+ rule.value = raw;
7858
+ }
7859
+ }
7860
+ toEditorControlValue(prop, value) {
7861
+ if (prop?.editorType === 'textarea' &&
7862
+ value !== undefined &&
7863
+ value !== null &&
7864
+ typeof value !== 'string') {
7865
+ return JSON.stringify(value, null, 2);
7866
+ }
7867
+ return value;
6157
7868
  }
6158
7869
  /**
6159
7870
  * Interpreta textarea como lista simples de strings:
@@ -6207,7 +7918,11 @@ class FieldMetadataEditorComponent {
6207
7918
  }
6208
7919
  }
6209
7920
  reset() {
6210
- this.form.reset(this.factory.extractPatch(this.form));
7921
+ const snapshot = this.cloneSnapshot(this.initialSnapshot ?? this.form.getRawValue());
7922
+ this.form.reset(snapshot);
7923
+ this.form.markAsPristine();
7924
+ this.form.markAsUntouched();
7925
+ this.form.updateValueAndValidity({ emitEvent: true });
6211
7926
  this.isDirty$.next(false);
6212
7927
  }
6213
7928
  onControlTypeChange(next) {
@@ -6225,28 +7940,162 @@ class FieldMetadataEditorComponent {
6225
7940
  const missingSharedProps = fieldSubmitProperties.filter((prop) => !propNames.has(prop.name));
6226
7941
  return missingSharedProps.length ? [...props, ...missingSharedProps] : props;
6227
7942
  }
7943
+ get isArrayEditor() {
7944
+ return this.controlType === FieldControlType.ARRAY_INPUT;
7945
+ }
7946
+ buildRenderedProps(props) {
7947
+ if (!this.isArrayEditor) {
7948
+ return props;
7949
+ }
7950
+ return (props || []).filter((prop) => prop?.name !== 'array.itemSchema.fields');
7951
+ }
7952
+ cloneSnapshot(value) {
7953
+ return this.cloneMetadataValue(value, new WeakMap());
7954
+ }
7955
+ cloneMetadataValue(value, seen) {
7956
+ if (!value || typeof value !== 'object') {
7957
+ return value;
7958
+ }
7959
+ if (seen.has(value)) {
7960
+ return seen.get(value);
7961
+ }
7962
+ if (value instanceof Date) {
7963
+ return new Date(value.getTime());
7964
+ }
7965
+ if (value instanceof RegExp) {
7966
+ return new RegExp(value.source, value.flags);
7967
+ }
7968
+ if (Array.isArray(value)) {
7969
+ const clone = [];
7970
+ seen.set(value, clone);
7971
+ clone.push(...value.map((entry) => this.cloneMetadataValue(entry, seen)));
7972
+ return clone;
7973
+ }
7974
+ if (value instanceof Map) {
7975
+ const clone = new Map();
7976
+ seen.set(value, clone);
7977
+ value.forEach((entry, key) => {
7978
+ clone.set(this.cloneMetadataValue(key, seen), this.cloneMetadataValue(entry, seen));
7979
+ });
7980
+ return clone;
7981
+ }
7982
+ if (value instanceof Set) {
7983
+ const clone = new Set();
7984
+ seen.set(value, clone);
7985
+ value.forEach((entry) => clone.add(this.cloneMetadataValue(entry, seen)));
7986
+ return clone;
7987
+ }
7988
+ const prototype = Object.getPrototypeOf(value);
7989
+ if (prototype !== Object.prototype && prototype !== null) {
7990
+ return value;
7991
+ }
7992
+ const clone = {};
7993
+ seen.set(value, clone);
7994
+ for (const [key, entry] of Object.entries(value)) {
7995
+ clone[key] = this.cloneMetadataValue(entry, seen);
7996
+ }
7997
+ return clone;
7998
+ }
7999
+ canEmitSettingsValue() {
8000
+ this.validateArrayItemSchemaFields();
8001
+ this.form.updateValueAndValidity({ emitEvent: true });
8002
+ const valid = this.form.valid;
8003
+ this.isValid$.next(valid);
8004
+ if (!valid) {
8005
+ this.form.markAllAsTouched();
8006
+ }
8007
+ return valid;
8008
+ }
8009
+ validateArrayItemSchemaFields() {
8010
+ if (!this.isArrayEditor) {
8011
+ return;
8012
+ }
8013
+ const control = this.form.get('array.itemSchema.fields');
8014
+ if (!control) {
8015
+ return;
8016
+ }
8017
+ const value = control.value;
8018
+ const fields = Array.isArray(value)
8019
+ ? value
8020
+ : typeof value === 'string' && value.trim()
8021
+ ? this.parseArrayItemFields(value)
8022
+ : [];
8023
+ const seen = new Set();
8024
+ const duplicated = new Set();
8025
+ let hasEmptyName = false;
8026
+ for (const field of fields) {
8027
+ const name = String(field?.name || '').trim();
8028
+ if (!name) {
8029
+ hasEmptyName = true;
8030
+ continue;
8031
+ }
8032
+ if (seen.has(name)) {
8033
+ duplicated.add(name);
8034
+ }
8035
+ seen.add(name);
8036
+ }
8037
+ this.setControlError(control, 'arrayFieldNameRequired', hasEmptyName);
8038
+ this.setControlError(control, 'arrayFieldNameDuplicated', duplicated.size ? { names: Array.from(duplicated) } : null);
8039
+ }
8040
+ parseArrayItemFields(value) {
8041
+ try {
8042
+ const parsed = JSON.parse(value);
8043
+ return Array.isArray(parsed) ? parsed : [];
8044
+ }
8045
+ catch {
8046
+ return [];
8047
+ }
8048
+ }
8049
+ setControlError(control, key, value) {
8050
+ const errors = { ...(control.errors || {}) };
8051
+ const hasError = value !== null && value !== undefined && value !== false;
8052
+ if (hasError) {
8053
+ errors[key] = value === true ? true : value;
8054
+ }
8055
+ else {
8056
+ delete errors[key];
8057
+ }
8058
+ control.setErrors(Object.keys(errors).length ? errors : null);
8059
+ }
6228
8060
  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
8061
  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
8062
  <div class="p-3" *ngIf="form">
6231
8063
  <praxis-dynamic-editor-renderer
6232
- [properties]="normalizedProps"
8064
+ [properties]="renderedProps"
6233
8065
  [form]="form"
6234
8066
  ></praxis-dynamic-editor-renderer>
8067
+
8068
+ <praxis-array-item-schema-fields-editor
8069
+ *ngIf="isArrayEditor"
8070
+ [control]="form.get('array.itemSchema.fields')"
8071
+ [arrayControl]="form.get('array')"
8072
+ ></praxis-array-item-schema-fields-editor>
6235
8073
  </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"] }] });
8074
+ `, 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
8075
  }
6238
8076
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: FieldMetadataEditorComponent, decorators: [{
6239
8077
  type: Component,
6240
8078
  args: [{
6241
8079
  selector: 'praxis-field-metadata-editor',
6242
8080
  standalone: true,
6243
- imports: [CommonModule, ReactiveFormsModule, DynamicEditorRendererComponent],
8081
+ imports: [
8082
+ CommonModule,
8083
+ ReactiveFormsModule,
8084
+ DynamicEditorRendererComponent,
8085
+ ArrayItemSchemaFieldsEditorComponent,
8086
+ ],
6244
8087
  template: `
6245
8088
  <div class="p-3" *ngIf="form">
6246
8089
  <praxis-dynamic-editor-renderer
6247
- [properties]="normalizedProps"
8090
+ [properties]="renderedProps"
6248
8091
  [form]="form"
6249
8092
  ></praxis-dynamic-editor-renderer>
8093
+
8094
+ <praxis-array-item-schema-fields-editor
8095
+ *ngIf="isArrayEditor"
8096
+ [control]="form.get('array.itemSchema.fields')"
8097
+ [arrayControl]="form.get('array')"
8098
+ ></praxis-array-item-schema-fields-editor>
6250
8099
  </div>
6251
8100
  `,
6252
8101
  }]
@@ -6267,15 +8116,19 @@ class CascadeRulesService {
6267
8116
  return map;
6268
8117
  }
6269
8118
  hydrateRule(field) {
6270
- const deps = field.dependencyFields;
8119
+ const deps = (field.dependencyFields ??
8120
+ field.optionSource?.dependsOn);
6271
8121
  if (!deps || deps.length === 0)
6272
8122
  return null;
8123
+ const dependencyFilterMap = field.dependencyFilterMap ??
8124
+ field.optionSource?.dependencyFilterMap ??
8125
+ null;
6273
8126
  const vm = {
6274
8127
  targetField: field.name,
6275
8128
  dependencyFields: [...deps],
6276
8129
  enableDependencyCascade: field.enableDependencyCascade === false ? false : true,
6277
8130
  resetOnDependentChange: !!field.resetOnDependentChange,
6278
- dependencyFilterMap: field.dependencyFilterMap || null,
8131
+ dependencyFilterMap,
6279
8132
  dependencyValuePath: field.dependencyValuePath || null,
6280
8133
  dependencyMergeStrategy: field.dependencyMergeStrategy || 'merge',
6281
8134
  dependencyDebounceMs: field.dependencyDebounceMs != null
@@ -6956,7 +8809,7 @@ class CascadeManagerTabComponent {
6956
8809
  </div>
6957
8810
  </div>
6958
8811
  </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"] }] });
8812
+ `, 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
8813
  }
6961
8814
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.17", ngImport: i0, type: CascadeManagerTabComponent, decorators: [{
6962
8815
  type: Component,
@@ -7293,8 +9146,415 @@ const METADATA_EDITOR_AI_CAPABILITY_CATALOG = {
7293
9146
  enums: {},
7294
9147
  };
7295
9148
 
9149
+ const fieldMetadataPropertySchema = {
9150
+ type: 'object',
9151
+ required: ['path', 'value'],
9152
+ properties: {
9153
+ path: {
9154
+ enum: [
9155
+ 'name',
9156
+ 'label',
9157
+ 'description',
9158
+ 'controlType',
9159
+ 'placeholder',
9160
+ 'defaultValue',
9161
+ 'group',
9162
+ 'order',
9163
+ 'required',
9164
+ 'disabled',
9165
+ 'readOnly',
9166
+ 'hidden',
9167
+ 'source',
9168
+ 'transient',
9169
+ 'submitPolicy',
9170
+ 'hint',
9171
+ 'helpText',
9172
+ 'tooltip',
9173
+ 'options',
9174
+ 'optionSource',
9175
+ 'validators',
9176
+ 'conditionalRequired',
9177
+ 'conditionalDisplay',
9178
+ 'visibleIn',
9179
+ 'ariaLabel',
9180
+ 'ariaDescribedBy',
9181
+ ],
9182
+ },
9183
+ value: {},
9184
+ merge: { type: 'boolean' },
9185
+ },
9186
+ };
9187
+ const optionSourceSchema = {
9188
+ type: 'object',
9189
+ minProperties: 1,
9190
+ properties: {
9191
+ kind: { enum: ['static', 'remote', 'resource', 'lookup'] },
9192
+ resource: { type: 'string' },
9193
+ endpoint: { type: 'string' },
9194
+ valueField: { type: 'string' },
9195
+ labelField: { type: 'string' },
9196
+ dependsOn: { type: 'string' },
9197
+ dependencyFilterMap: { type: 'object' },
9198
+ options: { type: 'array' },
9199
+ },
9200
+ };
9201
+ const cascadeSchema = {
9202
+ type: 'object',
9203
+ required: ['dependentField'],
9204
+ properties: {
9205
+ dependentField: { type: 'string' },
9206
+ sourceField: { type: 'string' },
9207
+ strategy: { enum: ['replace', 'merge'] },
9208
+ debounceMs: { type: 'number' },
9209
+ loadMode: { enum: ['immediate', 'manual', 'respectLoadOn'] },
9210
+ dependencyFilterMap: { type: 'object' },
9211
+ optionSource: {
9212
+ type: 'object',
9213
+ properties: {
9214
+ kind: { enum: ['static', 'remote', 'resource', 'lookup'] },
9215
+ resource: { type: 'string' },
9216
+ endpoint: { type: 'string' },
9217
+ dependsOn: { type: 'string' },
9218
+ dependencyFilterMap: { type: 'object' },
9219
+ },
9220
+ },
9221
+ },
9222
+ };
9223
+ const PRAXIS_METADATA_EDITOR_AUTHORING_MANIFEST = {
9224
+ schemaVersion: '1.0.0',
9225
+ componentId: 'praxis-metadata-editor',
9226
+ ownerPackage: '@praxisui/metadata-editor',
9227
+ configSchemaId: 'FieldMetadata',
9228
+ manifestVersion: '1.0.0',
9229
+ runtimeInputs: [
9230
+ { name: 'controlType', type: 'FieldControlType', description: 'Canonical control type used to resolve editor property coverage.' },
9231
+ { name: 'seed', type: 'Partial<FieldMetadata | FieldDefinition>', description: 'Initial canonical field metadata used to hydrate the editor.' },
9232
+ { name: 'fields', type: 'Array<FieldMetadata | FieldDefinition>', description: 'Available fields used by cascade authoring and context validation.' },
9233
+ { name: 'properties', type: 'EditorProperty[]', description: 'Renderer property catalog resolved from ConfigRegistryService.' },
9234
+ { name: 'form', type: 'FormGroup', description: 'Dynamic form generated from canonical editor properties by DynamicFormFactoryService.' },
9235
+ ],
9236
+ editableTargets: [
9237
+ { kind: 'fieldMetadata', resolver: 'field-metadata-json-path', description: 'Canonical FieldMetadata root and property paths.' },
9238
+ { kind: 'controlType', resolver: 'dynamic-fields-control-type-discovery', description: 'Control type selected from dynamic-fields discovery and editor config registry.' },
9239
+ { kind: 'optionSource', resolver: 'field-metadata-option-source', description: 'Canonical option source including backend x-ui option source fields where applicable.' },
9240
+ { kind: 'cascade', resolver: 'metadata-editor-cascade-rules', description: 'Cascade dependencies and dependency filter mappings edited through CascadeManagerTab.' },
9241
+ { kind: 'renderer', resolver: 'metadata-editor-renderer-property', description: 'Dynamic editor renderer property coverage and editor component mapping.' },
9242
+ { kind: 'validation', resolver: 'field-metadata-validation-rules', description: 'Field validation rules and contextual validators.' },
9243
+ { kind: 'contextHint', resolver: 'metadata-editor-context-hints', description: 'Authoring hints, help text and contextual guidance for metadata editors.' },
9244
+ { kind: 'normalization', resolver: 'metadata-editor-schema-normalizer', description: 'Schema normalization and seed hydration rules.' },
9245
+ ],
9246
+ operations: [
9247
+ {
9248
+ operationId: 'fieldMetadata.property.set',
9249
+ title: 'Set FieldMetadata property',
9250
+ scope: 'fieldMetadataPath',
9251
+ targetKind: 'fieldMetadata',
9252
+ target: { kind: 'fieldMetadata', resolver: 'field-metadata-json-path', ambiguityPolicy: 'fail', required: true },
9253
+ inputSchema: fieldMetadataPropertySchema,
9254
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-field-property-set', handlerContract: {
9255
+ reads: ['fieldMetadata', 'fieldMetadataPath', 'SchemaNormalizerService'],
9256
+ writes: ['fieldMetadata'],
9257
+ identityKeys: ['field.name', 'path'],
9258
+ inputSchema: fieldMetadataPropertySchema,
9259
+ failureModes: ['unknown-field-metadata-path', 'non-canonical-shape', 'readonly-field', 'normalization-failed'],
9260
+ description: 'Sets a canonical FieldMetadata property through a governed metadata path and re-runs schema normalization.',
9261
+ } }],
9262
+ destructive: false,
9263
+ requiresConfirmation: false,
9264
+ validators: ['field-metadata-shape-canonical', 'field-path-supported-by-editor', 'metadata-round-trip'],
9265
+ affectedPaths: ['fieldMetadata'],
9266
+ submissionImpact: 'affects-schema-backed-data',
9267
+ preconditions: ['field-metadata-loaded'],
9268
+ },
9269
+ {
9270
+ operationId: 'controlType.set',
9271
+ title: 'Set control type',
9272
+ scope: 'controlType',
9273
+ targetKind: 'controlType',
9274
+ target: { kind: 'controlType', resolver: 'dynamic-fields-control-type-discovery', ambiguityPolicy: 'fail', required: true },
9275
+ inputSchema: {
9276
+ type: 'object',
9277
+ required: ['controlType'],
9278
+ properties: {
9279
+ controlType: { type: 'string' },
9280
+ preserveCompatibleProperties: { type: 'boolean' },
9281
+ },
9282
+ },
9283
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-control-type-set', handlerContract: {
9284
+ reads: ['FieldControlType', 'ConfigRegistryService', 'dynamic-fields-discovery', 'fieldMetadata'],
9285
+ writes: ['fieldMetadata.controlType', 'properties', 'normalizedSeed'],
9286
+ identityKeys: ['field.name', 'controlType'],
9287
+ inputSchema: { type: 'object', required: ['controlType'], properties: { controlType: { type: 'string' }, preserveCompatibleProperties: { type: 'boolean' } } },
9288
+ failureModes: ['control-type-not-discovered', 'editor-coverage-missing', 'incompatible-metadata-preservation'],
9289
+ description: 'Changes control type only when dynamic-fields discovery and metadata-editor config registry both expose renderer/editor coverage.',
9290
+ } }],
9291
+ destructive: false,
9292
+ requiresConfirmation: false,
9293
+ validators: ['control-type-exists-in-discovery', 'editor-coverage-exists', 'metadata-round-trip'],
9294
+ affectedPaths: ['fieldMetadata.controlType', 'properties', 'normalizedSeed'],
9295
+ submissionImpact: 'affects-schema-backed-data',
9296
+ preconditions: ['dynamic-fields-discovery-loaded'],
9297
+ },
9298
+ {
9299
+ operationId: 'optionSource.configure',
9300
+ title: 'Configure option source',
9301
+ scope: 'dataBinding',
9302
+ targetKind: 'optionSource',
9303
+ target: { kind: 'optionSource', resolver: 'field-metadata-option-source', ambiguityPolicy: 'fail', required: false },
9304
+ inputSchema: optionSourceSchema,
9305
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-option-source-configure', handlerContract: {
9306
+ reads: ['fieldMetadata.optionSource', 'backend.x-ui.optionSource', 'SchemaNormalizerService'],
9307
+ writes: ['fieldMetadata.optionSource'],
9308
+ identityKeys: ['field.name', 'optionSource.kind', 'optionSource.resource'],
9309
+ inputSchema: optionSourceSchema,
9310
+ failureModes: ['invalid-option-source-kind', 'remote-source-missing-governed-resource', 'dependency-filter-map-invalid'],
9311
+ description: 'Configures canonical optionSource fields while preserving backend x-ui dependsOn and dependencyFilterMap semantics.',
9312
+ } }],
9313
+ destructive: false,
9314
+ requiresConfirmation: false,
9315
+ validators: ['option-source-shape-canonical', 'remote-option-source-governed', 'cascade-backend-shape-preserved', 'metadata-round-trip'],
9316
+ affectedPaths: ['fieldMetadata.optionSource'],
9317
+ submissionImpact: 'affects-remote-binding',
9318
+ preconditions: ['field-metadata-loaded'],
9319
+ },
9320
+ {
9321
+ operationId: 'cascade.configure',
9322
+ title: 'Configure cascade rule',
9323
+ scope: 'interaction',
9324
+ targetKind: 'cascade',
9325
+ target: { kind: 'cascade', resolver: 'metadata-editor-cascade-rules', ambiguityPolicy: 'fail', required: false },
9326
+ inputSchema: cascadeSchema,
9327
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-cascade-configure', handlerContract: {
9328
+ reads: ['CascadeManagerTabComponent', 'CascadeRulesService', 'fields', 'fieldMetadata.optionSource', 'fieldMetadata.dependencyFields', 'fieldMetadata.dependencyFilterMap'],
9329
+ writes: ['fieldMetadata.dependencyFields', 'fieldMetadata.enableDependencyCascade', 'fieldMetadata.resetOnDependentChange', 'fieldMetadata.dependencyFilterMap', 'fieldMetadata.dependencyValuePath', 'fieldMetadata.dependencyMergeStrategy', 'fieldMetadata.dependencyDebounceMs', 'fieldMetadata.dependencyLoadOnChange', 'fieldMetadata.optionSource.dependsOn', 'fieldMetadata.optionSource.dependencyFilterMap'],
9330
+ identityKeys: ['dependentField', 'sourceField'],
9331
+ inputSchema: cascadeSchema,
9332
+ failureModes: ['dependent-field-not-found', 'source-field-not-found', 'cascade-cycle-detected', 'dependency-filter-map-invalid'],
9333
+ description: 'Applies cascade dependencies through CascadeRulesService using the metadata-editor save contract while preserving backend x-ui optionSource dependency semantics during hydration.',
9334
+ } }],
9335
+ destructive: false,
9336
+ requiresConfirmation: false,
9337
+ validators: ['cascade-fields-exist', 'cascade-cycle-free', 'cascade-backend-shape-preserved', 'option-source-shape-canonical', 'remote-option-source-governed', 'metadata-round-trip'],
9338
+ affectedPaths: ['fieldMetadata.dependencyFields', 'fieldMetadata.enableDependencyCascade', 'fieldMetadata.resetOnDependentChange', 'fieldMetadata.dependencyFilterMap', 'fieldMetadata.dependencyValuePath', 'fieldMetadata.dependencyMergeStrategy', 'fieldMetadata.dependencyDebounceMs', 'fieldMetadata.dependencyLoadOnChange', 'fieldMetadata.optionSource.dependsOn', 'fieldMetadata.optionSource.dependencyFilterMap'],
9339
+ submissionImpact: 'affects-remote-binding',
9340
+ preconditions: ['field-list-loaded'],
9341
+ },
9342
+ {
9343
+ operationId: 'renderer.configure',
9344
+ title: 'Configure renderer coverage',
9345
+ scope: 'editorCoverage',
9346
+ targetKind: 'renderer',
9347
+ target: { kind: 'renderer', resolver: 'metadata-editor-renderer-property', ambiguityPolicy: 'fail', required: true },
9348
+ inputSchema: {
9349
+ type: 'object',
9350
+ required: ['propertyName', 'editorType'],
9351
+ properties: {
9352
+ propertyName: { type: 'string' },
9353
+ editorType: { type: 'string' },
9354
+ group: { type: 'string' },
9355
+ required: { type: 'boolean' },
9356
+ options: { type: 'array' },
9357
+ },
9358
+ },
9359
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-renderer-configure', handlerContract: {
9360
+ reads: ['DynamicEditorRendererComponent', 'EditorComponentRegistryService', 'ConfigRegistryService', 'EditorProperty'],
9361
+ writes: ['properties', 'editorCoverage'],
9362
+ identityKeys: ['controlType', 'propertyName'],
9363
+ inputSchema: { type: 'object', required: ['propertyName', 'editorType'], properties: { propertyName: { type: 'string' }, editorType: { type: 'string' }, group: { type: 'string' } } },
9364
+ failureModes: ['editor-type-not-registered', 'property-not-covered', 'json-only-coverage-not-accepted'],
9365
+ description: 'Configures visual renderer coverage for a metadata property and rejects JSON-only support for required visual authoring.',
9366
+ } }],
9367
+ destructive: false,
9368
+ requiresConfirmation: false,
9369
+ validators: ['renderer-editor-type-registered', 'visual-editor-coverage-required', 'editor-coverage-exists', 'metadata-round-trip'],
9370
+ affectedPaths: ['properties', 'editorCoverage'],
9371
+ submissionImpact: 'config-only',
9372
+ preconditions: ['config-registry-loaded'],
9373
+ },
9374
+ {
9375
+ operationId: 'validationRule.add',
9376
+ title: 'Add validation rule',
9377
+ scope: 'fieldMetadataPath',
9378
+ targetKind: 'validation',
9379
+ target: { kind: 'validation', resolver: 'field-metadata-validation-rules', ambiguityPolicy: 'fail', required: false },
9380
+ inputSchema: {
9381
+ type: 'object',
9382
+ required: ['rule'],
9383
+ properties: {
9384
+ rule: { type: 'object' },
9385
+ message: { type: 'string' },
9386
+ contextValidatorId: { type: 'string' },
9387
+ },
9388
+ },
9389
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-validation-rule-add', handlerContract: {
9390
+ reads: ['fieldMetadata.validators', 'ContextValidatorRegistryService', 'DynamicFormFactoryService'],
9391
+ writes: ['fieldMetadata.validators'],
9392
+ identityKeys: ['field.name', 'rule.type', 'contextValidatorId'],
9393
+ inputSchema: { type: 'object', required: ['rule'], properties: { rule: { type: 'object' }, message: { type: 'string' }, contextValidatorId: { type: 'string' } } },
9394
+ failureModes: ['validation-rule-invalid', 'context-validator-not-registered', 'duplicate-validation-rule'],
9395
+ description: 'Adds a canonical validation rule and verifies contextual validator availability before persistence.',
9396
+ } }],
9397
+ destructive: false,
9398
+ requiresConfirmation: false,
9399
+ validators: ['validation-rule-canonical', 'context-validator-registered', 'metadata-round-trip'],
9400
+ affectedPaths: ['fieldMetadata.validators'],
9401
+ submissionImpact: 'affects-submission',
9402
+ preconditions: ['field-metadata-loaded'],
9403
+ },
9404
+ {
9405
+ operationId: 'contextHint.set',
9406
+ title: 'Set metadata context hint',
9407
+ scope: 'meta',
9408
+ targetKind: 'contextHint',
9409
+ target: { kind: 'contextHint', resolver: 'metadata-editor-context-hints', ambiguityPolicy: 'fail', required: false },
9410
+ inputSchema: {
9411
+ type: 'object',
9412
+ required: ['hintPath', 'value'],
9413
+ properties: {
9414
+ hintPath: { enum: ['hint', 'helpText', 'description', 'tooltip', 'ariaLabel', 'ariaDescribedBy'] },
9415
+ value: {},
9416
+ localeKey: { type: 'string' },
9417
+ },
9418
+ },
9419
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-context-hint-set', handlerContract: {
9420
+ reads: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy', 'metadata-editor-i18n'],
9421
+ writes: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy'],
9422
+ identityKeys: ['field.name', 'hintPath'],
9423
+ inputSchema: { type: 'object', required: ['hintPath', 'value'], properties: { hintPath: { enum: ['hint', 'helpText', 'description', 'tooltip', 'ariaLabel', 'ariaDescribedBy'] }, value: {}, localeKey: { type: 'string' } } },
9424
+ failureModes: ['hint-path-not-canonical', 'hint-value-not-serializable', 'i18n-key-missing'],
9425
+ description: 'Sets structured FieldMetadata hint/help/accessibility text through canonical metadata paths and metadata-editor i18n constraints.',
9426
+ } }],
9427
+ destructive: false,
9428
+ requiresConfirmation: false,
9429
+ validators: ['context-hint-shape-canonical', 'context-hint-i18n-compatible', 'metadata-round-trip'],
9430
+ affectedPaths: ['fieldMetadata.hint', 'fieldMetadata.helpText', 'fieldMetadata.description', 'fieldMetadata.tooltip', 'fieldMetadata.ariaLabel', 'fieldMetadata.ariaDescribedBy'],
9431
+ submissionImpact: 'visual-only',
9432
+ preconditions: ['field-metadata-loaded'],
9433
+ },
9434
+ {
9435
+ operationId: 'normalization.apply',
9436
+ title: 'Apply schema normalization',
9437
+ scope: 'runtimeCoverage',
9438
+ targetKind: 'normalization',
9439
+ target: { kind: 'normalization', resolver: 'metadata-editor-schema-normalizer', ambiguityPolicy: 'fail', required: false },
9440
+ inputSchema: {
9441
+ type: 'object',
9442
+ properties: {
9443
+ mode: { enum: ['hydrate-seed', 'coerce-types', 'apply-defaults', 'preserve-advanced-properties'] },
9444
+ preserveUnknownCanonicalFields: { type: 'boolean' },
9445
+ },
9446
+ },
9447
+ effects: [{ kind: 'compile-domain-patch', handler: 'metadata-normalization-apply', handlerContract: {
9448
+ reads: ['SchemaNormalizerService', 'fieldMetadata', 'properties', 'DynamicFormFactoryService'],
9449
+ writes: ['normalizedSeed', 'form', 'fieldMetadata'],
9450
+ identityKeys: ['field.name', 'controlType', 'mode'],
9451
+ inputSchema: { type: 'object', properties: { mode: { enum: ['hydrate-seed', 'coerce-types', 'apply-defaults', 'preserve-advanced-properties'] }, preserveUnknownCanonicalFields: { type: 'boolean' } } },
9452
+ failureModes: ['normalizer-missing', 'type-coercion-failed', 'advanced-property-lost', 'runtime-editor-drift'],
9453
+ description: 'Runs metadata-editor schema normalization while preserving canonical advanced FieldMetadata properties and editor/runtime round-trip.',
9454
+ } }],
9455
+ destructive: false,
9456
+ requiresConfirmation: false,
9457
+ validators: ['normalization-preserves-canonical-fields', 'runtime-editor-round-trip', 'metadata-round-trip'],
9458
+ affectedPaths: ['normalizedSeed', 'form', 'fieldMetadata'],
9459
+ submissionImpact: 'config-only',
9460
+ preconditions: ['field-metadata-loaded', 'editor-properties-loaded'],
9461
+ },
9462
+ ],
9463
+ validators: [
9464
+ { validatorId: 'field-metadata-shape-canonical', level: 'error', code: 'METADATA_FIELD_SHAPE_CANONICAL', description: 'Edited metadata must remain compatible with canonical FieldMetadata.' },
9465
+ { 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.' },
9466
+ { validatorId: 'control-type-exists-in-discovery', level: 'error', code: 'METADATA_CONTROL_TYPE_DISCOVERED', description: 'Control type must exist in dynamic-fields discovery.' },
9467
+ { validatorId: 'editor-coverage-exists', level: 'error', code: 'METADATA_EDITOR_COVERAGE_EXISTS', description: 'Control type and property must have metadata-editor coverage.' },
9468
+ { validatorId: 'option-source-shape-canonical', level: 'error', code: 'METADATA_OPTION_SOURCE_CANONICAL', description: 'Option source must use canonical FieldMetadata/x-ui shape.' },
9469
+ { 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.' },
9470
+ { validatorId: 'cascade-fields-exist', level: 'error', code: 'METADATA_CASCADE_FIELDS_EXIST', description: 'Cascade source and dependent fields must exist.' },
9471
+ { validatorId: 'cascade-cycle-free', level: 'error', code: 'METADATA_CASCADE_CYCLE_FREE', description: 'Cascade dependencies must not create cycles.' },
9472
+ { 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.' },
9473
+ { validatorId: 'renderer-editor-type-registered', level: 'error', code: 'METADATA_RENDERER_TYPE_REGISTERED', description: 'Renderer editor type must be registered.' },
9474
+ { validatorId: 'visual-editor-coverage-required', level: 'error', code: 'METADATA_VISUAL_COVERAGE_REQUIRED', description: 'JSON-only support is not accepted for required visual authoring coverage.' },
9475
+ { validatorId: 'validation-rule-canonical', level: 'error', code: 'METADATA_VALIDATION_RULE_CANONICAL', description: 'Validation rule must use canonical metadata shape.' },
9476
+ { validatorId: 'context-validator-registered', level: 'error', code: 'METADATA_CONTEXT_VALIDATOR_REGISTERED', description: 'Contextual validator must be registered before use.' },
9477
+ { 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.' },
9478
+ { validatorId: 'context-hint-i18n-compatible', level: 'warning', code: 'METADATA_CONTEXT_HINT_I18N_COMPATIBLE', description: 'Authoring hint text must remain compatible with metadata-editor i18n.' },
9479
+ { validatorId: 'normalization-preserves-canonical-fields', level: 'error', code: 'METADATA_NORMALIZATION_PRESERVES_FIELDS', description: 'Normalization must not drop canonical advanced FieldMetadata properties.' },
9480
+ { validatorId: 'runtime-editor-round-trip', level: 'error', code: 'METADATA_RUNTIME_EDITOR_ROUND_TRIP', description: 'Runtime and editor must consume the same normalized metadata shape.' },
9481
+ { validatorId: 'metadata-round-trip', level: 'error', code: 'METADATA_ROUND_TRIP', description: 'Open, edit, apply/save, reopen and runtime consume must preserve metadata.' },
9482
+ ],
9483
+ roundTripRequirements: [
9484
+ 'FieldMetadata is the canonical edited document shape; backend x-ui-derived metadata must not be rewritten into host-only aliases.',
9485
+ 'Control type changes require both dynamic-fields discovery and metadata-editor visual coverage.',
9486
+ 'Option source cascades preserve x-ui optionSource.dependsOn and optionSource.dependencyFilterMap semantics.',
9487
+ 'JSON-only support is incomplete when visual editor coverage is required.',
9488
+ 'Schema normalization must preserve advanced canonical properties through open, edit, apply/save, reopen and runtime consumption.',
9489
+ ],
9490
+ examples: [
9491
+ { id: 'set-label', request: 'Set this field label to Customer name.', operationId: 'fieldMetadata.property.set', params: { path: 'label', value: 'Customer name' }, isPositive: true },
9492
+ { id: 'set-control-type', request: 'Change this field to a select control.', operationId: 'controlType.set', params: { controlType: 'select', preserveCompatibleProperties: true }, isPositive: true },
9493
+ { 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 },
9494
+ { id: 'configure-cascade', request: 'Filter city options when state changes.', operationId: 'cascade.configure', params: { dependentField: 'city', sourceField: 'state', dependencyFilterMap: { stateId: 'state.id' } }, isPositive: true },
9495
+ { 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 },
9496
+ { 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 },
9497
+ { 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 },
9498
+ { 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 },
9499
+ { id: 'reject-unknown-control', request: 'Use an unknown control type named magic-picker.', operationId: 'controlType.set', params: { controlType: 'magic-picker' }, isPositive: false },
9500
+ { id: 'reject-json-only-coverage', request: 'Support this field only by editing raw JSON.', operationId: 'renderer.configure', params: { propertyName: 'optionSource', editorType: 'json' }, isPositive: false },
9501
+ { 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 },
9502
+ { 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 },
9503
+ ],
9504
+ };
9505
+
9506
+ /** Metadata for Praxis Metadata Editor component */
9507
+ const PRAXIS_METADATA_EDITOR_COMPONENT_METADATA = {
9508
+ id: 'praxis-metadata-editor',
9509
+ selector: 'praxis-field-metadata-editor',
9510
+ component: FieldMetadataEditorComponent,
9511
+ friendlyName: 'Praxis Metadata Editor',
9512
+ description: 'Editor for field metadata and schema helpers.',
9513
+ inputs: [
9514
+ {
9515
+ name: 'controlType',
9516
+ type: 'FieldControlType',
9517
+ label: 'Tipo de controle',
9518
+ description: 'Tipo de controle do campo alvo.',
9519
+ },
9520
+ {
9521
+ name: 'seed',
9522
+ type: 'Partial<FieldDefinition>',
9523
+ label: 'Seed',
9524
+ description: 'Valores iniciais do FieldDefinition para hidratar o editor.',
9525
+ },
9526
+ ],
9527
+ outputs: [
9528
+ {
9529
+ name: 'applied',
9530
+ type: 'Partial<FieldDefinition>',
9531
+ label: 'Aplicado',
9532
+ description: 'Disparado quando o patch de metadata e aplicado.',
9533
+ },
9534
+ {
9535
+ name: 'cancel',
9536
+ type: 'void',
9537
+ label: 'Cancelar',
9538
+ description: 'Disparado quando o usuario cancela a edicao.',
9539
+ },
9540
+ ],
9541
+ tags: ['widget', 'metadata', 'configurable'],
9542
+ lib: '@praxisui/metadata-editor',
9543
+ };
9544
+ /** Provider para auto-registrar metadados do componente Metadata Editor. */
9545
+ function providePraxisMetadataEditorMetadata() {
9546
+ return {
9547
+ provide: ENVIRONMENT_INITIALIZER,
9548
+ multi: true,
9549
+ useFactory: (registry) => () => {
9550
+ registry.register(PRAXIS_METADATA_EDITOR_COMPONENT_METADATA);
9551
+ },
9552
+ deps: [ComponentMetadataRegistry],
9553
+ };
9554
+ }
9555
+
7296
9556
  /**
7297
9557
  * Generated bundle index. Do not edit.
7298
9558
  */
7299
9559
 
7300
- export { CascadeManagerTabComponent, CascadeRulesService, ConfigRegistryService, ContextValidatorRegistryService, DynamicEditorRendererComponent, DynamicFormFactoryService, EditorComponentRegistryService, FieldMetadataEditorComponent, METADATA_EDITOR_AI_CAPABILITIES, METADATA_EDITOR_AI_CAPABILITY_CATALOG, SchemaNormalizerService };
9560
+ 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 };