import { ChangeDetectionStrategy, Component, HostBinding } from '@angular/core';
import { AbstractPropertyEdit } from '../abstract-property-edit';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "@angular/material/form-field";
import * as i4 from "@angular/material/radio";
import * as i5 from "@aztrix/icons";
import * as i6 from "../property-error/property-error.component";
import * as i7 from "@aztrix/components/clear-button";
import * as i8 from "@aztrix/helpers";
import * as i9 from "@aztrix/translate";
export class GenderEditComponent extends AbstractPropertyEdit {
    constructor() {
        super(...arguments);
        this.propertyEditClass = true;
    }
    get showIconClass() {
        return this.showIcon;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GenderEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: GenderEditComponent, selector: "ax-gender-edit", host: { properties: { "class.c-property-edit": "this.propertyEditClass", "class.showIcon": "this.showIconClass" } }, usesInheritance: true, ngImport: i0, template: "<ax-icon\n  *ngIf=\"showIcon\"\n  class=\"icon type-icon\"\n  [name]=\"PropertyType.GENDER | propertyIcon\"\n></ax-icon>\n<div>\n  <div class=\"header\">\n    <div class=\"title\">\n      <label class=\"label\"\n        >{{ customLabel === '' ? (form.getRawValue() | propertyTypeLabel) : customLabel\n        }}<span *ngIf=\"required\">&nbsp;*</span></label\n      >\n    </div>\n    <ax-clear-button\n      matSuffix\n      [form]=\"valueControl\"\n      *ngIf=\"hasValue && !valueControl.disabled && !readonly\"\n    ></ax-clear-button>\n  </div>\n  <mat-radio-group\n    [name]=\"getName()\"\n    class=\"radio\"\n    [ngClass]=\"{readonly: readonly}\"\n    [formControl]=\"valueControl\"\n  >\n    <mat-radio-button value=\"M\" class=\"radio-item\" type=\"radio\">\n      {{ 'label.male' | translate }}\n    </mat-radio-button>\n    <mat-radio-button value=\"F\" class=\"radio-item\" type=\"radio\">\n      {{ 'label.female' | translate }}\n    </mat-radio-button>\n  </mat-radio-group>\n\n  <mat-hint class=\"hint\" align=\"end\">\n    {{ hint }}\n  </mat-hint>\n\n  <ax-property-error *ngIf=\"valueControl.touched\" [form]=\"form\"></ax-property-error>\n</div>\n", styles: [":host{position:relative}:host ::ng-deep ax-clear-button{height:20px}.radio{display:flex;flex-direction:column;margin-top:.5rem}.radio.readonly{pointer-events:none}.radio.readonly .radio-item:not(.mat-mdc-radio-checked){--mdc-radio-unselected-icon-color: rgba(0, 0, 0, .25);--mdc-form-field-label-text-color: rgba(0, 0, 0, .5)}.radio-item{padding-bottom:.5rem}.radio-item:last-child{padding-bottom:0}.header{display:flex;justify-content:space-between}.header button{margin:-6px 0}.title{display:flex;align-items:center}\n", ":host .type-icon{display:none}:host.showIcon{display:grid;grid-template-columns:38px 1fr}:host.showIcon .type-icon{display:inline}\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.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i4.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i4.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: i5.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { kind: "component", type: i6.PropertyErrorComponent, selector: "ax-property-error", inputs: ["form", "label"] }, { kind: "component", type: i7.ClearButtonComponent, selector: "ax-clear-button", inputs: ["form"] }, { kind: "pipe", type: i8.PropertyTypeLabelPipe, name: "propertyTypeLabel" }, { kind: "pipe", type: i8.PropertyIconPipe, name: "propertyIcon" }, { kind: "pipe", type: i9.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: GenderEditComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-gender-edit', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ax-icon\n  *ngIf=\"showIcon\"\n  class=\"icon type-icon\"\n  [name]=\"PropertyType.GENDER | propertyIcon\"\n></ax-icon>\n<div>\n  <div class=\"header\">\n    <div class=\"title\">\n      <label class=\"label\"\n        >{{ customLabel === '' ? (form.getRawValue() | propertyTypeLabel) : customLabel\n        }}<span *ngIf=\"required\">&nbsp;*</span></label\n      >\n    </div>\n    <ax-clear-button\n      matSuffix\n      [form]=\"valueControl\"\n      *ngIf=\"hasValue && !valueControl.disabled && !readonly\"\n    ></ax-clear-button>\n  </div>\n  <mat-radio-group\n    [name]=\"getName()\"\n    class=\"radio\"\n    [ngClass]=\"{readonly: readonly}\"\n    [formControl]=\"valueControl\"\n  >\n    <mat-radio-button value=\"M\" class=\"radio-item\" type=\"radio\">\n      {{ 'label.male' | translate }}\n    </mat-radio-button>\n    <mat-radio-button value=\"F\" class=\"radio-item\" type=\"radio\">\n      {{ 'label.female' | translate }}\n    </mat-radio-button>\n  </mat-radio-group>\n\n  <mat-hint class=\"hint\" align=\"end\">\n    {{ hint }}\n  </mat-hint>\n\n  <ax-property-error *ngIf=\"valueControl.touched\" [form]=\"form\"></ax-property-error>\n</div>\n", styles: [":host{position:relative}:host ::ng-deep ax-clear-button{height:20px}.radio{display:flex;flex-direction:column;margin-top:.5rem}.radio.readonly{pointer-events:none}.radio.readonly .radio-item:not(.mat-mdc-radio-checked){--mdc-radio-unselected-icon-color: rgba(0, 0, 0, .25);--mdc-form-field-label-text-color: rgba(0, 0, 0, .5)}.radio-item{padding-bottom:.5rem}.radio-item:last-child{padding-bottom:0}.header{display:flex;justify-content:space-between}.header button{margin:-6px 0}.title{display:flex;align-items:center}\n", ":host .type-icon{display:none}:host.showIcon{display:grid;grid-template-columns:38px 1fr}:host.showIcon .type-icon{display:inline}\n"] }]
        }], propDecorators: { propertyEditClass: [{
                type: HostBinding,
                args: ['class.c-property-edit']
            }], showIconClass: [{
                type: HostBinding,
                args: ['class.showIcon']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZGVyLWVkaXQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Byb3BlcnR5LWVkaXQvZ2VuZGVyLWVkaXQvZ2VuZGVyLWVkaXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Byb3BlcnR5LWVkaXQvZ2VuZGVyLWVkaXQvZ2VuZGVyLWVkaXQuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFOUUsT0FBTyxFQUFDLG9CQUFvQixFQUFDLE1BQU0sMkJBQTJCLENBQUM7Ozs7Ozs7Ozs7O0FBUS9ELE1BQU0sT0FBTyxtQkFBb0IsU0FBUSxvQkFBb0I7SUFON0Q7O1FBT3dDLHNCQUFpQixHQUFHLElBQUksQ0FBQztLQUloRTtJQUhD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