import { Component, Inject, NgModule, ChangeDetectionStrategy, ChangeDetectorRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UxControlFeedbackComponentModule, } from '@eui/components/legacy/ux-control-feedback';
import { UxFormGroupComponentModule, } from '@eui/components/legacy/ux-form-group';
import { UxFieldsetComponentModule, } from '@eui/components/legacy/ux-fieldset';
import { UxDynResolveLabelPipeModule } from '../../../pipes/resolve-label.pipe';
import { BaseDynComponent } from '../../../core/base-dyn/base-dyn.component';
import { DYNAMIC_COMPONENT_CONFIG } from '@eui/core';
import { UxDynFormChildContainerComponentModule } from '../../core/form-child-container/form-child-container.component';
import { UxDynNativeElementProviderDirectiveModule } from '../../../directives/native-element-provider.directive';
import { TranslateModule } from '@ngx-translate/core';
import * as i0 from "@angular/core";
import * as i1 from "@eui/components/legacy/ux-fieldset";
import * as i2 from "../../core/form-child-container/form-child-container.component";
import * as i3 from "@angular/common";
import * as i4 from "../../../pipes/resolve-label.pipe";
export class FieldsetWrapperComponent extends BaseDynComponent {
    constructor(config, cdRef) {
        super(config);
        this.cdRef = cdRef;
        this.inputs = this.context.inputs;
        this.manualHandleChangeDetection();
    }
    ngOnInit() {
    }
    ngOnDestroy() {
        if (this.statusSubs) {
            this.statusSubs.unsubscribe();
        }
        if (this.modeSubs) {
            this.modeSubs.unsubscribe();
        }
    }
    manualHandleChangeDetection() {
        this.modeSubs = this.dynFormApi.getMode().subscribe(() => {
            this.cdRef.markForCheck();
        });
    }
}
/** @nocollapse */ FieldsetWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FieldsetWrapperComponent, deps: [{ token: DYNAMIC_COMPONENT_CONFIG }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
/** @nocollapse */ FieldsetWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FieldsetWrapperComponent, selector: "ux-dyn-fieldset-container", usesInheritance: true, ngImport: i0, template: "<ux-fieldset label=\" \" *ngIf=\"!inputs.notHeader\"\n>\n    <uxFieldsetLabelExtraContent>\n        <div class=\"ux-fieldset__header-label\" [innerHtml]=\"inputs.label | resolveLabel | async\"></div>\n        <span *ngIf=\"inputs.tooltip\" class=\"ux-form-group__info-label ux-icon ux-icon-info-circle ux-u-color-info\"\n              [class.ux-u-cursor-help]=\"inputs.tooltip !== ''\" title=\"{{inputs.tooltip | resolveLabel | async}}\">\n       </span>\n    </uxFieldsetLabelExtraContent>\n    <ux-dyn-form-child-container [config]=\"childrenConfig\" [frameId]=\"frameId\" [parent]=\"parent\">\n    </ux-dyn-form-child-container>\n</ux-fieldset>\n", styles: [""], components: [{ type: i1.UxFieldsetComponent, selector: "ux-fieldset", inputs: ["id", "label", "typeClass", "iconClass", "labelWidthClass", "inputWidthClass", "styleClass", "isFirst", "isLarge", "isCompactFields", "isVerticalFields", "isHighlighted", "isExpandable", "isExpanded", "e2eAttr"], outputs: ["expanded"] }, { type: i2.FormChildContainerComponent, selector: "ux-dyn-form-child-container", inputs: ["config", "frameId", "parent", "parentData"] }], directives: [{ type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.UxFieldsetLabelExtraContentTagDirective, selector: "uxFieldsetLabelExtraContent" }], pipes: { "async": i3.AsyncPipe, "resolveLabel": i4.ResolveLabelPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FieldsetWrapperComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ux-dyn-fieldset-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ux-fieldset label=\" \" *ngIf=\"!inputs.notHeader\"\n>\n    <uxFieldsetLabelExtraContent>\n        <div class=\"ux-fieldset__header-label\" [innerHtml]=\"inputs.label | resolveLabel | async\"></div>\n        <span *ngIf=\"inputs.tooltip\" class=\"ux-form-group__info-label ux-icon ux-icon-info-circle ux-u-color-info\"\n              [class.ux-u-cursor-help]=\"inputs.tooltip !== ''\" title=\"{{inputs.tooltip | resolveLabel | async}}\">\n       </span>\n    </uxFieldsetLabelExtraContent>\n    <ux-dyn-form-child-container [config]=\"childrenConfig\" [frameId]=\"frameId\" [parent]=\"parent\">\n    </ux-dyn-form-child-container>\n</ux-fieldset>\n", styles: [""] }]
        }], ctorParameters: function () { return [{ type: undefined, decorators: [{
                    type: Inject,
                    args: [DYNAMIC_COMPONENT_CONFIG]
                }] }, { type: i0.ChangeDetectorRef }]; } });
export class UxDynFieldsetWrapperComponentModule {
}
/** @nocollapse */ UxDynFieldsetWrapperComponentModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UxDynFieldsetWrapperComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
/** @nocollapse */ UxDynFieldsetWrapperComponentModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UxDynFieldsetWrapperComponentModule, declarations: [FieldsetWrapperComponent], imports: [CommonModule,
        UxFieldsetComponentModule,
        UxDynFormChildContainerComponentModule,
        // EuiTooltipDirectiveModule,
        UxFormGroupComponentModule,
        UxDynNativeElementProviderDirectiveModule,
        UxControlFeedbackComponentModule,
        UxDynResolveLabelPipeModule,
        TranslateModule], exports: [FieldsetWrapperComponent] });
/** @nocollapse */ UxDynFieldsetWrapperComponentModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UxDynFieldsetWrapperComponentModule, imports: [[
            CommonModule,
            UxFieldsetComponentModule,
            UxDynFormChildContainerComponentModule,
            // EuiTooltipDirectiveModule,
            UxFormGroupComponentModule,
            UxDynNativeElementProviderDirectiveModule,
            UxControlFeedbackComponentModule,
            UxDynResolveLabelPipeModule,
            TranslateModule,
        ]] });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: UxDynFieldsetWrapperComponentModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [
                        CommonModule,
                        UxFieldsetComponentModule,
                        UxDynFormChildContainerComponentModule,
                        // EuiTooltipDirectiveModule,
                        UxFormGroupComponentModule,
                        UxDynNativeElementProviderDirectiveModule,
                        UxControlFeedbackComponentModule,
                        UxDynResolveLabelPipeModule,
                        TranslateModule,
                    ],
                    exports: [FieldsetWrapperComponent],
                    declarations: [FieldsetWrapperComponent],
                }]
        }] });
//# sourceMappingURL=data:application/json;base64, 