nice-elements 1.3.15 → 1.4.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +38 -20
  2. package/LICENSE.md +3 -3
  3. package/README.md +3 -3
  4. package/bower.json +1 -1
  5. package/dist/nice.js +181 -188
  6. package/dist/nice.min.js +1 -1
  7. package/dist/style.css +463 -488
  8. package/dist/style.css.map +40 -0
  9. package/dist/style.min.css +2 -2
  10. package/package.json +12 -17
  11. package/src/components/nice-calendar/nice-calendar.html +15 -15
  12. package/src/components/nice-calendar/nice-calendar.js +4 -26
  13. package/src/components/nice-date/nice-date.js +27 -8
  14. package/src/components/nice-date-range/nice-date-range.js +6 -40
  15. package/src/components/nice-datetime-picker/nice-datetime-picker.js +6 -6
  16. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +6 -6
  17. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +7 -7
  18. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +6 -6
  19. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +2 -2
  20. package/src/components/nice-dropdown/nice-dropdown.html +2 -2
  21. package/src/components/nice-dropdown/nice-dropdown.js +43 -12
  22. package/src/components/nice-dropdown/nice-dropdown.scss +4 -0
  23. package/src/components/nice-dropdown-date/nice-dropdown-date.js +14 -14
  24. package/src/components/nice-dropdown-old/nice-dropdown-old.html +2 -2
  25. package/src/components/nice-dropdown-old/nice-dropdown-old.js +2 -2
  26. package/src/components/nice-dtp/nice-dtp.js +5 -5
  27. package/src/components/nice-help/nice-help.js +0 -6
  28. package/src/components/nice-input/nice-input.html +6 -6
  29. package/src/components/nice-loader/nice-loader.html +3 -1
  30. package/src/components/nice-loader/nice-loader.js +6 -2
  31. package/src/components/nice-loader/nice-loader.scss +25 -2
  32. package/src/components/nice-notification/nice-notification.js +1 -2
  33. package/src/components/nice-number/nice-number.html +5 -5
  34. package/src/components/nice-percent/nice-percent.html +2 -2
  35. package/src/components/nice-search/nice-search.html +1 -1
  36. package/src/components/nice-search2/nice-search2.html +1 -1
  37. package/src/components/nice-upload/nice-upload.js +5 -5
  38. package/src/components/nice-yesno/nice-yesno.js +3 -3
@@ -35,11 +35,11 @@ angular.module('niceElements')
35
35
  isInline: '=',
36
36
  onChange: '&?'
37
37
  },
