nice-elements 1.13.2 → 1.13.4

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.
Files changed (68) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +1 -1
  3. package/bower.json +1 -1
  4. package/dist/nice.js +313 -145
  5. package/dist/nice.min.js +1 -1
  6. package/dist/style.css +108 -74
  7. package/dist/style.css.map +1 -1
  8. package/dist/style.min.css +2 -2
  9. package/package.json +1 -1
  10. package/src/components/nice-alert/nice-alert.js +3 -2
  11. package/src/components/nice-calendar/nice-calendar.html +105 -12
  12. package/src/components/nice-calendar/nice-calendar.js +118 -47
  13. package/src/components/nice-calendar/nice-calendar.scss +137 -95
  14. package/src/components/nice-checkbox/nice-checkbox.html +1 -1
  15. package/src/components/nice-choice/nice-choice.html +1 -1
  16. package/src/components/nice-choice/nice-choice.js +1 -0
  17. package/src/components/nice-comment/nice-comment.html +1 -1
  18. package/src/components/nice-comment/nice-comment.js +1 -0
  19. package/src/components/nice-date/nice-date.html +18 -9
  20. package/src/components/nice-date/nice-date.js +67 -36
  21. package/src/components/nice-date/nice-date.scss +21 -27
  22. package/src/components/nice-date-input/nice-date-input.html +1 -1
  23. package/src/components/nice-date-input/nice-date-input.js +1 -0
  24. package/src/components/nice-date-range/nice-date-range.html +1 -1
  25. package/src/components/nice-date-range/nice-date-range.js +1 -0
  26. package/src/components/nice-datetime-picker/nice-datetime-picker.html +1 -1
  27. package/src/components/nice-datetime-picker/nice-datetime-picker.js +1 -0
  28. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +1 -1
  29. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +1 -0
  30. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +1 -1
  31. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +1 -0
  32. package/src/components/nice-dropdown/nice-dropdown.html +1 -1
  33. package/src/components/nice-dropdown/nice-dropdown.js +1 -0
  34. package/src/components/nice-dropdown-date/nice-dropdown-date.html +1 -1
  35. package/src/components/nice-dropdown-date/nice-dropdown-date.js +1 -0
  36. package/src/components/nice-dropdown-old/nice-dropdown-old.html +1 -1
  37. package/src/components/nice-dropdown-old/nice-dropdown-old.js +1 -0
  38. package/src/components/nice-dtp/nice-dtp.js +1 -0
  39. package/src/components/nice-input/nice-input.js +1 -1
  40. package/src/components/nice-label/nice-label.html +1 -1
  41. package/src/components/nice-label/nice-label.js +1 -0
  42. package/src/components/nice-number/nice-number.html +1 -1
  43. package/src/components/nice-number/nice-number.js +1 -0
  44. package/src/components/nice-options/nice-options.html +1 -1
  45. package/src/components/nice-options/nice-options.js +1 -0
  46. package/src/components/nice-percent/nice-percent.html +1 -1
  47. package/src/components/nice-percent/nice-percent.js +1 -0
  48. package/src/components/nice-progress-bar/nice-progress-bar.html +1 -1
  49. package/src/components/nice-progress-bar/nice-progress-bar.js +1 -0
  50. package/src/components/nice-quantity/nice-quantity.html +1 -1
  51. package/src/components/nice-quantity/nice-quantity.js +1 -0
  52. package/src/components/nice-search/nice-search.html +1 -1
  53. package/src/components/nice-search/nice-search.js +1 -0
  54. package/src/components/nice-search2/nice-search2.html +1 -1
  55. package/src/components/nice-search2/nice-search2.js +1 -0
  56. package/src/components/nice-slot/nice-slot.html +1 -1
  57. package/src/components/nice-slot/nice-slot.js +1 -0
  58. package/src/components/nice-time-picker/nice-time-picker.html +1 -1
  59. package/src/components/nice-time-picker/nice-time-picker.js +1 -0
  60. package/src/components/nice-toggle/nice-toggle.html +1 -1
  61. package/src/components/nice-upload/nice-upload.html +17 -3
  62. package/src/components/nice-upload/nice-upload.js +12 -6
  63. package/src/components/nice-wrapper/nice-wrapper.js +1 -0
  64. package/src/components/nice-yesno/nice-yesno.html +1 -1
  65. package/src/components/nice-yesno/nice-yesno.js +1 -0
  66. package/src/filters/nice-highlight.js +15 -6
  67. package/src/services/nice-service.js +1 -1
  68. package/src/styles/_nice-common.scss +11 -1
package/dist/nice.js CHANGED
@@ -19,10 +19,11 @@ angular.module('niceElements')
19
19
  icon: '@?',
20
20
  type: '@?',
21
21
  niceTitle: '@?',
22
+ description: '@?',
22
23
  message: '@?',
23
24
  fitContent: '=?',
24
- iconCenter: '@?',
25
- largeIcon: '@?'
25
+ iconCenter: '=?',
26
+ largeIcon: '=?'
26
27
  },
27
28
  controller: function ($scope) {
28
29
  if (!$scope.type) $scope.type = "error";
@@ -235,6 +236,7 @@ angular.module('niceElements')
235
236
  templateUrl: "src/components/nice-calendar/nice-calendar.html",
236
237
  scope: {
237
238
  niceTitle: '@',
239
+ description: '@?',
238
240
  title: '@',
239
241
  fieldWidth: '@',
240
242
  labelWidth: '@',
@@ -255,9 +257,31 @@ angular.module('niceElements')
255
257
  },
256
258
  link: function (scope, element) {
257
259
  // ------------------ Init default values ------------------
260
+ scope.innerDate = moment();
258
261
  scope.selectStart = true;
259
262
  scope.popupText = gettextCatalog.getString("Select start date", null, "Nice");
260
263
 
264
+ scope.years = [];
265
+ const year = moment().year() - 100;
266
+ for (let i = 0; i < 200; i++) {
267
+ scope.years.push(year + i);
268
+ }
269
+
270
+ scope.months = [
271
+ { value: 0, name: gettextCatalog.getString("January", null, "Nice") },
272
+ { value: 1, name: gettextCatalog.getString("February", null, "Nice") },
273
+ { value: 2, name: gettextCatalog.getString("March", null, "Nice") },
274
+ { value: 3, name: gettextCatalog.getString("April", null, "Nice") },
275
+ { value: 4, name: gettextCatalog.getString("May", null, "Nice") },
276
+ { value: 5, name: gettextCatalog.getString("June", null, "Nice") },
277
+ { value: 6, name: gettextCatalog.getString("July", null, "Nice") },
278
+ { value: 7, name: gettextCatalog.getString("August", null, "Nice") },
279
+ { value: 8, name: gettextCatalog.getString("September", null, "Nice") },
280
+ { value: 9, name: gettextCatalog.getString("October", null, "Nice") },
281
+ { value: 10, name: gettextCatalog.getString("November", null, "Nice") },
282
+ { value: 11, name: gettextCatalog.getString("December", null, "Nice") }
283
+ ];
284
+
261
285
  scope.hours = [
262
286
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
263
287
  ];
@@ -320,11 +344,11 @@ angular.module('niceElements')
320
344
  scope.endDateMinute = moment(scope.endDate).minutes();
321
345
  }
322
346
  }
