nice-elements 1.14.0 → 1.14.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "description": "Nice elements used in olaii angular 1.x webapps.",
5
5
  "main": "dist/nice.js",
6
6
  "license": "MIT",
@@ -31,6 +31,11 @@
31
31
  .nice-alert-title {
32
32
  font-size: 1.2em;
33
33
  font-weight: bold;
34
+ margin-bottom: 3px;
35
+ }
36
+
37
+ .nice-alert-message {
38
+ line-height: 1.4;
34
39
  }
35
40
 
36
41
  &.nice-alert-success {
@@ -194,6 +194,7 @@
194
194
 
195
195
  &.between {
196
196
  background: var(--nice-primary-color-lighter);
197
+ color: white;
197
198
  }
198
199
 
199
200
  &:hover {
@@ -32,6 +32,7 @@
32
32
  width: 110px;
33
33
  display: flex;
34
34
  flex-direction: column;
35
+ flex-shrink: 0;
35
36
 
36
37
  @media (max-width: $screen-md-min) {
37
38
  width: auto;
@@ -11,9 +11,9 @@
11
11
  <input class="hidden-input" ng-model="model" ng-required="required" ng-disabled="disabled" tabindex="-1" />
12
12
  <div class="btn-dropdown-inside" ng-transclude="button" ng-if="selected != null">
13
13
  <span ng-if="!multiple">{{ selected[objValue] }}</span>
14
- <span ng-if="multiple">
15
- <span ng-if="selected.length > 1">{{ selected.length }} {{ selectedText }}</span>
16
- <span ng-if="selected.length == 1">{{ selected[0][objValue] }}</span>
14
+ <span ng-if="multiple" class="multiple-selected" ng-class="{ 'has-more': selected.length > maxSelectedShown }">
15
+ <span ng-if="selected.length > 0" class="multiple-selected-values"><span ng-repeat="item in selected | limitTo: maxSelectedShown">{{ item[objValue] }}{{ $last ? '' : ', ' }}</span></span>
16
+ <span ng-if="selected.length > maxSelectedShown" class="multiple-selected-more">+{{ selected.length - maxSelectedShown }} {{ moreText }}</span>
17
17
  <span ng-if="selected.length == 0" class="not-selected">{{ nullableText }}</span>
18
18
  </span>
19
19
  </div>
@@ -46,6 +46,8 @@ angular.module('niceElements')
46
46
  noSearch: '=',
47
47
  nullableText: '@',
48
48
  selectedText: '@',
49
+ maxSelectedShown: '@?', // Multiple: number of selected values shown before "+x more" (default 4)
50
+ moreText: '@?', // Multiple: text after "+x" (default "more")
49
51
  dropdownDistance: '@',
50
52
  searchFunction: '=?',
51
53
  filterFunction: '=?',
@@ -65,6 +67,9 @@ angular.module('niceElements')
65
67
  if (!$scope.nullableText) { $scope.nullableText = gettextCatalog.getString("None", null, "Nice"); }
66
68
  if (!$scope.selectText) { $scope.selectText = gettextCatalog.getString("None", null, "Nice"); }
67
69
  if (!$scope.selectedText) { $scope.selectedText = gettextCatalog.getString("selected", null, "Nice"); }
70
+ if (!$scope.moreText) { $scope.moreText = gettextCatalog.getString("more", null, "Nice"); }
71
+ $scope.maxSelectedShown = parseInt($scope.maxSelectedShown, 10);
72
+ if (isNaN($scope.maxSelectedShown) || $scope.maxSelectedShown < 1) { $scope.maxSelectedShown = 4; }
68
73
  if (!$scope.addButtonFunction) { $scope.addButtonFunction = null; }
69
74
  if (!$scope.placement) { $scope.placement = "bottom-start"; }
70
75
  $scope.noMargin = $scope.noMargin === 'true' || $scope.noMargin === true;
@@ -205,6 +205,26 @@
205
205
  line-height: 1.2;
206
206
  margin-top: 1px;
207
207
  flex-grow: 1;
208
+
209
+ .multiple-selected {
210
+ display: flex;
211
+ align-items: baseline;
212
+ min-width: 0;
213
+ }
214
+
215
+ .multiple-selected-values {
216
+ overflow: hidden;
217
+ text-overflow: ellipsis;
218
+ white-space: nowrap;
219
+ min-width: 0;
220
+ }
221
+
222
+ .multiple-selected-more {
223
+ flex-shrink: 0;
224
+ margin-left: 6px;
225
+ opacity: 0.6;
226
+ white-space: nowrap;
227
+ }
208
228
  }
209
229
 
210
230
  .caret {
@@ -53,7 +53,7 @@
53
53
 
54
54
  .input-group-addon {
55
55
  line-height: 31px;
56
- padding-left: 4px;
56
+ padding-left: 4px;
57
57
  }
58
58
  }
59
59
 
@@ -96,7 +96,8 @@
96
96
  flex: 0 0 auto;
97
97
  width: 20px;
98
98
  height: 20px;
99
- margin-right: 0.5rem;
99
+ margin-right: 1rem;
100
+ flex-shrink: 0;
100
101
  }
101
102
 
102
103
  .notification-content {
@@ -109,6 +110,7 @@
109
110
  text-align: left;
110
111
  font-size: 1em;
111
112
  font-weight: bold;
113
+ margin-bottom: 3px;
112
114
  }
113
115
 
114
116
  & a {
@@ -1,4 +1,4 @@
1
- <ng-form class="nice-component nice-input" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" name="form">
1
+ <ng-form class="nice-component nice-percent nice-input nice-input-type-number" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" name="form">
2
2
  <div class="row">
3
3
  <!------------------------- Title ------------------------->
4
4
  <nice-title text="title || niceTitle" help="help" required="required" description="description" label-width="labelWidth"></nice-title>
@@ -6,10 +6,10 @@
6
6
  <!------------------------- Field ------------------------->
7
7
  <div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
8
8
  <div class="input-group has-feedback symbol" ng-class="{
9
- 'has-warning': !isDisabled && form.$invalid && form.$dirty && !hideValid,
10
- 'has-success': !isDisabled && form.$valid && form.$dirty && showValid,
11
- 'disabled': isDisabled
12
- }">
9
+ 'has-warning': !isDisabled && form.$invalid && form.$dirty && !hideValid,
10
+ 'has-success': !isDisabled && form.$valid && form.$dirty && showValid,
11
+ 'disabled': isDisabled
12
+ }">
13
13
  <input class="form-control" type="text" max="100" min="0" ng-model="internalModel" placeholder="{{ placeholder }}" ng-required="required" ng-keypress="keypress($event)" ng-change="change()" ng-disabled="isDisabled">
