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 !== false && !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 [allowDeletion]="allowDeletion"
54 (onValueChange)="onPropertyValueChange($event)">
55 </app-input-list-item>
59 <ng-container *ngIf="isTypeList(type.name)">
60 <ul *ngIf="isExpanded">
61 <ng-container *ngFor="let value1 of valueObjRef; index as i; trackBy: trackByIndex">
62 <li class="input-value" *ngIf="isTypeSimple(schema.property.type)">
63 <ng-container *ngIf="isViewOnly">
66 <input type="text" *ngIf="!isViewOnly"
67 [(ngModel)]="valueObjRef[i]" (ngModelChange)="onListValueChange()" />
68 <span class="sprite-new delete-btn" *ngIf="!isViewOnly" (click)="onListItemDelete(i)"></span>
70 <app-input-list-item *ngIf="!isTypeSimple(schema.property.type)"
72 [type]="getDataType(schema.property.type)"
73 [dataTypeMap]="dataTypeMap"
74 [valueObjRef]="valueObjRef[i]"
76 [nestingLevel]="nestingLevel + 1"
79 [isViewOnly]="isViewOnly"
80 [allowDeletion]="allowDeletion"
81 (onValueChange)="onPropertyValueChange($event)"
82 (onChildListItemDelete)="onListItemDelete($event)">
83 </app-input-list-item>
85 <li class="input-value" *ngIf="!isViewOnly">
86 <a class="add-btn" (click)="addListElement()">{{'INPUT_LIST_ADD_LIST_ENTRY' | translate}}</a>
90 <ng-container *ngIf="isTypeMap(type.name)">
91 <ul *ngIf="isExpanded">
92 <ng-container *ngFor="let key of getObjectEntries(valueObjRef); index as i">
93 <li class="input-value" *ngIf="isTypeSimple(schema.property.type)">
94 <label class="input-label">{{key}}:</label>
95 <ng-container *ngIf="isViewOnly">
98 <input type="text" *ngIf="!isViewOnly" [(ngModel)]="valueObjRef[key]" (ngModelChange)="onMapValueChange()"/>
99 <span class="sprite-new delete-btn" *ngIf="!isViewOnly" (click)="onMapKeyDelete(key)"></span>
102 *ngIf="!isTypeSimple(schema.property.type)"
104 [type]="getDataType(schema.property.type)"
105 [dataTypeMap]="dataTypeMap"
106 [valueObjRef]="valueObjRef[key]"
109 [nestingLevel]="nestingLevel + 1"
110 [isViewOnly]="isViewOnly"
111 [allowDeletion]="allowDeletion"
112 (onValueChange)="onPropertyValueChange($event)"
113 (onDelete)="onMapKeyDelete($event)">
114 </app-input-list-item>
116 <li class="input-value" *ngIf="!isViewOnly">
117 <input type="text" [(ngModel)]="mapEntryName" placeholder="{{ 'INPUT_LIST_MAP_KEY_PLACEHOLDER' | translate }}"/>
118 <a class="add-btn" (click)="addMapEntry()">{{ 'INPUT_LIST_ADD_MAP_ENTRY' | translate }}</a>