323
-
324
- scope.month = angular.copy(moment(scope.startDate));
347
+
348
+ scope.innerDate = angular.copy(moment(scope.startDate));
325
349
  const start = angular.copy(moment(scope.startDate));
326
350
  _removeTimeWithDate(start.date(0));
327
- _buildMonth(scope, start, scope.month);
351
+ _buildMonth();
328
352
  }
329
353
 
330
354
  bootstrap();
@@ -381,7 +405,7 @@ angular.module('niceElements')
381
405
  }
382
406
  }
383
407
 
384
- if (scope.onChange) scope.onChange({ model: { startDate: scope.startDate, endDate: scope.endDate }, element: element });
408
+ scope.handleUpdate();
385
409
  }
386
410
  };
387
411
 
@@ -440,31 +464,44 @@ angular.module('niceElements')
440
464
 
441
465
 
442
466
  scope.handleUpdate = function () {
467
+ scope.startDate.seconds(0).millisecond(0);
468
+ scope.endDate.seconds(59).milliseconds(999);
443
469
  if (scope.onChange) scope.onChange({ model: { startDate: scope.startDate, endDate: scope.endDate }, element: element });
444
470
  };
445
471
 
472
+ scope.yearSelectChange = function () {
473
+ scope.innerDate = scope.innerDate.year(scope.selectedYear);
474
+ _buildMonth();
475
+ };
476
+
477
+ scope.monthSelectChange = function () {
478
+ scope.innerDate = scope.innerDate.month(scope.selectedMonth);
479
+ _buildMonth();
480
+ };
481
+
482
+ // ------------------ Go to today ------------------
483
+ scope.today = function () {
484
+ scope.innerDate = moment();
485
+ _buildMonth();
486
+ };
446
487
 
447
488
  // ------------------ Go to next month ------------------
448
489
  scope.next = function () {
449
- const next = angular.copy(scope.month);
450
- _removeTimeWithDate(next.month(next.month() + 1).date(0));
451
- scope.month.month(scope.month.month() + 1);
452
- _buildMonth(scope, next, scope.month);
490
+ scope.innerDate = scope.innerDate.add(1, "month");
491
+ _buildMonth();
453
492
  };
454
493
 
455
494
 
456
495
  // ------------------ Go to previous month ------------------
457
496
  scope.previous = function () {
458
- const previous = angular.copy(scope.month);
459
- _removeTimeWithDate(previous.month(previous.month() - 1).date(0));
460
- scope.month.month(scope.month.month() - 1);
461
- _buildMonth(scope, previous, scope.month);
497
+ scope.innerDate = scope.innerDate.subtract(1, "month");
498
+ _buildMonth();
462
499
  };
463
500
 
464
501
 
465
502
  // ------------------ Check if dates are equal without time ------------------
466
503
  scope.isSameDay = function (date1, date2) {
467
- if(!date1 || !date2) return false;
504
+ if (!date1 || !date2) return false;
468
505
  const d1 = _removeTime(angular.copy(date1));
469
506
  const d2 = _removeTime(angular.copy(date2));
470
507
  return d1.isSame(d2);
@@ -473,7 +510,7 @@ angular.module('niceElements')
473
510
 
474
511
  // ------------------ Check if date is between start and end date ------------------
475
512
  scope.isBetweenRange = function (date) {
476
- if(!scope.endDate || !scope.startDate) return false;
513
+ if (!scope.endDate || !scope.startDate) return false;
477
514
  return (date.isBefore(moment(scope.endDate)) && date.isAfter(moment(scope.startDate)));
478
515
  };
479
516
 
@@ -523,45 +560,80 @@ angular.module('niceElements')
523
560
  return date.day(0).hour(0).minute(0).second(0).millisecond(0);
524
561
  }
525
562
 
