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 } from '@anglr/dynamic/relations';
import { RelationsEditorMetadata } from '@anglr/dynamic/relations-editor';
import { HostDisplayBlockStyle } from '@anglr/common';
import { nameof } from '@jscrpt/common';
import { IfBlockLayoutDesignerTypeLoader, IfBlockLayoutMetadataLoader, IfBlockRelationsMetadataLoader } from './ifBlock.metadata';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/**
 * Component used for displaying if block
 */
let IfBlockSAComponent = class IfBlockSAComponent extends LayoutComponentBase {
    constructor() {
        super(...arguments);
        //######################### public properties - inputs #########################
        /**
         * Condition used for displaying content of if block
         */
        this.condition = true;
    }
    //######################### protected - overrides #########################
    /**
     * @inheritdoc
     */
    onOptionsSet() {
        this.condition = this.options?.condition ?? false;
    }
};
IfBlockSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: IfBlockSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
IfBlockSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: IfBlockSAComponent, isStandalone: true, selector: "if-block", inputs: { condition: "condition" }, usesInheritance: true, ngImport: i0, template: "<ng-container *ngIf=\"condition\">\n    <ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>\n</ng-container>", styles: [":host{display: block;}"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: LayoutComponentRendererSADirective, selector: "[layoutComponentRenderer]", inputs: ["layoutComponentRenderer", "layoutComponentRendererInjector", "layoutComponentRendererDisableTransformer"], outputs: ["layoutComponentRendererComponentChange", "componentElementChange"], exportAs: ["layoutComponentRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
IfBlockSAComponent = __decorate([
    DebugData({
        inputs: [
            nameof('condition'),
        ],
    }),
    DescendantsGetter(options => options?.content ? [options?.content] : []),
    LayoutEditorDesignerType(IfBlockLayoutDesignerTypeLoader),
    RelationsEditorMetadata(IfBlockRelationsMetadataLoader),
    LayoutEditorMetadata(IfBlockLayoutMetadataLoader)
], IfBlockSAComponent);
export { IfBlockSAComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: IfBlockSAComponent, decorators: [{
            type: Component,
            args: [{ selector: 'if-block', standalone: true, imports: [
                        CommonModule,
                        LayoutComponentRendererSADirective,
                    ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"condition\">\n    <ng-template [layoutComponentRenderer]=\"options?.content\"></ng-template>\n</ng-container>", styles: [":host{display: block;}"] }]
        }], propDecorators: { condition: [{
                type: Input
            }] } });
//# sourceMappingURL=ifBlock.component.js.map