nice-elements 1.6.2 → 1.7.1

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 (50) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +2 -1
  3. package/bower.json +1 -1
  4. package/dist/nice.js +249 -220
  5. package/dist/nice.min.js +1 -1
  6. package/dist/style.css +247 -91
  7. package/dist/style.css.map +3 -2
  8. package/dist/style.min.css +2 -2
  9. package/package.json +1 -1
  10. package/src/components/nice-calendar/nice-calendar.html +3 -2
  11. package/src/components/nice-calendar/nice-calendar.scss +9 -7
  12. package/src/components/nice-checkbox/nice-checkbox.html +1 -3
  13. package/src/components/nice-checkbox/nice-checkbox.scss +12 -12
  14. package/src/components/nice-choice/nice-choice.html +3 -1
  15. package/src/components/nice-choice/nice-choice.scss +14 -3
  16. package/src/components/nice-date/nice-date.html +7 -8
  17. package/src/components/nice-date/nice-date.js +51 -53
  18. package/src/components/nice-date/nice-date.scss +29 -6
  19. package/src/components/nice-date-input/nice-date-input.html +6 -9
  20. package/src/components/nice-date-input/nice-date-input.js +24 -11
  21. package/src/components/nice-date-range/nice-date-range.html +3 -1
  22. package/src/components/nice-datetime-picker/nice-datetime-picker.html +5 -19
  23. package/src/components/nice-datetime-picker/nice-datetime-picker.scss +1 -1
  24. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +6 -1
  25. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +5 -3
  26. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +25 -26
  27. package/src/components/nice-dropdown/nice-dropdown.html +3 -1
  28. package/src/components/nice-dropdown/nice-dropdown.scss +1 -0
  29. package/src/components/nice-dropdown-old/nice-dropdown-old.js +38 -36
  30. package/src/components/nice-dtp/nice-dtp.html +12 -12
  31. package/src/components/nice-dtp/nice-dtp.js +1 -0
  32. package/src/components/nice-help/nice-help.html +2 -1
  33. package/src/components/nice-help/nice-help.scss +7 -0
  34. package/src/components/nice-input/nice-input.html +9 -42
  35. package/src/components/nice-input/nice-input.js +28 -28
  36. package/src/components/nice-input/nice-input.scss +27 -20
  37. package/src/components/nice-number/nice-number.html +6 -2
  38. package/src/components/nice-number/nice-number.scss +15 -3
  39. package/src/components/nice-quantity/nice-quantity.html +6 -2
  40. package/src/components/nice-quantity/nice-quantity.scss +11 -0
  41. package/src/components/nice-search/nice-search.html +9 -20
  42. package/src/components/nice-search2/nice-search2.html +4 -2
  43. package/src/components/nice-time-picker/nice-time-picker.html +21 -27
  44. package/src/components/nice-time-picker/nice-time-picker.scss +11 -32
  45. package/src/components/nice-yesno/nice-yesno.html +2 -2
  46. package/src/components/nice-yesno/nice-yesno.scss +13 -0
  47. package/src/styles/_nice-buttons.scss +22 -9
  48. package/src/styles/_nice-common.scss +64 -16
  49. package/src/styles/_nice.scss +2 -1
  50. package/src/styles/_variables.scss +3 -0
@@ -8,7 +8,7 @@
8
8
  */
9
9
  angular.module('niceElements')
10
10
 