14
14
  <span class="input-group-addon">%</span>
15
15
  <!--<span ng-if="!disabled && showValid && form.$valid && form.$dirty" class="glyphicon glyphicon-ok form-control-feedback feedback-valid" aria-hidden="true"></span>-->
@@ -21,7 +21,7 @@
21
21
  <button type="button" class="nice-toggle-field" ng-click="toggle()" ng-disabled="isDisabled">
22
22
  <div class="nice-toggle-field-handle">
23
23
  <nice-icon ng-if="showIcons && model" icon="icon-check"></nice-icon>
24
- <nice-icon ng-if="showIcons && !model" icon="icon-x"></nice-icon>
24
+ <!-- <nice-icon ng-if="showIcons && !model" icon="icon-x"></nice-icon> -->
25
25
  </div>
26
26
  </button>
27
27
  </div>
@@ -81,9 +81,16 @@
81
81
  cursor: not-allowed;
82
82
  }
83
83
 
84
+ // &:active {
85
+ // .nice-toggle-field-handle {
86
+ // transform: scale(1);
87
+ // }
88
+ // }
89
+
84
90
  &:hover {
85
91
  .nice-toggle-field-handle {
86
92
  background: var(--nice-border-color-darker);
93
+ transform: scale(0.8);
87
94
  }
88
95
  }
89
96
 
@@ -95,7 +102,8 @@
95
102
  height: 19px;
96
103
  background: var(--nice-border-color);
97
104
  border-radius: 50%;
98
- transition: all 0.3s ease-in-out;
105
+ transition: all 0.20s ease;
106
+ transform: scale(0.7);
99
107
 
100
108
  display: flex;
101
109
  flex-direction: column;
@@ -117,12 +125,18 @@
117
125
  .nice-toggle-field-handle {
118
126
  background: var(--nice-input-bg);
119
127
  left: calc(100% - 22px);
128
+ transform: scale(1);
120
129
 
121
130
  .nice-icon {
122
131
  color: var(--nice-primary-color);
123
132
  }
124
133
  }
125
134
 
135
+ &:hover {
136
+ .nice-toggle-field-handle {
137
+ transform: scale(0.8);
138
+ }
139
+ }
126
140
  }
127
141
 
128
142
  &.nice-toggle-success {
@@ -14,7 +14,7 @@
14
14
  <div class="text text-placeholder" ng-if="dragging" translate translate-group="Nice">Drop file here</div>
15
15
  <div class="error" ng-if="error">{{ error }}</div>
16
16
  </div>
17
- <div ng-if="imageSource" ng-transclude>
17
+ <div ng-if="imageSource && !(loading && uploadProgress != null)" ng-transclude>
18
18
  <img data-ng-src="{{ imageSource }}" />
19
19
  </div>
20
20
  </div>
@@ -106,6 +106,9 @@
106
106
  left: 0;
107
107
  width: 100%;
108
108
  height: 100%;
109
+ z-index: 5;
110
+ border-radius: var(--nice-border-radius);
111
+ background: var(--nice-input-bg);
109
112
  }
110
113
 
111
114
  .nice-upload-progress {
@@ -10,7 +10,7 @@ angular.module('niceElements')
10
10
  .service('NiceService', function ($rootScope) {
11
11
  const service = {
12
12
  name: "Nice elements",
13
- version: "1.14.0",
13
+ version: "1.14.1",
14
14
  getHeader: function () {
15
15
  return {};
16
16
  },