nice-elements 1.12.2 → 1.12.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.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "nice-elements",
3
- "version": "1.12.2",
3
+ "version": "1.12.4",
4
4
  "description": "Nice elements used in olaii angular 1.x webapps.",
5
5
  "main": "dist/nice.js",
6
6
  "license": "MIT",
7
7
  "scripts": {
8
8
  "serve": "node server.js",
9
- "build": "./node_modules/.bin/grunt"
9
+ "build": "grunt"
10
10
  },
11
11
  "dependencies": {
12
12
  "@olaii/ng-infinite-scroll": "1.3.1",
@@ -1,4 +1,4 @@
1
- <div class="nice-alert" ng-class="['nice-alert-' + type, { 'nice-alert-fit': fitContent, 'nice-icon-center': iconCenter }]">
1
+ <div class="nice-alert" ng-class="['nice-alert-' + type, { 'nice-alert-large-icon': largeIcon, 'nice-alert-fit': fitContent, 'nice-icon-center': iconCenter }]">
2
2
  <nice-icon class="nice-alert-icon" icon="{{ icon }}" ng-if="icon"></nice-icon>
3
3
  <div class="nice-alert-body">
4
4
  <div class="nice-alert-title" ng-if="niceTitle">{{ niceTitle }}</div>
@@ -18,7 +18,8 @@ angular.module('niceElements')
18
18
  niceTitle: '@?',
19
19
  message: '@?',
20
20
  fitContent: '=?',
21
- iconCenter: '@?'
21
+ iconCenter: '@?',
22
+ largeIcon: '@?'
22
23
  },
23
24
  controller: function ($scope) {
24
25
  if (!$scope.type) $scope.type = "error";
@@ -13,6 +13,15 @@
13
13
  align-items: center;
14
14
  }
15
15
 
16
+ &.nice-alert-large-icon {
17
+ flex-direction: column;
18
+
19
+ .nice-alert-icon {
20
+ height: 100px;
21
+ width: auto;
22
+ }
23
+ }
24
+
16
25
  .nice-alert-icon {
17
26
  height: 30px;
18
27
  width: 30px;
@@ -24,6 +33,12 @@
24
33
  font-weight: bold;
25
34
  }
26
35
 
36
+ &.nice-alert-success {
37
+ color: var(--nice-success-color-darker);
38
+ background: var(--nice-success-color-plain);
39
+ border-color: var(--nice-success-color-lighter);
40
+ }
41
+
27
42
  &.nice-alert-danger,
28
43
  &.nice-alert-error {
29
44
  color: var(--nice-danger-color);
@@ -12,9 +12,9 @@
12
12
  height: 20px;
13
13
  width: 20px;
14
14
  min-height: unset;
15
- border: 1px solid $nice-border-color;
16
- border-radius: $nice-border-radius-small;
17
- background: transparent;
15
+ border: 1px solid var(--nice-border-color);
16
+ border-radius: var(--nice-border-radius-small);
17
+ background: var(--nice-input-bg);
18
18
  margin: 0;
19
19
  padding: 0;
20
20
  flex-shrink: 0;
@@ -34,16 +34,16 @@
34
34
 
35
35
  .nice-checkbox-message {
36
36
  user-select: none;
37
- color: $nice-font-color;
37
+ color: var(--nice-font-color);
38
38
  }
39
39
 
40
40
  &:hover {
41
41
  .nice-checkbox-checkbox {
42
- border-color: $nice-choice-hover-border;
42
+ border-color: var(--nice-choice-hover-border);
43
43
  }
44
44
 
45
45
  .nice-checkbox-message {
46
- color: darken($nice-font-color, 15%);
46
+ color: var(--nice-font-color-darker);
47
47
  }
48
48
  }
49
49
 
@@ -57,13 +57,13 @@
57
57
  }
58
58
 
59
59
  .nice-checkbox-message {
60
- color: $nice-font-color;
60
+ color: var(--nice-font-color);
61
61
  }
62
62
  }
63
63
 
