import { ChangeDetectionStrategy, ChangeDetectorRef, Component, HostBinding, Input, } from '@angular/core';
import { AvatarType } from '@aztrix/components/avatar';
import { AbstractPropertyEdit } from '../abstract-property-edit';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/legacy-form-field";
import * as i3 from "@aztrix/icons";
import * as i4 from "@aztrix/components/avatar";
export class AvatarPropertyEditComponent extends AbstractPropertyEdit {
    constructor(_changeDetector) {
        super();
        this._changeDetector = _changeDetector;
        this.propertyEditClass = true;
        this.isIndividual = false;
        this.AvatarType = AvatarType;
        this.updateAvatar = (image) => {
            this.form.get('value').setValue(image ? image : null);
            this.markAsDirty();
            this._changeDetector.markForCheck();
        };
    }
}
AvatarPropertyEditComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AvatarPropertyEditComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
AvatarPropertyEditComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.1.5", type: AvatarPropertyEditComponent, selector: "ax-avatar-property-edit", inputs: { isIndividual: "isIndividual" }, host: { properties: { "class.c-property-edit": "this.propertyEditClass" } }, usesInheritance: true, ngImport: i0, template: "<ax-avatar-edit\n  [name]=\"getName()\"\n  [avatarURL]=\"form?.value?.value\"\n  [update]=\"updateAvatar\"\n  [canDelete]=\"form?.value.value\"\n  [delete]=\"updateAvatar\"\n  [type]=\"isIndividual ? AvatarType.INDIVIDUAL : AvatarType.INDIVIDUAL\"\n  [published]=\"published\"\n></ax-avatar-edit>\n<mat-hint\n  [ngClass]=\"{collapsed}\"\n  (click)=\"collapsed = !collapsed\"\n  class=\"hint collapsible\"\n  align=\"end\"\n  #hintElement\n>\n  <div>\n    <ax-icon *ngIf=\"isOverflowing()\" class=\"icon\" name=\"chevron-down\"></ax-icon>\n  </div>\n  <span [ngClass]=\"{overflowing: isOverflowing()}\">{{ hint }}</span>\n</mat-hint>\n", styles: [":host{display:block;padding-bottom:1rem}.hint{text-align:center}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2.MatLegacyHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i3.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: i4.AvatarEditComponent, selector: "ax-avatar-edit", inputs: ["name", "avatarURL", "canDelete", "delete", "type", "update", "published"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.5", ngImport: i0, type: AvatarPropertyEditComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-avatar-property-edit', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-avatar-edit\n  [name]=\"getName()\"\n  [avatarURL]=\"form?.value?.value\"\n  [update]=\"updateAvatar\"\n  [canDelete]=\"form?.value.value\"\n  [delete]=\"updateAvatar\"\n  [type]=\"isIndividual ? AvatarType.INDIVIDUAL : AvatarType.INDIVIDUAL\"\n  [published]=\"published\"\n></ax-avatar-edit>\n<mat-hint\n  [ngClass]=\"{collapsed}\"\n  (click)=\"collapsed = !collapsed\"\n  class=\"hint collapsible\"\n  align=\"end\"\n  #hintElement\n>\n  <div>\n    <ax-icon *ngIf=\"isOverflowing()\" class=\"icon\" name=\"chevron-down\"></ax-icon>\n  </div>\n  <span [ngClass]=\"{overflowing: isOverflowing()}\">{{ hint }}</span>\n</mat-hint>\n", styles: [":host{display:block;padding-bottom:1rem}.hint{text-align:center}\n"] }]
        }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { propertyEditClass: [{
                type: HostBinding,
                args: ['class.c-property-edit']
            }], isIndividual: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2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