38
- controller: function($rootScope, $scope, $document, $element) {
38
+ controller: function($scope, $element, gettextCatalog) {
39
39
  if (!$scope.objValue) { $scope.objValue = 'value'; }
40
40
  if (!$scope.objKey) { $scope.objKey = 'id'; }
41
41
  if (!$scope.list) { $scope.list = []; }
42
- if (!$scope.noOptionsText) { $scope.noOptionsText = "No options"; }
42
+ if (!$scope.noOptionsText) { $scope.noOptionsText = gettextCatalog.getString("No options", null, "Nice"); }
43
43
  if(!$scope.addButtonFunction) { $scope.addButtonFunction = null; }
44
44
  if(!$scope.listenKeydown) { $scope.listenKeydown = false; }
45
45
  $scope.valid = $scope.formDropdown;
@@ -14,7 +14,7 @@ angular.module('niceElements')
14
14
  scope: {
15
15
  onChange: '&?', // function called on date changed
16
16
  model: '=', // binding model
17
- format: '@', // default: 'DD.MM.YYYY HH:mm', format for input label string
17
+ format: '@', // default: 'D.M.YYYY • H:mm', format for input label string
18
18
  modelFormat: '@', // default: ''
19
19
  //currentDate: '@',
20
20
  date: '@', // default: true, is date picker enabled?
@@ -35,7 +35,7 @@ angular.module('niceElements')
35
35
  closed: '='
36
36
  },
37
37
  templateUrl: 'src/components/nice-dtp/nice-dtp.html',
38
- link: function ($scope, $element, $attrs) {
38
+ controller: function ($scope, $element, $attrs, gettextCatalog) {
39
39
 
40
40
  // default parameters
41
41
  var params = {
@@ -43,15 +43,15 @@ angular.module('niceElements')
43
43
  noMargin: false,
44
44
  fieldWidth: 'col-sm-8',
45
45
  labelWidth: 'col-sm-4',
46
- format: 'DD.MM.YYYY HH:mm',
46
+ format: 'D.M.YYYY • H:mm',
47
47
  modelFormat: 'YYYY-MM-DDTHH:mm:ss.SSS',
48
48
  minDate: null,
49
49
  maxDate: null,
50
50
  lang: 'en',
51
51
  weekStart: 1,
52
52
  shortTime: false,
53
- cancelText: 'Cancel',
54
- okText: 'OK',
53
+ cancelText: gettextCatalog.getString('Cancel', null, 'Nice'),
54
+ okText: gettextCatalog.getString('OK', null, 'Nice'),
55
55
  date: true,
56
56
  time: false,
57
57
  width: 300,
@@ -13,12 +13,6 @@ angular.module('niceElements')
13
13
  restrict: 'E',
14
14
  scope: {
15
15
  text: '@'
16
- },
17
- link: function postLink(scope, element, attrs) {
18
-
19
- },
20
- controller: function($rootScope, $scope) {
21
-
22
16
  }
23
17
  };
24
18
  });
@@ -60,12 +60,12 @@
60
60
  </div>
61
61
 
62
62
  <div ng-if="forma.$error && forma.$dirty">
63
- <div class="error-message" ng-if="forma.$dirty && forma.$error.email" translate>Email is not valid.</div>
64
- <div class="error-message" ng-if="forma.$dirty && forma.$error.pattern" translate>This field requires a specific pattern.</div>
65
- <div class="error-message" ng-if="forma.$error.minlength"><translate>Your input is too short. It must contain at least</translate> {{ minlength }} <translate>characters</translate>.</div>
66
- <div class="error-message" ng-if="forma.$error.maxlength" translate>Your input is too long</div>
67
- <div class="error-message" ng-if="forma.$error.required" ng-if="forma.$dirty" translate>This field is required.</div>
68
- <div class="error-message" ng-if="forma.$error.unique" translate>This field must be unique.</div>
63
+ <div class="error-message" ng-if="forma.$dirty && forma.$error.email" translate translate-context="Nice">Email is not valid.</div>
64
+ <div class="error-message" ng-if="forma.$dirty && forma.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>
65
+ <div class="error-message" ng-if="forma.$error.minlength"><translate translate-context="Nice">Your input is too short. It must contain at least</translate>&nbsp;{{ minlength }}&nbsp;<translate translate-context="Nice">characters</translate>.</div>
66
+ <div class="error-message" ng-if="forma.$error.maxlength" translate translate-context="Nice">Your input is too long</div>
67
+ <div class="error-message" ng-if="forma.$error.required" ng-if="forma.$dirty" translate translate-context="Nice">This field is required.</div>
68
+ <div class="error-message" ng-if="forma.$error.unique" translate translate-context="Nice">This field must be unique.</div>
69
69
  </div>
70
70
 
71
71
  <!-- <pre>{{ forma | json }}</pre> -->
@@ -1,5 +1,7 @@
1
- <div class="nice-loader" ng-if="!visibleWhen" ng-class="addClass">
1
+ <div class="nice-loader" ng-if="!visibleWhen" ng-class="[addClass, { 'nice-loader-fullscreen': fullscreen, 'nice-loader-fulldiv': fulldiv }]">
2
2
  <svg version="1.1" id="loader" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="40px" height="40px" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50;" xml:space="preserve">
3
3
  <path fill="#000" d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path>
4
4
  </svg>
5
+ <div class="nice-loader-message" ng-if="message">{{ message }}</div>
6
+ <ng-transclude></ng-transclude>
5
7
  </div>
@@ -11,9 +11,13 @@ angular.module('niceElements')
11
11
  return {
12
12
  templateUrl: 'src/components/nice-loader/nice-loader.html',
13
13
  restrict: 'E',
14
+ transclude: true,
14
15
  scope: {
15
- visibleWhen: '=',
16
- addClass: '@'
16
+ visibleWhen: '=',
17
+ message: '@',
18
+ fullscreen: '@',
19
+ fulldiv: '@',
20
+ addClass: '@'
17
21
  }
18
22
  };
19
23
  });
