nice-elements 1.7.1 → 1.7.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## v1.7.3 (22.12.2022)
4
+
5
+ - added regex error and regex-raw to nice input component
6
+
7
+ ## v1.7.2 (15.12.2022)
8
+
9
+ - fixed nice dropdown alignment,
10
+ - fixed input addon border color on focus,
11
+ - fixed nice highlight null value,
12
+ - added more button icon and text margins,
13
+ - added addSeconds to niceDate filter,
14
+ - added filters example page
15
+
3
16
  ## v1.7.1 (8.12.2022)
4
17
 
5
18
  - fixed nice-date-input,
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ![Nice elements](/demo/assets/logo.png)
2
2
 
3
- # Nice elements v1.7.1
3
+ # Nice elements v1.7.3
4
4
 
5
5
  Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
6
6
 
package/bower.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "authors": [
5
5
  "Klemen Kastelic <klemen@olaii.com>"
6
6
  ],
package/dist/nice.js CHANGED
@@ -3597,6 +3597,8 @@ angular.module('niceElements')
3597
3597
  type: '@',
3598
3598
  title: '@?',
3599
3599
  regex: '@?',
3600
+ regexRaw: '@?',
3601
+ regexError: '@?',
3600
3602
  placeholder: '@',
3601
3603
  min: '@?',
3602
3604
  max: '@?',
@@ -3687,6 +3689,10 @@ angular.module('niceElements')
3687
3689
  scope.regexexp = new RegExp(scope.regex);
3688
3690
  }
3689
3691
 
3692
+ if (angular.isDefined(scope.regexRaw) && scope.regexRaw != '') {
3693
+ scope.regexexp = regexRaw;
3694
+ }
3695
+
3690
3696
  scope.$watch('model', function (value_new, value_old) {
3691
3697
  scope.internalModel = scope.model;
3692
3698
  });
@@ -5394,9 +5400,12 @@ angular.module('niceElements')
5394
5400
  * Filter in the niceElements.
5395
5401
  */
5396
5402
  angular.module('niceElements').filter('niceDate', function () {
5397
- return function(object, addDate) {
5403
+ return function (object, addTime, addSeconds) {
5398
5404
  var formatString = "D.M.YYYY";
5399
- if (addDate) formatString = "D.M.YYYY • H:mm";
5405
+ if (addTime) {
5406
+ formatString = "D.M.YYYY • H:mm";
5407
+ if (addSeconds) formatString += ":ss";
5408
+ }
5400
5409
  return moment(object).format(formatString);
5401
5410
  };
5402
5411
  });
@@ -5410,6 +5419,7 @@ angular.module('niceElements').filter('niceDate', function () {
5410
5419
  */
5411
5420
  angular.module('niceElements').filter('niceHighlight', function () {
5412
5421
  return function (value, highlightedText) {
5422
+ if (!value) return "";
5413
5423
  var regex = new RegExp(highlightedText, 'gmi');
5414
5424
  var newValue = String(value).replace(regex, "<span class='nice-highligh'>$&</span>");
5415
5425
  return newValue;
@@ -6066,7 +6076,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6066
6076
  "</div>\n" +
6067
6077
  "<div ng-if=\"forma.$error && forma.$dirty\">\n" +
6068
6078
  "<div class=\"error-message\" ng-if=\"forma.$dirty && forma.$error.email\" translate translate-context=\"Nice\">Email is not valid.</div>\n" +
6069
- "<div class=\"error-message\" ng-if=\"forma.$dirty && forma.$error.pattern\" translate translate-context=\"Nice\">This field requires a specific pattern.</div>\n" +
6079
+ "<div class=\"error-message\" ng-if=\"forma.$dirty && forma.$error.pattern\">\n" +
6080
+ "<span ng-if=\"regexError\">{{ regexError }}</span>\n" +
6081
+ "<span ng-if=\"!regexError\" translate translate-context=\"Nice\">This field requires a specific pattern.</span>\n" +
6082
+ "</div>\n" +
6070
6083
  "<div class=\"error-message\" ng-if=\"forma.$error.minlength\">\n" +
6071
6084
  "<translate translate-context=\"Nice\">Your input is too short. It must contain at least</translate>&nbsp;{{ minlength }}&nbsp;<translate translate-context=\"Nice\">characters</translate>.\n" +
6072
6085
  "</div>\n" +