64
64
  &:hover {
65
65
  .nice-checkbox-checkbox {
66
- border-color: $nice-choice-hover-border;
66
+ border-color: var(--nice-choice-hover-border);
67
67
  }
68
68
  }
69
69
  }
@@ -73,18 +73,18 @@
73
73
 
74
74
  &:hover {
75
75
  .nice-checkbox-checkbox {
76
- border-color: $nice-border-color;
76
+ border-color: var(--nice-border-color);
77
77
  }
78
78
 
79
79
  .nice-checkbox-message {
80
- color: $nice-font-color;
80
+ color: var(--nice-font-color);
81
81
  }
82
82
  }
83
83
 
84
84
  &.nice-checkbox-checked {
85
85
  &:hover {
86
86
  .nice-checkbox-checkbox {
87
- border-color: $nice-border-color;
87
+ border-color: var(--nice-border-color);
88
88
  }
89
89
  }
90
90
  }
@@ -20,30 +20,30 @@ angular.module('niceElements')
20
20
  isDisabled: '=',
21
21
  fieldWidth: '@',
22
22
  labelWidth: '@',
23
- listIsObj: '@',
24
- selectedIsObj: '@',
23
+ listIsObj: '=?',
24
+ selectedIsObj: '=?',
25
25
  objValue: '@',
26
26
  objKey: '@',
27
- noMargin: '@',
28
- multiple: '@',
27
+ noMargin: '=?',
28
+ multiple: '=?',
29
29
  help: '@',
30
- isInline: '=',
30
+ isInline: '=?',
31
31
  onChange: '&?'
32
32
  },
