3 ~ ============LICENSE_START=======================================================
4 ~ Copyright (C) 2022 Nordix Foundation.
5 ~ ================================================================================
6 ~ Licensed under the Apache License, Version 2.0 (the "License");
7 ~ you may not use this file except in compliance with the License.
8 ~ You may obtain a copy of the License at
10 ~ http://www.apache.org/licenses/LICENSE-2.0
12 ~ Unless required by applicable law or agreed to in writing, software
13 ~ distributed under the License is distributed on an "AS IS" BASIS,
14 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 ~ See the License for the specific language governing permissions and
16 ~ limitations under the License.
18 ~ SPDX-License-Identifier: Apache-2.0
19 ~ ============LICENSE_END=========================================================
22 <li [class.root]="isRoot()">
23 <span class="input-info">
24 <em class="sprite-new round-expand-icon" [class.open]="isExpanded" (click)="expandAndCollapse()"></em>
25 <label class="input-label">{{name}}:</label> <em data-tests-id="input-type">{{resolveType()}}</em>
26 <span class="sprite-new delete-btn" *ngIf="showInputDelete()" (click)="onInputDelete()"></span>
27 <span class="sprite-new delete-btn" *ngIf="showListItemDelete()" (click)="onChildListItemDelete()"></span>
30 <ng-container *ngIf="isExpanded && showToscaFunctionOption">
32 <fieldset [disabled]="isViewOnly" >
33 <input type="radio" name="hasGetFunctionValue"
34 [(ngModel)]="isToscaFunction"
36 (change)="onValueTypeChange()"/> Value
37 <input type="radio" name="hasGetFunctionValue"
38 [(ngModel)]="isToscaFunction"
39 [value]="true"/> {{'TOSCA_FUNCTION_LABEL' | translate}}
42 <div *ngIf="isToscaFunction">
45 <div *ngIf="componentInstanceMap">
49 [componentInstanceMap]="componentInstanceMap"
50 (onValidityChange)="onToscaFunctionValidityChange($event)">
53 <div *ngIf="!componentInstanceMap">
57 (onValidityChange)="onToscaFunctionValidityChange($event)">
65 <div *ngIf="!isToscaFunction">
66 <ng-container *ngIf="isTypeSimple(type.name)">
67 <ul *ngIf="isExpanded">
68 <li class="input-value">
69 <ng-container *ngIf="isViewOnly">
70 {{valueObjRef}}<em class="empty-value" *ngIf="valueObjRef !== false && !valueObjRef">empty</em>
72 <input *ngIf="!isViewOnly" [type]="getSimpleValueInputType()" name="value"
73 [(ngModel)]="valueObjRef"
74 (ngModelChange)="onValueChange($event)"
79 <ng-container *ngIf="isTypeComplex(type.name)" >
80 <ul *ngIf="isExpanded">
81 <ng-container *ngFor="let property of this.type.properties">
83 [name]="property.name"
84 [type]="getDataType(property.type)"
85 [dataTypeMap]="dataTypeMap"
86 [valueObjRef]="valueObjRef[property.name]"
87 [schema]="property.schema"
88 [nestingLevel]="nestingLevel + 1"
89 [isViewOnly]="isViewOnly"
90 [showToscaFunctionOption]="showToscaFunctionOption"
91 [allowDeletion]="allowDeletion"
92 (onValueChange)="onPropertyValueChange($event)">
93 </app-input-list-item>
97 <ng-container *ngIf="isTypeList(type.name)">
98 <ul *ngIf="isExpanded">
99 <ng-container *ngFor="let value1 of valueObjRef; index as i; trackBy: trackByIndex">
100 <li class="input-value" *ngIf="isTypeSimple(schema.property.type)">
101 <ng-container *ngIf="isViewOnly">
104 <input type="text" *ngIf="!isViewOnly"
105 [(ngModel)]="valueObjRef[i]" (ngModelChange)="onListValueChange()" />
106 <span class="sprite-new delete-btn" *ngIf="!isViewOnly" (click)="onListItemDelete(i)"></span>
108 <app-input-list-item *ngIf="!isTypeSimple(schema.property.type)"
110 [type]="getDataType(schema.property.type)"
111 [dataTypeMap]="dataTypeMap"
112 [valueObjRef]="valueObjRef[i]"
114 [nestingLevel]="nestingLevel + 1"
117 [isViewOnly]="isViewOnly"
118 [allowDeletion]="allowDeletion"
119 (onValueChange)="onPropertyValueChange($event)"
120 (onChildListItemDelete)="onListItemDelete($event)">
121 </app-input-list-item>
123 <li class="input-value" *ngIf="!isViewOnly">
124 <a class="add-btn" (click)="addListElement()">{{'INPUT_LIST_ADD_LIST_ENTRY' | translate}}</a>
128 <ng-container *ngIf="isTypeMap(type.name)">
129 <ul *ngIf="isExpanded">
130 <ng-container *ngFor="let key of getObjectEntries(valueObjRef); index as i">
131 <li class="input-value" *ngIf="isTypeSimple(schema.property.type)">
132 <label class="input-label">{{key}}:</label>
133 <ng-container *ngIf="isViewOnly">
136 <input type="text" *ngIf="!isViewOnly" [(ngModel)]="valueObjRef[key]" (ngModelChange)="onMapValueChange()"/>
137 <span class="sprite-new delete-btn" *ngIf="!isViewOnly" (click)="onMapKeyDelete(key)"></span>
140 *ngIf="!isTypeSimple(schema.property.type)"
142 [type]="getDataType(schema.property.type)"
143 [dataTypeMap]="dataTypeMap"
144 [valueObjRef]="valueObjRef[key]"
147 [nestingLevel]="nestingLevel + 1"
148 [isViewOnly]="isViewOnly"
149 [allowDeletion]="allowDeletion"
150 (onValueChange)="onPropertyValueChange($event)"
151 (onDelete)="onMapKeyDelete($event)">
152 </app-input-list-item>
154 <li class="input-value" *ngIf="!isViewOnly">
155 <input type="text" [(ngModel)]="mapEntryName" placeholder="{{ 'INPUT_LIST_MAP_KEY_PLACEHOLDER' | translate }}"/>
156 <a class="add-btn" (click)="addMapEntry()">{{ 'INPUT_LIST_ADD_MAP_ENTRY' | translate }}</a>