nice-elements 1.3.17 → 1.4.2
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/.vscode/settings.json +4 -0
- package/CHANGELOG.md +15 -0
- package/LICENSE.md +3 -3
- package/README.md +8 -10
- package/bower.json +3 -11
- package/dist/nice.js +187 -197
- package/dist/nice.min.js +1 -1
- package/dist/style.css +80 -10
- package/dist/style.css.map +3 -2
- package/dist/style.min.css +1 -1
- package/package.json +5 -4
- package/src/components/nice-calendar/nice-calendar.html +15 -15
- package/src/components/nice-calendar/nice-calendar.js +4 -26
- package/src/components/nice-date/nice-date.js +27 -8
- package/src/components/nice-date-range/nice-date-range.js +6 -40
- package/src/components/nice-datetime-picker/nice-datetime-picker.js +6 -6
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +6 -6
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +7 -7
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +6 -6
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +2 -2
- package/src/components/nice-dropdown/nice-dropdown.js +7 -7
- package/src/components/nice-dropdown-date/nice-dropdown-date.js +14 -14
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +2 -2
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +2 -2
- package/src/components/nice-dtp/nice-dtp.js +5 -5
- package/src/components/nice-help/nice-help.js +0 -6
- package/src/components/nice-help/nice-help.scss +8 -9
- package/src/components/nice-input/nice-input.html +6 -6
- package/src/components/nice-loader/nice-loader.html +3 -1
- package/src/components/nice-loader/nice-loader.js +6 -2
- package/src/components/nice-loader/nice-loader.scss +25 -2
- package/src/components/nice-notification/nice-notification.js +1 -2
- package/src/components/nice-number/nice-number.html +17 -10
- package/src/components/nice-number/nice-number.js +8 -8
- package/src/components/nice-percent/nice-percent.html +2 -2
- package/src/components/nice-search/nice-search.html +1 -1
- package/src/components/nice-search2/nice-search2.html +1 -1
- package/src/components/nice-tooltip/_nice-tooltip.scss +72 -0
- package/src/components/nice-tooltip/nice-tooltip.js +20 -0
- package/src/components/nice-upload/nice-upload.js +5 -5
- package/src/components/nice-yesno/nice-yesno.js +8 -9
- package/src/styles/_nice.scss +1 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
i{
|
|
7
7
|
font-size: 14px;
|
|
8
|
-
cursor:
|
|
8
|
+
cursor: help;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
&:hover{
|
|
@@ -21,14 +21,13 @@
|
|
|
21
21
|
color: white;
|
|
22
22
|
max-width: 200px;
|
|
23
23
|
width: max-content;
|
|
24
|
-
bottom:
|
|
24
|
+
bottom: 100%;
|
|
25
25
|
left: 50%;
|
|
26
26
|
border-radius: $nice-border-radius;
|
|
27
27
|
font-size: 12px;
|
|
28
28
|
z-index: 99999;
|
|
29
|
-
transform: translate(-50%,
|
|
29
|
+
transform: translate(-50%, -3px);
|
|
30
30
|
line-height: 1.3;
|
|
31
|
-
// padding: 1rem;
|
|
32
31
|
padding: 7px 10px;
|
|
33
32
|
font-weight: normal;
|
|
34
33
|
text-align: center;
|
|
@@ -44,14 +43,14 @@
|
|
|
44
43
|
width: 0;
|
|
45
44
|
height: 0;
|
|
46
45
|
position: absolute;
|
|
47
|
-
bottom: -
|
|
46
|
+
bottom: -3px;
|
|
48
47
|
left: 50%;
|
|
49
|
-
margin-left: -
|
|
48
|
+
margin-left: -5px;
|
|
50
49
|
|
|
51
50
|
border-bottom: 0px solid transparent;
|
|
52
|
-
border-left:
|
|
53
|
-
border-right:
|
|
54
|
-
border-top:
|
|
51
|
+
border-left: 5px solid transparent;
|
|
52
|
+
border-right: 5px solid transparent;
|
|
53
|
+
border-top: 3px solid $nice-help-popup-color;
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
}
|
|
@@ -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
|
|
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> {{ minlength }} <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
|
-
|
|
16
|
-
|
|
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
|
-
|
|
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, $
|
|
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 = [];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="nice-component nice-number" ng-form="
|
|
1
|
+
<div class="nice-component nice-number" ng-form="niceNumberForm" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }">
|
|
2
2
|
<div ng-class="{'row' : !disableRow}">
|
|
3
3
|
<!------------------------- Label ------------------------->
|
|
4
4
|
<div class="nice-title col-xs-12" ng-class="labelWidth ? labelWidth : 'col-sm-4'" ng-if="title">
|
|
@@ -8,8 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<!------------------------- Field ------------------------->
|
|
10
10
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
11
|
-
<div class="input-group"
|
|
12
|
-
ng-class="{'has-warning': !disabled && form.$invalid && form.$dirty}">
|
|
11
|
+
<div class="input-group" ng-class="{'has-warning': !disabled && niceNumberForm.$invalid && niceNumberForm.$dirty}">
|
|
13
12
|
<span class="input-group-btn">
|
|
14
13
|
<button class="btn btn-default" type="button" ng-disabled="!canSubstract" ng-click="subtract()">-</button>
|
|
15
14
|
</span>
|
|
@@ -20,13 +19,21 @@
|
|
|
20
19
|
<button class="btn btn-default" type="button" ng-disabled="!canAdd" ng-click="add()">+</button>
|
|
21
20
|
</span>
|
|
22
21
|
</div>
|
|
23
|
-
|
|
24
|
-
<div class="error-messages" ng-if="
|
|
25
|
-
<div class="error-message" ng-if="
|
|
26
|
-
<div class="error-message" ng-if="
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<div class="error-message" ng-if="
|
|
22
|
+
|
|
23
|
+
<div class="error-messages" ng-if="niceNumberForm.$error && !hideError" ng-class="{ 'floating-error': floatingError }">
|
|
24
|
+
<div class="error-message" ng-if="niceNumberForm.$dirty && niceNumberForm.$error.number" translate translate-context="Nice">This field requires a number</div>
|
|
25
|
+
<div class="error-message" ng-if="niceNumberForm.$error.min">
|
|
26
|
+
<translate translate-context="Nice">Minimum value is</translate> {{ min }}
|
|
27
|
+
</div>
|
|
28
|
+
<div class="error-message" ng-if="niceNumberForm.$error.max">
|
|
29
|
+
<translate translate-context="Nice">Maximum value is</translate> {{ max }}
|
|
30
|
+
</div>
|
|
31
|
+
<div class="error-message" ng-if="niceNumberForm.$error.zero">
|
|
32
|
+
<translate translate-context="Nice">0 is not allowed</translate>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="error-message" ng-if="niceNumberForm.$error.no-value && !niceNumberForm.$error.zero && !niceNumberForm.$error.min && !niceNumberForm.$error.max">
|
|
35
|
+
<translate translate-context="Nice">Value is missing</translate>
|
|
36
|
+
</div>
|
|
30
37
|
</div>
|
|
31
38
|
</div>
|
|
32
39
|
</div>
|
|
@@ -41,7 +41,7 @@ angular.module('niceElements')
|
|
|
41
41
|
|
|
42
42
|
// Link form object with valid object
|
|
43
43
|
if ($scope.valid) {
|
|
44
|
-
$scope.valid = $scope.
|
|
44
|
+
$scope.valid = $scope.forma;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// Fix min
|
|
@@ -85,9 +85,9 @@ angular.module('niceElements')
|
|
|
85
85
|
// Check canAdd or canSubtract
|
|
86
86
|
$scope.check = function() {
|
|
87
87
|
if ($scope.required && ($scope.model == undefined || $scope.model == null)) {
|
|
88
|
-
$scope.
|
|
88
|
+
$scope.niceNumberForm.$setValidity("no-value", false);
|
|
89
89
|
} else {
|
|
90
|
-
$scope.
|
|
90
|
+
$scope.niceNumberForm.$setValidity("no-value", null);
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
if ($scope.min && parseFloat($scope.model) <= $scope.min) {
|
|
@@ -105,9 +105,9 @@ angular.module('niceElements')
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
if ($scope.preventZero && parseFloat($scope.model) == 0) {
|
|
108
|
-
$scope.
|
|
108
|
+
$scope.niceNumberForm.$setValidity("zero", false);
|
|
109
109
|
} else {
|
|
110
|
-
$scope.
|
|
110
|
+
$scope.niceNumberForm.$setValidity("zero", null);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
@@ -138,11 +138,11 @@ angular.module('niceElements')
|
|
|
138
138
|
if ($scope.max) {
|
|
139
139
|
if (result <= parseFloat($scope.max)) {
|
|
140
140
|
$scope.model = result;
|
|
141
|
-
$scope.
|
|
141
|
+
$scope.niceNumberForm.$setDirty();
|
|
142
142
|
}
|
|
143
143
|
} else {
|
|
144
144
|
$scope.model = result;
|
|
145
|
-
$scope.
|
|
145
|
+
$scope.niceNumberForm.$setDirty();
|
|
146
146
|
}
|
|
147
147
|
$scope.check();
|
|
148
148
|
};
|
|
@@ -153,7 +153,7 @@ angular.module('niceElements')
|
|
|
153
153
|
var result = new Decimal($scope.model != undefined ? $scope.model : $scope.defaultValue).minus($scope.step).toNumber();
|
|
154
154
|
if (result >= Number($scope.min)) {
|
|
155
155
|
$scope.model = result;
|
|
156
|
-
$scope.
|
|
156
|
+
$scope.niceNumberForm.$setDirty();
|
|
157
157
|
}
|
|
158
158
|
$scope.check();
|
|
159
159
|
};
|
|
@@ -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>
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
.nice-tooltip {
|
|
2
|
+
$nice-help-popup-color: #3e3e3e;
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
cursor: help;
|
|
6
|
+
|
|
7
|
+
&:hover{
|
|
8
|
+
.nice-tooltip-window {
|
|
9
|
+
display: block;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&:before {
|
|
13
|
+
display: block;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// &:before {
|
|
18
|
+
// content: attr(nice-tooltip) " ";
|
|
19
|
+
// display: none;
|
|
20
|
+
// position: absolute;
|
|
21
|
+
// background: $nice-help-popup-color;
|
|
22
|
+
// color: white;
|
|
23
|
+
// max-width: 200px;
|
|
24
|
+
// width: max-content;
|
|
25
|
+
// bottom: 100%;
|
|
26
|
+
// left: 50%;
|
|
27
|
+
// border-radius: $nice-border-radius;
|
|
28
|
+
// font-size: 12px;
|
|
29
|
+
// z-index: 99999;
|
|
30
|
+
// transform: translate(-50%, -5px);
|
|
31
|
+
// line-height: 1.3;
|
|
32
|
+
// padding: 7px 10px;
|
|
33
|
+
// font-weight: normal;
|
|
34
|
+
// text-align: center;
|
|
35
|
+
// text-transform: none;
|
|
36
|
+
// }
|
|
37
|
+
|
|
38
|
+
.nice-tooltip-window {
|
|
39
|
+
display: none;
|
|
40
|
+
position: absolute;
|
|
41
|
+
background: $nice-help-popup-color;
|
|
42
|
+
color: white;
|
|
43
|
+
max-width: 200px;
|
|
44
|
+
width: max-content;
|
|
45
|
+
bottom: 100%;
|
|
46
|
+
left: 50%;
|
|
47
|
+
border-radius: $nice-border-radius;
|
|
48
|
+
font-size: 12px;
|
|
49
|
+
z-index: 99999;
|
|
50
|
+
transform: translate(-50%, -5px);
|
|
51
|
+
line-height: 1.3;
|
|
52
|
+
padding: 7px 10px;
|
|
53
|
+
font-weight: normal;
|
|
54
|
+
text-align: center;
|
|
55
|
+
text-transform: none;
|
|
56
|
+
|
|
57
|
+
&:before {
|
|
58
|
+
content: "";
|
|
59
|
+
width: 0;
|
|
60
|
+
height: 0;
|
|
61
|
+
position: absolute;
|
|
62
|
+
bottom: -3px;
|
|
63
|
+
left: 50%;
|
|
64
|
+
margin-left: -5px;
|
|
65
|
+
|
|
66
|
+
border-bottom: 0px solid transparent;
|
|
67
|
+
border-left: 5px solid transparent;
|
|
68
|
+
border-right: 5px solid transparent;
|
|
69
|
+
border-top: 3px solid $nice-help-popup-color;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceTooltip
|
|
6
|
+
* @description
|
|
7
|
+
* # niceTooltip
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceTooltip', function() {
|
|
11
|
+
return {
|
|
12
|
+
restrict: 'EA',
|
|
13
|
+
link: function(scope, element, attrs) {
|
|
14
|
+
var html = element.html();
|
|
15
|
+
element.addClass("nice-tooltip");
|
|
16
|
+
html = html + "<span class='nice-tooltip-window'>" + attrs.niceTooltip + "</span>"
|
|
17
|
+
element.html(html);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
});
|
|
@@ -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
|
|
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,18 +27,17 @@ angular.module('niceElements')
|
|
|
27
27
|
isInline: '=',
|
|
28
28
|
help: '@'
|
|
29
29
|
},
|
|
30
|
-
controller: function($scope,
|
|
31
|
-
if (!$
|
|
32
|
-
if (!$
|
|
33
|
-
if (!$
|
|
34
|
-
if (!$
|
|
35
|
-
if (!$
|
|
30
|
+
controller: function($scope, gettextCatalog) {
|
|
31
|
+
if (!$scope.yes) { $scope.yes = gettextCatalog.getString('Yes', null, "Nice"); }
|
|
32
|
+
if (!$scope.no) { $scope.no = gettextCatalog.getString('No', null, "Nice"); }
|
|
33
|
+
if (!$scope.title) { $scope.title = ''; }
|
|
34
|
+
if (!$scope.fieldWidth) { $scope.fieldWidth = 'col-sm-8'; }
|
|
35
|
+
if (!$scope.labelWidth) { $scope.labelWidth = 'col-sm-4'; }
|
|
36
36
|
if(!angular.isDefined($scope.model) && !angular.isDefined($scope.options)) $scope.model = !angular.isDefined($scope.defaultFalse);
|
|
37
37
|
if(!angular.isDefined($scope.modelValue) && angular.isDefined($scope.options)) $scope.modelValue = $scope.options[0];
|
|
38
38
|
|
|
39
|
-
$
|
|
40
|
-
$
|
|
41
|
-
$attrs.isDisabled = angular.isDefined($attrs.isDisabled);
|
|
39
|
+
$scope.defaultFalse = angular.isDefined($scope.defaultFalse);
|
|
40
|
+
$scope.noMargin = angular.isDefined($scope.noMargin);
|
|
42
41
|
|
|
43
42
|
$scope.buttonClass = "";
|
|
44
43
|
|
package/src/styles/_nice.scss
CHANGED