33
- link: function (scope, element, attr) {
34
- if (!attr.title) { attr.title = ''; }
35
- if (!attr.fieldWidth) { attr.fieldWidth = 'col-sm-8'; }
36
- if (!attr.labelWidth) { attr.labelWidth = 'col-sm-4'; }
37
- attr.listIsObj = angular.isDefined(attr.listIsObj);
38
- attr.selectedIsObj = angular.isDefined(attr.selectedIsObj);
39
- if (!attr.objValue) { attr.objValue = 'value'; }
40
- if (!attr.objKey) { attr.objKey = 'id'; }
41
- attr.multiple = angular.isDefined(attr.multiple);
42
-
43
- scope.firstTime = true;
44
- scope.checkIfFirstTime = function () {
45
- if (scope.firstTime) {
46
- scope.firstTime = false;
33
+ controller: function ($attrs, $scope) {
34
+ if (!$attrs.title) { $attrs.title = ''; }
35
+ if (!$attrs.fieldWidth) { $attrs.fieldWidth = 'col-sm-8'; }
36
+ if (!$attrs.labelWidth) { $attrs.labelWidth = 'col-sm-4'; }
37
+ if (!$attrs.objValue) { $attrs.objValue = 'value'; }
38
+ if (!$attrs.objKey) { $attrs.objKey = 'id'; }
39
+ $scope.multiple = $scope.multiple === 'true' || $scope.multiple === true;
40
+ $scope.selectedIsObj = $scope.selectedIsObj === 'true' || $scope.selectedIsObj === true;
41
+ $scope.listIsObj = $scope.listIsObj === 'true' || $scope.listIsObj === true;
42
+
43
+ $scope.firstTime = true;
44
+ $scope.checkIfFirstTime = function () {
45
+ if ($scope.firstTime) {
46
+ $scope.firstTime = false;
47
47
  return true;
48
48
  } else {
49
49
  return false;
@@ -51,48 +51,47 @@ angular.module('niceElements')
51
51
  };
52
52
 
53
53
  // If selected is not yet defined
54
- if (!angular.isDefined(scope.model)) {
55
- if (scope.multiple) {
56
- scope.model = [];
54
+ if (!angular.isDefined($scope.model)) {
55
+ if ($scope.multiple) {
56
+ $scope.model = [];
57
57
  }
58
58
  }
59
59
 
60
60
  // Set internalList
61
- if (scope.listIsObj) {
62
- scope.internalList = scope.list;
61
+ if ($scope.listIsObj) {
62
+ $scope.internalList = $scope.list;
63
63
  } else {
64
- scope.internalList = _.map(scope.list, function (val) {
64
+ $scope.internalList = _.map($scope.list, function (val) {
65
65
  const obj = {};
66
- obj[scope.objKey] = val;
67
- obj[scope.objValue] = val;
66
+ obj[$scope.objKey] = val;
67
+ obj[$scope.objValue] = val;
68
68
  return obj;
69
69
  });
70
70
  }
71
71
 
72
72
  // Set internalSelected
73
- if (scope.selectedIsObj) {
74
- scope.internalSelected = scope.model;
73
+ if ($scope.selectedIsObj) {
74
+ $scope.internalSelected = $scope.model;
75
75
  } else {
76
- if (scope.multiple) {
77
- scope.internalSelected = _.map(scope.model, function (val) {
76
+ if ($scope.multiple) {
77
+ $scope.internalSelected = _.map($scope.model, function (val) {
78
78
  const obj = {};
79
- obj[scope.objKey] = val;
80
- obj[scope.objValue] = val;
79
+ obj[$scope.objKey] = val;
80
+ obj[$scope.objValue] = val;
81
81
  return obj;
82
82
  });
83
83
  } else {
84
- if (scope.model) {
84
+ if ($scope.model) {
85
85
  const obj = {};
86
- obj[scope.objKey] = scope.model;
87
- obj[scope.objValue] = scope.model;
88
- scope.internalSelected = obj;
86
+ obj[$scope.objKey] = $scope.model;
87
+ obj[$scope.objValue] = $scope.model;
88
+ $scope.internalSelected = obj;
89
89
  } else {
90
- scope.internalSelected = scope.internalList[0];
90
+ $scope.internalSelected = $scope.internalList[0];
91
91
  }
92
92
  }
93
93
  }
94
- },
95
- controller: function ($rootScope, $scope) {
94
+
96
95
  const getFilter = function (item) {
97
96
  // Create filter for finding object by objValue with _.where()
98
97
  const filter = {};
@@ -108,7 +107,7 @@ angular.module('niceElements')
108
107
  if (event.buttons == 1 && $scope.multiple) {
109
108
  $scope.toggle(item);
110
109
  }
111
- }
110
+ };
112
111
 
113
112
  $scope.setDefault = function () {
114
113
  if (!$scope.multiple) {
@@ -192,7 +191,7 @@ angular.module('niceElements')
192
191
  if ($scope.multiple) {
193
192
  $scope.internalSelected = _.map(value_new, function (item) {
194
193
  return _.find($scope.internalList, getFilter(item));
195
- })
194
+ });
196
195
  } else {
197
196
  $scope.internalSelected = _.find($scope.internalList, getFilter(value_new));
198
197
  }
@@ -29,11 +29,11 @@ angular.module('niceElements')
29
29
  link: function postLink(scope, element, attrs) {
30
30
  if (scope.model == null) { scope.model = ''; }
31
31
  if (!attrs.placeholder) { attrs.placeholder = ''; }
32
- if (!attrs.noTextLabel) { angular.isDefined(attrs.noTextLabel); }
33
32
  if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
34
33
  if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
35
34
  if (!attrs.help) { attrs.help = ''; }
36
35
  if (!attrs.rows) { attrs.rows = 1; }
36
+ attrs.noTextLabel = attrs.noTextLabel === 'true' || attrs.noTextLabel === true;
37
37
 
38
38
  const textareas = element.find('textarea');
39
39
 
@@ -11,11 +11,14 @@
11
11
 
12
12
  <!------------------------------ Input ------------------------------>
13
13
  <div class="nice-date-button input-group" ng-class="{ 'open': isOpen }" ng-show="!inline" ng-click="toggleOpen()">
14
- <input type="text" class="form-control" value="{{ model | niceDate:time }}" readonly="readonly" ng-disabled="isDisabled" />
14
+ <input type="text" class="form-control" value="{{ innerDate.value }}" placeholder="{{ placeholder }}" readonly="readonly" ng-disabled="isDisabled" />
15
15
  <span class="input-group-btn">
16
- <button type="button" class="btn btn-default btn-right" ng-disabled="isDisabled">
16
+ <button type="button" class="btn btn-default btn-right" ng-disabled="isDisabled" ng-if="!(model && nullable)">
17
17
  <nice-icon icon="icon-calendar"></nice-icon>
18
18
  </button>
19
+ <button type="button" class="btn btn-default btn-right" ng-disabled="isDisabled" ng-if="model && nullable" ng-click="clear()">
20
+ <nice-icon icon="icon-x"></nice-icon>
21
+ </button>
19
22
  </span>
20
23
  </div>
21
24
 
@@ -31,11 +31,14 @@ angular.module('niceElements')
31
31
  isInline: '=',
32
32
  onChange: '&?',
33
33
  required: '=',
34
+ nullable: '=',
35
+ placeholder: '@',
34
36
  placement: '@', // Describes the preferred placement of the popper
35
37
  },
36
38
  controller: function ($scope, $element, $timeout, gettextCatalog) {
37
39
  $scope.isOpen = false;
38
40
  if (!$scope.placement) { $scope.placement = "bottom-start"; }
41
+ if (!$scope.placeholder) { $scope.placeholder = gettextCatalog.getString("Select date", null, "Nice"); }
39
42
  if ($scope.date == undefined) $scope.date = true;
40
43
  if ($scope.time == undefined) $scope.time = false;
41
44
  $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];
@@ -44,7 +47,7 @@ angular.module('niceElements')
44
47
  nextMonth: gettextCatalog.getString("Next month", null, "Nice"),
45
48
  prevMonth: gettextCatalog.getString("Previous month", null, "Nice"),
46
49
  };
47
- if (!$scope.model) $scope.model = moment();
50
+ if (!$scope.model && !$scope.nullable) $scope.model = moment();
48
51
  $scope.innerDate = {
49
52
  month: 0,
50
53
  year: 0,
@@ -121,13 +124,13 @@ angular.module('niceElements')
121
124
  selectedDate = $scope._removeTime(selectedDate);
122
125
  selectedDate.hours($scope.innerDate.hour);
123
126
  selectedDate.minutes($scope.innerDate.minute);
124
- $scope.innerDate.value = $scope.formatDate(selectedDate);
125
127
 
126
128
  $scope.model = angular.copy(selectedDate);
129
+ $scope.innerDate.value = $scope.formatDate($scope.model);
127
130
  $timeout(function () {
128
131
  if ($scope.onChange) $scope.onChange({ model: $scope.model });
129
132
  $scope.forma.$setDirty();
130
- })
133
+ });
131
134
  };
132
135
 
133
136
 
@@ -147,6 +150,18 @@ angular.module('niceElements')
147
150
  };
148
151
 
149
152
 
153
+ // ------------------ Clear ------------------
154
+ $scope.clear = function () {
155
+ $scope.isOpen = false;
156
+ $scope.model = null;
157
+ $timeout(function () {
158
+ if ($scope.onChange) $scope.onChange({ model: $scope.model });
159
+ $scope.forma.$setDirty();
160
+ $scope.isOpen = false;
161
+ });
162
+ };
163
+
164
+
150
165
  // ------------------ Handle date change ------------------
151
166
  $scope.handleDateChange = function () {
152
167
  $scope.innerDate.date.year($scope.innerDate.year);
@@ -223,6 +238,8 @@ angular.module('niceElements')
223
238
 
224
239
  // ------------------ Format date ------------------
225
240
  $scope.formatDate = function (date) {
241
+ if (!date) return "";
242
+ date = moment(date);
226
243
  if ($scope.time) return date.format('D.M.YYYY • H:mm');
227
244
  else return date.format('D.M.YYYY');
228
245
  };
@@ -299,20 +316,20 @@ angular.module('niceElements')
299
316
  $scope.innerDate.minute = 0;
300
317
  }
301
318
 
302
- $scope.innerDate.value = $scope.formatDate($scope.innerDate.date);
319
+ $scope.innerDate.value = $scope.formatDate($scope.model);
303
320
  };
304
321
 
305
322
 
306
323
  // ------------------ Bootstrap ------------------
307
324
  $scope.bootstrap = function () {
308
- $scope.setInnerDate(moment($scope.model));
325
+ $scope.setInnerDate($scope.model ? moment($scope.model) : moment());
309
326
  $scope.getTime();
310
327
 
311
328
  if (!$scope.time) {
312
329
  $scope.model = $scope._removeTime($scope.model);
313
330
  }
314
331
 
315
- $scope.innerDate.value = $scope.formatDate(moment($scope.model));
332
+ $scope.innerDate.value = $scope.formatDate($scope.model);
316
333
  $scope._buildMonth();
317
334
  };
318
335
 
@@ -325,7 +342,7 @@ angular.module('niceElements')
325
342
  $scope.isOpen = !$scope.isOpen;
326
343
  $timeout(function () {
327
344
  if ($scope.popper) $scope.popper.update();
328
- })
345
+ });
329
346
  }
330
347
  };
331
348
  }
@@ -1,4 +1,4 @@
1
- <div class="nice-component nice-date-input" ng-form="niceDateInputForm" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline, 'error': niceDateInputForm.$invalid }">
1
+ <div class="nice-component nice-date-input" ng-form="niceDateInputForm" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline, 'error': niceDateInputForm.$invalid, 'nice-date-input-no-date': !date }">
2
2
  <div class="row">
3
3
  <!------------------------- Title ------------------------->
4
4
  <nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
@@ -6,10 +6,14 @@
6
6
  <!------------------------- Field ------------------------->
7
7
  <div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
8
8
  <div class="input-group nice-date-input" ng-show="date" ng-class="{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }">
9
- <input type="text" class="form-control" ng-model="modelDate" ng-blur="dateBlur($event)" ng-disabled="isDisabled">
9
+ <input type="text" class="form-control" ng-model="modelDate" placeholder="{{ placeholderDate }}" ng-blur="dateBlur($event)" ng-disabled="isDisabled">
10
10
  <nice-popup placement="bottom">
11
11
  <nice-popup-target>
12
- <span class="input-group-btn">
12
+ <span class="input-group-btns input-group-btn">
13
+ <button type="button" class="btn btn-default btn-right" ng-if="model && nullable" tabindex="-1" ng-disabled="isDisabled" ng-click="clear()">
14
+ <nice-icon icon="icon-x"></nice-icon>
15
+ </button>
16
+
13
17
  <button type="button" class="btn btn-default btn-right" tabindex="-1" ng-disabled="isDisabled">
14
18
  <nice-icon icon="icon-calendar"></nice-icon>
15
19
  </button>
@@ -22,10 +26,14 @@
22
26
  </nice-popup>
23
27
  </div>
24
28
  <div class="input-group nice-time-input" ng-show="time" ng-class="{ 'has-warning': !disabled && niceDateInputForm.$invalid && niceDateInputForm.$dirty }">
25
- <input type="text" class="form-control" ng-model="modelTime" ng-blur="timeBlur($event)" ng-disabled="isDisabled">
29
+ <input type="text" class="form-control" ng-model="modelTime" placeholder="{{ placeholderTime }}" ng-blur="timeBlur($event)" ng-disabled="isDisabled">
26
30
  <nice-popup placement="bottom">
27
31
  <nice-popup-target>
28
- <span class="input-group-btn">
32
+ <span class="input-group-btns input-group-btn">
33
+ <button type="button" class="btn btn-default btn-right" ng-if="model && nullable && !date" tabindex="-1" ng-disabled="isDisabled" ng-click="clear()">
34
+ <nice-icon icon="icon-x"></nice-icon>
35
+ </button>
36
+
29
37
  <button type="button" class="btn btn-default btn-right" tabindex="-1" ng-disabled="isDisabled">
30
38
  <nice-icon icon="icon-clock"></nice-icon>
31
39
  </button>
@@ -27,17 +27,22 @@ angular.module('niceElements')
27
27
  help: '@',
28
28
  isInline: '=',
29
29
  onChange: '&?',
30
- required: '='
30
+ required: '=',
31
+ nullable: '=',
32
+ placeholderDate: '@',
33
+ placeholderTime: '@',
31
34
  },
32
- controller: function ($scope, $timeout) {
35
+ controller: function ($scope, $timeout, gettextCatalog) {
33
36
  $scope.formatDate = "DD.MM.YYYY";
34
37
  $scope.formatTime = "HH:mm";
35
38
  if ($scope.date === undefined) $scope.date = true;
36
39
  if ($scope.time === undefined) $scope.time = true;
37
- $scope.model = moment($scope.model) || moment().set({ 'second': 0, 'millisecond': 0 });
40
+ if (!$scope.placeholderDate) { $scope.placeholderDate = gettextCatalog.getString("••.••.••••", null, "Nice"); }
41
+ if (!$scope.placeholderTime) { $scope.placeholderTime = gettextCatalog.getString("••:••", null, "Nice"); }
42
+ if (!$scope.model && !$scope.nullable) $scope.model = moment($scope.model) || moment().set({ 'second': 0, 'millisecond': 0 });
38
43
  $scope.inner = {
39
- timeModel: angular.copy($scope.model),
40
- dateModel: angular.copy($scope.model)
44
+ timeModel: angular.copy($scope.model || moment()),
45
+ dateModel: angular.copy($scope.model || moment()),
41
46
  };
42
47
 
43
48
  $scope.dateChanged = function () {
@@ -45,17 +50,18 @@ angular.module('niceElements')
45
50
  $scope.modelDate = $scope.inner.dateModel.format($scope.formatDate);
46
51
  $scope.handleChange();
47
52
  });
48
- }
53
+ };
49
54
 
