<!--
  ~ Licensed to the Apache Software Foundation (ASF) under one or more
  ~ contributor license agreements.  See the NOTICE file distributed with
  ~ this work for additional information regarding copyright ownership.
  ~ The ASF licenses this file to You under the Apache License, Version 2.0
  ~ (the "License"); you may not use this file except in compliance with
  ~ the License.  You may obtain a copy of the License at
  ~
  ~    http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<div id="formWrapper" fxFlex="100" fxLayout="column">
    <div fxFlex fxLayout="column" class="content">
        <div>
            <mat-radio-group  *ngIf="staticProperty.alternatives.length > 1"
                    class="radio-group" (change)="radioSelectionChange($event)" required>
                <mat-radio-button *ngFor="let alternative of staticProperty.alternatives" class="radio-button"
                                  [value]="alternative" [checked]="alternative.selected" [matTooltip]="alternative.description">
                    <label style="font-weight: normal;">
                        {{alternative.label}}
                    </label>
                </mat-radio-button>
            </mat-radio-group>

            <!-- TODO: Remove hack -->
            <mat-checkbox *ngIf="staticProperty.alternatives.length === 1"
                          [(ngModel)]="staticProperty.alternatives[0].selected">
                {{staticProperty.alternatives[0].label}}
            </mat-checkbox>

        </div>

        <div *ngFor="let alternative of staticProperty.alternatives; let i = index">
            <div *ngIf="alternative.selected == true && alternative.staticProperty != null">
                <div style="padding-top: 0px; padding-bottom: 0px;
                                                   padding-left: 10px; padding-right: 10px">
                    <app-static-property [adapterId]="adapterId"
                                         [eventSchemas]="eventSchemas"
                                         [parentForm]="parentForm"
                                         [staticProperties]="staticProperties"
                                         [fieldName]="fieldName + '-'  + alternative.staticProperty.internalName + '-' + i"
                                         [staticProperty]="alternative.staticProperty"
                                         [displayRecommended]="displayRecommended"
                                         (validateEmitter)="valueChange($event)"
                                         class="test fullWidth">
                    </app-static-property>
                </div>
            </div>
        </div>


    </div>


</div>