nice-elements 1.9.8 → 1.9.10
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 +14 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +98 -89
- package/dist/nice.min.js +1 -1
- package/package.json +1 -1
- package/src/components/nice-input/nice-input.html +1 -1
- package/src/components/nice-input/nice-input.js +11 -2
- package/src/services/nice-service.js +1 -1
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}">
|
|
15
15
|
|
|
16
16
|
<textarea ng-if="textArea" class="form-control" ng-model="$parent.model" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" rows="{{textAreaLines}}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-pattern="regexexp" ng-disabled="isDisabled"></textarea>
|
|
17
|
-
<input ng-if="!textArea" class="form-control" type="{{ internalType }}" ng-model="$parent.model" name="{{ name }}" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-keypress="keypress($event)" ng-pattern="regexexp" ng-disabled="isDisabled" />
|
|
17
|
+
<input ng-if="!textArea" class="form-control" type="{{ internalType }}" inputmode="{{ inputMode }}" ng-model="$parent.model" name="{{ name }}" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-keypress="keypress($event)" ng-pattern="regexexp" ng-disabled="isDisabled" />
|
|
18
18
|
|
|
19
19
|
<div class="input-group-addon" ng-if="symbol">{{ symbol }}</div>
|
|
20
20
|
<button class="input-group-btn" ng-if="multilanguageField" ng-click="openMultilanguage()">
|
|
@@ -59,6 +59,7 @@ angular.module('niceElements')
|
|
|
59
59
|
attrs.textArea = angular.isDefined(attrs.textArea);
|
|
60
60
|
attrs.noMargin = angular.isDefined(attrs.noMargin);
|
|
61
61
|
attrs.required = attrs.required === 'true';
|
|
62
|
+
scope.inputMode = null;
|
|
62
63
|
//attrs.required = angular.isDefined(attrs.required);
|
|
63
64
|
|
|
64
65
|
if (!scope.textArea) {
|
|
@@ -72,13 +73,19 @@ angular.module('niceElements')
|
|
|
72
73
|
if (input) input.focus();
|
|
73
74
|
}
|
|
74
75
|
|
|
76
|
+
if (scope.numbersOnly) {
|
|
77
|
+
scope.inputMode = "numeric";
|
|
78
|
+
}
|
|
79
|
+
|
|
75
80
|
// Set internal type
|
|
76
81
|
scope.internalType = attrs.type;
|
|
77
82
|
if (attrs.type == "percent") {
|
|
78
83
|
scope.internalType = "percent";
|
|
84
|
+
scope.inputMode = "decimal";
|
|
79
85
|
attrs.symbol = '%';
|
|
80
86
|
} else if (attrs.type == "number") {
|
|
81
|
-
scope.internalType = "
|
|
87
|
+
scope.internalType = "text";
|
|
88
|
+
scope.inputMode = "decimal";
|
|
82
89
|
if (scope.model) {
|
|
83
90
|
scope.model = Number(scope.model);
|
|
84
91
|
} else {
|
|
@@ -86,8 +93,10 @@ angular.module('niceElements')
|
|
|
86
93
|
}
|
|
87
94
|
} else if (attrs.type == "integer") {
|
|
88
95
|
scope.internalType = "text";
|
|
96
|
+
scope.inputMode = "numeric";
|
|
89
97
|
scope.model = Number(scope.model);
|
|
90
98
|
} else if (attrs.type == "email") {
|
|
99
|
+
scope.inputMode = "email";
|
|
91
100
|
// TODO: get rid of the errors
|
|
92
101
|
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})');
|
|
93
102
|
}
|
|
@@ -96,7 +105,7 @@ angular.module('niceElements')
|
|
|
96
105
|
scope.valid = scope.form;
|
|
97
106
|
}
|
|
98
107
|
|
|
99
|
-
if (angular.isDefined(attrs.minDecimalsCutZeros) && attrs.type == 'number') {
|
|
108
|
+
if (scope.model && angular.isDefined(attrs.minDecimalsCutZeros) && attrs.type == 'number') {
|
|
100
109
|
scope.model = Number(scope.model);
|
|
101
110
|
if (scope.model.toString().split('.').length < 2 || scope.model.toString().split('.')[1].length < parseInt(attrs.minDecimalsCutZeros)) {
|
|
102
111
|
scope.model = Number((Number(scope.model)).toFixed(parseInt(attrs.minDecimalsCutZeros)));
|