import { Component, Input } from '@angular/core';
import { HtmlTemplatesHelper } from '../util/helpers/html-templates.helper';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/*
* Gov Uk Fieldset Component
* Used to wrap group fieldset elements
* it can conditionally display h1 tag
* @param config
* @param isHeading
* @param errorMessage - used for aria tag
* */
export class GovUkFieldsetComponent {
    setDescribedBy() {
        return HtmlTemplatesHelper.setDescribedBy(this.errorMessage, this.config);
    }
    /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GovUkFieldsetComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: GovUkFieldsetComponent, selector: "mv-gov-uk-fieldset", inputs: { config: "config", isHeading: "isHeading", errorMessage: "errorMessage" }, ngImport: i0, template: `
      <fieldset class="govuk-fieldset" [attr.aria-describedby]="setDescribedBy()">
        <legend [class]="config.classes + ' govuk-fieldset__legend'" *ngIf="!isHeading">
          {{config.legend}}
        </legend>

        <legend [class]="config.classes + ' govuk-fieldset__legend'" *ngIf="isHeading">
          <h1>{{config.legend}}</h1>
        </legend>

        <span [id]="config.id+'-hint'" class="govuk-hint" *ngIf="config.hint">
          {{config.hint}}
        </span>
        <ng-content></ng-content>
      </fieldset>
  `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: GovUkFieldsetComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'mv-gov-uk-fieldset',
                    template: `
      <fieldset class="govuk-fieldset" [attr.aria-describedby]="setDescribedBy()">
        <legend [class]="config.classes + ' govuk-fieldset__legend'" *ngIf="!isHeading">
          {{config.legend}}
        </legend>

        <legend [class]="config.classes + ' govuk-fieldset__legend'" *ngIf="isHeading">
          <h1>{{config.legend}}</h1>
        </legend>

        <span [id]="config.id+'-hint'" class="govuk-hint" *ngIf="config.hint">
          {{config.hint}}
        </span>
        <ng-content></ng-content>
      </fieldset>
  `
                }]
        }], propDecorators: { config: [{
                type: Input
            }], isHeading: [{
                type: Input
            }], errorMessage: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ292LXVrLWZpZWxkc2V0LmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL21lZGlhLXZpZXdlci9zcmMvbGliL3NoYXJlZC9nb3YtdWstZmllbGRzZXQvZ292LXVrLWZpZWxkc2V0LmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsU0FBUyxFQUFFLEtBQUssRUFBQyxNQUFNLGVBQWUsQ0FBQztBQUMvQyxPQUFPLEVBQUMsbUJBQW1CLEVBQUMsTUFBTSx1Q0FBdUMsQ0FBQzs7O0FBQzFFOzs7Ozs7O0lBT0k7QUFvQkosTUFBTSxPQUFPLHNCQUFzQjtJQUtqQyxjQUFjO1FBQ1osT0FBTyxtQkFBbUIsQ0FBQyxjQUFjLENBQUMsSUFBSSxDQUFDLFlBQVksRUFBRSxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUM7SUFDNUUsQ0FBQztrSUFQVSxzQkFBc0I7c0hBQXRCLHNCQUFzQiw4SUFqQnZCOzs7Ozs7Ozs7Ozs7Ozs7R0FlVDs7NEZBRVUsc0JBQXNCO2tCQW5CbEMsU0FBUzttQkFBQztvQkFDVCxRQUFRLEVBQUUsb0JBQW9CO29CQUM5QixRQUFRLEVBQUU7Ozs7Ozs7Ozs7Ozs7OztHQWVUO2lCQUNGOzhCQUVVLE1BQU07c0JBQWQsS0FBSztnQkFDRyxTQUF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