import { __decorate } from "tslib";
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { CommonModule } from '@angular/common';
import { HostDisplayFlexStyle } from '@anglr/common';
import { LayoutComponentBase, LayoutComponentRendererSADirective } from '@anglr/dynamic/layout';
import { DescendantsGetter, LayoutEditorMetadata } from '@anglr/dynamic/layout-editor';
import { StackPanelLayoutMetadataLoader } from './stackPanel.metadata';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
/**
 * Component used for displaying stack panel layout
 */
let StackPanelSAComponent = class StackPanelSAComponent extends LayoutComponentBase {
    //######################### protected methods - overrides #########################
    /**
     * @inheritdoc
     */
    onOptionsSet() {
        this._setStyles();
    }
    //######################### protected methods #########################
    /**
     * Sets styles for stack panel
     */
    _setStyles() {
        const style = this.componentElement.nativeElement.style;
        style.flexDirection = this.options?.horizontal ? 'row' : 'column';
        style.flexWrap = this.options?.wrap ? 'wrap' : 'nowrap';
    }
};
StackPanelSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: StackPanelSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
StackPanelSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: StackPanelSAComponent, isStandalone: true, selector: "stack-panel", usesInheritance: true, ngImport: i0, template: "<ng-container *ngFor=\"let type of options?.children\">\n    <ng-template [layoutComponentRenderer]=\"type\"></ng-template>\n</ng-container>", styles: [":host{display: flex;}"], 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
StackPanelSAComponent = __decorate([
    DescendantsGetter(options => options?.children ?? []),
    LayoutEditorMetadata(StackPanelLayoutMetadataLoader)
], StackPanelSAComponent);
export { StackPanelSAComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: StackPanelSAComponent, decorators: [{
            type: Component,
            args: [{ selector: 'stack-panel', standalone: true, imports: [
                        CommonModule,
                        LayoutComponentRendererSADirective,
                    ], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let type of options?.children\">\n    <ng-template [layoutComponentRenderer]=\"type\"></ng-template>\n</ng-container>", styles: [":host{display: flex;}"] }]
        }] });
//# sourceMappingURL=stackPanel.component.js.map