import { ChangeDetectorRef, Directive, Input } from '@angular/core';
import * as i0 from "@angular/core";
/**
 * Base class for property type control
 */
export class PropertyTypeControlBase {
    //######################### public properties - implementation of PropertyTypeControl #########################
    /**
     * @inheritdoc
     */
    get control() {
        return this._control;
    }
    set control(value) {
        this._control = value;
        this._controlSet();
    }
    //######################### constructor #########################
    constructor(_changeDetector) {
        this._changeDetector = _changeDetector;
        /**
         * Indication whether was component already initialized
         */
        this._initialized = false;
        /**
         * @inheritdoc
         */
        this.values = [];
    }
    //######################### public methods - implementation of OnInit #########################
    /**
     * Initialize component
     */
    async ngOnInit() {
        if (this._initialized) {
            return;
        }
        this._initialized = true;
        await this._initialize();
    }
    //######################### public methods - implementation of PropertyTypeControl #########################
    /**
     * @inheritdoc
     */
    async initialize() {
        await this.ngOnInit();
    }
    /**
     * @inheritdoc
     */
    invalidateVisuals() {
        this._changeDetector.detectChanges();
    }
    //######################### protected methods #########################
    /**
     * Use this method for initialization of component
     */
    _initialize() {
    }
    /**
     * When overriden allows to react to change of control
     */
    _controlSet() {
    }
}
PropertyTypeControlBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PropertyTypeControlBase, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
PropertyTypeControlBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.0.4", type: PropertyTypeControlBase, inputs: { control: "control", values: "values" }, ngImport: i0 });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.4", ngImport: i0, type: PropertyTypeControlBase, decorators: [{
            type: Directive
        }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { control: [{
                type: Input
            }], values: [{
                type: Input
            }] } });
//# sourceMappingURL=propertyTypeControlBase.js.map