nice-elements 1.6.2 → 1.7.0
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 +7 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +182 -167
- package/dist/nice.min.js +1 -1
- package/dist/style.css +239 -85
- package/dist/style.css.map +3 -2
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-calendar/nice-calendar.html +3 -2
- package/src/components/nice-calendar/nice-calendar.scss +9 -5
- package/src/components/nice-checkbox/nice-checkbox.html +1 -3
- package/src/components/nice-checkbox/nice-checkbox.scss +12 -12
- package/src/components/nice-choice/nice-choice.html +3 -1
- package/src/components/nice-choice/nice-choice.scss +14 -3
- package/src/components/nice-date/nice-date.html +5 -4
- package/src/components/nice-date/nice-date.js +50 -52
- package/src/components/nice-date/nice-date.scss +29 -6
- package/src/components/nice-date-input/nice-date-input.html +3 -6
- package/src/components/nice-date-input/nice-date-input.js +2 -2
- package/src/components/nice-date-range/nice-date-range.html +3 -1
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +5 -19
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +6 -1
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +5 -3
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +25 -26
- package/src/components/nice-dropdown/nice-dropdown.html +3 -1
- package/src/components/nice-dropdown/nice-dropdown.scss +1 -0
- package/src/components/nice-dtp/nice-dtp.html +12 -12
- package/src/components/nice-help/nice-help.html +2 -1
- package/src/components/nice-help/nice-help.scss +7 -0
- package/src/components/nice-input/nice-input.html +9 -42
- package/src/components/nice-input/nice-input.js +28 -28
- package/src/components/nice-input/nice-input.scss +27 -20
- package/src/components/nice-number/nice-number.html +6 -2
- package/src/components/nice-number/nice-number.scss +15 -3
- package/src/components/nice-quantity/nice-quantity.html +6 -2
- package/src/components/nice-quantity/nice-quantity.scss +11 -0
- package/src/components/nice-search/nice-search.html +9 -20
- package/src/components/nice-search2/nice-search2.html +4 -2
- package/src/components/nice-time-picker/nice-time-picker.html +21 -27
- package/src/components/nice-time-picker/nice-time-picker.scss +11 -32
- package/src/components/nice-yesno/nice-yesno.html +2 -2
- package/src/components/nice-yesno/nice-yesno.scss +13 -0
- package/src/styles/_nice-buttons.scss +22 -9
- package/src/styles/_nice-common.scss +57 -13
- package/src/styles/_nice.scss +2 -1
- package/src/styles/_variables.scss +3 -0
package/dist/nice.js
CHANGED
|
@@ -844,8 +844,8 @@ angular.module('niceElements')
|
|
|
844
844
|
controller: function ($scope) {
|
|
845
845
|
$scope.formatDate = "DD.MM.YYYY";
|
|
846
846
|
$scope.formatTime = "HH:mm";
|
|
847
|
-
$scope.
|
|
848
|
-
$scope.
|
|
847
|
+
if ($scope.date === undefined) $scope.date = true;
|
|
848
|
+
if ($scope.time === undefined) $scope.time = true;
|
|
849
849
|
$scope.model = moment($scope.model) || moment().set({ 'second': 0, 'millisecond': 0 });
|
|
850
850
|
|
|
851
851
|
$scope.dateChanged = function (date) {
|
|
@@ -996,7 +996,7 @@ angular.module('niceElements')
|
|
|
996
996
|
*/
|
|
997
997
|
angular.module('niceElements')
|
|
998
998
|
|
|
999
|
-
.directive('niceDate', function() {
|
|
999
|
+
.directive('niceDate', function () {
|
|
1000
1000
|
return {
|
|
1001
1001
|
restrict: 'E',
|
|
1002
1002
|
replace: true,
|
|
@@ -1008,7 +1008,8 @@ angular.module('niceElements')
|
|
|
1008
1008
|
fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
|
|
1009
1009
|
labelWidth: '@', // default: 'col-sm-4', bootstrap classes that defines width of label
|
|
1010
1010
|
model: '=',
|
|
1011
|
-
time: '
|
|
1011
|
+
time: '=?',
|
|
1012
|
+
date: '=?',
|
|
1012
1013
|
help: '@',
|
|
1013
1014
|
inline: '@',
|
|
1014
1015
|
maxDate: '=',
|
|
@@ -1018,14 +1019,17 @@ angular.module('niceElements')
|
|
|
1018
1019
|
isInline: '=',
|
|
1019
1020
|
onChange: '&?'
|
|
1020
1021
|
},
|
|
1021
|
-
controller: function($scope, $element, $timeout, gettextCatalog) {
|
|
1022
|
+
controller: function ($scope, $element, $timeout, gettextCatalog) {
|
|
1022
1023
|
$scope.isOpen = false;
|
|
1024
|
+
if ($scope.date == undefined) $scope.date = true;
|
|
1025
|
+
if ($scope.time == undefined) $scope.time = false;
|
|
1023
1026
|
$scope.hours = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
|
|
1024
1027
|
$scope.minutes = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59];
|
|
1025
1028
|
$scope.translations = {
|
|
1026
1029
|
nextMonth: gettextCatalog.getString("Next month", null, "Nice"),
|
|
1027
1030
|
prevMonth: gettextCatalog.getString("Previous month", null, "Nice"),
|
|
1028
1031
|
};
|
|
1032
|
+
if (!$scope.model) $scope.model = moment();
|
|
1029
1033
|
$scope.innerDate = {
|
|
1030
1034
|
month: 0,
|
|
1031
1035
|
year: 0,
|
|
@@ -1038,18 +1042,18 @@ angular.module('niceElements')
|
|
|
1038
1042
|
|
|
1039
1043
|
// $scope.weekdays = moment.weekdaysShort(false);
|
|
1040
1044
|
$scope.weekdays = [
|
|
1041
|
-
gettextCatalog.getString("Mon", null, "Nice"),
|
|
1042
|
-
gettextCatalog.getString("Tue", null, "Nice"),
|
|
1043
|
-
gettextCatalog.getString("Wed", null, "Nice"),
|
|
1044
|
-
gettextCatalog.getString("Thu", null, "Nice"),
|
|
1045
|
-
gettextCatalog.getString("Fri", null, "Nice"),
|
|
1046
|
-
gettextCatalog.getString("Sat", null, "Nice"),
|
|
1045
|
+
gettextCatalog.getString("Mon", null, "Nice"),
|
|
1046
|
+
gettextCatalog.getString("Tue", null, "Nice"),
|
|
1047
|
+
gettextCatalog.getString("Wed", null, "Nice"),
|
|
1048
|
+
gettextCatalog.getString("Thu", null, "Nice"),
|
|
1049
|
+
gettextCatalog.getString("Fri", null, "Nice"),
|
|
1050
|
+
gettextCatalog.getString("Sat", null, "Nice"),
|
|
1047
1051
|
gettextCatalog.getString("Sun", null, "Nice")
|
|
1048
1052
|
];
|
|
1049
1053
|
|
|
1050
1054
|
$scope.years = [];
|
|
1051
|
-
var year = moment().year()-100;
|
|
1052
|
-
for(var i=0; i<200; i++) {
|
|
1055
|
+
var year = moment().year() - 100;
|
|
1056
|
+
for (var i = 0; i < 200; i++) {
|
|
1053
1057
|
$scope.years.push(year + i);
|
|
1054
1058
|
}
|
|
1055
1059
|
|
|
@@ -1068,20 +1072,13 @@ angular.module('niceElements')
|
|
|
1068
1072
|
{ value: 11, name: gettextCatalog.getString("December", null, "Nice") }
|
|
1069
1073
|
]
|
|
1070
1074
|
|
|
1071
|
-
|
|
1072
|
-
if(!$scope.model) $scope.model = moment();
|
|
1073
|
-
|
|
1074
|
-
if(!$scope.time) $scope.time = false;
|
|
1075
|
-
else $scope.time = $scope.time == "true";
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
1075
|
if ($scope.maxDate) $scope.maxDate = moment($scope.maxDate);
|
|
1079
1076
|
if ($scope.minDate) $scope.minDate = moment($scope.minDate);
|
|
1080
1077
|
|
|
1081
|
-
|
|
1078
|
+
|
|
1082
1079
|
// Setup popper
|
|
1083
1080
|
// https://popper.js.org/docs/v2/constructors/
|
|
1084
|
-
$scope.setupPopper = function() {
|
|
1081
|
+
$scope.setupPopper = function () {
|
|
1085
1082
|
var button = $element[0].getElementsByClassName('nice-date-button')[0];
|
|
1086
1083
|
var tooltip = $element[0].getElementsByClassName('nice-date-dropdown-wrapper')[0];
|
|
1087
1084
|
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
@@ -1104,13 +1101,13 @@ angular.module('niceElements')
|
|
|
1104
1101
|
|
|
1105
1102
|
|
|
1106
1103
|
// ------------------ Time changes ------------------
|
|
1107
|
-
$scope.timeChange = function() {
|
|
1104
|
+
$scope.timeChange = function () {
|
|
1108
1105
|
var selectedDate = angular.copy($scope.model);
|
|
1109
1106
|
selectedDate = $scope._removeTime(selectedDate);
|
|
1110
1107
|
selectedDate.hours($scope.innerDate.hour);
|
|
1111
1108
|
selectedDate.minutes($scope.innerDate.minute);
|
|
1112
1109
|
$scope.innerDate.value = $scope.formatDate(selectedDate);
|
|
1113
|
-
|
|
1110
|
+
|
|
1114
1111
|
$scope.model = selectedDate;
|
|
1115
1112
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
1116
1113
|
$scope.forma.$setDirty();
|
|
@@ -1118,8 +1115,8 @@ angular.module('niceElements')
|
|
|
1118
1115
|
|
|
1119
1116
|
|
|
1120
1117
|
// ------------------ Day was selected ------------------
|
|
1121
|
-
$scope.select = function(day) {
|
|
1122
|
-
if(!day.isDisabled){
|
|
1118
|
+
$scope.select = function (day) {
|
|
1119
|
+
if (!day.isDisabled) {
|
|
1123
1120
|
var selectedDate = angular.copy(day.date);
|
|
1124
1121
|
selectedDate.hours($scope.innerDate.hour);
|
|
1125
1122
|
selectedDate.minutes($scope.innerDate.minute);
|
|
@@ -1140,7 +1137,7 @@ angular.module('niceElements')
|
|
|
1140
1137
|
|
|
1141
1138
|
|
|
1142
1139
|
// ------------------ Set inner date ------------------
|
|
1143
|
-
$scope.setInnerDate = function(date) {
|
|
1140
|
+
$scope.setInnerDate = function (date) {
|
|
1144
1141
|
$scope.innerDate.year = date.year();
|
|
1145
1142
|
$scope.innerDate.month = date.month();
|
|
1146
1143
|
$scope.innerDate.date = date;
|
|
@@ -1148,14 +1145,14 @@ angular.module('niceElements')
|
|
|
1148
1145
|
|
|
1149
1146
|
|
|
1150
1147
|
// ------------------ Today ------------------
|
|
1151
|
-
$scope.today = function() {
|
|
1148
|
+
$scope.today = function () {
|
|
1152
1149
|
$scope.setInnerDate(moment());
|
|
1153
1150
|
$scope._buildMonth();
|
|
1154
1151
|
};
|
|
1155
1152
|
|
|
1156
1153
|
|
|
1157
1154
|
// ------------------ Go to next month ------------------
|
|
1158
|
-
$scope.next = function() {
|
|
1155
|
+
$scope.next = function () {
|
|
1159
1156
|
$scope.innerDate.date.add(1, "month");
|
|
1160
1157
|
$scope.setInnerDate($scope.innerDate.date);
|
|
1161
1158
|
$scope._buildMonth();
|
|
@@ -1163,7 +1160,7 @@ angular.module('niceElements')
|
|
|
1163
1160
|
|
|
1164
1161
|
|
|
1165
1162
|
// ------------------ Go to previous month ------------------
|
|
1166
|
-
$scope.previous = function() {
|
|
1163
|
+
$scope.previous = function () {
|
|
1167
1164
|
$scope.innerDate.date.subtract(1, "month");
|
|
1168
1165
|
$scope.setInnerDate($scope.innerDate.date);
|
|
1169
1166
|
$scope._buildMonth();
|
|
@@ -1171,7 +1168,7 @@ angular.module('niceElements')
|
|
|
1171
1168
|
|
|
1172
1169
|
|
|
1173
1170
|
// ------------------ Check if dates are equal without time ------------------
|
|
1174
|
-
$scope.isSameDay = function(date1, date2){
|
|
1171
|
+
$scope.isSameDay = function (date1, date2) {
|
|
1175
1172
|
date1 = moment(date1);
|
|
1176
1173
|
date2 = moment(date2);
|
|
1177
1174
|
return (
|
|
@@ -1182,7 +1179,7 @@ angular.module('niceElements')
|
|
|
1182
1179
|
};
|
|
1183
1180
|
|
|
1184
1181
|
// ------------------ Check month ------------------
|
|
1185
|
-
$scope.isSameMonth = function(date1, date2){
|
|
1182
|
+
$scope.isSameMonth = function (date1, date2) {
|
|
1186
1183
|
date1 = moment(date1);
|
|
1187
1184
|
date2 = moment(date2);
|
|
1188
1185
|
return (
|
|
@@ -1192,12 +1189,12 @@ angular.module('niceElements')
|
|
|
1192
1189
|
};
|
|
1193
1190
|
|
|
1194
1191
|
|
|
1195
|
-
$scope.isBetween = function(date1, date2, date3){
|
|
1196
|
-
if(!$scope.nextDate){
|
|
1192
|
+
$scope.isBetween = function (date1, date2, date3) {
|
|
1193
|
+
if (!$scope.nextDate) {
|
|
1197
1194
|
return false;
|
|
1198
|
-
} else if($scope.isSameDay(date1, date2) || $scope.isSameDay(date1, date3)){
|
|
1195
|
+
} else if ($scope.isSameDay(date1, date2) || $scope.isSameDay(date1, date3)) {
|
|
1199
1196
|
return true;
|
|
1200
|
-
} else if(date2.isBefore(date3)){
|
|
1197
|
+
} else if (date2.isBefore(date3)) {
|
|
1201
1198
|
return $scope._removeTime(date1).isBetween(date2, date3);
|
|
1202
1199
|
} else {
|
|
1203
1200
|
return $scope._removeTime(date1).isBetween(date3, date2);
|
|
@@ -1206,24 +1203,25 @@ angular.module('niceElements')
|
|
|
1206
1203
|
|
|
1207
1204
|
|
|
1208
1205
|
// ------------------ Format date ------------------
|
|
1209
|
-
$scope.formatDate = function(date) {
|
|
1210
|
-
if($scope.time) return date.format('D.M.YYYY • H:mm');
|
|
1206
|
+
$scope.formatDate = function (date) {
|
|
1207
|
+
if ($scope.time) return date.format('D.M.YYYY • H:mm');
|
|
1211
1208
|
else return date.format('D.M.YYYY');
|
|
1212
1209
|
};
|
|
1213
1210
|
|
|
1214
1211
|
|
|
1215
1212
|
// ------------------ Remove time from date ------------------
|
|
1216
|
-
$scope._removeTime = function(date) {
|
|
1213
|
+
$scope._removeTime = function (date) {
|
|
1214
|
+
if (!date) return date;
|
|
1217
1215
|
return date.hour(0).minute(0).second(0).millisecond(0);
|
|
1218
1216
|
};
|
|
1219
1217
|
|
|
1220
|
-
$scope._removeTimeWithDate = function(date) {
|
|
1218
|
+
$scope._removeTimeWithDate = function (date) {
|
|
1221
1219
|
return date.date(0).hour(0).minute(0).second(0).millisecond(0);
|
|
1222
1220
|
};
|
|
1223
1221
|
|
|
1224
1222
|
|
|
1225
1223
|
// ------------------ Build month ------------------
|
|
1226
|
-
$scope._buildMonth = function() {
|
|
1224
|
+
$scope._buildMonth = function () {
|
|
1227
1225
|
var done = false;
|
|
1228
1226
|
var date = angular.copy($scope.innerDate.date).date(0).startOf('week').isoWeekday(1);
|
|
1229
1227
|
var monthIndex = date.month();
|
|
@@ -1242,7 +1240,7 @@ angular.module('niceElements')
|
|
|
1242
1240
|
|
|
1243
1241
|
|
|
1244
1242
|
// ------------------ Build week ------------------
|
|
1245
|
-
$scope._buildWeek = function(date) {
|
|
1243
|
+
$scope._buildWeek = function (date) {
|
|
1246
1244
|
var days = [];
|
|
1247
1245
|
for (var i = 0; i < 7; i++) {
|
|
1248
1246
|
var day = {
|
|
@@ -1255,9 +1253,9 @@ angular.module('niceElements')
|
|
|
1255
1253
|
date: date
|
|
1256
1254
|
};
|
|
1257
1255
|
|
|
1258
|
-
if($scope.minDate) day.isDisabled = date.isBefore($scope.minDate);
|
|
1259
|
-
if($scope.maxDate) day.isDisabled = date.isAfter($scope.maxDate);
|
|
1260
|
-
if($scope.minDate && $scope.maxDate) day.isDisabled = !date.isBetween($scope.minDate, $scope.maxDate);
|
|
1256
|
+
if ($scope.minDate) day.isDisabled = date.isBefore($scope.minDate);
|
|
1257
|
+
if ($scope.maxDate) day.isDisabled = date.isAfter($scope.maxDate);
|
|
1258
|
+
if ($scope.minDate && $scope.maxDate) day.isDisabled = !date.isBetween($scope.minDate, $scope.maxDate);
|
|
1261
1259
|
|
|
1262
1260
|
days.push(day);
|
|
1263
1261
|
date = date.clone();
|
|
@@ -1269,13 +1267,13 @@ angular.module('niceElements')
|
|
|
1269
1267
|
|
|
1270
1268
|
|
|
1271
1269
|
// ------------------ Watch for model change ------------------
|
|
1272
|
-
$scope.$watchGroup(["model", 'minDate', 'maxDate', 'nextDate'], function(value) {
|
|
1270
|
+
$scope.$watchGroup(["model", 'minDate', 'maxDate', 'nextDate'], function (value) {
|
|
1273
1271
|
$scope.boostrap();
|
|
1274
1272
|
});
|
|
1275
|
-
|
|
1273
|
+
|
|
1276
1274
|
|
|
1277
1275
|
// ------------------ Get time ------------------
|
|
1278
|
-
$scope.getTime = function() {
|
|
1276
|
+
$scope.getTime = function () {
|
|
1279
1277
|
if ($scope.time) {
|
|
1280
1278
|
$scope.innerDate.hour = moment($scope.model).hours();
|
|
1281
1279
|
$scope.innerDate.minute = moment($scope.model).minutes();
|
|
@@ -1289,14 +1287,14 @@ angular.module('niceElements')
|
|
|
1289
1287
|
|
|
1290
1288
|
|
|
1291
1289
|
// ------------------ Bootstrap ------------------
|
|
1292
|
-
$scope.boostrap = function() {
|
|
1290
|
+
$scope.boostrap = function () {
|
|
1293
1291
|
$scope.setInnerDate(moment($scope.model));
|
|
1294
1292
|
$scope.getTime();
|
|
1295
|
-
|
|
1296
|
-
if(!$scope.time) {
|
|
1293
|
+
|
|
1294
|
+
if (!$scope.time) {
|
|
1297
1295
|
$scope.model = $scope._removeTime($scope.model);
|
|
1298
1296
|
}
|
|
1299
|
-
|
|
1297
|
+
|
|
1300
1298
|
$scope.innerDate.value = $scope.formatDate(moment($scope.model));
|
|
1301
1299
|
$scope._buildMonth();
|
|
1302
1300
|
};
|
|
@@ -1305,10 +1303,10 @@ angular.module('niceElements')
|
|
|
1305
1303
|
|
|
1306
1304
|
|
|
1307
1305
|
// ------------------ Toggle open ------------------
|
|
1308
|
-
$scope.toggleOpen = function() {
|
|
1306
|
+
$scope.toggleOpen = function () {
|
|
1309
1307
|
if (!$scope.isDisabled) {
|
|
1310
1308
|
$scope.isOpen = !$scope.isOpen;
|
|
1311
|
-
$timeout(function() {
|
|
1309
|
+
$timeout(function () {
|
|
1312
1310
|
if ($scope.popper) $scope.popper.update();
|
|
1313
1311
|
})
|
|
1314
1312
|
}
|
|
@@ -1413,14 +1411,14 @@ angular.module('niceElements').directive('niceDatetimePicker', function () {
|
|
|
1413
1411
|
* # niceDatetimerangePicker2
|
|
1414
1412
|
*/
|
|
1415
1413
|
angular.module('niceElements')
|
|
1416
|
-
.directive('niceDatetimerangePicker2', function() {
|
|
1414
|
+
.directive('niceDatetimerangePicker2', function () {
|
|
1417
1415
|
return {
|
|
1418
1416
|
scope: {
|
|
1419
1417
|
startDate: '=', // binding model
|
|
1420
1418
|
endDate: '=', // binding model
|
|
1421
1419
|
formatString: '@', // default: 'D.M.YYYY • H:mm', format for input label string
|
|
1422
1420
|
modelFormat: '@',
|
|
1423
|
-
time: '
|
|
1421
|
+
time: '=', // default: false, is time picker enabled?
|
|
1424
1422
|
minDate: '@', // default: undefined
|
|
1425
1423
|
maxDate: '@', // default: undefined
|
|
1426
1424
|
title: '@', // default: ''
|
|
@@ -1442,25 +1440,24 @@ angular.module('niceElements')
|
|
|
1442
1440
|
|
|
1443
1441
|
|
|
1444
1442
|
// Set defaults
|
|
1445
|
-
if(
|
|
1446
|
-
else $scope.time = $scope.time == "true";
|
|
1443
|
+
if ($scope.time == undefined) $scope.time = false;
|
|
1447
1444
|
|
|
1448
1445
|
|
|
1449
1446
|
// Set format string
|
|
1450
|
-
if(!$scope.formatString) {
|
|
1451
|
-
if($scope.time) $scope.formatString = 'D.M.YYYY • H:mm';
|
|
1447
|
+
if (!$scope.formatString) {
|
|
1448
|
+
if ($scope.time) $scope.formatString = 'D.M.YYYY • H:mm';
|
|
1452
1449
|
else $scope.formatString = 'D.M.YYYY';
|
|
1453
1450
|
}
|
|
1454
1451
|
|
|
1455
1452
|
// Set start date
|
|
1456
|
-
if(!$scope.startDate) {
|
|
1453
|
+
if (!$scope.startDate) {
|
|
1457
1454
|
$scope.startDate = moment();
|
|
1458
1455
|
} else {
|
|
1459
1456
|
$scope.model.innerStartDate = angular.copy($scope.startDate);
|
|
1460
1457
|
}
|
|
1461
1458
|
|
|
1462
1459
|
// Set end date
|
|
1463
|
-
if(!$scope.endDate) {
|
|
1460
|
+
if (!$scope.endDate) {
|
|
1464
1461
|
$scope.endDate = moment();
|
|
1465
1462
|
} else {
|
|
1466
1463
|
$scope.model.innerEndDate = angular.copy($scope.endDate);
|
|
@@ -1469,7 +1466,7 @@ angular.module('niceElements')
|
|
|
1469
1466
|
|
|
1470
1467
|
// Setup popper
|
|
1471
1468
|
// https://popper.js.org/docs/v2/constructors/
|
|
1472
|
-
$scope.setupPopper = function() {
|
|
1469
|
+
$scope.setupPopper = function () {
|
|
1473
1470
|
var button = $element[0].getElementsByClassName('nice-daterange-picker-button')[0];
|
|
1474
1471
|
var tooltip = $element[0].getElementsByClassName('nice-daterange-picker-wrapper')[0];
|
|
1475
1472
|
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
@@ -1485,18 +1482,18 @@ angular.module('niceElements')
|
|
|
1485
1482
|
],
|
|
1486
1483
|
});
|
|
1487
1484
|
};
|
|
1488
|
-
|
|
1485
|
+
|
|
1489
1486
|
$timeout(function () {
|
|
1490
1487
|
$scope.setupPopper();
|
|
1491
1488
|
});
|
|
1492
1489
|
|
|
1493
1490
|
|
|
1494
|
-
$scope.format = function(){
|
|
1491
|
+
$scope.format = function () {
|
|
1495
1492
|
$scope.modelFormat = $scope.startDate.format($scope.formatString) + " - " + $scope.endDate.format($scope.formatString);
|
|
1496
1493
|
};
|
|
1497
1494
|
|
|
1498
1495
|
|
|
1499
|
-
$scope.open = function() {
|
|
1496
|
+
$scope.open = function () {
|
|
1500
1497
|
if (!$scope.isDisabled) {
|
|
1501
1498
|
$scope.isOpen = true;
|
|
1502
1499
|
$scope.popper.update();
|
|
@@ -1504,14 +1501,14 @@ angular.module('niceElements')
|
|
|
1504
1501
|
};
|
|
1505
1502
|
|
|
1506
1503
|
|
|
1507
|
-
$scope.close = function() {
|
|
1504
|
+
$scope.close = function () {
|
|
1508
1505
|
$scope.model.innerStartDate = angular.copy($scope.startDate);
|
|
1509
1506
|
$scope.model.innerEndDate = angular.copy($scope.endDate);
|
|
1510
1507
|
$scope.isOpen = false;
|
|
1511
1508
|
};
|
|
1512
1509
|
|
|
1513
1510
|
|
|
1514
|
-
$scope.confirm = function() {
|
|
1511
|
+
$scope.confirm = function () {
|
|
1515
1512
|
$scope.startDate = angular.copy($scope.model.innerStartDate);
|
|
1516
1513
|
$scope.endDate = angular.copy($scope.model.innerEndDate);
|
|
1517
1514
|
if ($scope.onChange) $scope.onChange({ startDate: $scope.startDate, endDate: $scope.endDate });
|
|
@@ -1519,58 +1516,58 @@ angular.module('niceElements')
|
|
|
1519
1516
|
};
|
|
1520
1517
|
|
|
1521
1518
|
|
|
1522
|
-
$scope.selectToday = function(){
|
|
1519
|
+
$scope.selectToday = function () {
|
|
1523
1520
|
$scope.model.innerStartDate = moment().startOf('day');
|
|
1524
1521
|
$scope.model.innerEndDate = moment().endOf('day');
|
|
1525
1522
|
};
|
|
1526
1523
|
|
|
1527
1524
|
|
|
1528
|
-
$scope.selectLastNDays = function(days){
|
|
1525
|
+
$scope.selectLastNDays = function (days) {
|
|
1529
1526
|
$scope.model.innerStartDate = moment().subtract(days, 'days').startOf('day');
|
|
1530
1527
|
$scope.model.innerEndDate = moment().endOf('day');
|
|
1531
1528
|
};
|
|
1532
1529
|
|
|
1533
1530
|
|
|
1534
|
-
$scope.selectLastMonth = function(){
|
|
1531
|
+
$scope.selectLastMonth = function () {
|
|
1535
1532
|
$scope.model.innerStartDate = moment().subtract(1, 'months').startOf('month').startOf('date');
|
|
1536
1533
|
$scope.model.innerEndDate = moment().subtract(1, 'months').endOf('month').endOf('date');
|
|
1537
1534
|
};
|
|
1538
1535
|
|
|
1539
1536
|
|
|
1540
|
-
$scope.selectThisMonth = function(){
|
|
1537
|
+
$scope.selectThisMonth = function () {
|
|
1541
1538
|
$scope.model.innerStartDate = moment().startOf('month').startOf('date');
|
|
1542
1539
|
$scope.model.innerEndDate = moment().endOf('month').endOf('date');
|
|
1543
1540
|
};
|
|
1544
1541
|
|
|
1545
1542
|
|
|
1546
1543
|
// ------------------ Remove time from date ------------------
|
|
1547
|
-
$scope._removeTime = function(date) {
|
|
1544
|
+
$scope._removeTime = function (date) {
|
|
1548
1545
|
return date.hour(0).minute(0).second(0).millisecond(0);
|
|
1549
1546
|
};
|
|
1550
1547
|
|
|
1551
1548
|
|
|
1552
|
-
$scope.dateChanged = function() {
|
|
1553
|
-
$timeout(function() {
|
|
1549
|
+
$scope.dateChanged = function () {
|
|
1550
|
+
$timeout(function () {
|
|
1554
1551
|
if ($scope.model.innerStartDate && $scope.model.innerEndDate) {
|
|
1555
1552
|
// Check if start date is after end date
|
|
1556
1553
|
if ($scope.model.innerStartDate.isAfter($scope.model.innerEndDate)) {
|
|
1557
1554
|
var temp = angular.copy($scope.model.innerStartDate);
|
|
1558
|
-
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
1559
|
-
$scope.model.innerEndDate = temp;
|
|
1555
|
+
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
1556
|
+
$scope.model.innerEndDate = temp;
|
|
1560
1557
|
}
|
|
1561
1558
|
|
|
1562
1559
|
// Check if end date is before start date
|
|
1563
1560
|
if ($scope.model.innerEndDate.isBefore($scope.model.innerStartDate)) {
|
|
1564
1561
|
var temp = angular.copy($scope.model.innerStartDate);
|
|
1565
|
-
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
1566
|
-
$scope.model.innerEndDate = temp;
|
|
1562
|
+
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
1563
|
+
$scope.model.innerEndDate = temp;
|
|
1567
1564
|
}
|
|
1568
1565
|
}
|
|
1569
1566
|
});
|
|
1570
1567
|
}
|
|
1571
1568
|
|
|
1572
1569
|
|
|
1573
|
-
$scope.$watchGroup(["startDate", "endDate"], function() {
|
|
1570
|
+
$scope.$watchGroup(["startDate", "endDate"], function () {
|
|
1574
1571
|
$scope.model.innerStartDate = angular.copy($scope.startDate);
|
|
1575
1572
|
$scope.model.innerEndDate = angular.copy($scope.endDate);
|
|
1576
1573
|
$scope.format();
|
|
@@ -3628,7 +3625,7 @@ angular.module('niceElements')
|
|
|
3628
3625
|
attrs.required = attrs.required === 'true';
|
|
3629
3626
|
//attrs.required = angular.isDefined(attrs.required);
|
|
3630
3627
|
|
|
3631
|
-
if(!scope.textArea) {
|
|
3628
|
+
if (!scope.textArea) {
|
|
3632
3629
|
scope.elementType = "input";
|
|
3633
3630
|
} else {
|
|
3634
3631
|
scope.elementType = "textarea";
|
|
@@ -3636,9 +3633,7 @@ angular.module('niceElements')
|
|
|
3636
3633
|
|
|
3637
3634
|
if (scope.isFocused) {
|
|
3638
3635
|
var input = element[0].getElementsByTagName(scope.elementType)[0];
|
|
3639
|
-
if (input)
|
|
3640
|
-
input.focus();
|
|
3641
|
-
}
|
|
3636
|
+
if (input) input.focus();
|
|
3642
3637
|
}
|
|
3643
3638
|
|
|
3644
3639
|
// Set internal type
|
|
@@ -3667,8 +3662,9 @@ angular.module('niceElements')
|
|
|
3667
3662
|
|
|
3668
3663
|
if (angular.isDefined(attrs.minDecimalsCutZeros) && attrs.type == 'number') {
|
|
3669
3664
|
scope.model = Number(scope.model);
|
|
3670
|
-
if (scope.model.toString().split('.').length < 2 || scope.model.toString().split('.')[1].length < parseInt(attrs.minDecimalsCutZeros))
|
|
3671
|
-
scope.model = (Number(scope.model)).toFixed(parseInt(attrs.minDecimalsCutZeros));
|
|
3665
|
+
if (scope.model.toString().split('.').length < 2 || scope.model.toString().split('.')[1].length < parseInt(attrs.minDecimalsCutZeros)) {
|
|
3666
|
+
scope.model = Number((Number(scope.model)).toFixed(parseInt(attrs.minDecimalsCutZeros)));
|
|
3667
|
+
}
|
|
3672
3668
|
}
|
|
3673
3669
|
|
|
3674
3670
|
if (angular.isDefined(scope.regex) && scope.regex != '') {
|
|
@@ -3687,40 +3683,41 @@ angular.module('niceElements')
|
|
|
3687
3683
|
if (scope.onChange) scope.onChange({ model: scope.model });
|
|
3688
3684
|
}
|
|
3689
3685
|
} else {
|
|
3686
|
+
scope.model = scope.internalModel;
|
|
3690
3687
|
if (scope.onChange) scope.onChange({ model: scope.model });
|
|
3691
3688
|
}
|
|
3692
3689
|
});
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
event.preventDefault();
|
|
3704
|
-
return false;
|
|
3705
|
-
}
|
|
3706
|
-
} else {
|
|
3707
|
-
event.preventDefault();
|
|
3708
|
-
return false;
|
|
3709
|
-
}
|
|
3710
|
-
} else if (event.charCode == 45) {
|
|
3711
|
-
if (String($scope.model).indexOf("-") >= 0) {
|
|
3690
|
+
},
|
|
3691
|
+
|
|
3692
|
+
controller: function ($scope) {
|
|
3693
|
+
$scope.id = Math.random().toString(36).substring(7);
|
|
3694
|
+
|
|
3695
|
+
$scope.keypress = function (event) {
|
|
3696
|
+
if ($scope.type == "number" || $scope.type == "integer") {
|
|
3697
|
+
if (event.charCode == 46 || event.charCode == 44) { // Handle "." and "," key (only one allowed)
|
|
3698
|
+
if ($scope.type == "number") {
|
|
3699
|
+
if (String($scope.model).indexOf(".") >= 0) {
|
|
3712
3700
|
event.preventDefault();
|
|
3713
3701
|
return false;
|
|
3714
3702
|
}
|
|
3715
|
-
} else
|
|
3716
|
-
return true;
|
|
3717
|
-
} else { // Prevent everything else
|
|
3703
|
+
} else {
|
|
3718
3704
|
event.preventDefault();
|
|
3719
3705
|
return false;
|
|
3720
3706
|
}
|
|
3707
|
+
} else if (event.charCode == 45) {
|
|
3708
|
+
if (String($scope.model).indexOf("-") >= 0) {
|
|
3709
|
+
event.preventDefault();
|
|
3710
|
+
return false;
|
|
3711
|
+
}
|
|
3712
|
+
} else if ((event.charCode >= 48 && event.charCode <= 58) || event.charCode == 0) { // Allow only numbers
|
|
3713
|
+
return true;
|
|
3714
|
+
} else { // Prevent everything else
|
|
3715
|
+
event.preventDefault();
|
|
3716
|
+
return false;
|
|
3721
3717
|
}
|
|
3722
|
-
}
|
|
3723
|
-
}
|
|
3718
|
+
}
|
|
3719
|
+
};
|
|
3720
|
+
}
|
|
3724
3721
|
};
|
|
3725
3722
|
});
|
|
3726
3723
|
|
|
@@ -5484,8 +5481,8 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5484
5481
|
"<select title=\"{{ 'Select start time' | translate:'Nice' }}\" class=\"time-picker-minute\" ng-model=\"startDateMinute\" ng-change=\"startMinuteChange(startDateMinute)\" ng-options=\"minute for minute in minutes\">\n" +
|
|
5485
5482
|
"</select>\n" +
|
|
5486
5483
|
"</div>\n" +
|
|
5487
|
-
"<div class=\"time-
|
|
5488
|
-
"<
|
|
5484
|
+
"<div class=\"time-picker-icon\">\n" +
|
|
5485
|
+
"<nice-icon icon=\"icon-clock\"></nice-icon>\n" +
|
|
5489
5486
|
"</div>\n" +
|
|
5490
5487
|
"<div class=\"time-picker\">\n" +
|
|
5491
5488
|
"<select title=\"{{ 'Select end time' | translate:'Nice' }}\" class=\"time-picker-hour\" ng-model=\"endDateHour\" ng-change=\"endHourChange(endDateHour)\" ng-options=\"hour for hour in hours\">\n" +
|
|
@@ -5516,9 +5513,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5516
5513
|
$templateCache.put('src/components/nice-checkbox/nice-checkbox.html',
|
|
5517
5514
|
"<div class=\"nice-component nice-checkbox\" ng-class=\"{ 'checked': model, 'margin-bottom-0' : noMargin }\" ng-click=\"toggle()\">\n" +
|
|
5518
5515
|
"<button class=\"btn checkbox\">\n" +
|
|
5519
|
-
"<
|
|
5520
|
-
"<path class=\"check-stroke\" d=\"M-273.2,398.2l10,9.9 l22.4-22.3\"></path>\n" +
|
|
5521
|
-
"</svg>\n" +
|
|
5516
|
+
"<nice-icon class=\"check\" icon=\"icon-check\"></nice-icon>\n" +
|
|
5522
5517
|
"</button>\n" +
|
|
5523
5518
|
"<div ng-if=\"title\" class=\"message\">{{ title }}</div>\n" +
|
|
5524
5519
|
"</div>"
|
|
@@ -5535,7 +5530,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5535
5530
|
"<div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
5536
5531
|
"<ul class=\"list-unstyled\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
|
|
5537
5532
|
"<li ng-repeat=\"item in internalList\" ng-class=\"{ 'selected' : isItemSelected(item) }\" ng-click=\"toggle(item)\">\n" +
|
|
5538
|
-
"<button class=\"choice-checkbox\" ng-class=\"{'circle' : !multiple }\"
|
|
5533
|
+
"<button class=\"choice-checkbox\" ng-class=\"{'circle' : !multiple }\">\n" +
|
|
5534
|
+
"<nice-icon icon=\"icon-check\"></nice-icon>\n" +
|
|
5535
|
+
"</button>\n" +
|
|
5539
5536
|
"<div ng-transclude class=\"choice-label\">{{ getLabel(item) }}</div>\n" +
|
|
5540
5537
|
"</li>\n" +
|
|
5541
5538
|
"</ul>\n" +
|
|
@@ -5568,7 +5565,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5568
5565
|
"<nice-help class=\"nice-title-help\" ng-if=\"help\" text=\"{{ help }}\"></nice-help>\n" +
|
|
5569
5566
|
"</div>\n" +
|
|
5570
5567
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
5571
|
-
"<div class=\"input-group nice-date-input\" ng-class=\"{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }\">\n" +
|
|
5568
|
+
"<div class=\"input-group nice-date-input\" ng-if=\"date\" ng-class=\"{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }\">\n" +
|
|
5572
5569
|
"<input type=\"text\" class=\"form-control\" ng-model=\"modelDate\" ng-blur=\"dateBlur()\" ng-disabled=\"isDisabled\">\n" +
|
|
5573
5570
|
"<nice-popup placement=\"bottom\">\n" +
|
|
5574
5571
|
"<nice-popup-target>\n" +
|
|
@@ -5581,7 +5578,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5581
5578
|
"</nice-popup-content>\n" +
|
|
5582
5579
|
"</nice-popup>\n" +
|
|
5583
5580
|
"</div>\n" +
|
|
5584
|
-
"<div class=\"input-group nice-time-input\" ng-class=\"{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }\">\n" +
|
|
5581
|
+
"<div class=\"input-group nice-time-input\" ng-if=\"time\" ng-class=\"{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }\">\n" +
|
|
5585
5582
|
"<input type=\"text\" class=\"form-control\" ng-model=\"modelTime\" ng-blur=\"timeBlur()\" ng-disabled=\"isDisabled\">\n" +
|
|
5586
5583
|
"<nice-popup placement=\"bottom\">\n" +
|
|
5587
5584
|
"<nice-popup-target>\n" +
|
|
@@ -5590,9 +5587,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5590
5587
|
"</button>\n" +
|
|
5591
5588
|
"</nice-popup-target>\n" +
|
|
5592
5589
|
"<nice-popup-content>\n" +
|
|
5593
|
-
"<
|
|
5594
|
-
"<div class=\"date\"></div>\n" +
|
|
5595
|
-
"</div>\n" +
|
|
5590
|
+
"<nice-date is-inline=\"true\" inline=\"true\" time=\"true\" date=\"false\" on-change=\"timeChanged(model)\" model=\"model\"></nice-date>\n" +
|
|
5596
5591
|
"</nice-popup-content>\n" +
|
|
5597
5592
|
"</nice-popup>\n" +
|
|
5598
5593
|
"</div>\n" +
|
|
@@ -5612,7 +5607,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5612
5607
|
"<div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
5613
5608
|
"<div class=\"input-group\">\n" +
|
|
5614
5609
|
"<input date-range-picker class=\"form-control date-picker\" type=\"text\" options=\"opts\" ng-model=\"model\">\n" +
|
|
5615
|
-
"<span date-range-picker options=\"opts\" ng-model=\"model\" class=\"input-group-addon\"
|
|
5610
|
+
"<span date-range-picker options=\"opts\" ng-model=\"model\" class=\"input-group-addon\">\n" +
|
|
5611
|
+
"<nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
5612
|
+
"</span>\n" +
|
|
5616
5613
|
"</div>\n" +
|
|
5617
5614
|
"</div>\n" +
|
|
5618
5615
|
"</div>\n" +
|
|
@@ -5633,12 +5630,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5633
5630
|
"<div class=\"nice-date-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-show=\"!inline\" ng-click=\"toggleOpen()\">\n" +
|
|
5634
5631
|
"<input type=\"text\" class=\"form-control\" value=\"{{ model | niceDate:time }}\" readonly=\"readonly\">\n" +
|
|
5635
5632
|
"<span class=\"input-group-addon clickable\">\n" +
|
|
5636
|
-
"<
|
|
5633
|
+
"<nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
5637
5634
|
"</span>\n" +
|
|
5638
5635
|
"</div>\n" +
|
|
5639
5636
|
"<div ng-class=\"{ 'nice-date-dropdown-wrapper': !inline }\">\n" +
|
|
5640
|
-
"<div ng-class=\"{ 'nice-date-dropdown': !inline }\" ng-if=\"inline || isOpen\">\n" +
|
|
5641
|
-
"<div class=\"nice-date-date\" ng-
|
|
5637
|
+
"<div ng-class=\"{ 'nice-date-dropdown': !inline, 'with-time': time, 'no-date': !date }\" ng-if=\"inline || isOpen\">\n" +
|
|
5638
|
+
"<div class=\"nice-date-date\" ng-if=\"date\" role=\"grid\">\n" +
|
|
5642
5639
|
"<div class=\"nice-date-header\">\n" +
|
|
5643
5640
|
"<span>\n" +
|
|
5644
5641
|
"<select class=\"year-picker\" ng-model=\"innerDate.year\" ng-change=\"handleDateChange()\" ng-options=\"year for year in years\">\n" +
|
|
@@ -5667,7 +5664,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5667
5664
|
"</div>\n" +
|
|
5668
5665
|
"</div>\n" +
|
|
5669
5666
|
"<div class=\"nice-date-time\" ng-if=\"time\">\n" +
|
|
5670
|
-
"<
|
|
5667
|
+
"<nice-icon icon=\"icon-clock\"></nice-icon>\n" +
|
|
5671
5668
|
"<div class=\"time-picker time-picker-hour\">\n" +
|
|
5672
5669
|
"<select ng-disabled=\"isDisabled\" ng-model=\"innerDate.hour\" ng-change=\"timeChange()\" ng-options=\"hour as hour for hour in hours track by hour\">\n" +
|
|
5673
5670
|
"</select>\n" +
|
|
@@ -5699,7 +5696,8 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5699
5696
|
"<div class=\"input-group\" id=\"dropdown{{randNum}}\">\n" +
|
|
5700
5697
|
"<input type=\"text\" class=\"form-control\" value=\"{{ value }}\" ng-click=\"openDtp()\" ng-disabled=\"isDisabled\">\n" +
|
|
5701
5698
|
"<span class=\"input-group-addon clickable\" ng-click=\"openDtp()\">\n" +
|
|
5702
|
-
"<
|
|
5699
|
+
"<nice-icon ng-if=\"date == 'true'\" icon=\"icon-calendar\"></nice-icon>\n" +
|
|
5700
|
+
"<nice-icon ng-if=\"date != 'true'\" icon=\"icon-clock\"></nice-icon>\n" +
|
|
5703
5701
|
"</span>\n" +
|
|
5704
5702
|
"</div>\n" +
|
|
5705
5703
|
"<div ng-show=\"isOpen\">\n" +
|
|
@@ -5707,7 +5705,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5707
5705
|
"</div>\n" +
|
|
5708
5706
|
"</div>\n" +
|
|
5709
5707
|
"</div>\n" +
|
|
5710
|
-
"</div
|
|
5708
|
+
"</div>"
|
|
5711
5709
|
);
|
|
5712
5710
|
|
|
5713
5711
|
|
|
@@ -5722,7 +5720,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5722
5720
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
5723
5721
|
"<div class=\"nice-daterange-picker-button input-group\" ng-class=\"{ 'open': isOpen }\" ng-click=\"open()\">\n" +
|
|
5724
5722
|
"<input type=\"text\" class=\"form-control\" value=\"{{ modelFormat }}\" readonly=\"readonly\">\n" +
|
|
5725
|
-
"<span class=\"input-group-addon clickable\"
|
|
5723
|
+
"<span class=\"input-group-addon clickable\">\n" +
|
|
5724
|
+
"<nice-icon icon=\"icon-calendar\"></nice-icon>\n" +
|
|
5725
|
+
"</span>\n" +
|
|
5726
5726
|
"</div>\n" +
|
|
5727
5727
|
"<div class=\"nice-daterange-picker-wrapper\">\n" +
|
|
5728
5728
|
"<div class=\"dtp-wrapper\" ng-if=\"isOpen\">\n" +
|
|
@@ -5739,10 +5739,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5739
5739
|
"</div>\n" +
|
|
5740
5740
|
"</div>\n" +
|
|
5741
5741
|
"<div class=\"dtp-left\">\n" +
|
|
5742
|
-
"<nice-date model=\"model.innerStartDate\" next-date=\"model.innerEndDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"
|
|
5742
|
+
"<nice-date model=\"model.innerStartDate\" next-date=\"model.innerEndDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" on-change=\"dateChanged(model)\"></nice-date>\n" +
|
|
5743
5743
|
"</div>\n" +
|
|
5744
5744
|
"<div class=\"dtp-right\">\n" +
|
|
5745
|
-
"<nice-date model=\"model.innerEndDate\" next-date=\"model.innerStartDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"
|
|
5745
|
+
"<nice-date model=\"model.innerEndDate\" next-date=\"model.innerStartDate\" is-inline=\"true\" no-margin=\"true\" inline=\"true\" time=\"time\" on-change=\"dateChanged(model)\"></nice-date>\n" +
|
|
5746
5746
|
"</div>\n" +
|
|
5747
5747
|
"</div>\n" +
|
|
5748
5748
|
"</div>\n" +
|
|
@@ -5766,7 +5766,10 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5766
5766
|
"<div class=\"dropdown-toggle\" id=\"dropdown{{randNum}}\" role=\"button\" ng-click=\"openDtpRange()\">\n" +
|
|
5767
5767
|
"<div class=\"input-group\">\n" +
|
|
5768
5768
|
"<input type=\"text\" class=\"form-control\" value=\"{{value}}\" ng-click=\"openDtpRange()\">\n" +
|
|
5769
|
-
"<span class=\"input-group-addon clickable\"
|
|
5769
|
+
"<span class=\"input-group-addon clickable\">\n" +
|
|
5770
|
+
"<nice-icon ng-if=\"date != 'false'\" icon=\"icon-calendar\"></nice-icon>\n" +
|
|
5771
|
+
"<nice-icon ng-if=\"date == 'false'\" icon=\"icon-clock\"></nice-icon>\n" +
|
|
5772
|
+
"</span>\n" +
|
|
5770
5773
|
"</div>\n" +
|
|
5771
5774
|
"</div>\n" +
|
|
5772
5775
|
"</div>\n" +
|
|
@@ -5910,7 +5913,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5910
5913
|
"</div>\n" +
|
|
5911
5914
|
"</div>\n" +
|
|
5912
5915
|
"</div>\n" +
|
|
5913
|
-
"<button class=\"btn btn-primary add-btn\" type=\"button\" ng-if=\"addButtonFunction && !isDisabled\" ng-click=\"addButtonFunction()\"
|
|
5916
|
+
"<button class=\"btn btn-primary btn-icon add-btn\" type=\"button\" ng-if=\"addButtonFunction && !isDisabled\" ng-click=\"addButtonFunction()\">\n" +
|
|
5917
|
+
"<nice-icon icon=\"icon-plus\"></nice-icon>\n" +
|
|
5918
|
+
"</button>\n" +
|
|
5914
5919
|
"</div>\n" +
|
|
5915
5920
|
"</div>\n" +
|
|
5916
5921
|
"</div>\n" +
|
|
@@ -6004,13 +6009,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
6004
6009
|
"</div>\n" +
|
|
6005
6010
|
"</div>\n" +
|
|
6006
6011
|
"</div>\n" +
|
|
6007
|
-
"</div
|
|
6012
|
+
"</div>"
|
|
6008
6013
|
);
|
|
6009
6014
|
|
|
6010
6015
|
|
|
6011
6016
|
$templateCache.put('src/components/nice-help/nice-help.html',
|
|
6012
6017
|
"<div class=\"nice-help\" ng-mouseover=\"onHover()\">\n" +
|
|
6013
|
-
"<
|
|
6018
|
+
"<nice-icon icon=\"icon-help-circle\" class=\"nice-help-button\"></nice-icon>\n" +
|
|
6014
6019
|
"<div class=\"nice-help-popup\">\n" +
|
|
6015
6020
|
"<span ng-bind-html=\"text\">{{ text }}</span>\n" +
|
|
6016
6021
|
"<div data-popper-arrow class=\"nice-help-arrow\"></div>\n" +
|
|
@@ -6048,14 +6053,16 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
6048
6053
|
"<div ng-if=\"forma.$error && forma.$dirty\">\n" +
|
|
6049
6054
|
"<div class=\"error-message\" ng-if=\"forma.$dirty && forma.$error.email\" translate translate-context=\"Nice\">Email is not valid.</div>\n" +
|
|
6050
6055
|
"<div class=\"error-message\" ng-if=\"forma.$dirty && forma.$error.pattern\" translate translate-context=\"Nice\">This field requires a specific pattern.</div>\n" +
|
|
6051
|
-
"<div class=\"error-message\" ng-if=\"forma.$error.minlength\"
|
|
6056
|
+
"<div class=\"error-message\" ng-if=\"forma.$error.minlength\">\n" +
|
|
6057
|
+
"<translate translate-context=\"Nice\">Your input is too short. It must contain at least</translate> {{ minlength }} <translate translate-context=\"Nice\">characters</translate>.\n" +
|
|
6058
|
+
"</div>\n" +
|
|
6052
6059
|
"<div class=\"error-message\" ng-if=\"forma.$error.maxlength\" translate translate-context=\"Nice\">Your input is too long</div>\n" +
|
|
6053
6060
|
"<div class=\"error-message\" ng-if=\"forma.$error.required\" ng-if=\"forma.$dirty\" translate translate-context=\"Nice\">This field is required.</div>\n" +
|
|
6054
6061
|
"<div class=\"error-message\" ng-if=\"forma.$error.unique\" translate translate-context=\"Nice\">This field must be unique.</div>\n" +
|
|
6055
6062
|
"</div>\n" +
|
|
6056
6063
|
"</div>\n" +
|
|
6057
6064
|
"</div>\n" +
|
|
6058
|
-
"</ng-form
|
|
6065
|
+
"</ng-form>"
|
|
6059
6066
|
);
|
|
6060
6067
|
|
|
6061
6068
|
|
|
@@ -6103,11 +6110,15 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
6103
6110
|
"<div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
6104
6111
|
"<div class=\"input-group\" ng-class=\"{'has-warning': !disabled && niceNumberForm.$invalid && niceNumberForm.$dirty}\">\n" +
|
|
6105
6112
|
"<span class=\"input-group-btn\">\n" +
|
|
6106
|
-
"<button class=\"btn btn-default\" type=\"button\" ng-disabled=\"!canSubstract\" ng-click=\"subtract()\" tabindex=\"-1\"
|
|
6113
|
+
"<button class=\"btn btn-default btn-left\" type=\"button\" ng-disabled=\"!canSubstract\" ng-click=\"subtract()\" tabindex=\"-1\">\n" +
|
|
6114
|
+
"<nice-icon icon=\"icon-minus\"></nice-icon>\n" +
|
|
6115
|
+
"</button>\n" +
|
|
6107
6116
|
"</span>\n" +
|
|
6108
6117
|
"<input type=\"number\" step=\"{{ step }}\" ng-change=\"inputChanged()\" class=\"form-control\" max=\"{{ max }}\" min=\"{{ min }}\" ng-model=\"model\">\n" +
|
|
6109
6118
|
"<span class=\"input-group-btn\">\n" +
|
|
6110
|
-
"<button class=\"btn btn-default\" type=\"button\" ng-disabled=\"!canAdd\" ng-click=\"add()\" tabindex=\"-1\"
|
|
6119
|
+
"<button class=\"btn btn-default btn-right\" type=\"button\" ng-disabled=\"!canAdd\" ng-click=\"add()\" tabindex=\"-1\">\n" +
|
|
6120
|
+
"<nice-icon icon=\"icon-plus\"></nice-icon>\n" +
|
|
6121
|
+
"</button>\n" +
|
|
6111
6122
|
"</span>\n" +
|
|
6112
6123
|
"</div>\n" +
|
|
6113
6124
|
"<div class=\"error-messages\" ng-if=\"niceNumberForm.$error && !hideError\" ng-class=\"{ 'floating-error': floatingError }\">\n" +
|
|
@@ -6197,9 +6208,13 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
6197
6208
|
"</div>\n" +
|
|
6198
6209
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
6199
6210
|
"<div class=\"input-group\">\n" +
|
|
6200
|
-
"<button class=\"btn btn-default btn-left\" ng-click=\"sub()\" type=\"button\" ng-disabled=\"isDisabled\" tabindex=\"-1\"
|
|
6211
|
+
"<button class=\"btn btn-default btn-left\" ng-click=\"sub()\" type=\"button\" ng-disabled=\"isDisabled\" tabindex=\"-1\">\n" +
|
|
6212
|
+
"<nice-icon icon=\"icon-minus\"></nice-icon>\n" +
|
|
6213
|
+
"</button>\n" +
|
|
6201
6214
|
"<input class=\"value form-control\" ng-model=\"model\" type=\"number\" ng-change=\"handleChange()\" ng-disabled=\"isDisabled\">\n" +
|
|
6202
|
-
"<button class=\"btn btn-default btn-right\" ng-click=\"add()\" type=\"button\" ng-disabled=\"isDisabled\" tabindex=\"-1\"
|
|
6215
|
+
"<button class=\"btn btn-default btn-right\" ng-click=\"add()\" type=\"button\" ng-disabled=\"isDisabled\" tabindex=\"-1\">\n" +
|
|
6216
|
+
"<nice-icon icon=\"icon-plus\"></nice-icon>\n" +
|
|
6217
|
+
"</button>\n" +
|
|
6203
6218
|
"</div>\n" +
|
|
6204
6219
|
"</div>\n" +
|
|
6205
6220
|
"</div>\n" +
|
|
@@ -6222,11 +6237,11 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
6222
6237
|
" \">\n" +
|
|
6223
6238
|
"<input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"modelString\" ng-keypress=\"keypress($event)\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-required=\"required\" tabindex=\"{{ tabIndex }}\">\n" +
|
|
6224
6239
|
"<span class=\"input-group-addon clickable\" ng-click=\"search()\" ng-if=\"!model\">\n" +
|
|
6225
|
-
"<
|
|
6226
|
-
"<
|
|
6240
|
+
"<nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
|
|
6241
|
+
"<nice-icon ng-show=\"loading\" icon=\"icon-loader\" class=\"d-block nice-animation-spin\"></nice-icon>\n" +
|
|
6227
6242
|
"</span>\n" +
|
|
6228
6243
|
"<span class=\"input-group-addon clickable\" ng-click=\"remove()\" ng-if=\"model\">\n" +
|
|
6229
|
-
"<
|
|
6244
|
+
"<nice-icon ng-show=\"!loading\" icon=\"icon-x\"></nice-icon>\n" +
|
|
6230
6245
|
"</span>\n" +
|
|
6231
6246
|
"</div>\n" +
|
|
6232
6247
|
"</div>\n" +
|
|
@@ -6259,8 +6274,8 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
6259
6274
|
"<div class=\"nice-search-button input-group\" ng-class=\"{ 'disabled': isDisabled, 'has-warning': !isDisabled && form.$invalid && form.$dirty, 'has-success': !isDisabled && form.$valid && form.$dirty}\">\n" +
|
|
6260
6275
|
"<input class=\"form-control\" type=\"text\" id=\"{{ id }}\" ng-model=\"model\" placeholder=\"{{ placeholder }}\" ng-disabled=\"isDisabled\" ng-change=\"updateSearch()\" ng-focus=\"onFocus()\" tabindex=\"{{ tabIndex }}\">\n" +
|
|
6261
6276
|
"<span class=\"input-group-addon clickable\" ng-click=\"onFocus()\">\n" +
|
|
6262
|
-
"<
|
|
6263
|
-
"<
|
|
6277
|
+
"<nice-icon ng-show=\"!loading\" icon=\"icon-search\"></nice-icon>\n" +
|
|
6278
|
+
"<nice-icon ng-show=\"loading\" icon=\"icon-loader\" class=\"d-block nice-animation-spin\"></nice-icon>\n" +
|
|
6264
6279
|
"</span>\n" +
|
|
6265
6280
|
"</div>\n" +
|
|
6266
6281
|
"<div class=\"nice-search-dropdown-wrapper\">\n" +
|
|
@@ -7180,28 +7195,28 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7180
7195
|
" 'disabled': isDisabled\n" +
|
|
7181
7196
|
" }\">\n" +
|
|
7182
7197
|
"<input type=\"text\" class=\"form-control\" ng-model=\"modelString\" ng-keyup=\"$event.keyCode == 13 && validateDate()\" ng-blur=\"validateDate()\">\n" +
|
|
7183
|
-
"<span class=\"input-group-addon clickable\" ng-click=\"open = !open\"
|
|
7198
|
+
"<span class=\"input-group-addon clickable\" ng-click=\"open = !open\">\n" +
|
|
7199
|
+
"<nice-icon icon=\"icon-clock\"></nice-icon>\n" +
|
|
7200
|
+
"</span>\n" +
|
|
7184
7201
|
"</div>\n" +
|
|
7185
7202
|
"<div class=\"nice-time-picker-dropdown\" ng-if=\"open\">\n" +
|
|
7186
|
-
"<div
|
|
7187
|
-
"<
|
|
7188
|
-
"<
|
|
7189
|
-
"</
|
|
7190
|
-
"<div class=\"
|
|
7191
|
-
"<button ng-click=\"
|
|
7192
|
-
"
|
|
7193
|
-
"</
|
|
7194
|
-
"<div class=\"row numbers\">\n" +
|
|
7195
|
-
"<div class=\"col-xs-6\">{{ hours }}</div>\n" +
|
|
7196
|
-
"<div class=\"col-xs-6\">{{ minutes }}</div>\n" +
|
|
7197
|
-
"</div>\n" +
|
|
7198
|
-
"<div class=\"row\">\n" +
|
|
7199
|
-
"<div class=\"col-xs-6\">\n" +
|
|
7200
|
-
"<button ng-click=\"changeHour(false)\"><i class=\"fa fa-chevron-down\"></i></button>\n" +
|
|
7201
|
-
"</div>\n" +
|
|
7202
|
-
"<div class=\"col-xs-6\">\n" +
|
|
7203
|
-
"<button ng-click=\"changeMinutes(false)\"><i class=\"fa fa-chevron-down\"></i></button>\n" +
|
|
7203
|
+
"<div>\n" +
|
|
7204
|
+
"<button class=\"btn btn-sm btn-block btn-default\" ng-click=\"changeHour(true)\">\n" +
|
|
7205
|
+
"<nice-icon icon=\"icon-chevron-up\"></nice-icon>\n" +
|
|
7206
|
+
"</button>\n" +
|
|
7207
|
+
"<div class=\"numbers\">{{ hours }}</div>\n" +
|
|
7208
|
+
"<button class=\"btn btn-sm btn-block btn-default\" ng-click=\"changeHour(false)\">\n" +
|
|
7209
|
+
"<nice-icon icon=\"icon-chevron-down\"></nice-icon>\n" +
|
|
7210
|
+
"</button>\n" +
|
|
7204
7211
|
"</div>\n" +
|
|
7212
|
+
"<div>\n" +
|
|
7213
|
+
"<button class=\"btn btn-sm btn-block btn-default\" ng-click=\"changeMinutes(true)\">\n" +
|
|
7214
|
+
"<nice-icon icon=\"icon-chevron-up\"></nice-icon>\n" +
|
|
7215
|
+
"</button>\n" +
|
|
7216
|
+
"<div class=\"numbers\">{{ minutes }}</div>\n" +
|
|
7217
|
+
"<button class=\"btn btn-sm btn-block btn-default\" ng-click=\"changeMinutes(false)\">\n" +
|
|
7218
|
+
"<nice-icon icon=\"icon-chevron-down\"></nice-icon>\n" +
|
|
7219
|
+
"</button>\n" +
|
|
7205
7220
|
"</div>\n" +
|
|
7206
7221
|
"</div>\n" +
|
|
7207
7222
|
"</div>\n" +
|
|
@@ -7254,8 +7269,8 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7254
7269
|
"</div>\n" +
|
|
7255
7270
|
"<div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
7256
7271
|
"<div class=\"yesno-wrapper noselect\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
|
|
7257
|
-
"<
|
|
7258
|
-
"<
|
|
7272
|
+
"<button class=\"yesno-yes-bg\" ng-click=\"switch()\" tabindex=\"-1\">{{ yes }}</button>\n" +
|
|
7273
|
+
"<button class=\"yesno-no-bg\" ng-click=\"switch()\" tabindex=\"-1\">{{ no }}</button>\n" +
|
|
7259
7274
|
"<button class=\"yesno-button btn btn-primary\" ng-class=\"buttonClass\" ng-click=\"switch()\">{{ state }}</button>\n" +
|
|
7260
7275
|
"</div>\n" +
|
|
7261
7276
|
"</div>\n" +
|