{"version":3,"file":"eui-components-eui-fieldset.mjs","sources":["../../eui-fieldset/eui-fieldset.component.ts","../../eui-fieldset/eui-fieldset.component.html","../../eui-fieldset/index.ts","../../eui-fieldset/eui-components-eui-fieldset.ts"],"sourcesContent":["import {\n    AfterContentInit,\n    Component,\n    ContentChildren,\n    Directive,\n    EventEmitter,\n    HostBinding,\n    Input,\n    Output,\n    QueryList,\n    TemplateRef,\n    booleanAttribute,\n    inject,\n} from '@angular/core';\nimport { EuiTemplateDirective } from '@eui/components/directives';\n\nimport { BaseStatesDirective } from '@eui/components/shared';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { EUI_ICON } from '@eui/components/eui-icon';\nimport { EUI_ICON_BUTTON_EXPANDER } from '@eui/components/eui-icon-button-expander';\nimport { EUI_ICON_STATE } from '@eui/components/eui-icon-state';\n\n/**\n * Directive for projecting custom content into the right side of the fieldset label area.\n * Used to add supplementary controls or information aligned to the right of the label text.\n */\n// eslint-disable-next-line\n@Directive({ selector: 'euiFieldsetLabelRightContent' })\nexport class EuiFieldsetLabelRightContentTagDirective {}\n\n/**\n * Directive for projecting additional content below the main fieldset label.\n * Used to add descriptive text, hints, or secondary information in the label section.\n */\n// eslint-disable-next-line\n@Directive({ selector: 'euiFieldsetLabelExtraContent' })\nexport class EuiFieldsetLabelExtraContentTagDirective {}\n\n/**\n * @description\n * `eui-fieldset` is a container component that groups related form controls or content sections with a labeled border.\n * `eui-fieldset` supports collapsible/expandable behavior, custom icons, and flexible content projection.\n * Commonly used to organize complex forms into logical sections or create accordion-style interfaces.\n * `eui-fieldset` Provides visual hierarchy through theming variants and size options.\n *\n * @usageNotes\n * ### Basic fieldset\n * ```html\n * <eui-fieldset label=\"Personal Information\">\n *   <eui-input-text label=\"Name\"></eui-input-text>\n *   <eui-input-text label=\"Email\"></eui-input-text>\n * </eui-fieldset>\n * ```\n *\n * ### Expandable fieldset\n * ```html\n * <eui-fieldset \n *   label=\"Advanced Options\" \n *   [isExpandable]=\"true\" \n *   [isExpanded]=\"false\"\n *   (expand)=\"onExpand($event)\">\n *   <ng-template euiTemplate=\"eui-fieldset-content\">\n *     <p>Collapsible content here</p>\n *   </ng-template>\n * </eui-fieldset>\n * ```\n *\n * ### Accessibility\n * - Uses semantic `<fieldset>` and `<legend>` elements for proper form grouping\n * - Expand/collapse button includes descriptive aria-label\n * - Keyboard navigation supported for expandable fieldsets\n *\n * ### Notes\n * - Use `isExpandable` with lazy-loaded content via `euiTemplate` for performance\n * - Apply state variants (euiPrimary, euiSuccess, etc.) for visual emphasis\n * - Set `isFirst` to remove top margin in stacked layouts\n */\n@Component({\n    selector: 'eui-fieldset',\n    templateUrl: './eui-fieldset.component.html',\n    styleUrl: './eui-fieldset.scss',\n    imports: [\n        NgTemplateOutlet,\n        ...EUI_ICON,\n        ...EUI_ICON_BUTTON_EXPANDER,\n        ...EUI_ICON_STATE,\n    ],\n    hostDirectives: [\n        {\n            directive: BaseStatesDirective,\n            inputs: [\n                'euiPrimary',\n                'euiSecondary',\n                'euiSuccess',\n                'euiInfo',\n                'euiWarning',\n                'euiDanger',\n                'euiVariant',\n                'euiHighlighted',\n            ],\n        },\n    ],\n})\nexport class EuiFieldsetComponent implements AfterContentInit {\n    /** CSS classes applied to the host element */\n    @HostBinding('class')\n    public get cssClasses(): string {\n        return [\n            this.baseStatesDirective.getCssClasses('eui-fieldset'),\n            this.isFirst ? 'eui-fieldset--first' : '',\n            this.isExpandable ? 'eui-fieldset--expandable' : '',\n            this.iconSvgFillColor ? 'eui-fieldset--has-icon-color': '',\n        ].join(' ').trim();\n    }\n\n    /**\n     * Data attribute used for end-to-end testing identification.\n     * @default 'eui-fieldset'\n     */\n    @HostBinding('attr.data-e2e')\n    @Input() e2eAttr = 'eui-fieldset';\n\n    /**\n     * Unique identifier for the fieldset element.\n     * Emitted in the expand event to identify which fieldset was toggled.\n     * Required when using expandable fieldsets to track state.\n     */\n    @Input() id: string;\n\n    /**\n     * Primary text displayed in the fieldset header.\n     * Provides a descriptive title for the grouped content.\n     */\n    @Input() label: string;\n\n    /**\n     * CSS class name for a custom icon displayed in the fieldset header.\n     * Alternative to iconSvgName for using icon fonts or custom icon implementations.\n     */\n    @Input() iconClass: string;\n\n    /**\n     * Name of the SVG icon to display in the fieldset header.\n     * Follows EUI icon naming conventions for consistent visual language.\n     */\n    @Input() iconSvgName: string;\n\n    /**\n     * Fill color applied to the SVG icon in the fieldset header.\n     * Accepts CSS color values to customize icon appearance.\n     */\n    @Input() iconSvgFillColor: string;\n\n    /**\n     * Displays a default icon in the fieldset header when no custom icon is specified.\n     * Provides visual consistency across fieldsets.\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) hasDefaultIcon = false;\n\n    /**\n     * Enables expand/collapse functionality for the fieldset content.\n     * Adds an interactive toggle button to the header for showing/hiding content.\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) isExpandable = false;\n\n    /**\n     * Controls the expanded state of the fieldset content.\n     * Only effective when isExpandable is true.\n     * @default true\n     */\n    @Input({ transform: booleanAttribute }) isExpanded = true;\n\n    /**\n     * Positions the expand/collapse toggle button on the left side of the header.\n     * By default, the expander appears on the right.\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) hasLeftExpander = false;\n\n    /**\n     * Applies larger sizing to the fieldset header and spacing.\n     * Used to create visual hierarchy or emphasize important sections.\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) isLarge = false;\n\n    /**\n     * Removes top margin when the fieldset is the first in a sequence.\n     * Ensures proper spacing in stacked fieldset layouts.\n     * @default false\n     */\n    @Input({ transform: booleanAttribute }) isFirst = false;\n\n    /**\n     * Emitted when the fieldset is expanded or collapsed.\n     * Payload: string containing the fieldset's id property.\n     * Triggered by user interaction with the expand/collapse toggle.\n     */\n    @Output() expand: EventEmitter<string> = new EventEmitter();\n\n    /** Label for expand button accessibility */\n    public expandMenuLabel = 'Expand ';\n\n    /** Label for collapse button accessibility */\n    public collapseMenuLabel = 'Collapse ';\n\n    /** Template reference for lazy-loaded content */\n    protected lazyContent: TemplateRef<HTMLElement>;\n\n    /** Query list of template directives for content projection */\n    @ContentChildren(EuiTemplateDirective) templates: QueryList<EuiTemplateDirective>;\n    protected baseStatesDirective: BaseStatesDirective = inject(BaseStatesDirective);\n\n    ngAfterContentInit(): void {\n        const lazyTemplate = this.templates.filter(t => t.name === 'eui-fieldset-content')[0];\n        if (lazyTemplate) {\n            this.lazyContent = lazyTemplate.template;\n        }\n    }\n\n    /**\n     * Handles expand/collapse toggle events\n     * Emits the fieldset ID when toggled\n     */\n    onToggle(): void {\n        if (this.isExpandable) {\n            this.isExpanded = !this.isExpanded;\n            this.expand.emit(this.id);\n        }\n    }\n}\n","@if (label) {\n    <div class=\"eui-fieldset__header\">\n        @if (isExpandable && hasLeftExpander) {\n            <eui-icon-button-expander\n                [isExpanded]=\"isExpanded\"\n                (click)=\"onToggle()\"\n                isDirectionForward\n                fillColor=\"secondary\">\n            </eui-icon-button-expander>\n        }        \n        <div class=\"eui-fieldset__header-label\" [class.eui-fieldset__header-label--large]=\"isLarge\">\n            @if (iconSvgName) {\n                <div class=\"eui-fieldset__header-icon\">\n                    <eui-icon-svg [icon]=\"iconSvgName\" [fillColor]=\"iconSvgFillColor\"/>\n                </div>\n            }\n            @if (hasDefaultIcon) {\n                <div class=\"eui-fieldset__header-icon\">\n                    <eui-icon-state [euiVariant]=\"baseStatesDirective.euiVariant\"/>\n                </div>\n            }\n            {{ label }}\n            <ng-content select=\"euiFieldsetLabelExtraContent\"></ng-content>\n        </div>\n        <div class=\"eui-fieldset__header-right-content\">\n            <ng-content select=\"euiFieldsetLabelRightContent\"></ng-content>\n            @if (isExpandable && !hasLeftExpander) {\n                <eui-icon-button-expander\n                    [isExpanded]=\"isExpanded\"\n                    (click)=\"onToggle()\"\n                    isDirectionForward\n                    fillColor=\"secondary\">\n                </eui-icon-button-expander>\n            }\n        </div>\n    </div>\n}\n@if (isExpanded) {\n    <div id=\"fieldset-content\" class=\"eui-fieldset__content\">\n        @if (lazyContent) {\n            <ng-template [ngTemplateOutlet]=\"lazyContent\"></ng-template>\n        } @else {\n            <ng-content></ng-content>\n        }\n    </div>\n}\n","export * from './eui-fieldset.component';\n\nimport {\n    EuiFieldsetComponent, EuiFieldsetLabelExtraContentTagDirective, EuiFieldsetLabelRightContentTagDirective,\n} from './eui-fieldset.component';\n\nexport const EUI_FIELDSET = [\n    EuiFieldsetComponent,\n    EuiFieldsetLabelExtraContentTagDirective,\n    EuiFieldsetLabelRightContentTagDirective,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAsBA;;;AAGG;AACH;MAEa,wCAAwC,CAAA;8GAAxC,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAxC,wCAAwC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,8BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAxC,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBADpD,SAAS;mBAAC,EAAE,QAAQ,EAAE,8BAA8B,EAAE;;AAGvD;;;AAGG;AACH;MAEa,wCAAwC,CAAA;8GAAxC,wCAAwC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAxC,wCAAwC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,8BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAxC,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBADpD,SAAS;mBAAC,EAAE,QAAQ,EAAE,8BAA8B,EAAE;;AAGvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCG;MA2BU,oBAAoB,CAAA;AA1BjC,IAAA,WAAA,GAAA;AAsCI;;;AAGG;QAEM,IAAA,CAAA,OAAO,GA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