import { __decorate } from "tslib";
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LayoutComponentBase, LayoutComponentRendererSADirective } from '@anglr/dynamic/layout';
import { DescendantsGetter, LayoutEditorDesignerType, LayoutEditorMetadata } from '@anglr/dynamic/layout-editor';
import { DebugData, ScopedRelationsSADirective } from '@anglr/dynamic/relations';
import { RelationsEditorMetadata } from '@anglr/dynamic/relations-editor';
import { HostDisplayBlockStyle } from '@anglr/common';
import { nameof } from '@jscrpt/common';
import { ListBlockLayoutDesignerTypeLoader, ListBlockLayoutMetadataLoader, ListBlockRelationsMetadataLoader } from './listBlock.metadata';
import { ListBlockScopeRelationsSADirective } from './misc/directives';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/**
 * Component used for displaying list block
 */
let ListBlockSAComponent = class ListBlockSAComponent extends LayoutComponentBase {
    constructor() {
        super(...arguments);
        //######################### protected properties - template bindings #########################
        /**
         * Id of current component
         */
        this.id = '';
        //######################### public properties - inputs #########################
        /**
         * Array of data to be rendered in for cycle
         */
        this.data = [];
    }
    //######################### public methods #########################
    /**
     * Sets id of custom component
     * @param id - Id of custom component
     */
    setId(id) {
        this.id = id;
    }
};
ListBlockSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ListBlockSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
ListBlockSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: ListBlockSAComponent, isStandalone: true, selector: "list-block", inputs: { data: "data" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let datum of data; let index=index; let first=first; let last=last\">\n    <ng-template [layoutComponentRenderer]=\"options?.template\" scopedRelations listBlockScope [datum]=\"datum\" [first]=\"first\" [last]=\"last\" [index]=\"index\" [componentId]=\"id\"></ng-template>\n</ng-container>", styles: [":host{display: block;}"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }, { kind: "directive", type: ScopedRelationsSADirective, selector: "[scopedRelations]" }, { kind: "directive", type: ListBlockScopeRelationsSADirective, selector: "[listBlockScope]", inputs: ["datum", "index", "first", "last", "componentId"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
ListBlockSAComponent = __decorate([
    DebugData({
        inputs: [
            nameof('data'),
        ],
    }),
    DescendantsGetter(options => (options === null || options === void 0 ? void 0 : options.template) ? [options === null || options === void 0 ? void 0 : options.template] : []),
    LayoutEditorDesignerType(ListBlockLayoutDesignerTypeLoader),
    RelationsEditorMetadata(ListBlockRelationsMetadataLoader),
    LayoutEditorMetadata(ListBlockLayoutMetadataLoader)
], ListBlockSAComponent);
export { ListBlockSAComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: ListBlockSAComponent, decorators: [{
            type: Component,
            args: [{ selector: 'list-block', standalone: true, imports: [
                        CommonModule,
                        LayoutComponentRendererSADirective,
                        ScopedRelationsSADirective,
                        ListBlockScopeRelationsSADirective,
                    ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let datum of data; let index=index; let first=first; let last=last\">\n    <ng-template [layoutComponentRenderer]=\"options?.template\" scopedRelations listBlockScope [datum]=\"datum\" [first]=\"first\" [last]=\"last\" [index]=\"index\" [componentId]=\"id\"></ng-template>\n</ng-container>", styles: [":host{display: block;}"] }]
        }], propDecorators: { data: [{
                type: Input
            }] } });
//# sourceMappingURL=listBlock.component.js.map