50
55
  $scope.timeChanged = function () {
51
56
  $timeout(function () {
52
57
  $scope.modelTime = $scope.inner.timeModel.format($scope.formatTime);
53
58
  $scope.handleChange();
54
59
  });
55
- }
60
+ };
56
61
 
57
62
  // -------------------- On date change --------------------
58
63
  $scope.handleChange = function () {
64
+ if (!$scope.date) $scope.modelDate = moment().format($scope.formatDate);
59
65
  const newModel = moment($scope.modelDate + " " + $scope.modelTime, $scope.formatDate + " " + $scope.formatTime).seconds(0).milliseconds(0);
60
66
  if (newModel.isValid()) {
61
67
  $scope.model = newModel;
@@ -66,13 +72,25 @@ angular.module('niceElements')
66
72
  }
67
73
  if ($scope.onChange) $scope.onChange({ model: $scope.model });
68
74
  $scope.niceDateInputForm.$setDirty();
69
- }
75
+ };
76
+
77
+ // -------------------- Clear --------------------
78
+ $scope.clear = function () {
79
+ $scope.model = null;
80
+ if ($scope.onChange) $scope.onChange({ model: $scope.model });
81
+ $scope.niceDateInputForm.$setDirty();
82
+ };
70
83
 
71
84
  // -------------------- Format model --------------------
