import { __awaiter } from "tslib";
import { ChangeDetectorRef, Directive, Input } from '@angular/core';
import { LayoutEditorMetadataExtractor } from '../../../services';
import * as i0 from "@angular/core";
import * as i1 from "../../../services";
/**
 * Base class for properties control
 */
export class PropertiesControlBase {
    //######################### constructor #########################
    constructor(_changeDetector, _extractor) {
        this._changeDetector = _changeDetector;
        this._extractor = _extractor;
        //######################### protected fields #########################
        /**
         * Indication whether was component initialized or not
         */
        this._initialized = false;
        /**
         * @inheritdoc
         */
        this.propertiesMetadata = null;
    }
    //######################### public methods - implementation of OnInit #########################
    /**
     * Initialize component
     */
    ngOnInit() {
        return __awaiter(this, void 0, void 0, function* () {
            if (this._initialized) {
                return;
            }
            this._initialized = true;
            yield this._initialize();
        });
    }
    //######################### public methods - implementation of PropertiesControl #########################
    /**
     * @inheritdoc
     */
    initialize() {
        return __awaiter(this, void 0, void 0, function* () {
            yield this.ngOnInit();
        });
    }
    /**
     * @inheritdoc
     */
    invalidateVisuals() {
        this._changeDetector.detectChanges();
    }
    //######################### protected methods #########################
    /**
     * Use this method for initialization of component
     */
    _initialize() {
    }
}
PropertiesControlBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PropertiesControlBase, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.LayoutEditorMetadataExtractor }], target: i0.ɵɵFactoryTarget.Directive });
PropertiesControlBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: PropertiesControlBase, inputs: { form: "form", propertiesMetadata: "propertiesMetadata" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PropertiesControlBase, decorators: [{
            type: Directive
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.LayoutEditorMetadataExtractor }], propDecorators: { form: [{
                type: Input
            }], propertiesMetadata: [{
                type: Input
            }] } });
//# sourceMappingURL=propertiesControlBase.js.map