import * as i0 from '@angular/core';
import { input, Component, makeEnvironmentProviders, APP_INITIALIZER } from '@angular/core';
import { FieldLabelComponent, DynamicFormRegistry } from '@seniorsistemas/angular-components/dynamic-form';
import * as i1 from '@angular/forms';
import { ReactiveFormsModule } from '@angular/forms';
import { EditorComponent } from '@seniorsistemas/angular-components/editor';

class EditorFieldComponent {
    field = input.required();
    formControl = input.required();
    static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditorFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
    static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.14", type: EditorFieldComponent, isStandalone: true, selector: "ng-component", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, formControl: { classPropertyName: "formControl", publicName: "formControl", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let _field = field();\n<s-field-label [field]=\"_field\"></s-field-label>\n\n<s-editor\n    [formControl]=\"formControl()\"\n    [formats]=\"_field.formats\"\n    [readonly]=\"_field.readonly ?? false\"\n    [style]=\"_field.style\"\n    [extensions]=\"_field.extensions ?? []\"\n>\n</s-editor>\n", dependencies: [{ kind: "component", type: EditorComponent, selector: "s-editor", inputs: ["readonly", "formats", "placeholder", "style", "styleClass", "extensions"], outputs: ["editorInit", "textChange", "selectionChange"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: FieldLabelComponent, selector: "s-field-label", inputs: ["field", "fieldContainerRef"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: EditorFieldComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, imports: [EditorComponent, ReactiveFormsModule, FieldLabelComponent], template: "@let _field = field();\n<s-field-label [field]=\"_field\"></s-field-label>\n\n<s-editor\n    [formControl]=\"formControl()\"\n    [formats]=\"_field.formats\"\n    [readonly]=\"_field.readonly ?? false\"\n    [style]=\"_field.style\"\n    [extensions]=\"_field.extensions ?? []\"\n>\n</s-editor>\n" }]
        }] });

function provideEditorField() {
    return makeEnvironmentProviders([
        {
            provide: APP_INITIALIZER,
            useFactory: () => {
                return () => {
                    DynamicFormRegistry.registerField(EditorFieldComponent, 'editor');
                };
            },
            multi: true,
        },
    ]);
}

/**
 * Generated bundle index. Do not edit.
 */

export { provideEditorField };
//# sourceMappingURL=seniorsistemas-angular-components-optional-fields-editor.mjs.map
