import { 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/core";
import * as i5 from "@angular/material/select";
import * as i6 from "@aztrix/icons";
import * as i7 from "@aztrix/components/clear-button";
import * as i8 from "@aztrix/helpers";
export const ORGANISATION_TYPES = ['professional', 'company', 'non-profit'];
export class OrganisationTypeEditComponent extends AbstractPropertyEdit {
    constructor() {
        super(...arguments);
        this.types = ORGANISATION_TYPES;
    }
    get showIconClass() {
        return this.showIcon;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrganisationTypeEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: OrganisationTypeEditComponent, selector: "ax-organisation-type-edit", host: { properties: { "class.showIcon": "this.showIconClass" } }, usesInheritance: true, ngImport: i0, template: "<ax-icon\n  *ngIf=\"showIcon\"\n  class=\"icon type-icon\"\n  [name]=\"PropertyType.ORGANISATION_TYPE | propertyIcon\"\n></ax-icon>\n<mat-form-field\n  appearance=\"outline\"\n  class=\"c-input\"\n  [ngClass]=\"{readonly: readonly}\"\n  style=\"width: 100%\"\n  [subscriptSizing]=\"subscriptSizing\"\n>\n  <mat-label>\n    {{ customLabel === '' ? (type | propertyTypeLabel) : customLabel\n    }}<span *ngIf=\"required\">*</span>\n  </mat-label>\n  <mat-select\n    disableOptionCentering\n    [placeholder]=\"PropertyType.ORGANISATION_TYPE | propertyTypeLabel\"\n    [formControl]=\"form.get('value')\"\n  >\n    <mat-option *ngFor=\"let type of types\" [value]=\"type\">\n      {{ 'property.organisation-type.' + type | translate }}\n    </mat-option>\n  </mat-select>\n  <mat-hint *ngIf=\"hint\" class=\"hint\" align=\"end\">\n    <span>{{ hint }}</span>\n  </mat-hint>\n  <mat-error>\n    <ax-icon name=\"alert-circle\"></ax-icon>\n    {{\n      'property.validation.required'\n        | translate: {propertyType: 'property.CATEGORY.label' | translate}\n    }}\n  </mat-error>\n  <ax-clear-button *ngIf=\"form.value && !readonly\" [form]=\"form\" matSuffix></ax-clear-button>\n</mat-form-field>\n", styles: [".type-icon{margin-top:20px}\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.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: "component", type: i3.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i3.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i3.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i4.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i5.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i6.IconComponent, selector: "ax-icon", inputs: ["name", "inline"] }, { 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" }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: OrganisationTypeEditComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-organisation-type-edit', template: "<ax-icon\n  *ngIf=\"showIcon\"\n  class=\"icon type-icon\"\n  [name]=\"PropertyType.ORGANISATION_TYPE | propertyIcon\"\n></ax-icon>\n<mat-form-field\n  appearance=\"outline\"\n  class=\"c-input\"\n  [ngClass]=\"{readonly: readonly}\"\n  style=\"width: 100%\"\n  [subscriptSizing]=\"subscriptSizing\"\n>\n  <mat-label>\n    {{ customLabel === '' ? (type | propertyTypeLabel) : customLabel\n    }}<span *ngIf=\"required\">*</span>\n  </mat-label>\n  <mat-select\n    disableOptionCentering\n    [placeholder]=\"PropertyType.ORGANISATION_TYPE | propertyTypeLabel\"\n    [formControl]=\"form.get('value')\"\n  >\n    <mat-option *ngFor=\"let type of types\" [value]=\"type\">\n      {{ 'property.organisation-type.' + type | translate }}\n    </mat-option>\n  </mat-select>\n  <mat-hint *ngIf=\"hint\" class=\"hint\" align=\"end\">\n    <span>{{ hint }}</span>\n  </mat-hint>\n  <mat-error>\n    <ax-icon name=\"alert-circle\"></ax-icon>\n    {{\n      'property.validation.required'\n        | translate: {propertyType: 'property.CATEGORY.label' | translate}\n    }}\n  </mat-error>\n  <ax-clear-button *ngIf=\"form.value && !readonly\" [form]=\"form\" matSuffix></ax-clear-button>\n</mat-form-field>\n", styles: [".type-icon{margin-top:20px}\n", ":host .type-icon{display:none}:host.showIcon{display:grid;grid-template-columns:38px 1fr}:host.showIcon .type-icon{display:inline}\n"] }]
        }], propDecorators: { showIconClass: [{
                type: HostBinding,
                args: ['class.showIcon']
            }] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JnYW5pc2F0aW9uLXR5cGUtZWRpdC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvcHJvcGVydHktZWRpdC9vcmdhbmlzYXRpb24tdHlwZS1lZGl0L29yZ2FuaXNhdGlvbi10eXBlLWVkaXQuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3Byb3BlcnR5LWVkaXQvb3JnYW5pc2F0aW9uLXR5cGUtZWRpdC9vcmdhbmlzYXRpb24tdHlwZS1lZGl0LmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxTQUFTLEVBQUUsV0FBVyxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBRXJELE9BQU8sRUFBQyxvQkFBb0IsRUFBQyxNQUFNLDJCQUEyQixDQUFDOzs7Ozs7Ozs7O0FBRS9ELE1BQU0sQ0FBQyxNQUFNLGtCQUFrQixHQUFHLENBQUMsY0FBYyxFQUFFLFNBQVMsRUFBRSxZQUFZLENBQUMsQ0FBQztBQU81RSxNQUFNLE9BQU8sNkJBQThCLFNBQVEsb0JBQW9CO0lBTHZFOztRQU1FLFVBQUssR0FBRyxrQkFBa0IsQ0FBQztLQUs1QjtJQUhDLElBQW1DLGFBQWE7UUFDOUMsT0FBTyxJQUFJLENBQUMsUUFBUSxDQUFDO0lBQ3ZCLENBQUM7K0dBTFUsNkJBQTZCO21HQUE3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