nice-elements 1.3.17 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/.vscode/settings.json +4 -0
  2. package/CHANGELOG.md +15 -0
  3. package/LICENSE.md +3 -3
  4. package/README.md +8 -10
  5. package/bower.json +3 -11
  6. package/dist/nice.js +187 -197
  7. package/dist/nice.min.js +1 -1
  8. package/dist/style.css +80 -10
  9. package/dist/style.css.map +3 -2
  10. package/dist/style.min.css +1 -1
  11. package/package.json +5 -4
  12. package/src/components/nice-calendar/nice-calendar.html +15 -15
  13. package/src/components/nice-calendar/nice-calendar.js +4 -26
  14. package/src/components/nice-date/nice-date.js +27 -8
  15. package/src/components/nice-date-range/nice-date-range.js +6 -40
  16. package/src/components/nice-datetime-picker/nice-datetime-picker.js +6 -6
  17. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +6 -6
  18. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +7 -7
  19. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +6 -6
  20. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +2 -2
  21. package/src/components/nice-dropdown/nice-dropdown.js +7 -7
  22. package/src/components/nice-dropdown-date/nice-dropdown-date.js +14 -14
  23. package/src/components/nice-dropdown-old/nice-dropdown-old.html +2 -2
  24. package/src/components/nice-dropdown-old/nice-dropdown-old.js +2 -2
  25. package/src/components/nice-dtp/nice-dtp.js +5 -5
  26. package/src/components/nice-help/nice-help.js +0 -6
  27. package/src/components/nice-help/nice-help.scss +8 -9
  28. package/src/components/nice-input/nice-input.html +6 -6
  29. package/src/components/nice-loader/nice-loader.html +3 -1
  30. package/src/components/nice-loader/nice-loader.js +6 -2
  31. package/src/components/nice-loader/nice-loader.scss +25 -2
  32. package/src/components/nice-notification/nice-notification.js +1 -2
  33. package/src/components/nice-number/nice-number.html +17 -10
  34. package/src/components/nice-number/nice-number.js +8 -8
  35. package/src/components/nice-percent/nice-percent.html +2 -2
  36. package/src/components/nice-search/nice-search.html +1 -1
  37. package/src/components/nice-search2/nice-search2.html +1 -1
  38. package/src/components/nice-tooltip/_nice-tooltip.scss +72 -0
  39. package/src/components/nice-tooltip/nice-tooltip.js +20 -0
  40. package/src/components/nice-upload/nice-upload.js +5 -5
  41. package/src/components/nice-yesno/nice-yesno.js +8 -9
  42. package/src/styles/_nice.scss +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.3.17",
3
+ "version": "1.4.2",
4
4
  "description": "Nice elements used in olaii angular 1.x webapps.",
5
5
  "main": "dist/nice.js",
6
6
  "license": "MIT",
@@ -11,6 +11,7 @@
11
11
  "dependencies": {
12
12
  "angular": "1.5.8",
13
13
  "angular-animate": "1.5.8",
14
+ "angular-gettext": "2.4.2",
14
15
  "angular-route": "1.5.8",
15
16
  "angular-sanitize": "1.5.8",
16
17
  "angular-touch": "1.5.8",
@@ -23,7 +24,7 @@
23
24
  },
24
25
  "devDependencies": {
25
26
  "express": "4.17.1",
26
- "grunt": "1.4.1",
27
+ "grunt": "^1.5.2",
27
28
  "grunt-angular-templates": "1.2.0",
28
29
  "grunt-contrib-clean": "2.0.0",
29
30
  "grunt-contrib-concat": "1.0.1",
@@ -31,7 +32,7 @@
31
32
  "grunt-contrib-jshint": "3.0.0",
32
33
  "grunt-contrib-uglify": "5.0.1",
33
34
  "grunt-sass": "^3.1.0",
34
- "node-sass": "^6.0.0",
35
- "load-grunt-tasks": "5.1.0"
35
+ "load-grunt-tasks": "5.1.0",
36
+ "node-sass": "^7.0.1"
36
37
  }
37
38
  }
@@ -12,19 +12,19 @@
12
12
 
13
13
  <div class="nice-calendar-wrapper">
14
14
  <div class="header">
15
- <i class="fa fa-angle-left" ng-click="previous()" title="{{ translations.prevMonth }}"></i>
15
+ <i class="fa fa-angle-left" ng-click="previous()" title="{{ 'Previous month' | translate:'Nice' }}"></i>
16
16
  <span title="{{ month.format('M.YYYY' )}}">{{ month.format("MMMM, YYYY" )}}</span>
