2 ~ Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
4 ~ Licensed under the Apache License, Version 2.0 (the "License");
5 ~ you may not use this file except in compliance with the License.
6 ~ You may obtain a copy of the License at
8 ~ http://www.apache.org/licenses/LICENSE-2.0
10 ~ Unless required by applicable law or agreed to in writing, software
11 ~ distributed under the License is distributed on an "AS IS" BASIS,
12 ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ~ See the License for the specific language governing permissions and
14 ~ limitations under the License.
19 <div data-ng-if="!isSchemaTypeDataType">
20 <div class="i-sdc-form-item list-new-item" data-ng-class="{error:(parentFormObj['listNewItem'+fieldsPrefixName].$dirty && parentFormObj['listNewItem'+fieldsPrefixName].$invalid)}">
21 <input class="i-sdc-form-input"
22 data-tests-id="listNewItem{{fieldsPrefixName}}"
23 ng-if="!constraints && !((schemaProperty.simpleType||schemaProperty.type) == 'boolean')"
24 data-ng-disabled="readOnly"
25 data-ng-model="listNewItem.value"
27 name="listNewItem{{fieldsPrefixName}}"
28 data-ng-pattern="getValidationPattern((schemaProperty.simpleType||schemaProperty.type))"
29 data-ng-model-options="{ debounce: 200 }"
30 placeholder="Type a value and then click ADD"
31 data-ng-maxlength="maxLength"
32 maxlength="{{maxLength}}"
33 sdc-keyboard-events="" key-enter="schemaProperty.type && !parentFormObj['listNewItem'+fieldsPrefixName].$invalid && listNewItem.value && addListItem"
35 <select class="i-sdc-form-select"
36 data-tests-id="listNewItem{{fieldsPrefixName}}"
37 ng-if="!constraints && (schemaProperty.simpleType||schemaProperty.type) == 'boolean'"
38 data-ng-disabled="readOnly"
39 name="listNewItem{{fieldsPrefixName}}"
40 data-ng-model="listNewItem.value">
41 <option value="true">true</option>
42 <option value="false">false</option>
46 <select class="i-sdc-form-select"
47 data-tests-id="constraints"
49 data-ng-disabled="readOnly"
50 data-ng-model="listNewItem.value">
51 <!-- Get the default value in case exist -->
52 <option value = "{{listNewItem.value}" name = "{{listNewItem.value}}" hidden selected>
55 <!-- add all constratint to Select list -->
56 <option ng-repeat='value in constraints' value="{{value}}" name="{{value}}">
63 <div class="input-error" data-ng-show="parentFormObj['listNewItem'+fieldsPrefixName].$dirty && parentFormObj['listNewItem'+fieldsPrefixName].$invalid">
64 <span ng-show="parentFormObj['listNewItem'+fieldsPrefixName].$error.pattern" translate="PROPERTY_EDIT_PATTERN"></span>
65 <span ng-show="parentFormObj['listNewItem'+fieldsPrefixName].$error.maxlength" translate="VALIDATION_ERROR_MAX_LENGTH" translate-values="{'max': '{{maxLength}}' }"></span>
68 <div class="add-btn add-list-item" data-tests-id="add-list-item{{fieldsPrefixName}}"
69 data-ng-class="{'disabled': readOnly || !schemaProperty.type || parentFormObj['listNewItem'+fieldsPrefixName].$invalid || !listNewItem.value}" data-ng-click="addListItem()">Add</div>
70 <div class="list-value-items">
71 <span class="list-value-item" data-ng-repeat="value in valueObjRef track by $index">
73 <span ng-if="!readOnly" class="delete-list-item sprite-new small-x-button" data-ng-click="deleteListItem($index)"></span>
77 <div data-ng-if="isSchemaTypeDataType">
79 <div data-ng-repeat="value in valueObjRef track by $index" class="dt-list-item">
80 <span class="delete-dt-list-item" data-ng-click="deleteListItem($index)"></span>
81 <fields-structure value-obj-ref="valueObjRef[$index]"
82 type-name="schemaProperty.type"
83 parent-form-obj="parentFormObj"
84 fields-prefix-name="fieldsPrefixName+''+$index"
85 read-only="readOnly"></fields-structure>
87 <div class="add-btn add-list-item" data-tests-id="add-list-item"
88 data-ng-class="{'disabled': readOnly}" data-ng-click="listNewItem.value='{}';addListItem();">Add</div>