563
+ // ------------------ Build month ------------------
564
+ function _buildMonth() {
565
+ scope.selectedYear = scope.innerDate.year();
566
+ scope.selectedMonth = scope.innerDate.month();
567
+
568
+ scope.days = [];
526
569
 
570
+ // 1. Get the first day of the currently viewed month
571
+ const firstDayOfMonth = new Date(
572
+ scope.innerDate.year(),
573
+ scope.innerDate.month(),
574
+ 1
575
+ );
527
576
 
528
- // ------------------ Build month ------------------
529
- function _buildMonth(scope, start, month) {
530
- scope.weeks = [];
531
- let done = false, date = start.clone().startOf('week').isoWeekday(1), monthIndex = date.month(), count = 0;
532
- date.add(1, "w");
533
- while (!done) {
534
- scope.weeks.push({ days: _buildWeek(date.clone(), month) });
535
- date.add(1, "w");
536
- done = count++ > 2 && monthIndex !== date.month();
537
- monthIndex = date.month();
577
+ // 2. Calculate the offset (0 = Sunday, 1 = Monday, etc.)
578
+ // If your calendar starts on Monday, we adjust the JS Sunday (0) to 7
579
+ let startOffset = firstDayOfMonth.getDay();
580
+ if (startOffset === 0) startOffset = 7; // Treat Sunday as 7
581
+ startOffset -= 1; // Adjust so Monday = 0
582
+
583
+ // 3. We always want to show a standard 6-week grid (42 days)
584
+ // We start the loop from 1 minus the offset
585
+ for (let d = 1 - startOffset; d <= 42 - startOffset; d++) {
586
+ scope.days.push(
587
+ _buildDay(
588
+ scope.innerDate.year(),
589
+ scope.innerDate.month(),
590
+ d
591
+ )
592
+ );
538
593
  }
539
594
  }
540
595
 
596
+ // ------------------ Build day ------------------
597
+ function _buildDay(year, month, day) {
598
+ const today = moment();
599
+ const date = moment().year(year).month(month).date(day);
600
+ return {
601
+ id: date.toString(),
602
+ date: date,
603
+ year: date.year(),
604
+ month: date.month(),
605
+ day: date.date(),
606
+ dayInWeek: date.day(),
607
+ isCurrentMonth: date.month() == scope.innerDate.month(),
608
+ isWeekday: date.day() == 0 || date.day() == 6,
609
+ isToday: _isSameDay(moment(), date),
610
+ selected: _isSameDay(scope.innerDate, date),
611
+ today: _isSameDay(today, date),
612
+ highlighted: _isHighlighted(date),
613
+ isDisabled: _isDisabledDate(date),
614
+ text: date.format('dddd, D.M.YYYY'),
615
+ name: date.format('D'),
616
+ };
617
+ }
541
618
 
542
- // ------------------ Build week ------------------
543
- function _buildWeek(date, month) {
544
- const days = [];
545
- for (let i = 0; i < 7; i++) {
546
- const day = {
547
- name: date.format("dd"),
548
- number: date.date(),
549
- isCurrentMonth: date.month() === month.month(),
550
- isToday: date.isSame(new Date(), "day"),
551
- isWeekday: date.weekday() == 0 || date.weekday() == 6,
552
- date: date
553
- };
554
-
555
- if (scope.minDate) day.isDisabled = date.isBefore(moment(scope.minDate));
556
- if (scope.maxDate) day.isDisabled = date.isAfter(moment(scope.maxDate));
557
- if (scope.minDate && scope.maxDate) day.isDisabled = !date.isBetween(moment(scope.minDate), moment(scope.maxDate));
619
+ function _isDisabledDate(date) {
620
+ // console.log(date.format('D.M.YYYY'), scope.minDate.format('D.M.YYYY'), scope.maxDate.format('D.M.YYYY'));
621
+ if (scope.minDate && date.isBefore(scope.minDate)) return true;
622
+ if (scope.maxDate && date.isAfter(scope.maxDate)) return true;
623
+ return false;
624
+ }
558
625
 
559
- days.push(day);
560
- date = date.clone();
561
- date.add(1, "d");
562
- }
626
+ function _isHighlighted(date) {
627
+ // if (props.highlightTo && isWithinInterval(date, { end: props.highlightTo, start: selected.value })) return true;
628
+ return false;
629
+ }
563
630
 
564
- return days;
631
+ function _isSameDay(date1, date2) {
632
+ return (
633
+ date1.date() == date2.date() &&
634
+ date1.month() == date2.month() &&
635
+ date1.year() == date2.year()
636
+ );
565
637
  }
566
638
  }
567
639
  };
@@ -622,6 +694,7 @@ angular.module('niceElements')
622
694
  restrict: 'E',
623
695
  scope: {
624
696
  niceTitle: '@',
697
+ description: '@?',
625
698
  title: '@',
626
699
  model: '=',
627
700
  list: '=',
@@ -836,6 +909,7 @@ angular.module('niceElements')
836
909
  model: '=',
837
910
  title: '@?',
838
911
  niceTitle: '@?',
912
+ description: '@?',
839
913
  isDisabled: '=',
840
914
  placeholder: '@',
841
915
  noTextLabel: '@',
@@ -913,6 +987,7 @@ angular.module('niceElements')
913
987
  maxDate: '=', // default: undefined
914
988
  niceTitle: '@',
915
989
  title: '@', // default: ''
990
+ description: '@?',
916
991
  noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
917
992
  fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
918
993
  labelWidth: '@', // default: 'col-sm-4', bootstrap classes that defines width of label
@@ -1054,6 +1129,7 @@ angular.module('niceElements')
1054
1129
  model: '=',
1055
1130
  niceTitle: '@',
1056
1131
  title: '@',
1132
+ description: '@?',
1057
1133
  fieldWidth: '@',
1058
1134
  format: '@',
1059
1135
  min: '@',
@@ -1131,6 +1207,7 @@ angular.module('niceElements')
1131
1207
  templateUrl: 'src/components/nice-date/nice-date.html',
1132
1208
  scope: {
1133
1209
  niceTitle: '@',
1210
+ description: '@?',
1134
1211
  title: '@', // default: ''
1135
1212
  noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
1136
1213
  fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
@@ -1373,47 +1450,77 @@ angular.module('niceElements')
1373
1450
 
1374
1451
 
1375
1452
  // ------------------ Build month ------------------
1376
- $scope._buildMonth = function () {
1377
- let done = false;
1378
- const date = angular.copy($scope.innerDate.date).startOf("month").startOf('week').isoWeekday(1);
1379
- let monthIndex = date.month();
1380
- let count = 0;
1381
-
1382
- $scope.weeks = [];
1383
- while (!done) {
1384
- $scope.weeks.push({ days: $scope._buildWeek(date.clone()) });
1385
- date.add(1, "w");
1386
- done = count++ > 2 && monthIndex !== date.month();
1387
- monthIndex = date.month();
1453
+ $scope._buildMonth = function() {
1454
+ $scope.days = [];
1455
+
1456
+ // 1. Get the first day of the currently viewed month
1457
+ const firstDayOfMonth = new Date(
1458
+ $scope.innerDate.year,
1459
+ $scope.innerDate.month,
1460
+ 1
1461
+ );
1462
+
1463
+ // 2. Calculate the offset (0 = Sunday, 1 = Monday, etc.)
1464
+ // If your calendar starts on Monday, we adjust the JS Sunday (0) to 7
1465
+ let startOffset = firstDayOfMonth.getDay();
1466
+ if (startOffset === 0) startOffset = 7; // Treat Sunday as 7
1467
+ startOffset -= 1; // Adjust so Monday = 0
1468
+
1469
+ // 3. We always want to show a standard 6-week grid (42 days)
1470
+ // We start the loop from 1 minus the offset
1471
+ for (let d = 1 - startOffset; d <= 42 - startOffset; d++) {
1472
+ $scope.days.push(
1473
+ _buildDay(
1474
+ $scope.innerDate.year,
1475
+ $scope.innerDate.month,
1476
+ d
1477
+ )
1478
+ );
1388
1479
  }
1389
1480
  };
1390
1481
 
1482
+ // ------------------ Build day ------------------
1483
+ function _buildDay(year, month, day) {
1484
+ const today = moment();
1485
+ const date = moment().year(year).month(month).date(day);
1486
+ return {
1487
+ id: date.toString(),
1488
+ date: date,
1489
+ year: date.year(),
1490
+ month: date.month(),
1491
+ day: date.date(),
1492
+ dayInWeek: date.day(),
1493
+ isCurrentMonth: date.month() == $scope.innerDate.month,
1494
+ isWeekday: date.day() == 0 || date.day() == 6,
1495
+ isToday: _isSameDay(moment(), date),
1496
+ selected: _isSameDay($scope.innerDate.date, date),
1497
+ today: _isSameDay(today, date),
1498
+ highlighted: _isHighlighted(date),
1499
+ isDisabled: _isDisabledDate(date),
1500
+ text: date.format('dddd, D.M.YYYY'),
1501
+ name: date.format('D'),
1502
+ };
1503
+ }
1391
1504
 
1392
- // ------------------ Build week ------------------
1393
- $scope._buildWeek = function (date) {
1394
- const days = [];
1395
- for (let i = 0; i < 7; i++) {
1396
- const day = {
1397
- name: date.format("dd"),
1398
- number: date.date(),
1399
- isCurrentMonth: $scope.isSameMonth(date, $scope.innerDate.date),
1400
- isToday: date.isSame(new Date(), "day"),
1401
- isWeekday: date.weekday() == 6 || date.weekday() == 0,
1402
- value: date.format('D.M.YYYY'),
1403
- date: date
1404
- };
1405
-
1406
- if ($scope.minDate) day.isDisabled = date.isBefore($scope.minDate);
1407
- if ($scope.maxDate) day.isDisabled = date.isAfter($scope.maxDate);
1408
- if ($scope.minDate && $scope.maxDate) day.isDisabled = !date.isBetween($scope.minDate, $scope.maxDate);
1505
+ function _isDisabledDate(date) {
1506
+ // console.log(date.format('D.M.YYYY'), $scope.minDate.format('D.M.YYYY'), $scope.maxDate.format('D.M.YYYY'));
1507
+ if ($scope.minDate && date.isBefore($scope.minDate)) return true;
1508
+ if ($scope.maxDate && date.isAfter($scope.maxDate)) return true;
1509
+ return false;
1510
+ }
1409
1511
 
1410
- days.push(day);
1411
- date = date.clone();
1412
- date.add(1, "d");
1413
- }
1512
+ function _isHighlighted(date) {
1513
+ // if (props.highlightTo && isWithinInterval(date, { end: props.highlightTo, start: selected.value })) return true;
1514
+ return false;
1515
+ }
1414
1516
 
1415
- return days;
1416
- };
1517
+ function _isSameDay(date1, date2) {
1518
+ return (
1519
+ date1.date() == date2.date() &&
1520
+ date1.month() == date2.month() &&
1521
+ date1.year() == date2.year()
1522
+ );
1523
+ }
1417
1524
 
1418
1525
 
1419
1526
  // ------------------ Watch for model change ------------------
@@ -1493,6 +1600,7 @@ angular.module('niceElements').directive('niceDatetimePicker', function () {
1493
1600
  cancelText: '@',
1494
1601
  shortTime: '@', // default: false,
1495
1602
  niceTitle: '@',
1603
+ description: '@?',
1496
1604
  title: '@', // default: ''
1497
1605
  noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
1498
1606
  fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
@@ -1575,6 +1683,7 @@ angular.module('niceElements')
1575
1683
  minDate: '@', // default: undefined
1576
1684
  maxDate: '@', // default: undefined
1577
1685
  niceTitle: '@',
1686
+ description: '@?',
1578
1687
  title: '@', // default: ''
1579
1688
  noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
1580
1689
  fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
@@ -1759,6 +1868,7 @@ angular.module('niceElements')
1759
1868
  cancelText: '@',
1760
1869
  shortTime: '@', // default: false,
1761
1870
  niceTitle: '@',
1871
+ description: '@?',
1762
1872
  title: '@', // default: ''
1763
1873
  noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
1764
1874
  fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
@@ -1997,6 +2107,7 @@ angular.module('niceElements')
1997
2107
  scope: {
1998
2108
  model: '=',
1999
2109
  niceTitle: '@',
2110
+ description: '@?',
2000
2111
  title: '@',
2001
2112
  fieldWidth: '@',
2002
2113
  labelWidth: '@',
@@ -2129,6 +2240,7 @@ angular.module('niceElements')
2129
2240
  transclude: true,
2130
2241
  scope: {
2131
2242
  niceTitle: '@',
2243
+ description: '@?',
2132
2244
  title: '@', // Title of the field
2133
2245
  model: '=', // Aka model
2134
2246
  list: '=', // List of options
@@ -2463,6 +2575,7 @@ angular.module('niceElements')
2463
2575
  },
2464
2576
  scope: {
2465
2577
  niceTitle: '@',
2578
+ description: '@?',
2466
2579
  title: '@', // Title of the field
2467
2580
  model: '=', // Aka model
2468
2581
  list: '=', // List of options
@@ -2993,6 +3106,7 @@ angular.module('niceElements')
2993
3106
  cancelText: '@',
2994
3107
  shortTime: '@', // default: false,
2995
3108
  niceTitle: '@',
3109
+ description: '@?',
2996
3110
  title: '@', // default: ''
2997
3111
  noMargin: '@', // default: false, if noMargin==true then entire directive can be injected inside other divs
2998
3112
  fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
@@ -3889,8 +4003,8 @@ angular.module('niceElements')
3889
4003
  isDisabled: '=',
3890
4004
  type: '@',
3891
4005
  title: '@?',
3892
- description: '@?',
3893
4006
  niceTitle: '@?',
4007
+ description: '@?',
3894
4008
  regex: '@?',
3895
4009
  regexRaw: '@?',
3896
4010
  regexError: '@?',
@@ -4147,6 +4261,7 @@ angular.module('niceElements')
4147
4261
  labelWidth: '@',
4148
4262
  value: '@',
4149
4263
  niceTitle: '@',
4264
+ description: '@?',
4150
4265
  title: '@',
4151
4266
  noMargin: '@',
4152
4267
  isInline: '=',
@@ -4363,6 +4478,7 @@ angular.module('niceElements')
4363
4478
  isDisabled: '=',
4364
4479
  title: '@?',
4365
4480
  niceTitle: '@?',
4481
+ description: '@?',
4366
4482
  min: '@',
4367
4483
  max: '@',
4368
4484
  defaultValue: '@',
@@ -4552,6 +4668,7 @@ angular.module('niceElements')
4552
4668
  scope: {
4553
4669
  model: '=',
4554
4670
  niceTitle: '@',
4671
+ description: '@?',
4555
4672
  isDisabled: '=',
4556
4673
  fieldWidth: '@',
4557
4674
  labelWidth: '@',
@@ -4624,6 +4741,7 @@ angular.module('niceElements')
4624
4741
  isDisabled: '=',
4625
4742
  title: '@?',
4626
4743
  niceTitle: '@?',
4744
+ description: '@?',
4627
4745
  required: '=',
4628
4746
  fieldWidth: '@',
4629
4747
  labelWidth: '@',
@@ -4869,6 +4987,7 @@ angular.module('niceElements')
4869
4987
  templateUrl: 'src/components/nice-progress-bar/nice-progress-bar.html',
4870
4988
  scope: {
4871
4989
  niceTitle: '@',
4990
+ description: '@?',
4872
4991
  title: '@',
4873
4992
  noMargin: '@',
4874
4993
  value: '=',
@@ -4924,6 +5043,7 @@ angular.module('niceElements')
4924
5043
  restrict: 'E',
4925
5044
  scope: {
4926
5045
  niceTitle: '@',
5046
+ description: '@?',
4927
5047
  title: '@',
4928
5048
  model: '=',
4929
5049
  min: '=?',
@@ -4986,6 +5106,7 @@ angular.module('niceElements')
4986
5106
  isDisabled: '=',
4987
5107
  title: '@?',
4988
5108
  niceTitle: '@?',
5109
+ description: '@?',
4989
5110
  placeholder: '@',
4990
5111
  required: '=',
4991
5112
  fieldWidth: '@',
@@ -5231,6 +5352,7 @@ angular.module('niceElements')
5231
5352
  showDropdown: '=',
5232
5353
  title: '@?',
5233
5354
  niceTitle: '@?',
5355
+ description: '@?',
5234
5356
  placeholder: '@',
5235
5357
  fieldWidth: '@',
5236
5358
  labelWidth: '@',
@@ -5497,6 +5619,7 @@ angular.module('niceElements')
5497
5619
  fieldWidth: '@',
5498
5620
  labelWidth: '@',
5499
5621
  niceTitle: '@',
5622
+ description: '@?',
5500
5623
  title: '@',
5501
5624
  noMargin: '@',
5502
5625
  isInline: '=',
@@ -5606,6 +5729,7 @@ angular.module('niceElements')
5606
5729
  scope: {
5607
5730
  model: '=',
5608
5731
  niceTitle: '@',
5732
+ description: '@?',
5609
5733
  title: '@',
5610
5734
  isDisabled: '=',
5611
5735
  noMargin: '@',
@@ -5834,6 +5958,7 @@ angular.module('niceElements')
5834
5958
  scope: {
5835
5959
  model: '=',
5836
5960
  niceTitle: '@',
5961
+ description: '@?',
5837
5962
  title: '@',
5838
5963
  text: '@',
5839
5964
  fieldWidth: '@',
@@ -5846,7 +5971,7 @@ angular.module('niceElements')
5846
5971
  callbackUrl: '=',
5847
5972
  isDisabled: '=',
5848
5973
  isInline: '=',
5849
- hideClear: '=',
5974
+ showClear: '=',
5850
5975
  help: '@',
5851
5976
  maxFileSize: '@',
5852
5977
  required: '=',
@@ -5864,6 +5989,7 @@ angular.module('niceElements')
5864
5989
  scope.endDragging = function () { $timeout(function () { scope.dragging = false; }); };
5865
5990
  scope.startDraggingGlobal = function () { $timeout(function () { scope.draggingGlobal = true; }); };
5866
5991
  scope.endDraggingGlobal = function () { $timeout(function () { scope.dragging = false; scope.draggingGlobal = false; }); };
5992
+ scope.file = null;
5867
5993
 
5868
5994
  scope.dragging = false;
5869
5995
  scope.draggingGlobal = false;
@@ -5967,8 +6093,8 @@ angular.module('niceElements')
5967
6093
  });
5968
6094
  },
5969
6095
 
5970
- controller: function ($scope) {
5971
- $scope.$watch("model", function (value) {
6096
+ controller: function ($scope, $element) {
6097
+ $scope.$watch("model", function () {
5972
6098
  $scope.imageSource = angular.copy($scope.model);
5973
6099
  });
5974
6100
 
@@ -5976,10 +6102,14 @@ angular.module('niceElements')
5976
6102
  $scope.model = null;
5977
6103
  $scope.imageSource = null;
5978
6104
  $scope.form.$setDirty();
6105
+ const inputElement = $element[0].querySelector(".input-file");
6106
+ if (inputElement) inputElement.value = null;
6107
+
5979
6108
  $scope.text = gettextCatalog.getString('Click to upload file', null, 'Nice');
5980
- if ($scope.callbackFunction) $scope.callbackFunction(null);
5981
- if ($scope.callbackFile) $scope.callbackFile(null);
5982
- if ($scope.callbackUrl) $scope.callbackUrl(null);
6109
+ if ($scope.callbackFunction) $scope.callbackFunction();
6110
+ if ($scope.callbackFile) $scope.callbackFile();
6111
+ if ($scope.callbackUrl) $scope.callbackUrl();
6112
+ if ($scope.uploadFunction) $scope.uploadFunction();
5983
6113
  };
5984
6114
  }
5985
6115
 
@@ -6108,6 +6238,7 @@ angular.module('niceElements')
6108
6238
  },
6109
6239
  scope: {
6110
6240
  niceTitle: '@',
6241
+ description: '@?',
6111
6242
  title: '@',
6112
6243
  subtitle: '@',
6113
6244
  collapsable: '=',
@@ -6151,6 +6282,7 @@ angular.module('niceElements')
6151
6282
  yes: '@',
6152
6283
  no: '@',
6153
6284
  niceTitle: '@',
6285
+ description: '@?',
6154
6286
  title: '@',
6155
6287
  isDisabled: '=',
6156
6288
  fieldWidth: '@',
@@ -6270,12 +6402,21 @@ angular.module('niceElements').filter('niceDate', function () {
6270
6402
  * # niceHighlight
6271
6403
  * Filter in the niceElements.
6272
6404
  */
6273
- angular.module('niceElements').filter('niceHighlight', function () {
6274
- return function (value, highlightedText) {
6275
- if (!value || !highlightedText) return "";
6276
- const regex = new RegExp(highlightedText, 'gmi');
6277
- const newValue = String(value).replace(regex, "<span class='nice-highlight'>$&</span>");
6278
- return newValue;
6405
+ angular.module('niceElements').filter('niceHighlight', function ($sanitize, $sce) {
6406
+ return function (text, phrase) {
6407
+ if (!phrase || !text) return text;
6408
+
6409
+ // 1. Sanitize the original text to prevent XSS
6410
+ let cleanText = $sanitize(text);
6411
+
6412
+ // 2. Create the case-insensitive global Regex
6413
+ const regex = new RegExp('(' + phrase + ')', 'gi');
6414
+
6415
+ // 3. Replace matches with the h element
6416
+ const highlighted = cleanText.replace(regex, '<h>$1</h>');
6417
+
6418
+ // 4. Trust the result so ng-bind-html renders it
6419
+ return $sce.trustAsHtml(highlighted);
6279
6420
  };
6280
6421
  });
6281
6422
 
@@ -6534,7 +6675,7 @@ angular.module('niceElements')
6534
6675
  .service('NiceService', function ($rootScope) {
6535
6676
  const service = {
6536
6677
  name: "Nice elements",
6537
- version: "1.13.2",
6678
+ version: "1.13.4",
6538
6679
  getHeader: function () {
6539
6680
  return {};
6540
6681
  },
@@ -6658,7 +6799,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6658
6799
  "<div class=\"nice-component nice-calendar\" ng-form=\"formCalendar\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
6659
6800
  " <div class=\"row\">\n" +
6660
6801
  " \n" +
6661
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
6802
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
6662
6803
  "\n" +
6663
6804
  " \n" +
6664
6805
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -6666,13 +6807,33 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6666
6807
  "\n" +
6667
6808
  " <div class=\"nice-calendar-wrapper\">\n" +
6668
6809
  " <div class=\"nice-calendar-weeks\">\n" +
6669
- " <div class=\"header\">\n" +
6670
- " <button type=\"button\" class=\"btn\" type=\"button\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\" ng-disabled=\"isDisabled\"><i class=\"fa fa-angle-left\"></i></button>\n" +
6671
- " <span title=\"{{ month.format('M.YYYY' )}}\">{{ month.format(\"MMMM, YYYY\" )}}</span>\n" +
6672
- " <button type=\"button\" class=\"btn\" type=\"button\" ng-click=\"next()\" title=\"{{ 'Next month' | translate:'Nice' }}\" ng-disabled=\"isDisabled\"><i class=\"fa fa-angle-right\"></i></button>\n" +
6810
+ " <div class=\"nice-calendar-header\">\n" +
6811
+ " \n" +
6812
+ " <div class=\"nice-calendar-header-selects\">\n" +
6813
+ " \n" +
6814
+ " <select class=\"year-select\" ng-model=\"selectedYear\" ng-change=\"yearSelectChange()\" ng-options=\"year for year in years\" ng-disabled=\"isDisabled\"></select>\n" +
6815
+ " <span>,</span>\n" +
6816
+ " \n" +
6817
+ " <select class=\"month-select\" ng-model=\"selectedMonth\" ng-change=\"monthSelectChange()\" ng-options=\"month.value as month.name for month in months\" ng-disabled=\"isDisabled\"></select>\n" +
6818
+ " </div>\n" +
6819
+ "\n" +
6820
+ " \n" +
6821
+ " <button title=\"{{ 'Previous month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"previous()\" ng-disabled=\"isDisabled\">\n" +
6822
+ " <i class=\"fa fa-angle-left\"></i>\n" +
6823
+ " </button>\n" +
6824
+ "\n" +
6825
+ " \n" +
6826
+ " <button title=\"{{ 'Today' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"today()\" ng-disabled=\"isDisabled\">\n" +
6827
+ " <nice-icon icon=\"icon-circle\"></nice-icon>\n" +
6828
+ " </button>\n" +
6829
+ "\n" +
6830
+ " \n" +
6831
+ " <button title=\"{{ 'Next month' | translate:'Nice' }}\" type=\"button\" class=\"btn\" ng-click=\"next()\" ng-disabled=\"isDisabled\">\n" +
6832
+ " <i class=\"fa fa-angle-right\"></i>\n" +
6833
+ " </button>\n" +
6673
6834
  " </div>\n" +
6674
6835
  "\n" +
6675
- " <div class=\"week names\">\n" +
6836
+ " <div class=\"nice-calendar-days nice-calendar-days-header\">\n" +
6676
6837
  " <span class=\"day\" translate translate-context=\"Nice\">Mon</span>\n" +
6677
6838
  " <span class=\"day\" translate translate-context=\"Nice\">Tue</span>\n" +
6678
6839
  " <span class=\"day\" translate translate-context=\"Nice\">Wed</span>\n" +
@@ -6682,9 +6843,9 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6682
6843
  " <span class=\"day weekend\" translate translate-context=\"Nice\">Sun</span>\n" +
6683
6844
  " </div>\n" +
6684
6845
  "\n" +
6685
- " <div class=\"week\" ng-repeat=\"week in weeks\">\n" +
6686
- " <button type=\"button\" class=\"day\" type=\"button\" title=\"{{ day.date.format('D.M.YYYY') }}\" ng-class=\"{\n" +
6687
- " today: day.isToday,\n" +
6846
+ " <div class=\"nice-calendar-days\">\n" +
6847
+ " <button type=\"button\" class=\"day\" type=\"button\" title=\"{{ day.text }}\" ng-class=\"{\n" +
6848
+ " 'today': day.isToday,\n" +
6688
6849
  " 'different-month': !day.isCurrentMonth,\n" +
6689
6850
  " 'start-selected': isSameDay(day.date, startDate),\n" +
6690
6851
  " 'end-selected': isSameDay(day.date, endDate),\n" +
@@ -6697,23 +6858,23 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6697
6858
  " (color && isBetweenRange(day.date)) && {'background-color': lighten(color) } ||\n" +
6698
6859
  " (color && isSameDay(day.date, startDate)) && {'background-color': color } ||\n" +
6699
6860
  " (color && isSameDay(day.date, endDate)) && {'background-color': color }\n" +
6700
- " \" ng-click=\"select(day)\" ng-repeat=\"day in week.days\" ng-disabled=\"isDisabled\">\n" +
6701
- " {{ day.number }}\n" +
6861
+ " \" ng-click=\"select(day)\" ng-repeat=\"day in days\" ng-disabled=\"isDisabled\">\n" +
6862
+ " <span>{{ day.name }}</span>\n" +
6702
6863
  " <p class=\"popup\" ng-if=\"!hideHover\">{{ popupText }}</p>\n" +
6703
6864
  " </button>\n" +
6704
6865
  " </div>\n" +
6866
+ "\n" +
6867
+ " \n" +
6705
6868
  " </div>\n" +
6706
6869
  "\n" +
6707
6870
  "\n" +
6708
6871
  " <div class=\"nice-calendar-time\" ng-if=\"time\">\n" +
6709
6872
  " <div class=\"time-picker\">\n" +
6710
- " <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\" ng-disabled=\"isDisabled\">\n" +
6711
- " </select>\n" +
6873
+ " <select title=\"{{ 'Select start time' | translate:'Nice' }}\" class=\"time-picker-hour\" ng-model=\"startDateHour\" g-change=\"startHourChange(startDateHour)\" ng-options=\"hour for hour in hours\" ng-disabled=\"isDisabled\"></select>\n" +
6712
6874
  " </div>\n" +
6713
6875
  "\n" +
6714
6876
  " <div class=\"time-picker\">\n" +
6715
- " <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\" ng-disabled=\"isDisabled\">\n" +
6716
- " </select>\n" +
6877
+ " <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\" ng-disabled=\"isDisabled\"></select>\n" +
6717
6878
  " </div>\n" +
6718
6879
  "\n" +
6719
6880
  " <div class=\"time-picker-icon\">\n" +
@@ -6763,7 +6924,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6763
6924
  " <nice-icon ng-if=\"!model && indeterminate\" class=\"nice-checkbox-check\" icon=\"icon-minus\"></nice-icon>\n" +
6764
6925
  " </button>\n" +
6765
6926
  " <div class=\"nice-checkbox-info\" ng-transclude>\n" +
6766
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"niceDescription\" label-width=\"col-xs-12\"></nice-title>\n" +
6927
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" description=\"niceDescription\" label-width=\"col-xs-12\"></nice-title>\n" +
6767
6928
  " \n" +
6768
6929
  " \n" +
6769
6930
  " </div>\n" +
@@ -6775,7 +6936,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6775
6936
  "<div class=\"nice-component nice-choice\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" ng-form=\"formChoice\">\n" +
6776
6937
  " <div class=\"row\">\n" +
6777
6938
  " \n" +
6778
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
6939
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
6779
6940
  "\n" +
6780
6941
  " \n" +
6781
6942
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
@@ -6798,7 +6959,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6798
6959
  "<div class=\"nice-component nice-comment\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\">\n" +
6799
6960
  " <div class=\"row\">\n" +
6800
6961
  " \n" +
6801
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
6962
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
6802
6963
  "\n" +
6803
6964
  " \n" +
6804
6965
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" ng-click=\"edit()\">\n" +
@@ -6813,7 +6974,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6813
6974
  "<ng-form class=\"nice-component nice-date-input\" name=\"niceDateInputForm\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline, 'error': niceDateInputForm.$invalid, 'nice-date-input-no-date': !date }\">\n" +
6814
6975
  " <div class=\"row\">\n" +
6815
6976
  " \n" +
6816
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
6977
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
6817
6978
  "\n" +
6818
6979
  " \n" +
6819
6980
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -6874,7 +7035,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6874
7035
  "<ng-form class=\"nice-component nice-date-range\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" name=\"form\">\n" +
6875
7036
  " <div class=\"row\">\n" +
6876
7037
  " \n" +
6877
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7038
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
6878
7039
  "\n" +
6879
7040
  " \n" +
6880
7041
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
@@ -6896,7 +7057,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6896
7057
  "\n" +
6897
7058
  " <div class=\"row\">\n" +
6898
7059
  " \n" +
6899
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7060
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
6900
7061
  "\n" +
6901
7062
  " \n" +
6902
7063
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -6926,31 +7087,31 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6926
7087
  " <span class=\"nice-date-header-comma\">,</span>\n" +
6927
7088
  " <select class=\"month-picker\" ng-model=\"innerDate.month\" ng-change=\"handleDateChange()\" ng-options=\"month.value as month.name for month in months\" ng-disabled=\"isDisabled\"></select>\n" +
6928
7089
  " </span>\n" +
6929
- " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\">\n" +
7090
+ " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\">\n" +
6930
7091
  " <nice-icon icon=\"icon-chevron-left\"></nice-icon>\n" +
6931
7092
  " </button>\n" +
6932
- " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\">\n" +
7093
+ " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"today()\" title=\"{{ 'Today' | translate:'Nice' }}\">\n" +
6933
7094
  " <nice-icon icon=\"icon-circle\"></nice-icon>\n" +
6934
7095
  " </button>\n" +
6935
- " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\">\n" +
7096
+ " <button type=\"button\" class=\"btn btn-default-naked\" ng-disabled=\"isDisabled\" ng-click=\"next()\" title=\"{{ 'Next month' | translate:'Nice' }}\">\n" +
6936
7097
  " <nice-icon icon=\"icon-chevron-right\"></nice-icon>\n" +
6937
7098
  " </button>\n" +
6938
7099
  " </div>\n" +
6939
7100
  "\n" +
6940
- " <div class=\"nice-date-week names\">\n" +
7101
+ " <div class=\"nice-date-grid nice-date-grid-names\">\n" +
6941
7102
  " <span class=\"nice-date-day\" ng-class=\"{ 'weekend': $index == 6 || $index == 5 }\" ng-repeat=\"day in weekdays\">{{ day }}</span>\n" +
6942
7103
  " </div>\n" +
6943
7104
  "\n" +
6944
- " <div class=\"nice-date-week\" role=\"row\" ng-repeat=\"week in weeks\">\n" +
6945
- " <button type=\"button\" class=\"nice-date-day\" role=\"gridcell\" title=\"{{ day.value }}\" ng-class=\"{\n" +
7105
+ " <div class=\"nice-date-grid\">\n" +
7106
+ " <button type=\"button\" class=\"nice-date-day\" role=\"gridcell\" title=\"{{ day.text }}\" ng-class=\"{\n" +
6946
7107
  " 'today': day.isToday,\n" +
6947
7108
  " 'different-month': !day.isCurrentMonth,\n" +
6948
7109
  " 'selected': isSameDay(model, day.date),\n" +
6949
7110
  " 'weekend': day.isWeekday,\n" +
6950
7111
  " 'disabled': day.isDisabled,\n" +
6951
7112
  " 'between': isBetween(day.date, model, nextDate)\n" +
6952
- " }\" ng-click=\"select(day)\" ng-repeat=\"day in week.days\" ng-disabled=\"isDisabled\">\n" +
6953
- " {{ day.number }}\n" +
7113
+ " }\" ng-click=\"select(day)\" ng-repeat=\"day in days\" ng-disabled=\"isDisabled\">\n" +
7114
+ " <span>{{ day.name }}</span>\n" +
6954
7115
  " </button>\n" +
6955
7116
  " </div>\n" +
6956
7117
  " </div>\n" +
@@ -6983,7 +7144,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
6983
7144
  "\n" +
6984
7145
  " <div class=\"row\">\n" +
6985
7146
  " \n" +
6986
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7147
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
6987
7148
  "\n" +
6988
7149
  " \n" +
6989
7150
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -7017,7 +7178,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7017
7178
  "\n" +
7018
7179
  " <div class=\"row\">\n" +
7019
7180
  " \n" +
7020
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7181
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7021
7182
  "\n" +
7022
7183
  " \n" +
7023
7184
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -7066,7 +7227,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7066
7227
  "\n" +
7067
7228
  " <div class=\"row\">\n" +
7068
7229
  " \n" +
7069
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7230
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7070
7231
  "\n" +
7071
7232
  " \n" +
7072
7233
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -7124,7 +7285,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7124
7285
  "<div class=\"nice-component nice-dropdown-date\" ng-form=\"dropdownDateForm\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7125
7286
  " <div class=\"row\">\n" +
7126
7287
  " \n" +
7127
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7288
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7128
7289
  "\n" +
7129
7290
  " \n" +
7130
7291
  " <div class=\"nice-field col-xs-12\" ng-class=\"[\n" +
@@ -7157,7 +7318,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7157
7318
  "<div class=\"nice-component nice-dropdown-old\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7158
7319
  " <div class=\"row\">\n" +
7159
7320
  " \n" +
7160
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7321
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7161
7322
  "\n" +
7162
7323
  " \n" +
7163
7324
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
@@ -7206,7 +7367,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7206
7367
  "<div class=\"nice-component nice-dropdown\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\" ng-form=\"formDropdown\">\n" +
7207
7368
  " <div class=\"row\">\n" +
7208
7369
  " \n" +
7209
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7370
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7210
7371
  "\n" +
7211
7372
  " \n" +
7212
7373
  " <div class=\"nice-field col-xs-12\" ng-class=\"[ fieldWidth ? fieldWidth : 'col-sm-8', { 'open': isOpen, 'nice-disabled': isDisabled || emptyList } ]\" click-outside=\"close()\" is-open=\"{{ isOpen }}\">\n" +
@@ -7440,7 +7601,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7440
7601
  "<div class=\"nice-component nice-label\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\">\n" +
7441
7602
  " <div class=\"row\">\n" +
7442
7603
  " \n" +
7443
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7604
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7444
7605
  "\n" +
7445
7606
  " \n" +
7446
7607
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-xs-8'\">\n" +
@@ -7482,7 +7643,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7482
7643
  "<div class=\"nice-component nice-number\" ng-form=\"niceNumberForm\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\">\n" +
7483
7644
  " <div ng-class=\"{'row' : !disableRow}\">\n" +
7484
7645
  " \n" +
7485
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7646
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7486
7647
  "\n" +
7487
7648
  " \n" +
7488
7649
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -7527,7 +7688,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7527
7688
  "<div class=\"nice-component nice-options\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline, 'nice-disabled': isDisabled }\" ng-form=\"formNiceOptions\">\n" +
7528
7689
  " <div class=\"row\">\n" +
7529
7690
  " \n" +
7530
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7691
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7531
7692
  "\n" +
7532
7693
  " \n" +
7533
7694
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8']\">\n" +
@@ -7548,7 +7709,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7548
7709
  "<ng-form class=\"nice-component nice-input\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" name=\"form\">\n" +
7549
7710
  " <div class=\"row\">\n" +
7550
7711
  " \n" +
7551
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7712
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7552
7713
  "\n" +
7553
7714
  " \n" +
7554
7715
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
@@ -7596,7 +7757,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7596
7757
  "<div class=\"nice-component nice-progress-bar\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7597
7758
  " <div class=\"row\">\n" +
7598
7759
  " \n" +
7599
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7760
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7600
7761
  "\n" +
7601
7762
  " \n" +
7602
7763
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
@@ -7616,7 +7777,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7616
7777
  "<div class=\"nice-component nice-quantity\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
7617
7778
  " <div class=\"row\">\n" +
7618
7779
  " \n" +
7619
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7780
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7620
7781
  "\n" +
7621
7782
  " \n" +
7622
7783
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -7643,7 +7804,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7643
7804
  "<ng-form class=\"nice-component nice-input nice-search\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline}\" name=\"form\">\n" +
7644
7805
  " <div class=\"row\">\n" +
7645
7806
  " \n" +
7646
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7807
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7647
7808
  "\n" +
7648
7809
  " \n" +
7649
7810
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -7691,7 +7852,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7691
7852
  "<ng-form class=\"nice-component nice-input nice-search2\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" name=\"form\">\n" +
7692
7853
  " <div class=\"row\">\n" +
7693
7854
  " \n" +
7694
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7855
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7695
7856
  "\n" +
7696
7857
  " \n" +
7697
7858
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\" click-outside=\"close()\">\n" +
@@ -7728,7 +7889,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
7728
7889
  "<div class=\"nice-component nice-slot\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\">\n" +
7729
7890
  " <div class=\"row\">\n" +
7730
7891
  " \n" +
7731
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
7892
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
7732
7893
  "\n" +
7733
7894
  " \n" +
7734
7895
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-xs-8'\">\n" +
@@ -9125,7 +9286,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
9125
9286
  "<div class=\"nice-component nice-time-picker\" ng-form=\"forma\" ng-class=\"{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }\">\n" +
9126
9287
  " <div class=\"row\">\n" +
9127
9288
  " \n" +
9128
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
9289
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
9129
9290
  "\n" +
9130
9291
  " \n" +
9131
9292
  " <div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
@@ -9191,7 +9352,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
9191
9352
  "<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0': noMargin, 'title-right': titleRight, 'nice-component-inline': isInline, 'nice-component-block': isBlock, 'active': inverted ? !model : model }\" ng-form=\"formToggle\">\n" +
9192
9353
  " <div class=\"row\">\n" +
9193
9354
  " \n" +
9194
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
9355
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
9195
9356
  "\n" +
9196
9357
  " \n" +
9197
9358
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
@@ -9208,11 +9369,12 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
9208
9369
  "<ng-form class=\"nice-component nice-upload\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" name=\"form\">\n" +
9209
9370
  " <div class=\"row\">\n" +
9210
9371
  " \n" +
9211
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
9372
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
9212
9373
  "\n" +
9213
9374
  " \n" +
9214
9375
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
9215
9376
  " <div class=\"nice-upload-area\">\n" +
9377
+ " \n" +
9216
9378
  " <div class=\"input-area\" ng-class=\"{ 'dragging': dragging || draggingGlobal }\">\n" +
9217
9379
  " <div class=\"middle-text\" ng-if=\"!imageSource && !loading\">\n" +
9218
9380
  " <nice-icon icon=\"icon-upload\"></nice-icon>\n" +
@@ -9224,10 +9386,16 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
9224
9386
  " <img data-ng-src=\"{{ imageSource }}\">\n" +
9225
9387
  " </div>\n" +
9226
9388
  " </div>\n" +
9227
- " <button type=\"button\" ng-click=\"clear()\" ng-if=\"imageSource && !loading && !hideClear\" class=\"btn btn-primary nice-upload-clear-button\">\n" +
9389
+ "\n" +
9390
+ " \n" +
9391
+ " <button type=\"button\" ng-click=\"clear()\" ng-if=\"imageSource && !loading && showClear\" class=\"btn btn-primary nice-upload-clear-button\">\n" +
9228
9392
  " <nice-icon icon=\"icon-x\"></nice-icon>\n" +
9229
9393
  " </button>\n" +
9394
+ "\n" +
9395
+ " \n" +
9230
9396
  " <input class=\"input-file\" type=\"file\" accept=\"{{ accept }}\" ng-model=\"file\" ng-required=\"required\" ng-disabled=\"isDisabled || loading\">\n" +
9397
+ "\n" +
9398
+ " \n" +
9231
9399
  " <nice-loader fulldiv=\"true\" ng-if=\"loading\"></nice-loader>\n" +
9232
9400
  " </div>\n" +
9233
9401
  " </div>\n" +
@@ -9287,7 +9455,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
9287
9455
  "<div class=\"nice-component nice-yesno\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" ng-form=\"formYesno\">\n" +
9288
9456
  " <div class=\"row\">\n" +
9289
9457
  " \n" +
9290
- " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
9458
+ " <nice-title text=\"title || niceTitle\" help=\"help\" required=\"required\" description=\"description\" label-width=\"labelWidth\"></nice-title>\n" +
9291
9459
  "\n" +
9292
9460
  " \n" +
9293
9461
  " <div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +