nice-elements 1.7.2 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
4
4
  "description": "Nice elements used in olaii angular 1.x webapps.",
5
5
  "main": "dist/nice.js",
6
6
  "license": "MIT",
@@ -26,7 +26,10 @@
26
26
 
27
27
  <div ng-if="forma.$error && forma.$dirty">
28
28
  <div class="error-message" ng-if="forma.$dirty && forma.$error.email" translate translate-context="Nice">Email is not valid.</div>
29
- <div class="error-message" ng-if="forma.$dirty && forma.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>
29
+ <div class="error-message" ng-if="forma.$dirty && forma.$error.pattern">
30
+ <span ng-if="regexError">{{ regexError }}</span>
31
+ <span ng-if="!regexError" translate translate-context="Nice">This field requires a specific pattern.</span>
32
+ </div>
30
33
  <div class="error-message" ng-if="forma.$error.minlength">
31
34
  <translate translate-context="Nice">Your input is too short. It must contain at least</translate>&nbsp;{{ minlength }}&nbsp;<translate translate-context="Nice">characters</translate>.
32
35
  </div>
@@ -11,6 +11,8 @@ angular.module('niceElements')
11
11
  type: '@',
12
12
  title: '@?',
13
13
  regex: '@?',
14
+ regexRaw: '@?',
15
+ regexError: '@?',
14
16
  placeholder: '@',
15
17
  min: '@?',
16
18
  max: '@?',
@@ -101,6 +103,10 @@ angular.module('niceElements')
101
103
  scope.regexexp = new RegExp(scope.regex);
102
104
  }
103
105
 
106
+ if (angular.isDefined(scope.regexRaw) && scope.regexRaw != '') {
107
+ scope.regexexp = regexRaw;
108
+ }
109
+
104
110
  scope.$watch('model', function (value_new, value_old) {
105
111
  scope.internalModel = scope.model;
106
112
  });