72
85
  $scope.formatModel = function () {
73
- $scope.modelDate = $scope.model.format($scope.formatDate);
74
- $scope.modelTime = $scope.model.format($scope.formatTime);
75
- }
86
+ if (!$scope.model) {
87
+ $scope.modelDate = null;
88
+ $scope.modelTime = null;
89
+ } else {
90
+ $scope.modelDate = $scope.model.format($scope.formatDate);
91
+ $scope.modelTime = $scope.model.format($scope.formatTime);
92
+ }
93
+ };
76
94
  $scope.formatModel();
77
95
 
78
96
  // -------------------- Date --------------------
@@ -101,12 +119,11 @@ angular.module('niceElements')
101
119
  $scope.$watch('model', function () {
102
120
  $scope.formatModel();
103
121
  $scope.inner = {
104
- timeModel: angular.copy($scope.model),
105
- dateModel: angular.copy($scope.model)
122
+ timeModel: angular.copy($scope.model || moment()),
123
+ dateModel: angular.copy($scope.model || moment())
106
124
  };
107
-
108
125
  });
109
126
  }
110
- }
127
+ };
111
128
  }
112
129
  );
@@ -43,4 +43,11 @@
43
43
  }
44
44
  }
45
45
  }
46
- }
46
+
47
+ &.nice-date-input-no-date {
48
+ .nice-time-input {
49
+ width: 120px !important;
50
+ max-width: 100%;
51
+ }
52
+ }
53
+ }
@@ -35,7 +35,7 @@ angular.module('niceElements')
35
35
  if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