17
- <i class="fa fa-angle-right" ng-click="next()" title="{{ translations.nextMonth }}"></i>
17
+ <i class="fa fa-angle-right" ng-click="next()" title="{{ 'Next month' | translate:'Nice' }}"></i>
18
18
  </div>
19
19
 
20
20
  <div class="week names">
21
- <span class="day" translate>{{ translations.mon }}</span>
22
- <span class="day" translate>{{ translations.tue }}</span>
23
- <span class="day" translate>{{ translations.wed }}</span>
24
- <span class="day" translate>{{ translations.thu }}</span>
25
- <span class="day" translate>{{ translations.fri }}</span>
26
- <span class="day weekend" translate>{{ translations.sat }}</span>
27
- <span class="day weekend" translate>{{ translations.sun }}</span>
21
+ <span class="day" translate translate-context="Nice">Mon</span>
22
+ <span class="day" translate translate-context="Nice">Tue</span>
23
+ <span class="day" translate translate-context="Nice">Wed</span>
24
+ <span class="day" translate translate-context="Nice">Thu</span>
25
+ <span class="day" translate translate-context="Nice">Fri</span>
26
+ <span class="day weekend" translate translate-context="Nice">Sat</span>
27
+ <span class="day weekend" translate translate-context="Nice">Sun</span>
28
28
  </div>
29
29
 
30
30
  <div class="week" ng-repeat="week in weeks">
@@ -60,7 +60,7 @@
60
60
  <div class="nice-calendar-time" ng-if="time">
61
61
  <div class="time-picker">
62
62
  <select
63
- title="{{ translations.selectStartTime }}"
63
+ title="{{ 'Select start time' | translate:'Nice' }}"
64
64
  class="time-picker-hour"
65
65
  ng-model="startDateHour"
66
66
  ng-change="startHourChange(startDateHour)"
@@ -70,7 +70,7 @@
70
70
 
71
71
  <div class="time-picker">
72
72
  <select
73
- title="{{ translations.selectStartTime }}"
73
+ title="{{ 'Select start time' | translate:'Nice' }}"
74
74
  class="time-picker-minute"
75
75
  ng-model="startDateMinute"
76
76
  ng-change="startMinuteChange(startDateMinute)"
@@ -84,7 +84,7 @@
84
84
 
85
85
  <div class="time-picker">
86
86
  <select
87
- title="{{ translations.selectEndTime }}"
87
+ title="{{ 'Select end time' | translate:'Nice' }}"
88
88
  class="time-picker-hour"
89
89
  ng-model="endDateHour"
90
90
  ng-change="endHourChange(endDateHour)"
@@ -94,7 +94,7 @@
94
94
 
95
95
  <div class="time-picker no-border-right">
96
96
  <select
97
- title="{{ translations.selectEndTime }}"
97
+ title="{{ 'Select end time' | translate:'Nice' }}"
98
98
  class="time-picker-minute"
99
99
  ng-model="endDateMinute"
100
100
  ng-change="endMinuteChange(endDateMinute)"
@@ -105,11 +105,11 @@
105
105
 
106
106
  <div class="nice-selected-dates">
107
107
  <div class="nice-start-date">
108
- <label>{{ translations.start }}</label>
108
+ <label translate translate-context="Nice">Start</label>
109
109
  <div ng-class="startTimeClass">{{ formatDate(startDate) }}</div>
110
110
  </div>
111
111
  <div class="nice-end-date">
112
- <label>{{ translations.end }}</label>
112
+ <label translate translate-context="Nice">End</label>
113
113
  <div ng-class="endTimeClass">{{ formatDate(endDate) }}</div>
114
114
  </div>
115
115
  <div class="clearfix"></div>
@@ -7,7 +7,7 @@
7
7
  * # niceCalendar
8
8
  */
9
9
  angular.module('niceElements')
