import { NgForOf, NgIf } from '@angular/common';
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { TuiElement } from '@taiga-ui/cdk/directives/element';
import { tuiAsDataListAccessor, TuiDataList } from '@taiga-ui/core/components/data-list';
import { TuiLoader } from '@taiga-ui/core/components/loader';
import { PolymorpheusOutlet } from '@taiga-ui/polymorpheus';
import { TuiDataListWrapperComponent } from './data-list-wrapper.component';
import * as i0 from "@angular/core";
import * as i1 from "@taiga-ui/core/components/data-list";
class TuiDataListGroupWrapperComponent extends TuiDataListWrapperComponent {
    constructor() {
        super(...arguments);
        this.labels = [];
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDataListGroupWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TuiDataListGroupWrapperComponent, isStandalone: true, selector: "tui-data-list-wrapper[labels]", inputs: { labels: "labels" }, providers: [tuiAsDataListAccessor(TuiDataListGroupWrapperComponent)], usesInheritance: true, ngImport: i0, template: "<tui-data-list\n    *ngIf=\"items; else loading\"\n    [emptyContent]=\"emptyContent\"\n    [size]=\"size\"\n>\n    <tui-opt-group\n        *ngFor=\"let group of items; let index = index\"\n        [label]=\"labels[index]\"\n    >\n        <ng-container *ngIf=\"newOptionMode; else legacyOptionFallback\">\n            <button\n                *ngFor=\"let item of group\"\n                #elementRef=\"elementRef\"\n                new\n                tuiElement\n                tuiOption\n                type=\"button\"\n                [disabled]=\"disabledItemHandler(item)\"\n                [value]=\"item\"\n                (click.capture)=\"itemClick.emit(item)\"\n            >\n                <ng-container *polymorpheusOutlet=\"itemContent as text; context: getContext(item, elementRef)\">\n                    {{ text }}\n                </ng-container>\n            </button>\n        </ng-container>\n\n        <!-- TODO(v5): delete fallback -->\n        <ng-template #legacyOptionFallback>\n            <button\n                *ngFor=\"let item of group\"\n                #elementRef=\"elementRef\"\n                automation-id=\"tui-data-list-wrapper__option\"\n                tuiElement\n                tuiOption\n                type=\"button\"\n                [disabled]=\"disabledItemHandler(item)\"\n                [value]=\"item\"\n                (click)=\"itemClick.emit(item)\"\n            >\n                <ng-container *polymorpheusOutlet=\"itemContent as text; context: getContext(item, elementRef)\">\n                    {{ text }}\n                </ng-container>\n            </button>\n        </ng-template>\n    </tui-opt-group>\n</tui-data-list>\n<ng-template #loading>\n    <tui-loader class=\"t-loader\" />\n</ng-template>\n", styles: [":host{display:block}.t-content{flex:1;min-inline-size:0}.t-loader{margin:.75rem 0}\n"], dependencies: [{ kind: "directive", type: NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: PolymorpheusOutlet, selector: "[polymorpheusOutlet]", inputs: ["polymorpheusOutlet", "polymorpheusOutletContext"] }, { kind: "component", type: i1.TuiDataListComponent, selector: "tui-data-list", inputs: ["emptyContent", "size"] }, { kind: "component", type: i1.TuiOption, selector: "button[tuiOption]:not([new]), a[tuiOption]:not([new]), label[tuiOption]:not([new])", inputs: ["disabled", "value"] }, { kind: "directive", type: i1.TuiOptionNew, selector: "button[tuiOption][new], a[tuiOption][new], label[tuiOption][new]", inputs: ["disabled"] }, { kind: "directive", type: i1.TuiOptionWithValue, selector: "button[tuiOption][value][new], a[tuiOption][value][new], label[tuiOption][value][new]", inputs: ["disabled", "value"] }, { kind: "directive", type: i1.TuiOptGroup, selector: "tui-opt-group", inputs: ["label"] }, { kind: "directive", type: TuiElement, selector: "[tuiElement]", exportAs: ["elementRef"] }, { kind: "component", type: TuiLoader, selector: "tui-loader", inputs: ["size", "inheritColor", "overlay", "textContent", "showLoader"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
export { TuiDataListGroupWrapperComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TuiDataListGroupWrapperComponent, decorators: [{
            type: Component,
            args: [{ standalone: true, selector: 'tui-data-list-wrapper[labels]', imports: [NgForOf, NgIf, PolymorpheusOutlet, TuiDataList, TuiElement, TuiLoader], changeDetection: ChangeDetectionStrategy.OnPush, providers: [tuiAsDataListAccessor(TuiDataListGroupWrapperComponent)], template: "<tui-data-list\n    *ngIf=\"items; else loading\"\n    [emptyContent]=\"emptyContent\"\n    [size]=\"size\"\n>\n    <tui-opt-group\n        *ngFor=\"let group of items; let index = index\"\n        [label]=\"labels[index]\"\n    >\n        <ng-container *ngIf=\"newOptionMode; else legacyOptionFallback\">\n            <button\n                *ngFor=\"let item of group\"\n                #elementRef=\"elementRef\"\n                new\n                tuiElement\n                tuiOption\n                type=\"button\"\n                [disabled]=\"disabledItemHandler(item)\"\n                [value]=\"item\"\n                (click.capture)=\"itemClick.emit(item)\"\n            >\n                <ng-container *polymorpheusOutlet=\"itemContent as text; context: getContext(item, elementRef)\">\n                    {{ text }}\n                </ng-container>\n            </button>\n        </ng-container>\n\n        <!-- TODO(v5): delete fallback -->\n        <ng-template #legacyOptionFallback>\n            <button\n                *ngFor=\"let item of group\"\n                #elementRef=\"elementRef\"\n                automation-id=\"tui-data-list-wrapper__option\"\n                tuiElement\n                tuiOption\n                type=\"button\"\n                [disabled]=\"disabledItemHandler(item)\"\n                [value]=\"item\"\n                (click)=\"itemClick.emit(item)\"\n            >\n                <ng-container *polymorpheusOutlet=\"itemContent as text; context: getContext(item, elementRef)\">\n                    {{ text }}\n                </ng-container>\n            </button>\n        </ng-template>\n    </tui-opt-group>\n</tui-data-list>\n<ng-template #loading>\n    <tui-loader class=\"t-loader\" />\n</ng-template>\n", styles: [":host{display:block}.t-content{flex:1;min-inline-size:0}.t-loader{margin:.75rem 0}\n"] }]
        }], propDecorators: { labels: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 