36
36
  if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
37
37
  if (!attrs.format) { attrs.format = 'dd.MM.yyyy'; }
38
- attrs.noMargin = angular.isDefined(attrs.noMargin);
38
+ attrs.noMargin = attrs.noMargin === 'true' || attrs.noMargin === true;
39
39
 
40
40
  if (!angular.isDefined(scope.model)) {
41
41
  let model = null;
@@ -22,21 +22,21 @@ angular.module('niceElements')
22
22
  required: '=',
23
23
  fieldWidth: '@',
24
24
  labelWidth: '@',
25
- hideValid: '@',
26
- showValid: '@',
27
- textArea: '@',
28
- textAreaLines: '@',
25
+ hideValid: '=?',
26
+ showValid: '=?',
27
+ textArea: '=?',
28
+ textAreaLines: '=?',
29
29
  symbol: '@',
30
30
  help: '@',
31
31
  name: '@',
32
- noMargin: '@',
32
+ noMargin: '=?',
33
33
  minDecimalsCutZeros: '@', // Use this field to tell how much decimal places must always be, even if number is ceil.
34
34
  tabIndex: '@',
35
- isFocused: '@',
36
- isInline: '=',
35
+ isFocused: '=?',
36
+ isInline: '=?',
37
37
  onChange: '&?',
38
38
  onClear: '&?',
39
- numbersOnly: '=', // Allow only numbers in the input
39
+ numbersOnly: '=?', // Allow only numbers in the input
40
40
  positiveOnly: '=?', // Allow only positive numbers in the input
41
41
  multilanguage: '=?', // Multiple languages object
42
42
  multilanguageField: '@?', // Multiple languages field name
@@ -57,10 +57,10 @@ angular.module('niceElements')
57
57
  if (!$attrs.help) { $attrs.help = ''; }
58
58
  if (!$attrs.name) { $attrs.name = ''; }
59
59
  if (!$attrs.minDecimalsCutZeros) { $attrs.minDecimalsCutZeros = 0; }
60
- $attrs.hideValid = angular.isDefined($attrs.hideValid);
61
- $attrs.showValid = angular.isDefined($attrs.showValid);
62
- $attrs.noMargin = angular.isDefined($attrs.noMargin);
63
- $scope.textArea = $attrs.textArea == 'true' || $attrs.textArea == true;
60
+ $attrs.hideValid = $attrs.hideValid === 'true' || $attrs.hideValid === true;
61
+ $attrs.showValid = $attrs.showValid === 'true' || $attrs.showValid === true;
62
+ $attrs.noMargin = $attrs.noMargin === 'true' || $attrs.noMargin === true;
63
+ $scope.textArea = $scope.textArea == 'true' || $scope.textArea == true;
64
64
  $attrs.required = $attrs.required === 'true' || $attrs.required === true;
65
65
  $scope.inputMode = null;
66
66
  $scope.lastKey = null;
@@ -30,11 +30,11 @@ angular.module('niceElements')
30
30
 
31
31
  link: function (scope, element, attrs) {
32
32
  if (!attrs.title) { attrs.title = ''; }
33
- attrs.required = angular.isDefined(attrs.required);
34
33
  if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
35
34
  if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
36
35
  if (!attrs.placeholder) { attrs.placeholder = ''; }
37
- attrs.noMargin = angular.isDefined(attrs.noMargin);
36
+ attrs.required = attrs.required === 'true' || attrs.required === true;
37
+ attrs.noMargin = attrs.noMargin === 'true' || attrs.noMargin === true;
38
38
  },
39
39
 
40
40
  controller: function ($rootScope, $scope) {