11
- .directive('niceDate', function() {
11
+ .directive('niceDate', function () {
12
12
  return {
13
13
  restrict: 'E',
14
14
  replace: true,
@@ -20,7 +20,8 @@ angular.module('niceElements')
20
20
  fieldWidth: '@', // default: 'col-sm-8', bootstrap classes that defines width of field
21
21
  labelWidth: '@', // default: 'col-sm-4', bootstrap classes that defines width of label
22
22
  model: '=',
23
- time: '@',
23
+ time: '=?',
24
+ date: '=?',
24
25
  help: '@',
25
26
  inline: '@',
26
27
  maxDate: '=',
@@ -30,14 +31,17 @@ angular.module('niceElements')
30
31
  isInline: '=',
31
32
  onChange: '&?'
32
33
  },
33
- controller: function($scope, $element, $timeout, gettextCatalog) {
34
+ controller: function ($scope, $element, $timeout, gettextCatalog) {
34
35
  $scope.isOpen = false;
36
+ if ($scope.date == undefined) $scope.date = true;
37
+ if ($scope.time == undefined) $scope.time = false;
35
38
  $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
39
  $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
40
  $scope.translations = {
38
41
  nextMonth: gettextCatalog.getString("Next month", null, "Nice"),
39
42
  prevMonth: gettextCatalog.getString("Previous month", null, "Nice"),
40
43
  };
44
+ if (!$scope.model) $scope.model = moment();
41
45
  $scope.innerDate = {
42
46
  month: 0,
43
47
  year: 0,
@@ -50,18 +54,18 @@ angular.module('niceElements')
50
54
 
51
55
  // $scope.weekdays = moment.weekdaysShort(false);
52
56
  $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"),
57
+ gettextCatalog.getString("Mon", null, "Nice"),
58
+ gettextCatalog.getString("Tue", null, "Nice"),
59
+ gettextCatalog.getString("Wed", null, "Nice"),
60
+ gettextCatalog.getString("Thu", null, "Nice"),
61
+ gettextCatalog.getString("Fri", null, "Nice"),
62
+ gettextCatalog.getString("Sat", null, "Nice"),
59
63
  gettextCatalog.getString("Sun", null, "Nice")
60
64
  ];
61
65
 
62
66
  $scope.years = [];
63
- var year = moment().year()-100;
64
- for(var i=0; i<200; i++) {
67
+ var year = moment().year() - 100;
68
+ for (var i = 0; i < 200; i++) {
65
69
  $scope.years.push(year + i);
66
70
  }
67
71
 
@@ -80,20 +84,13 @@ angular.module('niceElements')
80
84
  { value: 11, name: gettextCatalog.getString("December", null, "Nice") }
81
85
  ]
82
86
 
83
-
84
- if(!$scope.model) $scope.model = moment();
85
-
86
- if(!$scope.time) $scope.time = false;
87
- else $scope.time = $scope.time == "true";
88
-
89
-
90
87
  if ($scope.maxDate) $scope.maxDate = moment($scope.maxDate);
91
88
  if ($scope.minDate) $scope.minDate = moment($scope.minDate);
92
89
 
93
-
90
+
94
91
  // Setup popper
95
92
  // https://popper.js.org/docs/v2/constructors/
96
- $scope.setupPopper = function() {
93
+ $scope.setupPopper = function () {
97
94
  var button = $element[0].getElementsByClassName('nice-date-button')[0];
98
95
  var tooltip = $element[0].getElementsByClassName('nice-date-dropdown-wrapper')[0];
99
96
  $scope.popper = Popper.createPopper(button, tooltip, {
@@ -116,22 +113,22 @@ angular.module('niceElements')
116
113
 
117
114
 
118
115
  // ------------------ Time changes ------------------
119
- $scope.timeChange = function() {
116
+ $scope.timeChange = function () {
120
117
  var selectedDate = angular.copy($scope.model);
121
118
  selectedDate = $scope._removeTime(selectedDate);
122
119
  selectedDate.hours($scope.innerDate.hour);
123
120
  selectedDate.minutes($scope.innerDate.minute);
124
121
  $scope.innerDate.value = $scope.formatDate(selectedDate);
125
-
126
- $scope.model = selectedDate;
122
+
123
+ $scope.model = angular.copy(selectedDate);
127
124
  if ($scope.onChange) $scope.onChange({ model: $scope.model });
128
125
  $scope.forma.$setDirty();
129
126
  };
130
127
 
131
128
 
132
129
  // ------------------ Day was selected ------------------
133
- $scope.select = function(day) {
134
- if(!day.isDisabled){
130
+ $scope.select = function (day) {
131
+ if (!day.isDisabled) {
135
132
  var selectedDate = angular.copy(day.date);
136
133
  selectedDate.hours($scope.innerDate.hour);
137
134
  selectedDate.minutes($scope.innerDate.minute);
@@ -152,7 +149,7 @@ angular.module('niceElements')
152
149
 
153
150
 
154
151
  // ------------------ Set inner date ------------------
155
- $scope.setInnerDate = function(date) {
152
+ $scope.setInnerDate = function (date) {
156
153
  $scope.innerDate.year = date.year();
157
154
  $scope.innerDate.month = date.month();
158
155
  $scope.innerDate.date = date;
@@ -160,14 +157,14 @@ angular.module('niceElements')
160
157
 
161
158
 
162
159
  // ------------------ Today ------------------
163
- $scope.today = function() {
160
+ $scope.today = function () {
164
161
  $scope.setInnerDate(moment());
165
162
  $scope._buildMonth();
166
163
  };
167
164
 
168
165
 
169
166
  // ------------------ Go to next month ------------------
170
- $scope.next = function() {
167
+ $scope.next = function () {
171
168
  $scope.innerDate.date.add(1, "month");
172
169
  $scope.setInnerDate($scope.innerDate.date);
173
170
  $scope._buildMonth();
@@ -175,7 +172,7 @@ angular.module('niceElements')
175
172
 
176
173
 
177
174
  // ------------------ Go to previous month ------------------
178
- $scope.previous = function() {
175
+ $scope.previous = function () {
179
176
  $scope.innerDate.date.subtract(1, "month");
180
177
  $scope.setInnerDate($scope.innerDate.date);
181
178
  $scope._buildMonth();
@@ -183,7 +180,7 @@ angular.module('niceElements')
183
180
 
184
181
 
185
182
  // ------------------ Check if dates are equal without time ------------------
186
- $scope.isSameDay = function(date1, date2){
183
+ $scope.isSameDay = function (date1, date2) {
187
184
  date1 = moment(date1);
188
185
  date2 = moment(date2);
189
186
  return (
@@ -194,7 +191,7 @@ angular.module('niceElements')
194
191
  };
195
192
 
196
193
  // ------------------ Check month ------------------
197
- $scope.isSameMonth = function(date1, date2){
194
+ $scope.isSameMonth = function (date1, date2) {
198
195
  date1 = moment(date1);
199
196
  date2 = moment(date2);
200
197
  return (
@@ -204,12 +201,12 @@ angular.module('niceElements')
204
201
  };
205
202
 
206
203
 
207
- $scope.isBetween = function(date1, date2, date3){
208
- if(!$scope.nextDate){
204
+ $scope.isBetween = function (date1, date2, date3) {
205
+ if (!$scope.nextDate) {
209
206
  return false;
210
- } else if($scope.isSameDay(date1, date2) || $scope.isSameDay(date1, date3)){
207
+ } else if ($scope.isSameDay(date1, date2) || $scope.isSameDay(date1, date3)) {
211
208
  return true;
212
- } else if(date2.isBefore(date3)){
209
+ } else if (date2.isBefore(date3)) {
213
210
  return $scope._removeTime(date1).isBetween(date2, date3);
214
211
  } else {
215
212
  return $scope._removeTime(date1).isBetween(date3, date2);
@@ -218,24 +215,25 @@ angular.module('niceElements')
218
215
 
219
216
 
220
217
  // ------------------ Format date ------------------
221
- $scope.formatDate = function(date) {
222
- if($scope.time) return date.format('D.M.YYYY • H:mm');
218
+ $scope.formatDate = function (date) {
219
+ if ($scope.time) return date.format('D.M.YYYY • H:mm');
223
220
  else return date.format('D.M.YYYY');
224
221
  };
225
222
 
226
223
 
227
224
  // ------------------ Remove time from date ------------------
228
- $scope._removeTime = function(date) {
225
+ $scope._removeTime = function (date) {
226
+ if (!date) return date;
229
227
  return date.hour(0).minute(0).second(0).millisecond(0);
230
228
  };
231
229
 
232
- $scope._removeTimeWithDate = function(date) {
230
+ $scope._removeTimeWithDate = function (date) {
233
231
  return date.date(0).hour(0).minute(0).second(0).millisecond(0);
234
232
  };
235
233
 
236
234
 
237
235
  // ------------------ Build month ------------------
238
- $scope._buildMonth = function() {
236
+ $scope._buildMonth = function () {
239
237
  var done = false;
240
238
  var date = angular.copy($scope.innerDate.date).date(0).startOf('week').isoWeekday(1);
241
239
  var monthIndex = date.month();
@@ -254,7 +252,7 @@ angular.module('niceElements')
254
252
 
255
253
 
256
254
  // ------------------ Build week ------------------
257
- $scope._buildWeek = function(date) {
255
+ $scope._buildWeek = function (date) {
258
256
  var days = [];
259
257
  for (var i = 0; i < 7; i++) {
260
258
  var day = {
@@ -267,9 +265,9 @@ angular.module('niceElements')
267
265
  date: date
268
266
  };
269
267
 
270
- if($scope.minDate) day.isDisabled = date.isBefore($scope.minDate);
271
- if($scope.maxDate) day.isDisabled = date.isAfter($scope.maxDate);
272
- if($scope.minDate && $scope.maxDate) day.isDisabled = !date.isBetween($scope.minDate, $scope.maxDate);
268
+ if ($scope.minDate) day.isDisabled = date.isBefore($scope.minDate);
269
+ if ($scope.maxDate) day.isDisabled = date.isAfter($scope.maxDate);
270
+ if ($scope.minDate && $scope.maxDate) day.isDisabled = !date.isBetween($scope.minDate, $scope.maxDate);
273
271
 
274
272
  days.push(day);
275
273
  date = date.clone();
@@ -281,13 +279,13 @@ angular.module('niceElements')
281
279
 
282
280
 
283
281
  // ------------------ Watch for model change ------------------
284
- $scope.$watchGroup(["model", 'minDate', 'maxDate', 'nextDate'], function(value) {
282
+ $scope.$watchGroup(["model", 'minDate', 'maxDate', 'nextDate'], function (value) {
285
283
  $scope.boostrap();
286
284
  });
287
-
285
+
288
286
 
289
287
  // ------------------ Get time ------------------
290
- $scope.getTime = function() {
288
+ $scope.getTime = function () {
291
289
  if ($scope.time) {
292
290
  $scope.innerDate.hour = moment($scope.model).hours();
293
291
  $scope.innerDate.minute = moment($scope.model).minutes();
@@ -301,14 +299,14 @@ angular.module('niceElements')
301
299
 
302
300
 
303
301
  // ------------------ Bootstrap ------------------
304
- $scope.boostrap = function() {
302
+ $scope.boostrap = function () {
305
303
  $scope.setInnerDate(moment($scope.model));
306
304
  $scope.getTime();
307
-
308
- if(!$scope.time) {
305
+
306
+ if (!$scope.time) {
309
307
  $scope.model = $scope._removeTime($scope.model);
310
308
  }
311
-
309
+
312
310
  $scope.innerDate.value = $scope.formatDate(moment($scope.model));
313
311
  $scope._buildMonth();
314
312
  };
@@ -317,10 +315,10 @@ angular.module('niceElements')
317
315
 
318
316
 
319
317
  // ------------------ Toggle open ------------------
320
- $scope.toggleOpen = function() {
318
+ $scope.toggleOpen = function () {
321
319
  if (!$scope.isDisabled) {
322
320
  $scope.isOpen = !$scope.isOpen;
323
- $timeout(function() {
321
+ $timeout(function () {
324
322
  if ($scope.popper) $scope.popper.update();
325
323
  })
326
324
  }
@@ -43,6 +43,23 @@
43
43
  }
44
44
  }
45
45
 
46
+ .with-time {
47
+ .nice-date-date {
48
+ border-bottom-left-radius: 0;
49
+ border-bottom-right-radius: 0;
50
+ }
51
+
52
+ .nice-date-time {
53
+ border-top: 0 none;
54
+ }
55
+ }
56
+
57
+ .no-date {
58
+ .nice-date-time {
59
+ border-top: 1px solid $nice-border-color;
60
+ }
61
+ }
62
+
46
63
  .nice-date-date {
47
64
  border-radius: $nice-border-radius;
48
65
  background: white;
@@ -55,11 +72,6 @@
55
72
  height: 250px;
56
73
  width: 100%;
57
74
 
58
- &.with-time {
59
- border-bottom-left-radius: 0;
60
- border-bottom-right-radius: 0;
61
- }
62
-
63
75
  .nice-date-header {
64
76
  background: $nice-base-color;
65
77
  line-height: 40px;
@@ -101,6 +113,7 @@
101
113
  background: transparent;
102
114
  border: 0px;
103
115
  -webkit-appearance: none;
116
+ appearance: none;
104
117
  cursor: pointer;
105
118
 
106
119
  &:focus {
@@ -211,6 +224,10 @@
211
224
  color: darken($nice-base-color, 10%);
212
225
  min-height: 20px;
213
226
  cursor: default;
227
+
228
+ &:hover {
229
+ background: white;
230
+ }
214
231
  }
215
232
  }
216
233
  }
@@ -222,7 +239,7 @@
222
239
  padding: 10px;
223
240
  background: #ffffff;
224
241
  border: 1px solid #cad4d9;
225
- border-top: 0;
242
+ align-items: center;
226
243
 
227
244
  border-bottom-left-radius: $nice-border-radius;
228
245
  border-bottom-right-radius: $nice-border-radius;
@@ -238,6 +255,12 @@
238
255
  color: $nice-border-color;
239
256
  }
240
257
 
258
+ svg {
259
+ height: 16px;
260
+ width: 16px;
261
+ margin-right: 10px;
262
+ }
263
+
241
264
  .time-picker {
242
265
  position: relative;
243
266
  // flex-grow: 1;
@@ -8,8 +8,8 @@
8
8
 
9
9
  <!------------------------- Field ------------------------->
10
10
  <div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
11
- <div class="input-group nice-date-input" ng-class="{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }">
12
- <input type="text" class="form-control" ng-model="modelDate" ng-blur="dateBlur()" ng-disabled="isDisabled">
11
+ <div class="input-group nice-date-input" ng-show="date" ng-class="{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }">
12
+ <input type="text" class="form-control" ng-model="modelDate" ng-blur="dateBlur($event)" ng-disabled="isDisabled">
13
13
  <nice-popup placement="bottom">
14
14
  <nice-popup-target>
15
15
  <button class="input-group-addon btn btn-default" tabindex="-1">
@@ -18,12 +18,12 @@
18
18
  </nice-popup-target>
19
19
 
20
20
  <nice-popup-content>
21
- <nice-date is-inline="true" inline="true" model="model" on-change="dateChanged(model)" no-margin="true"></nice-date>
21
+ <nice-date is-inline="true" inline="true" model="inner.dateModel" on-change="dateChanged()" no-margin="true"></nice-date>
22
22
  </nice-popup-content>
23
23
  </nice-popup>
24
24
  </div>
25
- <div class="input-group nice-time-input" ng-class="{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }">
26
- <input type="text" class="form-control" ng-model="modelTime" ng-blur="timeBlur()" ng-disabled="isDisabled">
25
+ <div class="input-group nice-time-input" ng-show="time" ng-class="{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }">
26
+ <input type="text" class="form-control" ng-model="modelTime" ng-blur="timeBlur($event)" ng-disabled="isDisabled">
27
27
  <nice-popup placement="bottom">
28
28
  <nice-popup-target>
29
29
  <button class="input-group-addon btn btn-default" tabindex="-1">
@@ -32,10 +32,7 @@
32
32
  </nice-popup-target>
33
33
 
34
34
  <nice-popup-content>
35
- <!-- <nice-date is-inline="true" inline="true" time="true" date="false" on-change="timeChanged(model)" model="model"></nice-date> -->
36
- <div class="dates">
37
- <div class="date"></div>
38
- </div>
35
+ <nice-date is-inline="true" inline="true" model="inner.timeModel" on-change="timeChanged()" time="true" date="false" no-margin="true"></nice-date>
39
36
  </nice-popup-content>
40
37
  </nice-popup>
41
38
  </div>
@@ -27,21 +27,29 @@ angular.module('niceElements')
27
27
  isInline: '=',
28
28
  onChange: '&?'
29
29
  },
30
- controller: function ($scope) {
30
+ controller: function ($scope, $timeout) {
31
31
  $scope.formatDate = "DD.MM.YYYY";
32
32
  $scope.formatTime = "HH:mm";
33
- $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];
34
- $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];
33
+ if ($scope.date === undefined) $scope.date = true;
34
+ if ($scope.time === undefined) $scope.time = true;
35
35
  $scope.model = moment($scope.model) || moment().set({ 'second': 0, 'millisecond': 0 });
36
+ $scope.inner = {
37
+ timeModel: angular.copy($scope.model),
38
+ dateModel: angular.copy($scope.model)
39
+ };
36
40
 
37
- $scope.dateChanged = function (date) {
38
- $scope.modelDate = date.format($scope.formatDate);
39
- $scope.handleChange();
41
+ $scope.dateChanged = function () {
42
+ $timeout(function () {
43
+ $scope.modelDate = $scope.inner.dateModel.format($scope.formatDate);
44
+ $scope.handleChange();
45
+ });
40
46
  }
41
47
 
42
- $scope.timeChanged = function (date) {
43
- $scope.modelTime = date.format($scope.formatTime);
44
- $scope.handleChange();
48
+ $scope.timeChanged = function () {
49
+ $timeout(function () {
50
+ $scope.modelTime = $scope.inner.timeModel.format($scope.formatTime);
51
+ $scope.handleChange();
52
+ });
45
53
  }
46
54
 
47
55
  // -------------------- On date change --------------------
@@ -49,13 +57,13 @@ angular.module('niceElements')
49
57
  var newModel = moment($scope.modelDate + " " + $scope.modelTime, $scope.formatDate + " " + $scope.formatTime).seconds(0).milliseconds(0);
50
58
  if (newModel.isValid()) {
51
59
  $scope.model = newModel;
52
- if ($scope.onChange) $scope.onChange({ model: $scope.model });
53
60
  $scope.niceDateInputForm.$setValidity('validDate', true);
54
61
  } else {
55
62
  $scope.model = null;
56
- if ($scope.onChange) $scope.onChange({ model: $scope.model });
57
63
  $scope.niceDateInputForm.$setValidity('validDate', false);
58
64
  }
65
+ if ($scope.onChange) $scope.onChange({ model: $scope.model });
66
+ $scope.niceDateInputForm.$setDirty();
59
67
  }
60
68
 
61
69
  // -------------------- Format model --------------------
@@ -90,6 +98,11 @@ angular.module('niceElements')
90
98
  // -------------------- Watch model --------------------
91
99
  $scope.$watch('model', function () {
92
100
  $scope.formatModel();
101
+ $scope.inner = {
102
+ timeModel: angular.copy($scope.model),
103
+ dateModel: angular.copy($scope.model)
104
+ };
105
+
93
106
  });
94
107
  }
95
108
  }
@@ -10,7 +10,9 @@
10
10
  <div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
11
11
  <div class="input-group">
12
12
  <input date-range-picker class="form-control date-picker" type="text" options="opts" ng-model="model" />
13
- <span date-range-picker options="opts" ng-model="model" class="input-group-addon"><i class="fa fa-calendar"></i></span>
13
+ <span date-range-picker options="opts" ng-model="model" class="input-group-addon">
14
+ <nice-icon icon="icon-calendar"></nice-icon>
15
+ </span>
14
16
  </div>
15
17
  </div>
16
18
  </div>
@@ -16,30 +16,16 @@
16
16
  <div class="input-group" id="dropdown{{randNum}}">
17
17
  <input type="text" class="form-control" value="{{ value }}" ng-click="openDtp()" ng-disabled="isDisabled">
18
18
  <span class="input-group-addon clickable" ng-click="openDtp()">
19
- <i class="fa" ng-class="date == 'true' ? 'fa-calendar' : 'fa-clock-o'"></i>
19
+ <!-- <i class="fa" ng-class="date == 'true' ? 'fa-calendar' : 'fa-clock-o'"></i> -->
20
+ <nice-icon ng-if="date == 'true'" icon="icon-calendar"></nice-icon>
21
+ <nice-icon ng-if="date != 'true'" icon="icon-clock"></nice-icon>
20
22
  </span>
21
23
  </div>
22
24
 
23
25
  <!-- inject nice-dtp here -->
24
26
  <div ng-show="isOpen">
25
- <nice-dtp
26
- model="internalDate"
27
- format="{{ format }}"
28
- model-format="{{ modelFormat }}"
29
- date="{{ date == 'true' }}"
30
- time="{{ time == 'true' }}"
31
- width="{{ width }}"
32
- enable-ok-buttons="{{ enableOkButtons }}"
33
- lang="{{ lang }}"
34
- min-date="{{ minDate }}"
35
- max-date="{{ maxDate }}"
36
- week-start="{{ weekStart }}"
37
- ok-text="{{ okText }}"
38
- cancel-text="{{ cancelText }}"
39
- closed="closeDtp"
40
- ></nice-dtp>
27
+ <nice-dtp model="internalDate" format="{{ format }}" model-format="{{ modelFormat }}" date="{{ date == 'true' }}" time="{{ time == 'true' }}" width="{{ width }}" enable-ok-buttons="{{ enableOkButtons }}" lang="{{ lang }}" min-date="{{ minDate }}" max-date="{{ maxDate }}" week-start="{{ weekStart }}" ok-text="{{ okText }}" cancel-text="{{ cancelText }}" closed="closeDtp"></nice-dtp>
41
28
  </div>
42
29
  </div>
43
30
  </div>
44
- </div>
45
-
31
+ </div>
@@ -343,7 +343,7 @@ $color_gallery_approx: #eee;
343
343
  td {
344
344
  border: none;
345
345
  font-weight: normal;
346
- font-size: 1.2rem;
346
+ font-size: 12px;
347
347
  text-align: center;
348
348
  padding: 7px 0;
349
349
 
@@ -17,7 +17,12 @@
17
17
  <div class="dropdown-toggle" id="dropdown{{randNum}}" role="button" ng-click="openDtpRange()">
18
18
  <div class="input-group">
19
19
  <input type="text" class="form-control" value="{{value}}" ng-click="openDtpRange()">
20
- <span class="input-group-addon clickable"><i class="fa" ng-class="{'fa-clock-o': date=='false', 'fa-calendar': date!='false'}"></i></span>
20
+ <span class="input-group-addon clickable">
21
+ <!-- <i class="fa" ng-class="{'fa-clock-o': date=='false', 'fa-calendar': date!='false'}"></i> -->
22
+ <nice-icon ng-if="date != 'false'" icon="icon-calendar"></nice-icon>
23
+ <nice-icon ng-if="date == 'false'" icon="icon-clock"></nice-icon>
24
+ </span>
25
+
21
26
  </div>
22
27
  </div>
23
28
  </div>
@@ -13,7 +13,9 @@
13
13
  <div class="nice-daterange-picker-button input-group" ng-class="{ 'open': isOpen }" ng-click="open()">
14
14
  <input type="text" class="form-control" value="{{ modelFormat }}" readonly="readonly" />
15
15
  <!-- <div class="form-control" title="{{ modelFormat }}">{{ modelFormat }}</div> -->
16
- <span class="input-group-addon clickable"><i class="fa fa-calendar"></i></span>
16
+ <span class="input-group-addon clickable">
17
+ <nice-icon icon="icon-calendar"></nice-icon>
18
+ </span>
17
19
  </div>
18
20
 
19
21
  <div class="nice-daterange-picker-wrapper">
@@ -33,11 +35,11 @@
33
35
  </div>
34
36
 
35
37
  <div class="dtp-left">
36
- <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>
38
+ <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>
37
39
  </div>
38
40
 
39
41
  <div class="dtp-right">
40
- <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>
42
+ <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>
41
43
  </div>
42
44
  </div>
43
45
  </div>