nice-elements 1.13.4 → 1.13.5

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.13.4",
3
+ "version": "1.13.5",
4
4
  "description": "Nice elements used in olaii angular 1.x webapps.",
5
5
  "main": "dist/nice.js",
6
6
  "license": "MIT",
@@ -5,15 +5,55 @@
5
5
 
6
6
  <!------------------------- Field ------------------------->
7
7
  <div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
8
- <div class="input-group" ng-class="{
8
+ <div
9
+ class="input-group"
10
+ ng-class="{
9
11
  'has-feedback': showValid && !hideValid,
10
12
  'has-warning': !isDisabled && forma.$invalid && forma.$dirty && !hideValid,
11
13
  'has-success': !isDisabled && forma.$valid && forma.$dirty && showValid,
12
14
  'symbol': symbol,
13
15
  'nice-disabled': isDisabled
14
- }">
15
- <textarea ng-if="textArea" class="form-control" ng-model="$parent.internalModel" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" rows="{{ textAreaLines }}" max="{{ max }}" min="{{ min }}" autocomplete="{{ autocomplete }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-pattern="regexexp" ng-disabled="isDisabled"></textarea>
16
- <input ng-if="!textArea" class="form-control" type="{{ internalType }}" inputmode="{{ inputMode }}" ng-model="$parent.internalModel" name="{{ name }}" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" max="{{ max }}" min="{{ min }}" autocomplete="{{ autocomplete }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-keypress="keypress($event)" ng-pattern="regexexp" ng-disabled="isDisabled" />
16
+ }"
17
+ >
18
+ <textarea
19
+ ng-if="textArea"
20
+ class="form-control"
21
+ ng-model="$parent.internalModel"
22
+ id="{{ id }}"
23
+ tabindex="{{ tabIndex }}"
24
+ placeholder="{{ placeholder }}"
25
+ rows="{{ textAreaLines }}"
26
+ max="{{ max }}"
27
+ min="{{ min }}"
28
+ autocomplete="{{ autocomplete }}"
29
+ ng-minlength="minlength"
30
+ ng-maxlength="maxlength"
31
+ ng-required="required"
32
+ ng-pattern="regexexp"
33
+ ng-disabled="isDisabled"
34
+ ></textarea>
35
+
36
+ <input
37
+ ng-if="!textArea"
38
+ class="form-control"
39
+ type="{{ internalType }}"
40
+ inputmode="{{ inputMode }}"
41
+ ng-model="$parent.internalModel"
42
+ name="{{ name }}"
43
+ id="{{ id }}"
44
+ tabindex="{{ tabIndex }}"
45
+ placeholder="{{ placeholder }}"
46
+ max="{{ max }}"
47
+ min="{{ min }}"
48
+ autocomplete="{{ autocomplete }}"
49
+ ng-minlength="minlength"
50
+ ng-maxlength="maxlength"
51
+ ng-required="required"
52
+ ng-keypress="keypress($event)"
53
+ ng-pattern="regexexp"
54
+ ng-disabled="isDisabled"
55
+ ng-trim="{{ !disableTrim }}"
56
+ />
17
57
 
18
58
  <div class="input-group-addon" ng-if="symbol">{{ symbol }}</div>
19
59
  <button type="button" class="input-group-btn" ng-if="!multilanguageDisabled && multilanguageField" ng-click="openMultilanguage()">
@@ -42,7 +42,8 @@ angular.module('niceElements')
42
42
  multilanguage: '=?', // Multiple languages object
43
43
  multilanguageField: '@?', // Multiple languages field name
44
44
  multilanguageDisabled: '=', // Multiple languages field disabled
45
- autocomplete: "@?"
45
+ autocomplete: "@?",
46
+ disableTrim: "@?"
46
47
  },
47
48
  controller: function ($scope, $attrs, $rootScope, $element, ngDialog) {
48
49
  if (!$attrs.type) { $attrs.type = 'text'; }
@@ -57,6 +58,7 @@ angular.module('niceElements')
57
58
  if (!$attrs.symbol) { $attrs.symbol = ''; }
58
59
  if (!$attrs.help) { $attrs.help = ''; }
59
60
  if (!$attrs.name) { $attrs.name = ''; }
61
+ if (!$attrs.disableTrim) { $attrs.disableTrim = false; }
60
62
  if (!$attrs.minDecimalsCutZeros) { $attrs.minDecimalsCutZeros = 0; }
61
63
  $attrs.hideValid = $attrs.hideValid === 'true' || $attrs.hideValid === true;
62
64
  $attrs.showValid = $attrs.showValid === 'true' || $attrs.showValid === true;
@@ -103,6 +105,8 @@ angular.module('niceElements')
103
105
  $scope.inputMode = "email";
104
106
  // TODO: get rid of the errors
105
107
  $scope.regexexp = new RegExp('^[_a-zA-Z0-9]+(.[_a-zA-Z0-9]+)*@[a-zA-Z0-9]+(.[a-zA-Z0-9]+)+(.[a-zA-Z]{2,4})');
108
+ } else {
109
+ $scope.internalType = "text";
106
110
  }
107
111
 
108
112
  if (angular.isDefined($scope.valid)) {
@@ -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.13.4",
13
+ version: "1.13.5",
14
14
  getHeader: function () {
15
15
  return {};
16
16
  },