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";
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: i8.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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2VuZGVyLWVkaXQuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Byb3BlcnR5LWVkaXQvZ2VuZGVyLWVkaXQvZ2VuZGVyLWVkaXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Byb3BlcnR5LWVkaXQvZ2VuZGVyLWVkaXQvZ2VuZGVyLWVkaXQuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLHVCQUF1QixFQUFFLFNBQVMsRUFBRSxXQUFXLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFOUUsT0FBTyxFQUFDLG9CQUFvQixFQUFDLE1BQU0sMkJBQTJCLENBQUM7Ozs7Ozs7Ozs7QUFRL0QsTUFBTSxPQUFPLG1CQUFvQixTQUFRLG9CQUFvQjtJQU43RDs7UUFPd0Msc0JBQWlCLEdBQUcsSUFBSSxDQUFDO0tBSWhFO0lBSEMsSUFBbUMsYUFBYTtR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