import { __decorate } from "tslib";
import { Component, ChangeDetectionStrategy, Input } from '@angular/core';
import { LayoutComponentBase } from '@anglr/dynamic/layout';
import { 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 { HtmlBlockLayoutMetadataLoader, HtmlBlockRelationsMetadataLoader } from './htmlBlock.metadata';
import * as i0 from "@angular/core";
/**
 * Component used for displaying html block
 */
let HtmlBlockSAComponent = class HtmlBlockSAComponent extends LayoutComponentBase {
    //######################### public methods - implementation of OnChanges #########################
    /**
     * @inheritdoc
     */
    async ngOnChanges(changes) {
        await super.ngOnChanges(changes);
        if (nameof('content') in changes) {
            this.componentElement.nativeElement.innerHTML = this.content ?? '';
        }
    }
    //######################### protected - overrides #########################
    /**
     * @inheritdoc
     */
    onOptionsSet() {
        if (!this.initialized) {
            return;
        }
        if (this.options?.content) {
            this.content = this.options.content;
            this.componentElement.nativeElement.innerHTML = this.content ?? '';
        }
    }
};
HtmlBlockSAComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: HtmlBlockSAComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
HtmlBlockSAComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.4", type: HtmlBlockSAComponent, isStandalone: true, selector: "html-block", inputs: { content: "content" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, styles: [":host{display: block;}"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
HtmlBlockSAComponent = __decorate([
    DebugData({
        inputs: [
            nameof('content'),
        ],
    }),
    RelationsEditorMetadata(HtmlBlockRelationsMetadataLoader),
    LayoutEditorMetadata(HtmlBlockLayoutMetadataLoader)
], HtmlBlockSAComponent);
export { HtmlBlockSAComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: HtmlBlockSAComponent, decorators: [{
            type: Component,
            args: [{ selector: 'html-block', template: '', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display: block;}"] }]
        }], propDecorators: { content: [{
                type: Input
            }] } });
//# sourceMappingURL=htmlBlock.component.js.map