@c8y/ng1-modules 1020.0.15 → 1020.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,30 @@
1
1
  <div
2
- sf-array="form"
3
2
  class="schema-form-array {{ form.htmlClass }}"
3
+ sf-array="form"
4
4
  ng-model="$$value$$"
5
5
  ng-model-options="form.ngModelOptions"
6
+ ng-init="visibleItems = 10"
6
7
  >
7
- <label class="control-label" ng-show="showTitle()">{{ form.title | translate }}</label>
8
- <ol class="list-unstyled" ng-model="modelArray">
8
+ <label
9
+ class="control-label"
10
+ ng-show="showTitle()"
11
+ >
12
+ {{ form.title | translate }}
13
+ </label>
14
+ <ol
15
+ class="list-unstyled"
16
+ ng-model="modelArray"
17
+ >
9
18
  <!--
10
19
  Removed ui-sortable, i suppose we don't use this
11
20
  anywhere and it only brings confusion to the UI
12
21
 
13
22
  ui-sortable="form.uiSortable || ''"
14
23
  -->
15
- <li class="{{ form.fieldHtmlClass }}" ng-repeat="item in modelArray track by $index">
24
+ <li
25
+ class="{{ form.fieldHtmlClass }}"
26
+ ng-repeat="item in modelArray.slice(0, visibleItems) track by $index"
27
+ >
16
28
  <div class="d-flex a-i-start">
17
29
  <sf-decorator
18
30
  class="flex-grow"
@@ -21,27 +33,49 @@
21
33
  ></sf-decorator>
22
34
  <div class="a-s-start">
23
35
  <button
36
+ class="btn btn-link"
24
37
  title="{{ 'Delete' | translate }}"
38
+ type="button"
25
39
  ng-hide="form.readonly || form.remove === null"
26
40
  ng-click="deleteFromArray($index)"
27
- type="button"
28
- class="btn btn-link"
29
41
  >
30
- <span aria-hidden="true" c8y-icon="minus-circle" class="text-danger"></span>
42
+ <span
43
+ class="text-danger"
44
+ c8y-icon="minus-circle"
45
+ aria-hidden="true"
46
+ ></span>
31
47
  </button>
32
48
  </div>
33
49
  </div>
34
50
  </li>
35
51
  </ol>
52
+
53
+ <div
54
+ class="p-t-8 p-b-8"
55
+ ng-show="visibleItems < modelArray.length"
56
+ >
57
+ <button
58
+ class="btn-default btn btn-block m-b-16 d-block"
59
+ style="border: 1px solid"
60
+ type="button"
61
+ ng-click="visibleItems = visibleItems + 10"
62
+ >
63
+ <i c8y-icon="repeat"></i>
64
+ <span>{{ 'Load more' | translate }}</span>
65
+ </button>
66
+ </div>
36
67
  <div class="p-t-8 p-b-8">
37
68
  <button
69
+ class="btn btn-xs {{ form.style.add || 'btn-default' }}"
38
70
  title="{{ form.add || 'Add' | translate }}"
71
+ type="button"
39
72
  ng-hide="form.readonly || form.add === null"
40
73
  ng-click="appendToArray()"
41
- type="button"
42
- class="btn btn-xs {{ form.style.add || 'btn-default' }}"
43
74
  >
44
- <i c8y-icon="plus" class="m-r-4"></i>
75
+ <i
76
+ class="m-r-4"
77
+ c8y-icon="plus"
78
+ ></i>
45
79
  {{ form.add || 'Add' | translate }}
46
80
  </button>
47
81
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c8y/ng1-modules",
3
- "version": "1020.0.15",
3
+ "version": "1020.0.17",
4
4
  "license": "Apache-2.0",
5
5
  "author": "Cumulocity",
6
6
  "description": "AngularJS modules for Cumulocity IoT applications.",