@@ -1,11 +1,13 @@
1
1
  .nice-loader{
2
2
  padding: 25px;
3
- text-align: center;
3
+ display: flex;
4
+ flex-direction: column;
5
+ align-items: center;
6
+ justify-content: center;
4
7
 
5
8
  svg{
6
9
  width: 40px;
7
10
  height: 40px;
8
- margin: 0 auto;
9
11
  }
10
12
 
11
13
  svg path,
@@ -17,6 +19,27 @@
17
19
  animation: spin 0.5s infinite;
18
20
  animation-delay: 0s;
19
21
  }
22
+
23
+ .nice-loader-message {
24
+ font-size: 0.8em;
25
+ opacity: 0.8;
26
+ }
27
+
28
+ &.nice-loader-fulldiv,
29
+ &.nice-loader-fullscreen {
30
+ position: fixed;
31
+ top: 0;
32
+ left: 0;
33
+ width: 100%;
34
+ height: 100%;
35
+ background: rgba(255, 255, 255, 0.65);
36
+ z-index: 9999;
37
+ }
38
+
39
+ &.nice-loader-fulldiv {
40
+ position: absolute;
41
+ z-index: auto;
42
+ }
20
43
  }
21
44
 
22
45
  @-moz-keyframes spin {
@@ -7,13 +7,12 @@
7
7
  */
8
8
 
9
9
  angular.module('niceElements')
10
- .factory('NiceNotification', function ($timeout, $http, $compile, $templateCache, $rootScope, $injector, $sce) {
10
+ .factory('NiceNotification', function ($timeout, $http, $compile, $templateCache, $rootScope, $sce) {
11
11
 
12
12
  var startTop = 10;
13
13
  var startRight = 10;
14
14
  var verticalSpacing = 10;
15
15
  var horizontalSpacing = 10;
16
- var type = '';
17
16
  var delay = 5000;
18
17
 
19
18
  var messageElements = [];
@@ -22,11 +22,11 @@
22
22
  </div>
23
23
 
24
24
  <div class="error-messages" ng-if="form.$error && !hideError" ng-class="{ 'floating-error': floatingError }">
25
- <div class="error-message" ng-if="form.$dirty && form.$error.number" translate>This field requires a number</div>
26
- <div class="error-message" ng-if="form.$error.min"><translate>Minimum value is</translate> {{ min }}</div>
27
- <div class="error-message" ng-if="form.$error.max"><translate>Maximum value is</translate> {{ max }}</div>
28
- <div class="error-message" ng-if="form.$error.zero"><translate>0 is not allowed</translate></div>
29
- <div class="error-message" ng-if="form.$error.noValue && !form.$error.zero && !form.$error.min && !form.$error.max"><translate>Value is missing</translate></div>
25
+ <div class="error-message" ng-if="form.$dirty && form.$error.number" translate translate-context="Nice">This field requires a number</div>
26
+ <div class="error-message" ng-if="form.$error.min"><translate translate-context="Nice">Minimum value is</translate> {{ min }}</div>
27
+ <div class="error-message" ng-if="form.$error.max"><translate translate-context="Nice">Maximum value is</translate> {{ max }}</div>
28
+ <div class="error-message" ng-if="form.$error.zero"><translate translate-context="Nice">0 is not allowed</translate></div>
29
+ <div class="error-message" ng-if="form.$error.noValue && !form.$error.zero && !form.$error.min && !form.$error.max"><translate translate-context="Nice">Value is missing</translate></div>
30
30
  </div>
31
31
  </div>
32
32
  </div>
@@ -34,8 +34,8 @@
34
34
  </div>
35
35
 
36
36
  <div ng-if="form.$error">
37
- <div class="error-message" ng-if="form.$dirty && form.$error.pattern">This field requires a specific pattern.</div>
38
- <div class="error-message" ng-if="form.$dirty && form.$error.required">This field is required.</div>
37
+ <div class="error-message" ng-if="form.$dirty && form.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>
38
+ <div class="error-message" ng-if="form.$dirty && form.$error.required" translate translate-context="Nice">This field is required.</div>
39
39
  </div>
40
40
  </div>
41
41
  </div>
@@ -45,7 +45,7 @@
45
45
  <div ng-class="labelWidth ? labelWidth : 'col-sm-4'" ng-if="title"></div>
46
46
  <div ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
47
47
  <div class="nice-dropdown-empty" ng-if="noResults">
48
- <div class="nice-search-row">No results found.</div>
48
+ <div class="nice-search-row" translate translate-context="Nice">No results found.</div>
49
49
  </div>
50
50
 
51
51
  <div class="nice-dropdown" ng-if="results.length">
@@ -31,7 +31,7 @@
31
31
  <nice-loader visible-when="!loading"></nice-loader>
32
32
  </div>
33
33
 
34
- <div class="nice-search-row nice-search-row-empty" ng-if="!loading && results.length == 0">No results found.</div>
34
+ <div class="nice-search-row nice-search-row-empty" ng-if="!loading && results.length == 0" translate translate-context="Nice">No results found.</div>
35
35
 
36
36
  <div ng-repeat="result in results" class="nice-search-row" ng-class="{'active': selectedIndex == $index}" ng-click="selectItem(result)">
37
37
  <ng-transclude>{{ result[keyForInputLabel] }}</ng-transclude>
@@ -7,7 +7,7 @@
7
7
  * # niceUpload
8
8
  */
9
9
  angular.module('niceElements')
10
- .directive('niceUpload', function ($timeout) {
10
+ .directive('niceUpload', function ($timeout, gettextCatalog) {
11
11
  return {
12
12
  restrict: 'E',
13
13
  replace: true,
@@ -30,9 +30,9 @@
30
30
  help: '@'
31
31
  },
32
32
 
33
- link: function(scope, element, attrs, ctrl){
33
+ link: function(scope, element, attrs){
34
34
  if (!attrs.title) { attrs.title = ''; }
35
- if (!attrs.text) { attrs.text = 'Click to upload file'; }
35
+ if (!attrs.text) { attrs.text = gettextCatalog.getString('Click to upload file', null, 'Nice'); }
36
36
  if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
37
37
  if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
38
38
  attrs.noMargin = angular.isDefined(attrs.noMargin);
@@ -91,7 +91,7 @@
91
91
  }
92
92
  } else {
93
93
  // Handle file too big error
94
- scope.error = "File must be smaller than 1MB";
94
+ scope.error = gettextCatalog.getString("File must be smaller than 1MB", null, "Nice");
95
95
  scope.loading = false;
96
96
  scope.imageSource = null;
97
97
  }
@@ -100,7 +100,7 @@
100
100
 
101
101
  } catch (err) {
102
102
  // Handle try catch
103
- scope.error = "Something went wrong";
103
+ scope.error = gettextCatalog.getString("Something went wrong", null, "Nice");
104
104
  scope.loading = false;
105
105
  scope.imageSource = null;
106
106
  }
@@ -27,9 +27,9 @@ angular.module('niceElements')
27
27
  isInline: '=',
28
28
  help: '@'
29
29
  },
30
- controller: function($scope, $attrs) {
31
- if (!$attrs.yes) { $attrs.yes = 'Yes'; }
32
- if (!$attrs.no) { $attrs.no = 'No'; }
30
+ controller: function($scope, $attrs, gettextCatalog) {
31
+ if (!$attrs.yes) { $attrs.yes = gettextCatalog.getString('Yes', null, "Nice"); }
32
+ if (!$attrs.no) { $attrs.no = gettextCatalog.getString('No', null, "Nice"); }
33
33
  if (!$attrs.title) { $attrs.title = ''; }
34
34
  if (!$attrs.fieldWidth) { $attrs.fieldWidth = 'col-sm-8'; }
35
35
  if (!$attrs.labelWidth) { $attrs.labelWidth = 'col-sm-4'; }