nice-elements 1.4.0 → 1.4.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/.vscode/settings.json +5 -0
- package/CHANGELOG.md +15 -0
- package/LICENSE.md +1 -1
- package/README.md +8 -10
- package/bower.json +1 -1
- package/dist/nice.js +177 -106
- package/dist/nice.min.js +1 -1
- package/dist/style.css +66 -20
- package/dist/style.css.map +3 -2
- package/dist/style.min.css +1 -1
- package/package.json +5 -5
- package/src/components/nice-calendar/nice-calendar.html +42 -42
- package/src/components/nice-calendar/nice-calendar.js +85 -53
- package/src/components/nice-calendar/nice-calendar.scss +12 -14
- package/src/components/nice-date/nice-date.js +22 -11
- package/src/components/nice-help/nice-help.scss +8 -9
- package/src/components/nice-input/nice-input.html +1 -1
- package/src/components/nice-number/nice-number.html +17 -10
- package/src/components/nice-number/nice-number.js +8 -8
- package/src/components/nice-tooltip/_nice-tooltip.scss +72 -0
- package/src/components/nice-tooltip/nice-tooltip.js +20 -0
- package/src/components/nice-yesno/nice-yesno.js +8 -9
- package/src/styles/_nice.scss +1 -0
package/dist/nice.js
CHANGED
|
@@ -75,7 +75,7 @@ angular.module('niceElements')
|
|
|
75
75
|
* # niceCalendar
|
|
76
76
|
*/
|
|
77
77
|
angular.module('niceElements')
|
|
78
|
-
.directive("niceCalendar", function($timeout, gettextCatalog) {
|
|
78
|
+
.directive("niceCalendar", function ($timeout, gettextCatalog) {
|
|
79
79
|
return {
|
|
80
80
|
restrict: "E",
|
|
81
81
|
templateUrl: "src/components/nice-calendar/nice-calendar.html",
|
|
@@ -86,7 +86,7 @@ angular.module('niceElements')
|
|
|
86
86
|
minDate: '=',
|
|
87
87
|
maxDate: '=',
|
|
88
88
|
hideHover: '=',
|
|
89
|
-
time: '
|
|
89
|
+
time: '=',
|
|
90
90
|
noMargin: '@',
|
|
91
91
|
color: '@',
|
|
92
92
|
endDate: '=',
|
|
@@ -96,7 +96,7 @@ angular.module('niceElements')
|
|
|
96
96
|
isInline: '=',
|
|
97
97
|
onChange: '&?'
|
|
98
98
|
},
|
|
99
|
-
link: function(scope, element) {
|
|
99
|
+
link: function (scope, element) {
|
|
100
100
|
// ------------------ Init default values ------------------
|
|
101
101
|
scope.selectStart = true;
|
|
102
102
|
scope.popupText = gettextCatalog.getString("Select start date", null, "Nice");
|
|
@@ -111,37 +111,52 @@ angular.module('niceElements')
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
// ------------------ Check if attributes are set ------------------
|
|
114
|
-
if(!scope.startDate) scope.startDate = moment().minutes(0).second(0).millisecond(0);
|
|
115
|
-
if(!scope.endDate) scope.endDate = moment().minutes(0).second(0).millisecond(0);
|
|
114
|
+
if (!scope.startDate) scope.startDate = moment().minutes(0).second(0).millisecond(0);
|
|
115
|
+
if (!scope.endDate) scope.endDate = moment().minutes(0).second(0).millisecond(0);
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
// ------------------ Look for model changes ------------------
|
|
119
|
-
scope.$watch("startDate", function(value, valueOld){
|
|
119
|
+
scope.$watch("startDate", function (value, valueOld) {
|
|
120
120
|
bootstrap();
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
scope.$watch("endDate", function(value, valueOld){
|
|
123
|
+
scope.$watch("endDate", function (value, valueOld) {
|
|
124
124
|
bootstrap();
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
scope.$watch("minDate", function(value, valueOld){
|
|
127
|
+
scope.$watch("minDate", function (value, valueOld) {
|
|
128
128
|
bootstrap();
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
scope.$watch("maxDate", function(value, valueOld){
|
|
131
|
+
scope.$watch("maxDate", function (value, valueOld) {
|
|
132
132
|
bootstrap();
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
// ------------------ Bootstrap calendar ------------------
|
|
137
137
|
function bootstrap() {
|
|
138
|
-
//scope.startDate = moment(scope.startDate.second(0).millisecond(0));
|
|
139
|
-
//scope.endDate = moment(scope.endDate.second(0).millisecond(0));
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
// scope.startDate = moment(scope.startDate.second(0).millisecond(0));
|
|
139
|
+
// scope.endDate = moment(scope.endDate.second(0).millisecond(0));
|
|
140
|
+
|
|
141
|
+
if (!scope.time) {
|
|
142
|
+
scope.startDateHour = 0;
|
|
143
|
+
scope.startDateMinute = 0;
|
|
144
|
+
scope.startDate.hours(0);
|
|
145
|
+
scope.startDate.minutes(0);
|
|
146
|
+
scope.startDate.seconds(0);
|
|
147
|
+
scope.startDate.millisecond(0);
|
|
148
|
+
scope.endDateHour = 0;
|
|
149
|
+
scope.endDateMinut = 0;
|
|
150
|
+
scope.endDate.hours(23);
|
|
151
|
+
scope.endDate.minutes(59);
|
|
152
|
+
scope.endDate.seconds(59);
|
|
153
|
+
scope.endDate.millisecond(999);
|
|
154
|
+
} else {
|
|
155
|
+
scope.startDateHour = moment(scope.startDate).hours();
|
|
156
|
+
scope.startDateMinute = moment(scope.startDate).minutes();
|
|
157
|
+
scope.endDateHour = moment(scope.endDate).hours();
|
|
158
|
+
scope.endDateMinute = moment(scope.endDate).minutes();
|
|
159
|
+
}
|
|
145
160
|
|
|
146
161
|
scope.month = angular.copy(moment(scope.startDate));
|
|
147
162
|
var start = angular.copy(moment(scope.startDate));
|
|
@@ -153,13 +168,20 @@ angular.module('niceElements')
|
|
|
153
168
|
|
|
154
169
|
|
|
155
170
|
// ------------------ Day was selected ------------------
|
|
156
|
-
scope.select = function(day) {
|
|
157
|
-
if(!day.isDisabled){
|
|
171
|
+
scope.select = function (day) {
|
|
172
|
+
if (!day.isDisabled) {
|
|
158
173
|
var selectedDate = angular.copy(day.date);
|
|
159
174
|
|
|
160
|
-
if(scope.selectStart){
|
|
161
|
-
|
|
162
|
-
|
|
175
|
+
if (scope.selectStart) {
|
|
176
|
+
if (!scope.time) {
|
|
177
|
+
selectedDate.hours(0);
|
|
178
|
+
selectedDate.minutes(0);
|
|
179
|
+
selectedDate.seconds(0);
|
|
180
|
+
selectedDate.millisecond(0);
|
|
181
|
+
} else {
|
|
182
|
+
selectedDate.hours(scope.startDateHour);
|
|
183
|
+
selectedDate.minutes(scope.startDateMinute);
|
|
184
|
+
}
|
|
163
185
|
|
|
164
186
|
// Set start date
|
|
165
187
|
scope.startDate = selectedDate;
|
|
@@ -169,12 +191,22 @@ angular.module('niceElements')
|
|
|
169
191
|
scope.displayStartChange();
|
|
170
192
|
|
|
171
193
|
// If start date is after end date
|
|
172
|
-
if(scope.startDate.isAfter(scope.endDate)){
|
|
194
|
+
if (scope.startDate.isAfter(scope.endDate)) {
|
|
173
195
|
scope.endDate = angular.copy(scope.startDate);
|
|
174
196
|
}
|
|
175
197
|
} else {
|
|
176
|
-
|
|
177
|
-
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
if (!scope.time) {
|
|
201
|
+
selectedDate.hours(23);
|
|
202
|
+
selectedDate.minutes(59);
|
|
203
|
+
selectedDate.seconds(59);
|
|
204
|
+
selectedDate.millisecond(999);
|
|
205
|
+
} else {
|
|
206
|
+
selectedDate.hours(scope.endDateHour);
|
|
207
|
+
selectedDate.minutes(scope.endDateMinute);
|
|
208
|
+
}
|
|
209
|
+
|
|
178
210
|
|
|
179
211
|
// Set end date
|
|
180
212
|
scope.endDate = selectedDate;
|
|
@@ -184,34 +216,34 @@ angular.module('niceElements')
|
|
|
184
216
|
scope.displayEndChange();
|
|
185
217
|
|
|
186
218
|
// If end date is before start date
|
|
187
|
-
if(scope.endDate.isBefore(scope.startDate)){
|
|
219
|
+
if (scope.endDate.isBefore(scope.startDate)) {
|
|
188
220
|
scope.startDate = angular.copy(scope.endDate);
|
|
189
221
|
}
|
|
190
222
|
}
|
|
191
223
|
|
|
192
|
-
if (scope.onChange) scope.onChange({ model: {startDate: scope.startDate, endDate: scope.endDate}, element: element });
|
|
224
|
+
if (scope.onChange) scope.onChange({ model: { startDate: scope.startDate, endDate: scope.endDate }, element: element });
|
|
193
225
|
}
|
|
194
226
|
};
|
|
195
227
|
|
|
196
228
|
|
|
197
229
|
// ------------------ Display date changes ------------------
|
|
198
|
-
scope.displayStartChange = function(){
|
|
230
|
+
scope.displayStartChange = function () {
|
|
199
231
|
scope.startTimeClass = "change";
|
|
200
|
-
$timeout(function(){
|
|
232
|
+
$timeout(function () {
|
|
201
233
|
scope.startTimeClass = "";
|
|
202
234
|
}, 1000);
|
|
203
235
|
};
|
|
204
236
|
|
|
205
|
-
scope.displayEndChange = function(){
|
|
237
|
+
scope.displayEndChange = function () {
|
|
206
238
|
scope.endTimeClass = "change";
|
|
207
|
-
$timeout(function(){
|
|
239
|
+
$timeout(function () {
|
|
208
240
|
scope.endTimeClass = "";
|
|
209
241
|
}, 1000);
|
|
210
242
|
};
|
|
211
243
|
|
|
212
244
|
|
|
213
245
|
// ------------------ Time changes ------------------
|
|
214
|
-
scope.startHourChange = function(value){
|
|
246
|
+
scope.startHourChange = function (value) {
|
|
215
247
|
scope.startDateHour = value;
|
|
216
248
|
scope.startDate = moment(scope.startDate).hours(scope.startDateHour);
|
|
217
249
|
scope.formCalendar.$setDirty();
|
|
@@ -219,7 +251,7 @@ angular.module('niceElements')
|
|
|
219
251
|
};
|
|
220
252
|
|
|
221
253
|
|
|
222
|
-
scope.startMinuteChange = function(value) {
|
|
254
|
+
scope.startMinuteChange = function (value) {
|
|
223
255
|
scope.startDateMinute = value;
|
|
224
256
|
scope.startDate = moment(scope.startDate).minutes(scope.startDateMinute);
|
|
225
257
|
scope.formCalendar.$setDirty();
|
|
@@ -227,7 +259,7 @@ angular.module('niceElements')
|
|
|
227
259
|
};
|
|
228
260
|
|
|
229
261
|
|
|
230
|
-
scope.endHourChange = function(value){
|
|
262
|
+
scope.endHourChange = function (value) {
|
|
231
263
|
scope.endDateHour = value;
|
|
232
264
|
scope.endDate = moment(scope.endDate).hours(scope.endDateHour);
|
|
233
265
|
scope.formCalendar.$setDirty();
|
|
@@ -235,7 +267,7 @@ angular.module('niceElements')
|
|
|
235
267
|
};
|
|
236
268
|
|
|
237
269
|
|
|
238
|
-
scope.endMinuteChange = function(value) {
|
|
270
|
+
scope.endMinuteChange = function (value) {
|
|
239
271
|
scope.endDateMinute = value;
|
|
240
272
|
scope.endDate = moment(scope.endDate).minutes(scope.endDateMinute);
|
|
241
273
|
scope.formCalendar.$setDirty();
|
|
@@ -244,25 +276,25 @@ angular.module('niceElements')
|
|
|
244
276
|
|
|
245
277
|
|
|
246
278
|
// ------------------ Go to next month ------------------
|
|
247
|
-
scope.next = function() {
|
|
279
|
+
scope.next = function () {
|
|
248
280
|
var next = angular.copy(scope.month);
|
|
249
|
-
_removeTimeWithDate(next.month(next.month()+1).date(0));
|
|
250
|
-
scope.month.month(scope.month.month()+1);
|
|
281
|
+
_removeTimeWithDate(next.month(next.month() + 1).date(0));
|
|
282
|
+
scope.month.month(scope.month.month() + 1);
|
|
251
283
|
_buildMonth(scope, next, scope.month);
|
|
252
284
|
};
|
|
253
285
|
|
|
254
286
|
|
|
255
287
|
// ------------------ Go to previous month ------------------
|
|
256
|
-
scope.previous = function() {
|
|
288
|
+
scope.previous = function () {
|
|
257
289
|
var previous = angular.copy(scope.month);
|
|
258
|
-
_removeTimeWithDate(previous.month(previous.month()-1).date(0));
|
|
259
|
-
scope.month.month(scope.month.month()-1);
|
|
290
|
+
_removeTimeWithDate(previous.month(previous.month() - 1).date(0));
|
|
291
|
+
scope.month.month(scope.month.month() - 1);
|
|
260
292
|
_buildMonth(scope, previous, scope.month);
|
|
261
293
|
};
|
|
262
294
|
|
|
263
295
|
|
|
264
296
|
// ------------------ Check if dates are equal without time ------------------
|
|
265
|
-
scope.isSameDay = function(date1, date2){
|
|
297
|
+
scope.isSameDay = function (date1, date2) {
|
|
266
298
|
var d1 = _removeTime(angular.copy(date1));
|
|
267
299
|
var d2 = _removeTime(angular.copy(date2));
|
|
268
300
|
return d1.isSame(d2);
|
|
@@ -270,20 +302,20 @@ angular.module('niceElements')
|
|
|
270
302
|
|
|
271
303
|
|
|
272
304
|
// ------------------ Check if date is between start and end date ------------------
|
|
273
|
-
scope.isBetweenRange = function(date){
|
|
305
|
+
scope.isBetweenRange = function (date) {
|
|
274
306
|
return (date.isBefore(moment(scope.endDate)) && date.isAfter(moment(scope.startDate)));
|
|
275
307
|
};
|
|
276
308
|
|
|
277
309
|
|
|
278
310
|
// ------------------ Format date ------------------
|
|
279
|
-
scope.formatDate = function(date){
|
|
280
|
-
if(scope.time) return moment(date).format('D.M.YYYY • H:mm');
|
|
311
|
+
scope.formatDate = function (date) {
|
|
312
|
+
if (scope.time) return moment(date).format('D.M.YYYY • H:mm');
|
|
281
313
|
else return moment(date).format('D.M.YYYY');
|
|
282
314
|
};
|
|
283
315
|
|
|
284
316
|
|
|
285
317
|
// ------------------ Lighten color by 20% ------------------
|
|
286
|
-
scope.lighten = function(col){
|
|
318
|
+
scope.lighten = function (col) {
|
|
287
319
|
var amt = 20;
|
|
288
320
|
var usePound = false;
|
|
289
321
|
|
|
@@ -292,21 +324,21 @@ angular.module('niceElements')
|
|
|
292
324
|
usePound = true;
|
|
293
325
|
}
|
|
294
326
|
|
|
295
|
-
var num = parseInt(col,16);
|
|
327
|
+
var num = parseInt(col, 16);
|
|
296
328
|
var r = (num >> 16) + amt;
|
|
297
329
|
|
|
298
330
|
if (r > 255) r = 255;
|
|
299
|
-
else if
|
|
331
|
+
else if (r < 0) r = 0;
|
|
300
332
|
|
|
301
333
|
var b = ((num >> 8) & 0x00FF) + amt;
|
|
302
334
|
if (b > 255) b = 255;
|
|
303
|
-
else if
|
|
335
|
+
else if (b < 0) b = 0;
|
|
304
336
|
|
|
305
337
|
var g = (num & 0x0000FF) + amt;
|
|
306
338
|
if (g > 255) g = 255;
|
|
307
339
|
else if (g < 0) g = 0;
|
|
308
340
|
|
|
309
|
-
return (usePound?"#":"") + (g | (b << 8) | (r << 16)).toString(16);
|
|
341
|
+
return (usePound ? "#" : "") + (g | (b << 8) | (r << 16)).toString(16);
|
|
310
342
|
};
|
|
311
343
|
|
|
312
344
|
|
|
@@ -348,9 +380,9 @@ angular.module('niceElements')
|
|
|
348
380
|
date: date
|
|
349
381
|
};
|
|
350
382
|
|
|
351
|
-
if(scope.minDate) day.isDisabled = date.isBefore(moment(scope.minDate));
|
|
352
|
-
if(scope.maxDate) day.isDisabled = date.isAfter(moment(scope.maxDate));
|
|
353
|
-
if(scope.minDate && scope.maxDate) day.isDisabled = !date.isBetween(moment(scope.minDate), moment(scope.maxDate));
|
|
383
|
+
if (scope.minDate) day.isDisabled = date.isBefore(moment(scope.minDate));
|
|
384
|
+
if (scope.maxDate) day.isDisabled = date.isAfter(moment(scope.maxDate));
|
|
385
|
+
if (scope.minDate && scope.maxDate) day.isDisabled = !date.isBetween(moment(scope.minDate), moment(scope.maxDate));
|
|
354
386
|
|
|
355
387
|
days.push(day);
|
|
356
388
|
date = date.clone();
|
|
@@ -361,7 +393,7 @@ angular.module('niceElements')
|
|
|
361
393
|
}
|
|
362
394
|
}
|
|
363
395
|
};
|
|
364
|
-
});
|
|
396
|
+
});
|
|
365
397
|
|
|
366
398
|
'use strict';
|
|
367
399
|
|
|
@@ -903,13 +935,13 @@ angular.module('niceElements')
|
|
|
903
935
|
|
|
904
936
|
// $scope.weekdays = moment.weekdaysShort(false);
|
|
905
937
|
$scope.weekdays = [
|
|
906
|
-
gettextCatalog.getString("
|
|
907
|
-
gettextCatalog.getString("
|
|
908
|
-
gettextCatalog.getString("
|
|
909
|
-
gettextCatalog.getString("
|
|
910
|
-
gettextCatalog.getString("
|
|
911
|
-
gettextCatalog.getString("
|
|
912
|
-
gettextCatalog.getString("
|
|
938
|
+
gettextCatalog.getString("Mon", null, "Nice"),
|
|
939
|
+
gettextCatalog.getString("Tue", null, "Nice"),
|
|
940
|
+
gettextCatalog.getString("Wed", null, "Nice"),
|
|
941
|
+
gettextCatalog.getString("Thu", null, "Nice"),
|
|
942
|
+
gettextCatalog.getString("Fri", null, "Nice"),
|
|
943
|
+
gettextCatalog.getString("Sat", null, "Nice"),
|
|
944
|
+
gettextCatalog.getString("Sun", null, "Nice")
|
|
913
945
|
];
|
|
914
946
|
|
|
915
947
|
$scope.years = [];
|
|
@@ -918,10 +950,21 @@ angular.module('niceElements')
|
|
|
918
950
|
$scope.years.push(year + i);
|
|
919
951
|
}
|
|
920
952
|
|
|
921
|
-
$scope.months =
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
953
|
+
$scope.months = [
|
|
954
|
+
{ value: 0, name: gettextCatalog.getString("January", null, "Nice") },
|
|
955
|
+
{ value: 1, name: gettextCatalog.getString("February", null, "Nice") },
|
|
956
|
+
{ value: 2, name: gettextCatalog.getString("March", null, "Nice") },
|
|
957
|
+
{ value: 3, name: gettextCatalog.getString("April", null, "Nice") },
|
|
958
|
+
{ value: 4, name: gettextCatalog.getString("May", null, "Nice") },
|
|
959
|
+
{ value: 5, name: gettextCatalog.getString("June", null, "Nice") },
|
|
960
|
+
{ value: 6, name: gettextCatalog.getString("July", null, "Nice") },
|
|
961
|
+
{ value: 7, name: gettextCatalog.getString("August", null, "Nice") },
|
|
962
|
+
{ value: 8, name: gettextCatalog.getString("September", null, "Nice") },
|
|
963
|
+
{ value: 9, name: gettextCatalog.getString("October", null, "Nice") },
|
|
964
|
+
{ value: 10, name: gettextCatalog.getString("November", null, "Nice") },
|
|
965
|
+
{ value: 11, name: gettextCatalog.getString("December", null, "Nice") }
|
|
966
|
+
]
|
|
967
|
+
|
|
925
968
|
|
|
926
969
|
if(!$scope.model) $scope.model = moment();
|
|
927
970
|
|
|
@@ -3663,7 +3706,7 @@ angular.module('niceElements')
|
|
|
3663
3706
|
|
|
3664
3707
|
// Link form object with valid object
|
|
3665
3708
|
if ($scope.valid) {
|
|
3666
|
-
$scope.valid = $scope.
|
|
3709
|
+
$scope.valid = $scope.forma;
|
|
3667
3710
|
}
|
|
3668
3711
|
|
|
3669
3712
|
// Fix min
|
|
@@ -3707,9 +3750,9 @@ angular.module('niceElements')
|
|
|
3707
3750
|
// Check canAdd or canSubtract
|
|
3708
3751
|
$scope.check = function() {
|
|
3709
3752
|
if ($scope.required && ($scope.model == undefined || $scope.model == null)) {
|
|
3710
|
-
$scope.
|
|
3753
|
+
$scope.niceNumberForm.$setValidity("no-value", false);
|
|
3711
3754
|
} else {
|
|
3712
|
-
$scope.
|
|
3755
|
+
$scope.niceNumberForm.$setValidity("no-value", null);
|
|
3713
3756
|
}
|
|
3714
3757
|
|
|
3715
3758
|
if ($scope.min && parseFloat($scope.model) <= $scope.min) {
|
|
@@ -3727,9 +3770,9 @@ angular.module('niceElements')
|
|
|
3727
3770
|
}
|
|
3728
3771
|
|
|
3729
3772
|
if ($scope.preventZero && parseFloat($scope.model) == 0) {
|
|
3730
|
-
$scope.
|
|
3773
|
+
$scope.niceNumberForm.$setValidity("zero", false);
|
|
3731
3774
|
} else {
|
|
3732
|
-
$scope.
|
|
3775
|
+
$scope.niceNumberForm.$setValidity("zero", null);
|
|
3733
3776
|
}
|
|
3734
3777
|
|
|
3735
3778
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
@@ -3760,11 +3803,11 @@ angular.module('niceElements')
|
|
|
3760
3803
|
if ($scope.max) {
|
|
3761
3804
|
if (result <= parseFloat($scope.max)) {
|
|
3762
3805
|
$scope.model = result;
|
|
3763
|
-
$scope.
|
|
3806
|
+
$scope.niceNumberForm.$setDirty();
|
|
3764
3807
|
}
|
|
3765
3808
|
} else {
|
|
3766
3809
|
$scope.model = result;
|
|
3767
|
-
$scope.
|
|
3810
|
+
$scope.niceNumberForm.$setDirty();
|
|
3768
3811
|
}
|
|
3769
3812
|
$scope.check();
|
|
3770
3813
|
};
|
|
@@ -3775,7 +3818,7 @@ angular.module('niceElements')
|
|
|
3775
3818
|
var result = new Decimal($scope.model != undefined ? $scope.model : $scope.defaultValue).minus($scope.step).toNumber();
|
|
3776
3819
|
if (result >= Number($scope.min)) {
|
|
3777
3820
|
$scope.model = result;
|
|
3778
|
-
$scope.
|
|
3821
|
+
$scope.niceNumberForm.$setDirty();
|
|
3779
3822
|
}
|
|
3780
3823
|
$scope.check();
|
|
3781
3824
|
};
|
|
@@ -4552,6 +4595,27 @@ angular.module('niceElements')
|
|
|
4552
4595
|
});
|
|
4553
4596
|
'use strict';
|
|
4554
4597
|
|
|
4598
|
+
/**
|
|
4599
|
+
* @ngdoc directive
|
|
4600
|
+
* @name niceElements.directive:niceTooltip
|
|
4601
|
+
* @description
|
|
4602
|
+
* # niceTooltip
|
|
4603
|
+
*/
|
|
4604
|
+
angular.module('niceElements')
|
|
4605
|
+
.directive('niceTooltip', function() {
|
|
4606
|
+
return {
|
|
4607
|
+
restrict: 'EA',
|
|
4608
|
+
link: function(scope, element, attrs) {
|
|
4609
|
+
var html = element.html();
|
|
4610
|
+
element.addClass("nice-tooltip");
|
|
4611
|
+
html = html + "<span class='nice-tooltip-window'>" + attrs.niceTooltip + "</span>"
|
|
4612
|
+
element.html(html);
|
|
4613
|
+
}
|
|
4614
|
+
};
|
|
4615
|
+
});
|
|
4616
|
+
|
|
4617
|
+
'use strict';
|
|
4618
|
+
|
|
4555
4619
|
/**
|
|
4556
4620
|
* @ngdoc directive
|
|
4557
4621
|
* @name niceElements.directive:niceUpload
|
|
@@ -4704,18 +4768,17 @@ angular.module('niceElements')
|
|
|
4704
4768
|
isInline: '=',
|
|
4705
4769
|
help: '@'
|
|
4706
4770
|
},
|
|
4707
|
-
controller: function($scope,
|
|
4708
|
-
if (!$
|
|
4709
|
-
if (!$
|
|
4710
|
-
if (!$
|
|
4711
|
-
if (!$
|
|
4712
|
-
if (!$
|
|
4771
|
+
controller: function($scope, gettextCatalog) {
|
|
4772
|
+
if (!$scope.yes) { $scope.yes = gettextCatalog.getString('Yes', null, "Nice"); }
|
|
4773
|
+
if (!$scope.no) { $scope.no = gettextCatalog.getString('No', null, "Nice"); }
|
|
4774
|
+
if (!$scope.title) { $scope.title = ''; }
|
|
4775
|
+
if (!$scope.fieldWidth) { $scope.fieldWidth = 'col-sm-8'; }
|
|
4776
|
+
if (!$scope.labelWidth) { $scope.labelWidth = 'col-sm-4'; }
|
|
4713
4777
|
if(!angular.isDefined($scope.model) && !angular.isDefined($scope.options)) $scope.model = !angular.isDefined($scope.defaultFalse);
|
|
4714
4778
|
if(!angular.isDefined($scope.modelValue) && angular.isDefined($scope.options)) $scope.modelValue = $scope.options[0];
|
|
4715
4779
|
|
|
4716
|
-
$
|
|
4717
|
-
$
|
|
4718
|
-
$attrs.isDisabled = angular.isDefined($attrs.isDisabled);
|
|
4780
|
+
$scope.defaultFalse = angular.isDefined($scope.defaultFalse);
|
|
4781
|
+
$scope.noMargin = angular.isDefined($scope.noMargin);
|
|
4719
4782
|
|
|
4720
4783
|
$scope.buttonClass = "";
|
|
4721
4784
|
|
|
@@ -4853,6 +4916,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
4853
4916
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
4854
4917
|
"<div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
|
|
4855
4918
|
"<div class=\"nice-calendar-wrapper\">\n" +
|
|
4919
|
+
"<div class=\"nice-calendar-weeks\">\n" +
|
|
4856
4920
|
"<div class=\"header\">\n" +
|
|
4857
4921
|
"<i class=\"fa fa-angle-left\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\"></i>\n" +
|
|
4858
4922
|
"<span title=\"{{ month.format('M.YYYY' )}}\">{{ month.format(\"MMMM, YYYY\" )}}</span>\n" +
|
|
@@ -4869,25 +4933,25 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
4869
4933
|
"</div>\n" +
|
|
4870
4934
|
"<div class=\"week\" ng-repeat=\"week in weeks\">\n" +
|
|
4871
4935
|
"<span class=\"day\" title=\"{{ day.date.format('D.M.YYYY') }}\" ng-class=\"{\n" +
|
|
4872
|
-
"
|
|
4873
|
-
"
|
|
4874
|
-
"
|
|
4875
|
-
"
|
|
4876
|
-
"
|
|
4877
|
-
"
|
|
4878
|
-
"
|
|
4879
|
-
"
|
|
4880
|
-
"
|
|
4881
|
-
"
|
|
4882
|
-
"
|
|
4883
|
-
"
|
|
4884
|
-
"
|
|
4885
|
-
"
|
|
4936
|
+
" today: day.isToday,\n" +
|
|
4937
|
+
" 'different-month': !day.isCurrentMonth,\n" +
|
|
4938
|
+
" 'start-selected': isSameDay(day.date, startDate),\n" +
|
|
4939
|
+
" 'end-selected': isSameDay(day.date, endDate),\n" +
|
|
4940
|
+
" 'selected': isBetweenRange(day.date),\n" +
|
|
4941
|
+
" 'selecting-start': selectStart,\n" +
|
|
4942
|
+
" 'selecting-end': !selectStart,\n" +
|
|
4943
|
+
" 'weekend': day.isWeekday,\n" +
|
|
4944
|
+
" 'disabled': day.isDisabled\n" +
|
|
4945
|
+
" }\" ng-style=\"\n" +
|
|
4946
|
+
" (color && isBetweenRange(day.date)) && {'background-color': lighten(color) } ||\n" +
|
|
4947
|
+
" (color && isSameDay(day.date, startDate)) && {'background-color': color } ||\n" +
|
|
4948
|
+
" (color && isSameDay(day.date, endDate)) && {'background-color': color }\n" +
|
|
4949
|
+
" \" ng-click=\"select(day)\" ng-repeat=\"day in week.days\">\n" +
|
|
4886
4950
|
"{{ day.number }}\n" +
|
|
4887
4951
|
"<p class=\"popup\" ng-if=\"!hideHover\">{{ popupText }}</p>\n" +
|
|
4888
4952
|
"</span>\n" +
|
|
4889
4953
|
"</div>\n" +
|
|
4890
|
-
"
|
|
4954
|
+
"</div>\n" +
|
|
4891
4955
|
"<div class=\"nice-calendar-time\" ng-if=\"time\">\n" +
|
|
4892
4956
|
"<div class=\"time-picker\">\n" +
|
|
4893
4957
|
"<select title=\"{{ 'Select start time' | translate:'Nice' }}\" class=\"time-picker-hour\" ng-model=\"startDateHour\" ng-change=\"startHourChange(startDateHour)\" ng-options=\"hour for hour in hours\">\n" +
|
|
@@ -4918,7 +4982,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
4918
4982
|
"<label translate translate-context=\"Nice\">End</label>\n" +
|
|
4919
4983
|
"<div ng-class=\"endTimeClass\">{{ formatDate(endDate) }}</div>\n" +
|
|
4920
4984
|
"</div>\n" +
|
|
4921
|
-
"<div class=\"clearfix\"></div>\n" +
|
|
4922
4985
|
"</div>\n" +
|
|
4923
4986
|
"</div>\n" +
|
|
4924
4987
|
"</div>\n" +
|
|
@@ -5402,7 +5465,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5402
5465
|
"<div ng-if=\"forma.$error && forma.$dirty\">\n" +
|
|
5403
5466
|
"<div class=\"error-message\" ng-if=\"forma.$dirty && forma.$error.email\" translate translate-context=\"Nice\">Email is not valid.</div>\n" +
|
|
5404
5467
|
"<div class=\"error-message\" ng-if=\"forma.$dirty && forma.$error.pattern\" translate translate-context=\"Nice\">This field requires a specific pattern.</div>\n" +
|
|
5405
|
-
"<div class=\"error-message\" ng-if=\"forma.$error.minlength\"><translate translate-context=\"Nice\">Your input is too short. It must contain at least</translate
|
|
5468
|
+
"<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>\n" +
|
|
5406
5469
|
"<div class=\"error-message\" ng-if=\"forma.$error.maxlength\" translate translate-context=\"Nice\">Your input is too long</div>\n" +
|
|
5407
5470
|
"<div class=\"error-message\" ng-if=\"forma.$error.required\" ng-if=\"forma.$dirty\" translate translate-context=\"Nice\">This field is required.</div>\n" +
|
|
5408
5471
|
"<div class=\"error-message\" ng-if=\"forma.$error.unique\" translate translate-context=\"Nice\">This field must be unique.</div>\n" +
|
|
@@ -5448,14 +5511,14 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5448
5511
|
|
|
5449
5512
|
|
|
5450
5513
|
$templateCache.put('src/components/nice-number/nice-number.html',
|
|
5451
|
-
"<div class=\"nice-component nice-number\" ng-form=\"
|
|
5514
|
+
"<div class=\"nice-component nice-number\" ng-form=\"niceNumberForm\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\">\n" +
|
|
5452
5515
|
"<div ng-class=\"{'row' : !disableRow}\">\n" +
|
|
5453
5516
|
"<div class=\"nice-title col-xs-12\" ng-class=\"labelWidth ? labelWidth : 'col-sm-4'\" ng-if=\"title\">\n" +
|
|
5454
5517
|
"<div class=\"nice-title-text\">{{ title }}<span ng-if=\"required\">*</span></div>\n" +
|
|
5455
5518
|
"<nice-help class=\"nice-title-help\" ng-if=\"help\" text=\"{{ help }}\"></nice-help>\n" +
|
|
5456
5519
|
"</div>\n" +
|
|
5457
5520
|
"<div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
5458
|
-
"<div class=\"input-group\" ng-class=\"{'has-warning': !disabled &&
|
|
5521
|
+
"<div class=\"input-group\" ng-class=\"{'has-warning': !disabled && niceNumberForm.$invalid && niceNumberForm.$dirty}\">\n" +
|
|
5459
5522
|
"<span class=\"input-group-btn\">\n" +
|
|
5460
5523
|
"<button class=\"btn btn-default\" type=\"button\" ng-disabled=\"!canSubstract\" ng-click=\"subtract()\">-</button>\n" +
|
|
5461
5524
|
"</span>\n" +
|
|
@@ -5464,12 +5527,20 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5464
5527
|
"<button class=\"btn btn-default\" type=\"button\" ng-disabled=\"!canAdd\" ng-click=\"add()\">+</button>\n" +
|
|
5465
5528
|
"</span>\n" +
|
|
5466
5529
|
"</div>\n" +
|
|
5467
|
-
"<div class=\"error-messages\" ng-if=\"
|
|
5468
|
-
"<div class=\"error-message\" ng-if=\"
|
|
5469
|
-
"<div class=\"error-message\" ng-if=\"
|
|
5470
|
-
"<
|
|
5471
|
-
"
|
|
5472
|
-
"<div class=\"error-message\" ng-if=\"
|
|
5530
|
+
"<div class=\"error-messages\" ng-if=\"niceNumberForm.$error && !hideError\" ng-class=\"{ 'floating-error': floatingError }\">\n" +
|
|
5531
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$dirty && niceNumberForm.$error.number\" translate translate-context=\"Nice\">This field requires a number</div>\n" +
|
|
5532
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.min\">\n" +
|
|
5533
|
+
"<translate translate-context=\"Nice\">Minimum value is</translate>{{ min }}\n" +
|
|
5534
|
+
"</div>\n" +
|
|
5535
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.max\">\n" +
|
|
5536
|
+
"<translate translate-context=\"Nice\">Maximum value is</translate>{{ max }}\n" +
|
|
5537
|
+
"</div>\n" +
|
|
5538
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.zero\">\n" +
|
|
5539
|
+
"<translate translate-context=\"Nice\">0 is not allowed</translate>\n" +
|
|
5540
|
+
"</div>\n" +
|
|
5541
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.no-value && !niceNumberForm.$error.zero && !niceNumberForm.$error.min && !niceNumberForm.$error.max\">\n" +
|
|
5542
|
+
"<translate translate-context=\"Nice\">Value is missing</translate>\n" +
|
|
5543
|
+
"</div>\n" +
|
|
5473
5544
|
"</div>\n" +
|
|
5474
5545
|
"</div>\n" +
|
|
5475
5546
|
"</div>\n" +
|