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>
29 <ng-container *ngIf="isTypeSimple(type.name)">
30 <ul *ngIf="isExpanded">
31 <li class="input-value">
32 <ng-container *ngIf="isViewOnly">
33 {{valueObjRef}}<em class="empty-value" *ngIf="!valueObjRef">empty</em>
35 <input *ngIf="!isViewOnly" [type]="getSimpleValueInputType()" name="value"
36 [(ngModel)]="valueObjRef"
37 (ngModelChange)="onValueChange($event)"
42 <ng-container *ngIf="isTypeComplex(type.name)" >
43 <ul *ngIf="isExpanded">
44 <ng-container *ngFor="let property of this.type.properties">
46 [name]="property.name"
47 [type]="getDataType(property.type)"
48 [dataTypeMap]="dataTypeMap"
49 [valueObjRef]="valueObjRef[property.name]"
50 [schema]="property.schema"
51 [nestingLevel]="nestingLevel + 1"
52 [isViewOnly]="isViewOnly"
53 (onValueChange)="onPropertyValueChange($event)">
54 </app-input-list-item>
58 <ng-container *ngIf="isTypeList(type.name)">
59 <ul *ngIf="isExpanded">
60 <ng-container *ngFor="let value1 of valueObjRef; index as i; trackBy: trackByIndex">
61 <li class="input-value" *ngIf="isTypeSimple(schema.property.type)">
62 <ng-container *ngIf="isViewOnly">
65 <input type="text" *ngIf="!isViewOnly"
66 [(ngModel)]="valueObjRef[i]" (ngModelChange)="onListValueChange()" />
67 <span class="sprite-new delete-btn" *ngIf="!isViewOnly" (click)="onListItemDelete(i)"></span>
69 <app-input-list-item *ngIf="!isTypeSimple(schema.property.type)"
71 [type]="getDataType(schema.property.type)"
72 [dataTypeMap]="dataTypeMap"
73 [valueObjRef]="valueObjRef[i]"
75 [nestingLevel]="nestingLevel + 1"
78 [isViewOnly]="isViewOnly"
79 (onValueChange)="onPropertyValueChange($event)"
80 (onChildListItemDelete)="onListItemDelete($event)">
81 </app-input-list-item>
83 <li class="input-value" *ngIf="!isViewOnly">
84 <a class="add-btn" (click)="addListElement()">{{'INPUT_LIST_ADD_LIST_ENTRY' | translate}}</a>
88 <ng-container *ngIf="isTypeMap(type.name)">
89 <ul *ngIf="isExpanded">
90 <ng-container *ngFor="let key of getObjectEntries(valueObjRef); index as i">
91 <li class="input-value" *ngIf="isTypeSimple(schema.property.type)">
92 <label class="input-label">{{key}}:</label>
93 <ng-container *ngIf="isViewOnly">
96 <input type="text" *ngIf="!isViewOnly" [(ngModel)]="valueObjRef[key]" (ngModelChange)="onMapValueChange()"/>
97 <span class="sprite-new delete-btn" *ngIf="!isViewOnly" (click)="onMapKeyDelete(key)"></span>
100 *ngIf="!isTypeSimple(schema.property.type)"
102 [type]="getDataType(schema.property.type)"
103 [dataTypeMap]="dataTypeMap"
104 [valueObjRef]="valueObjRef[key]"
107 [nestingLevel]="nestingLevel + 1"
108 [isViewOnly]="isViewOnly"
109 (onValueChange)="onPropertyValueChange($event)"
110 (onDelete)="onMapKeyDelete($event)">
111 </app-input-list-item>
113 <li class="input-value" *ngIf="!isViewOnly">
114 <input type="text" [(ngModel)]="mapEntryName" placeholder="{{ 'INPUT_LIST_MAP_KEY_PLACEHOLDER' | translate }}"/>
115 <a class="add-btn" (click)="addMapEntry()">{{ 'INPUT_LIST_ADD_MAP_ENTRY' | translate }}</a>