10
- .directive("niceCalendar", function($timeout) {
10
+ .directive("niceCalendar", function($timeout, gettextCatalog) {
11
11
  return {
12
12
  restrict: "E",
13
13
  templateUrl: "src/components/nice-calendar/nice-calendar.html",
@@ -24,36 +24,14 @@ angular.module('niceElements')
24
24
  endDate: '=',
25
25
  startDate: '=',
26
26
  isDisabled: '=',
27
- translations: '@',
28
27
  help: '@',
29
28
  isInline: '=',
30
29
  onChange: '&?'
31
30
  },
32
31
  link: function(scope, element) {
33
- scope.translations = {
34
- selectStartDate: "Select start date",
35
- selectStartTime: "Select start time",
36
- selectEndDate: "Select end date",
37
- selectEndTime: "Select end time",
38
- nextMonth: "Next month",
39
- prevMonth: "Previous month",
40
- start: "Start",
41
- end: "End",
42
- mon: "Mon",
43
- tue: "Tue",
44
- wed: "Wed",
45
- thu: "Thu",
46
- fri: "Fri",
47
- sat: "Sat",
48
- sun: "Sun",
49
- january: "January",
50
- february: "February",
51
-
52
- };
53
-
54
32
  // ------------------ Init default values ------------------
55
33
  scope.selectStart = true;
56
- scope.popupText = scope.translations.selectStartDate;
34
+ scope.popupText = gettextCatalog.getString("Select start date", null, "Nice");
57
35
 
58
36
  scope.hours = [
59
37
  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
@@ -118,7 +96,7 @@ angular.module('niceElements')
118
96
  // Set start date
119
97
  scope.startDate = selectedDate;
120
98
  scope.selectStart = false;
121
- scope.popupText = scope.translations.selectEndDate;
99
+ scope.popupText = gettextCatalog.getString("Select end date", null, "Nice");
122
100
  scope.formCalendar.$setDirty();
123
101
  scope.displayStartChange();
124
102
 
@@ -133,7 +111,7 @@ angular.module('niceElements')
133
111
  // Set end date
134
112
  scope.endDate = selectedDate;
135
113
  scope.selectStart = true;
136
- scope.popupText = scope.translations.selectStartDate;
114
+ scope.popupText = gettextCatalog.getString("Select start date", null, "Nice");
137
115
  scope.formCalendar.$setDirty();
138
116
  scope.displayEndChange();
139
117
 
@@ -30,13 +30,13 @@ angular.module('niceElements')
30
30
  isInline: '=',
31
31
  onChange: '&?'
32
32
  },
33
- controller: function($scope) {
33
+ controller: function($scope, gettextCatalog) {
34
34
  $scope.isOpen = false;
35
35
  $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];
36
36
  $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];
37
37
  $scope.translations = {
38
- nextMonth: "Next month",
39
- prevMonth: "Previous month",
38
+ nextMonth: gettextCatalog.getString("Next month", null, "Nice"),
39
+ prevMonth: gettextCatalog.getString("Previous month", null, "Nice"),
40
40
  };
41
41
  $scope.innerDate = {
42
42
  month: 0,
@@ -49,7 +49,15 @@ angular.module('niceElements')
49
49
  $scope.days = [];
50
50
 
51
51
  // $scope.weekdays = moment.weekdaysShort(false);
52
- $scope.weekdays = ["Pon", "Tor", "Sre", "Čet", "Pet", "Sob", "Ned"];
52
+ $scope.weekdays = [
53
+ gettextCatalog.getString("Mon", null, "Nice"),
54
+ gettextCatalog.getString("Tue", null, "Nice"),
55
+ gettextCatalog.getString("Wed", null, "Nice"),
56
+ gettextCatalog.getString("Thu", null, "Nice"),
57
+ gettextCatalog.getString("Fri", null, "Nice"),
58
+ gettextCatalog.getString("Sat", null, "Nice"),
59
+ gettextCatalog.getString("Sun", null, "Nice")
60
+ ];
53
61
 
54
62
  $scope.years = [];
55
63
  var year = moment().year()-100;
@@ -57,10 +65,21 @@ angular.module('niceElements')
57
65
  $scope.years.push(year + i);
58
66
  }
59
67
 
60
- $scope.months = [];
61
- angular.forEach(moment.months(), function(month, index) {
62
- $scope.months.push({ value: index, name: month });
63
- });
68
+ $scope.months = [
69
+ { value: 0, name: gettextCatalog.getString("January", null, "Nice") },
70
+ { value: 1, name: gettextCatalog.getString("February", null, "Nice") },
71
+ { value: 2, name: gettextCatalog.getString("March", null, "Nice") },
72
+ { value: 3, name: gettextCatalog.getString("April", null, "Nice") },
73
+ { value: 4, name: gettextCatalog.getString("May", null, "Nice") },
74
+ { value: 5, name: gettextCatalog.getString("June", null, "Nice") },
75
+ { value: 6, name: gettextCatalog.getString("July", null, "Nice") },
76
+ { value: 7, name: gettextCatalog.getString("August", null, "Nice") },
77
+ { value: 8, name: gettextCatalog.getString("September", null, "Nice") },
78
+ { value: 9, name: gettextCatalog.getString("October", null, "Nice") },
79
+ { value: 10, name: gettextCatalog.getString("November", null, "Nice") },
80
+ { value: 11, name: gettextCatalog.getString("December", null, "Nice") }
81
+ ]
82
+
64
83
 
65
84
  if(!$scope.model) $scope.model = moment();
66
85
 
@@ -28,7 +28,7 @@ angular.module('niceElements')
28
28
  onChange: '&?'
29
29
  },
30
30
 
31
- link: function(scope, iElement, attrs, ctrl){
31
+ link: function(scope, attrs){
32
32
  if (!attrs.title) { attrs.title = ''; }
33
33
  if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
34
34
  if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
@@ -53,55 +53,21 @@ angular.module('niceElements')
53
53
  }
54
54
  },
55
55
 
56
- controller: function($scope, $filter) { //gettextCatalog
56
+ controller: function($scope) {
57
57
  $scope.opts = {
58
- //format: 'DD.MM.YYYY',
59
58
  locale: {
60
59
  applyClass: 'btn-green',
61
- //applyLabel: gettextCatalog.getString("Apply"),
62
- //fromLabel: gettextCatalog.getString("From"),
63
- //toLabel: gettextCatalog.getString("To"),
64
- //cancelLabel: gettextCatalog.getString("Cancel"),
65
- //customRangeLabel: gettextCatalog.getString("Custom range"),
66
60
  firstDay: 1
67
- //daysOfWeek: [
68
- // gettextCatalog.getString("Sun"),
69
- // gettextCatalog.getString("Mon"),
70
- // gettextCatalog.getString("Tue"),
71
- // gettextCatalog.getString("Wed"),
72
- // gettextCatalog.getString("Thu"),
73
- // gettextCatalog.getString("Fri"),
74
- // gettextCatalog.getString("Sat")
75
- //],
76
- //monthNames: [
77
- // gettextCatalog.getString("January"),
78
- // gettextCatalog.getString("February"),
79
- // gettextCatalog.getString("March"),
80
- // gettextCatalog.getString("April"),
81
- // gettextCatalog.getString("May"),
82
- // gettextCatalog.getString("June"),
83
- // gettextCatalog.getString("July"),
84
- // gettextCatalog.getString("August"),
85
- // gettextCatalog.getString("September"),
86
- // gettextCatalog.getString("October"),
87
- // gettextCatalog.getString("November"),
88
- // gettextCatalog.getString("December")
89
- //]
90
61
  },
91
62
  ranges: {},
92
63
  min: $scope.min,
93
64
  max: $scope.max
94
65
  };
95
66
 
96
- //$scope.opts.ranges[gettextCatalog.getString("Today")] = [moment(), moment()];
97
- //$scope.opts.ranges[gettextCatalog.getString("Last 7 days")] = [moment().subtract(7, 'days'), moment()];
98
- //$scope.opts.ranges[gettextCatalog.getString("Last 30 days")] = [moment().subtract(30, 'days'), moment()];
99
- //$scope.opts.ranges[gettextCatalog.getString("This month")] = [moment().startOf('month'), moment().endOf('month')];
100
-
101
- $scope.opts.ranges["Today"] = [moment(), moment()];
102
- $scope.opts.ranges["Last 7 days"] = [moment().subtract(7, 'days'), moment()];
103
- $scope.opts.ranges["Last 30 days"] = [moment().subtract(30, 'days'), moment()];
104
- $scope.opts.ranges["This month"] = [moment().startOf('month'), moment().endOf('month')];
67
+ $scope.opts.ranges[gettextCatalog.getString("Today", null, "Nice")] = [moment(), moment()];
68
+ $scope.opts.ranges[gettextCatalog.getString("Last 7 days", null, "Nice")] = [moment().subtract(7, 'days'), moment()];
69
+ $scope.opts.ranges[gettextCatalog.getString("Last 30 days", null, "Nice")] = [moment().subtract(30, 'days'), moment()];
70
+ $scope.opts.ranges[gettextCatalog.getString("This month", null, "Nice")] = [moment().startOf('month'), moment().endOf('month')];
105
71
 
106
72
  if(angular.isDefined($scope.format)) $scope.opts.format = format;
107
73
  }
@@ -13,7 +13,7 @@ angular.module('niceElements').directive('niceDatetimePicker', function () {
13
13
  templateUrl: 'src/components/nice-datetime-picker/nice-datetime-picker.html',
14
14
  scope: {
15
15
  model: '=', // binding model
16
- format: '@', // default: 'DD.MM.YYYY HH:mm', format for input label string
16
+ format: '@', // default: 'D.M.YYYY • H:mm', format for input label string
17
17
  date: '@', // default: true, is date picker enabled?
18
18
  time: '@', // default: false, is time picker enabled?
19
19
  width: '@', // default: 300, width of entire dtp-picker in px
@@ -34,14 +34,14 @@ angular.module('niceElements').directive('niceDatetimePicker', function () {
34
34
  isInline: '=',
35
35
  onChange: '&?'
36
36
  },
37
- controller: function ($scope) {
37
+ controller: function ($scope, gettextCatalog) {
38
38
  $scope.date = $scope.date == 'true' || $scope.date == true;
39
39
  $scope.time = $scope.time == 'true' || $scope.time == true;
40
40
  $scope.noMargin === 'true' || $scope.noMargin === true;
41
41
  $scope.enableOkButtons === 'true' || $scope.enableOkButtons === true;
42
42
  $scope.lang = $scope.lang || 'en';
43
- $scope.okText = $scope.okText || 'OK';
44
- $scope.cancelText = $scope.cancelText || 'Cancel';
43
+ $scope.okText = $scope.okText || gettextCatalog.getString('OK', null, 'Nice');
44
+ $scope.cancelText = $scope.cancelText || gettextCatalog.getString('Cancel', null, 'Nice');
45
45
  $scope.weekStart = parseInt($scope.weekStart) || 1;
46
46
  $scope.width = parseInt($scope.width) || 300;
47
47
  $scope.isOpen = false;
@@ -49,11 +49,11 @@ angular.module('niceElements').directive('niceDatetimePicker', function () {
49
49
 
50
50
  if (!$scope.format) {
51
51
  if ($scope.date && !$scope.time) {
52
- $scope.format = 'DD.MM.YYYY';
52
+ $scope.format = 'D.M.YYYY';
53
53
  } else if (!$scope.date && $scope.time) {
54
54
  $scope.format = 'HH:mm';
55
55
  } else {
56
- $scope.format = 'DD.MM.YYYY HH:mm';
56
+ $scope.format = 'D.M.YYYY • H:mm';
57
57
  }
58
58
  }
59
59
 
@@ -26,10 +26,10 @@
26
26
 
27
27
  <div class="dtp-layer">
28
28
  <div class="dtp-buttons-left">
29
- <a class="btn btn-primary btn-block" ng-click="selectLastNDays(1)">Last 24 hours</a>
30
- <a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)">Last 7 days</a>
31
- <a class="btn btn-primary btn-block" ng-click="selectLastMonth()">Last month</a>
32
- <a class="btn btn-primary btn-block" ng-click="selectThisMonth()">This month</a>
29
+ <a class="btn btn-primary btn-block" ng-click="selectLastNDays(1)" translate translate-context="Nice">Last 24 hours</a>
30
+ <a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)" translate translate-context="Nice">Last 7 days</a>
31
+ <a class="btn btn-primary btn-block" ng-click="selectLastMonth()" translate translate-context="Nice">Last month</a>
32
+ <a class="btn btn-primary btn-block" ng-click="selectThisMonth()" translate translate-context="Nice">This month</a>
33
33
  </div>
34
34
 
35
35
 
@@ -73,8 +73,8 @@
73
73
  </div>
74
74
 
75
75
  <div class="dtp-buttons-bottom">
76
- <a class="btn btn-danger btn-block margin-right-20" ng-click="cancelClick()">Cancel</a>
77
- <a class="btn btn-success btn-block" ng-click="okClick()">OK</a>
76
+ <a class="btn btn-danger btn-block margin-right-20" ng-click="cancelClick()" translate translate-context="Nice">Cancel</a>
77
+ <a class="btn btn-success btn-block" ng-click="okClick()" translate translate-context="Nice">OK</a>
78
78
  </div>
79
79
  </div>
80
80
  </div>
@@ -7,12 +7,12 @@
7
7
  * # niceDatetimerangePicker
8
8
  */
9
9
  angular.module('niceElements')
10
- .directive('niceDatetimerangePicker', ['$window', '$timeout', function($window, $timeout) {
10
+ .directive('niceDatetimerangePicker', function(gettextCatalog) {
11
11
  return {
12
12
  scope: {
13
13
  modelStart: '=', // binding model
14
14
  modelEnd: '=', // binding model
15
- format: '@', // default: 'DD.MM.YYYY HH:mm', format for input label string
15
+ format: '@', // default: 'D.M.YYYY • H:mm', format for input label string
16
16
  modelFormat: '@',
17
17
  date: '@', // default: true, is date picker enabled?
18
18
  time: '@', // default: false, is time picker enabled?
@@ -37,22 +37,22 @@ angular.module('niceElements')
37
37
  },
38
38
  templateUrl: 'src/components/nice-datetimerange-picker/nice-datetimerange-picker.html',
39
39
  link: {
40
- pre: function($scope, $element, $attrs) {
40
+ pre: function($scope) {
41
41
  // Default parameters
42
42
  var params = {
43
43
  title: '',
44
44
  noMargin: false,
45
45
  fieldWidth: 'col-sm-8',
46
46
  labelWidth: 'col-sm-4',
47
- format: 'D.M.YYYY H:mm',
47
+ format: 'D.M.YYYY • H:mm',
48
48
  modelFormat: 'YYYY-MM-DDTHH:mm:ss.SSS',
49
49
  minDate: null,
50
50
  maxDate: null,
51
51
  lang: 'en',
52
52
  weekStart: 1,
53
53
  shortTime: false,
54
- cancelText: 'Cancel',
55
- okText: 'OK',
54
+ cancelText: gettextCatalog.getString('Cancel', null, 'Nice'),
55
+ okText: gettextCatalog.getString('OK', null, 'Nice'),
56
56
  date: true,
57
57
  time: false,
58
58
  width: 300,
@@ -243,4 +243,4 @@ angular.module('niceElements')
243
243
  }
244
244
  };
245
245
 
246
- }]);
246
+ });
@@ -19,15 +19,15 @@
19
19
  <div class="dtp-wrapper" ng-show="isOpen">
20
20
  <div class="dtp-buttons-left">
21
21
  <div class="dtp-buttons-top">
22
- <a class="btn btn-primary btn-block" ng-click="selectToday()">Last 24 hours</a>
23
- <a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)">Last 7 days</a>
24
- <a class="btn btn-primary btn-block" ng-click="selectLastMonth()">Last month</a>
25
- <a class="btn btn-primary btn-block" ng-click="selectThisMonth()">This month</a>
22
+ <a class="btn btn-primary btn-block" ng-click="selectToday()" translate translate-context="Nice">Last 24 hours</a>
23
+ <a class="btn btn-primary btn-block" ng-click="selectLastNDays(7)" translate translate-context="Nice">Last 7 days</a>
24
+ <a class="btn btn-primary btn-block" ng-click="selectLastMonth()" translate translate-context="Nice">Last month</a>
25
+ <a class="btn btn-primary btn-block" ng-click="selectThisMonth()" translate translate-context="Nice">This month</a>
26
26
  </div>
27
27
 
28
28
  <div class="dtp-buttons-bottom">
29
- <a class="btn btn-danger btn-block" ng-click="close()">Cancel</a>
30
- <a class="btn btn-success btn-block" ng-click="confirm()">OK</a>
29
+ <a class="btn btn-danger btn-block" ng-click="close()" translate translate-context="Nice">Cancel</a>
30
+ <a class="btn btn-success btn-block" ng-click="confirm()" translate translate-context="Nice">OK</a>
31
31
  </div>
32
32
  </div>
33
33
 
@@ -12,7 +12,7 @@ angular.module('niceElements')
12
12
  scope: {
13
13
  startDate: '=', // binding model
14
14
  endDate: '=', // binding model
15
- formatString: '@', // default: 'DD.MM.YYYY HH:mm', format for input label string
15
+ formatString: '@', // default: 'D.M.YYYY • H:mm', format for input label string
16
16
  modelFormat: '@',
17
17
  time: '@', // default: false, is time picker enabled?
18
18
  minDate: '@', // default: undefined
@@ -38,7 +38,7 @@ angular.module('niceElements')
38
38
 
39
39
  // Set format string
40
40
  if(!$scope.formatString) {
41
- if($scope.time) $scope.formatString = 'D.M.YYYY H:mm';
41
+ if($scope.time) $scope.formatString = 'D.M.YYYY • H:mm';
42
42
  else $scope.formatString = 'D.M.YYYY';
43
43
  }
44
44
 
@@ -44,15 +44,15 @@ angular.module('niceElements')
44
44
  clearOnSelect: '@',
45
45
  positionFixed: '=' // Dropdown menu will be fixed to page
46
46
  },
47
- controller: function ($scope, $element, $timeout) {
47
+ controller: function ($scope, $element, $timeout, gettextCatalog) {
48
48
  if (!$scope.objValue) { $scope.objValue = 'value'; }
49
49
  if (!$scope.objKey) { $scope.objKey = 'id'; }
50
- if (!$scope.noOptionsText) { $scope.noOptionsText = "No options"; }
51
- if (!$scope.noDataText) { $scope.noDataText = "No options"; }
52
- if (!$scope.searchText) { $scope.searchText = "Search..."; }
53
- if (!$scope.nullableText) { $scope.nullableText = "None"; }
54
- if (!$scope.selectText) { $scope.selectText = "None"; }
55
- if (!$scope.selectedText) { $scope.selectedText = "selected"; }
50
+ if (!$scope.noOptionsText) { $scope.noOptionsText = gettextCatalog.getString("No options", null, "Nice"); }
51
+ if (!$scope.noDataText) { $scope.noDataText = gettextCatalog.getString("No options", null, "Nice"); }
52
+ if (!$scope.searchText) { $scope.searchText = gettextCatalog.getString("Search...", null, "Nice"); }
53
+ if (!$scope.nullableText) { $scope.nullableText = gettextCatalog.getString("None", null, "Nice"); }
54
+ if (!$scope.selectText) { $scope.selectText = gettextCatalog.getString("None", null, "Nice"); }
55
+ if (!$scope.selectedText) { $scope.selectedText = gettextCatalog.getString("selected", null, "Nice"); }
56
56
  if (!$scope.addButtonFunction) { $scope.addButtonFunction = null; }
57
57
  $scope.nullable = $scope.nullable === 'true' || $scope.nullable === true;
58
58
  $scope.required = $scope.required === 'true' || $scope.required === true;
@@ -7,7 +7,7 @@
7
7
  * # niceDropdownDate
8
8
  */
9
9
  angular.module('niceElements')
10
- .directive('niceDropdownDate', function (){
10
+ .directive('niceDropdownDate', function (gettextCatalog) {
11
11
  return {
12
12
  restrict: 'E',
13
13
  replace: true,
@@ -29,18 +29,18 @@ angular.module('niceElements')
29
29
  link: function ($scope) {
30
30
  $scope.days = [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];
31
31
  $scope.months = [
32
- { value: 0, name: 'Jan' },
33
- { value: 1, name: 'Feb' },
34
- { value: 2, name: 'Mar' },
35
- { value: 3, name: 'Apr' },
36
- { value: 4, name: 'May' },
37
- { value: 5, name: 'Jun' },
38
- { value: 6, name: 'Jul' },
39
- { value: 7, name: 'Aug' },
40
- { value: 8, name: 'Sep' },
41
- { value: 9, name: 'Oct' },
42
- { value: 10, name: 'Nov' },
43
- { value: 11, name: 'Dec' }
32
+ { value: 0, name: gettextCatalog.getString('Jan', null, 'Nice') },
33
+ { value: 1, name: gettextCatalog.getString('Feb', null, 'Nice') },
34
+ { value: 2, name: gettextCatalog.getString('Mar', null, 'Nice') },
35
+ { value: 3, name: gettextCatalog.getString('Apr', null, 'Nice') },
36
+ { value: 4, name: gettextCatalog.getString('May', null, 'Nice') },
37
+ { value: 5, name: gettextCatalog.getString('Jun', null, 'Nice') },
38
+ { value: 6, name: gettextCatalog.getString('Jul', null, 'Nice') },
39
+ { value: 7, name: gettextCatalog.getString('Aug', null, 'Nice') },
40
+ { value: 8, name: gettextCatalog.getString('Sep', null, 'Nice') },
41
+ { value: 9, name: gettextCatalog.getString('Oct', null, 'Nice') },
42
+ { value: 10, name: gettextCatalog.getString('Nov', null, 'Nice') },
43
+ { value: 11, name: gettextCatalog.getString('Dec', null, 'Nice') }
44
44
  ];
45
45
 
46
46
 
@@ -82,7 +82,7 @@ angular.module('niceElements')
82
82
 
83
83
  // validate that the date selected is accurate
84
84
  $scope.checkDate = function(){
85
- var date = moment($scope.dateFields.day + "." + ($scope.dateFields.month + 1) + "." + $scope.dateFields.year, "DD.MM.YYYY");
85
+ var date = moment($scope.dateFields.day + "." + ($scope.dateFields.month + 1) + "." + $scope.dateFields.year, "D.M.YYYY");
86
86
 
87
87
  if(date.isValid()){
88
88
  // Format
@@ -23,9 +23,9 @@
23
23
 
24
24
  <span ng-if="multiple">
25
25
  <!--<span ng-repeat="item in internalSelected"><span ng-if="$index > 0">, </span>{{ getLabel(item) }}</span>-->
26
- <span ng-if="internalSelected.length > 1">{{ internalSelected.length }} <translate>selected</translate></span>
26
+ <span ng-if="internalSelected.length > 1">{{ internalSelected.length }} <translate translate-context="Nice">selected</translate></span>
27
27
  <span ng-if="internalSelected.length == 1">{{ getLabel(internalSelected[0]) }}</span>
28
- <span ng-if="internalSelected.length == 0" translate>None</span>
28
+ <span ng-if="internalSelected.length == 0" translate translate-context="Nice">None</span>
29
29
  </span>
30
30
 
31
31
  <!--<span ng-if="showTax && internalSelected.value">{{ internalSelected.value * 100 }}%</span>-->
@@ -35,11 +35,11 @@ angular.module('niceElements')
35
35
  isInline: '=',
36
36
  onChange: '&?'
37
37
  },
38
- controller: function($rootScope, $scope, $document, $element) {
38
+ controller: function($scope, $element, gettextCatalog) {
39
39
  if (!$scope.objValue) { $scope.objValue = 'value'; }
40
40
  if (!$scope.objKey) { $scope.objKey = 'id'; }
41
41
  if (!$scope.list) { $scope.list = []; }
42
- if (!$scope.noOptionsText) { $scope.noOptionsText = "No options"; }
42
+ if (!$scope.noOptionsText) { $scope.noOptionsText = gettextCatalog.getString("No options", null, "Nice"); }
43
43
  if(!$scope.addButtonFunction) { $scope.addButtonFunction = null; }
44
44
  if(!$scope.listenKeydown) { $scope.listenKeydown = false; }
45
45
  $scope.valid = $scope.formDropdown;
@@ -14,7 +14,7 @@ angular.module('niceElements')
14
14
  scope: {
15
15
  onChange: '&?', // function called on date changed
16
16
  model: '=', // binding model
17
- format: '@', // default: 'DD.MM.YYYY HH:mm', format for input label string
17
+ format: '@', // default: 'D.M.YYYY • H:mm', format for input label string
18
18
  modelFormat: '@', // default: ''
19
19
  //currentDate: '@',
20
20
  date: '@', // default: true, is date picker enabled?
@@ -35,7 +35,7 @@ angular.module('niceElements')
35
35
  closed: '='
36
36
  },
37
37
  templateUrl: 'src/components/nice-dtp/nice-dtp.html',
38
- link: function ($scope, $element, $attrs) {
38
+ controller: function ($scope, $element, $attrs, gettextCatalog) {
39
39
 
40
40
  // default parameters
41
41
  var params = {
@@ -43,15 +43,15 @@ angular.module('niceElements')
43
43
  noMargin: false,
44
44
  fieldWidth: 'col-sm-8',
45
45
  labelWidth: 'col-sm-4',
46
- format: 'DD.MM.YYYY HH:mm',
46
+ format: 'D.M.YYYY • H:mm',
47
47
  modelFormat: 'YYYY-MM-DDTHH:mm:ss.SSS',
48
48
  minDate: null,
49
49
  maxDate: null,
50
50
  lang: 'en',
51
51
  weekStart: 1,
52
52
  shortTime: false,
53
- cancelText: 'Cancel',
54
- okText: 'OK',
53
+ cancelText: gettextCatalog.getString('Cancel', null, 'Nice'),
54
+ okText: gettextCatalog.getString('OK', null, 'Nice'),
55
55
  date: true,
56
56
  time: false,
57
57
  width: 300,
@@ -13,12 +13,6 @@ angular.module('niceElements')
13
13
  restrict: 'E',
14
14
  scope: {
15
15
  text: '@'
16
- },
17
- link: function postLink(scope, element, attrs) {
18
-
19
- },
20
- controller: function($rootScope, $scope) {
21
-
22
16
  }
23
17
  };
24
18
  });