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.
- package/CHANGELOG.md +13 -0
- package/README.md +2 -1
- package/bower.json +1 -1
- package/dist/nice.js +249 -220
- package/dist/nice.min.js +1 -1
- package/dist/style.css +247 -91
- package/dist/style.css.map +3 -2
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-calendar/nice-calendar.html +3 -2
- package/src/components/nice-calendar/nice-calendar.scss +9 -7
- package/src/components/nice-checkbox/nice-checkbox.html +1 -3
- package/src/components/nice-checkbox/nice-checkbox.scss +12 -12
- package/src/components/nice-choice/nice-choice.html +3 -1
- package/src/components/nice-choice/nice-choice.scss +14 -3
- package/src/components/nice-date/nice-date.html +7 -8
- package/src/components/nice-date/nice-date.js +51 -53
- package/src/components/nice-date/nice-date.scss +29 -6
- package/src/components/nice-date-input/nice-date-input.html +6 -9
- package/src/components/nice-date-input/nice-date-input.js +24 -11
- package/src/components/nice-date-range/nice-date-range.html +3 -1
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +5 -19
- package/src/components/nice-datetime-picker/nice-datetime-picker.scss +1 -1
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +6 -1
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +5 -3
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +25 -26
- package/src/components/nice-dropdown/nice-dropdown.html +3 -1
- package/src/components/nice-dropdown/nice-dropdown.scss +1 -0
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +38 -36
- package/src/components/nice-dtp/nice-dtp.html +12 -12
- package/src/components/nice-dtp/nice-dtp.js +1 -0
- package/src/components/nice-help/nice-help.html +2 -1
- package/src/components/nice-help/nice-help.scss +7 -0
- package/src/components/nice-input/nice-input.html +9 -42
- package/src/components/nice-input/nice-input.js +28 -28
- package/src/components/nice-input/nice-input.scss +27 -20
- package/src/components/nice-number/nice-number.html +6 -2
- package/src/components/nice-number/nice-number.scss +15 -3
- package/src/components/nice-quantity/nice-quantity.html +6 -2
- package/src/components/nice-quantity/nice-quantity.scss +11 -0
- package/src/components/nice-search/nice-search.html +9 -20
- package/src/components/nice-search2/nice-search2.html +4 -2
- package/src/components/nice-time-picker/nice-time-picker.html +21 -27
- package/src/components/nice-time-picker/nice-time-picker.scss +11 -32
- package/src/components/nice-yesno/nice-yesno.html +2 -2
- package/src/components/nice-yesno/nice-yesno.scss +13 -0
- package/src/styles/_nice-buttons.scss +22 -9
- package/src/styles/_nice-common.scss +64 -16
- package/src/styles/_nice.scss +2 -1
- package/src/styles/_variables.scss +3 -0
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
* # niceDatetimerangePicker2
|
|
8
8
|
*/
|
|
9
9
|
angular.module('niceElements')
|
|
10
|
-
.directive('niceDatetimerangePicker2', function() {
|
|
10
|
+
.directive('niceDatetimerangePicker2', function () {
|
|
11
11
|
return {
|
|
12
12
|
scope: {
|
|
13
13
|
startDate: '=', // binding model
|
|
14
14
|
endDate: '=', // binding model
|
|
15
15
|
formatString: '@', // default: 'D.M.YYYY • H:mm', format for input label string
|
|
16
16
|
modelFormat: '@',
|
|
17
|
-
time: '
|
|
17
|
+
time: '=', // default: false, is time picker enabled?
|
|
18
18
|
minDate: '@', // default: undefined
|
|
19
19
|
maxDate: '@', // default: undefined
|
|
20
20
|
title: '@', // default: ''
|
|
@@ -36,25 +36,24 @@ angular.module('niceElements')
|
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
// Set defaults
|
|
39
|
-
if(
|
|
40
|
-
else $scope.time = $scope.time == "true";
|
|
39
|
+
if ($scope.time == undefined) $scope.time = false;
|
|
41
40
|
|
|
42
41
|
|
|
43
42
|
// Set format string
|
|
44
|
-
if(!$scope.formatString) {
|
|
45
|
-
if($scope.time) $scope.formatString = 'D.M.YYYY • H:mm';
|
|
43
|
+
if (!$scope.formatString) {
|
|
44
|
+
if ($scope.time) $scope.formatString = 'D.M.YYYY • H:mm';
|
|
46
45
|
else $scope.formatString = 'D.M.YYYY';
|
|
47
46
|
}
|
|
48
47
|
|
|
49
48
|
// Set start date
|
|
50
|
-
if(!$scope.startDate) {
|
|
49
|
+
if (!$scope.startDate) {
|
|
51
50
|
$scope.startDate = moment();
|
|
52
51
|
} else {
|
|
53
52
|
$scope.model.innerStartDate = angular.copy($scope.startDate);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
// Set end date
|
|
57
|
-
if(!$scope.endDate) {
|
|
56
|
+
if (!$scope.endDate) {
|
|
58
57
|
$scope.endDate = moment();
|
|
59
58
|
} else {
|
|
60
59
|
$scope.model.innerEndDate = angular.copy($scope.endDate);
|
|
@@ -63,7 +62,7 @@ angular.module('niceElements')
|
|
|
63
62
|
|
|
64
63
|
// Setup popper
|
|
65
64
|
// https://popper.js.org/docs/v2/constructors/
|
|
66
|
-
$scope.setupPopper = function() {
|
|
65
|
+
$scope.setupPopper = function () {
|
|
67
66
|
var button = $element[0].getElementsByClassName('nice-daterange-picker-button')[0];
|
|
68
67
|
var tooltip = $element[0].getElementsByClassName('nice-daterange-picker-wrapper')[0];
|
|
69
68
|
$scope.popper = Popper.createPopper(button, tooltip, {
|
|
@@ -79,18 +78,18 @@ angular.module('niceElements')
|
|
|
79
78
|
],
|
|
80
79
|
});
|
|
81
80
|
};
|
|
82
|
-
|
|
81
|
+
|
|
83
82
|
$timeout(function () {
|
|
84
83
|
$scope.setupPopper();
|
|
85
84
|
});
|
|
86
85
|
|
|
87
86
|
|
|
88
|
-
$scope.format = function(){
|
|
87
|
+
$scope.format = function () {
|
|
89
88
|
$scope.modelFormat = $scope.startDate.format($scope.formatString) + " - " + $scope.endDate.format($scope.formatString);
|
|
90
89
|
};
|
|
91
90
|
|
|
92
91
|
|
|
93
|
-
$scope.open = function() {
|
|
92
|
+
$scope.open = function () {
|
|
94
93
|
if (!$scope.isDisabled) {
|
|
95
94
|
$scope.isOpen = true;
|
|
96
95
|
$scope.popper.update();
|
|
@@ -98,14 +97,14 @@ angular.module('niceElements')
|
|
|
98
97
|
};
|
|
99
98
|
|
|
100
99
|
|
|
101
|
-
$scope.close = function() {
|
|
100
|
+
$scope.close = function () {
|
|
102
101
|
$scope.model.innerStartDate = angular.copy($scope.startDate);
|
|
103
102
|
$scope.model.innerEndDate = angular.copy($scope.endDate);
|
|
104
103
|
$scope.isOpen = false;
|
|
105
104
|
};
|
|
106
105
|
|
|
107
106
|
|
|
108
|
-
$scope.confirm = function() {
|
|
107
|
+
$scope.confirm = function () {
|
|
109
108
|
$scope.startDate = angular.copy($scope.model.innerStartDate);
|
|
110
109
|
$scope.endDate = angular.copy($scope.model.innerEndDate);
|
|
111
110
|
if ($scope.onChange) $scope.onChange({ startDate: $scope.startDate, endDate: $scope.endDate });
|
|
@@ -113,58 +112,58 @@ angular.module('niceElements')
|
|
|
113
112
|
};
|
|
114
113
|
|
|
115
114
|
|
|
116
|
-
$scope.selectToday = function(){
|
|
115
|
+
$scope.selectToday = function () {
|
|
117
116
|
$scope.model.innerStartDate = moment().startOf('day');
|
|
118
117
|
$scope.model.innerEndDate = moment().endOf('day');
|
|
119
118
|
};
|
|
120
119
|
|
|
121
120
|
|
|
122
|
-
$scope.selectLastNDays = function(days){
|
|
121
|
+
$scope.selectLastNDays = function (days) {
|
|
123
122
|
$scope.model.innerStartDate = moment().subtract(days, 'days').startOf('day');
|
|
124
123
|
$scope.model.innerEndDate = moment().endOf('day');
|
|
125
124
|
};
|
|
126
125
|
|
|
127
126
|
|
|
128
|
-
$scope.selectLastMonth = function(){
|
|
127
|
+
$scope.selectLastMonth = function () {
|
|
129
128
|
$scope.model.innerStartDate = moment().subtract(1, 'months').startOf('month').startOf('date');
|
|
130
129
|
$scope.model.innerEndDate = moment().subtract(1, 'months').endOf('month').endOf('date');
|
|
131
130
|
};
|
|
132
131
|
|
|
133
132
|
|
|
134
|
-
$scope.selectThisMonth = function(){
|
|
133
|
+
$scope.selectThisMonth = function () {
|
|
135
134
|
$scope.model.innerStartDate = moment().startOf('month').startOf('date');
|
|
136
135
|
$scope.model.innerEndDate = moment().endOf('month').endOf('date');
|
|
137
136
|
};
|
|
138
137
|
|
|
139
138
|
|
|
140
139
|
// ------------------ Remove time from date ------------------
|
|
141
|
-
$scope._removeTime = function(date) {
|
|
140
|
+
$scope._removeTime = function (date) {
|
|
142
141
|
return date.hour(0).minute(0).second(0).millisecond(0);
|
|
143
142
|
};
|
|
144
143
|
|
|
145
144
|
|
|
146
|
-
$scope.dateChanged = function() {
|
|
147
|
-
$timeout(function() {
|
|
145
|
+
$scope.dateChanged = function () {
|
|
146
|
+
$timeout(function () {
|
|
148
147
|
if ($scope.model.innerStartDate && $scope.model.innerEndDate) {
|
|
149
148
|
// Check if start date is after end date
|
|
150
149
|
if ($scope.model.innerStartDate.isAfter($scope.model.innerEndDate)) {
|
|
151
150
|
var temp = angular.copy($scope.model.innerStartDate);
|
|
152
|
-
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
153
|
-
$scope.model.innerEndDate = temp;
|
|
151
|
+
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
152
|
+
$scope.model.innerEndDate = temp;
|
|
154
153
|
}
|
|
155
154
|
|
|
156
155
|
// Check if end date is before start date
|
|
157
156
|
if ($scope.model.innerEndDate.isBefore($scope.model.innerStartDate)) {
|
|
158
157
|
var temp = angular.copy($scope.model.innerStartDate);
|
|
159
|
-
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
160
|
-
$scope.model.innerEndDate = temp;
|
|
158
|
+
$scope.model.innerStartDate = angular.copy($scope.model.innerEndDate);
|
|
159
|
+
$scope.model.innerEndDate = temp;
|
|
161
160
|
}
|
|
162
161
|
}
|
|
163
162
|
});
|
|
164
163
|
}
|
|
165
164
|
|
|
166
165
|
|
|
167
|
-
$scope.$watchGroup(["startDate", "endDate"], function() {
|
|
166
|
+
$scope.$watchGroup(["startDate", "endDate"], function () {
|
|
168
167
|
$scope.model.innerStartDate = angular.copy($scope.startDate);
|
|
169
168
|
$scope.model.innerEndDate = angular.copy($scope.endDate);
|
|
170
169
|
$scope.format();
|
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
|
|
53
53
|
|
|
54
54
|
<!------------------------- Add button ------------------------->
|
|
55
|
-
<button class="btn btn-primary add-btn" type="button" ng-if="addButtonFunction && !isDisabled" ng-click="addButtonFunction()"
|
|
55
|
+
<button class="btn btn-primary btn-icon add-btn" type="button" ng-if="addButtonFunction && !isDisabled" ng-click="addButtonFunction()">
|
|
56
|
+
<nice-icon icon="icon-plus"></nice-icon>
|
|
57
|
+
</button>
|
|
56
58
|
</div>
|
|
57
59
|
</div>
|
|
58
60
|
</div>
|
|
@@ -35,13 +35,15 @@ angular.module('niceElements')
|
|
|
35
35
|
isInline: '=',
|
|
36
36
|
onChange: '&?'
|
|
37
37
|
},
|
|
38
|
-
controller: function($scope, $element, gettextCatalog) {
|
|
38
|
+
controller: function ($scope, $element, gettextCatalog) {
|
|
39
|
+
console.warn("[NICE ELEMENTS] nice-dropdown-old component is deprecated!");
|
|
40
|
+
|
|
39
41
|
if (!$scope.objValue) { $scope.objValue = 'value'; }
|
|
40
42
|
if (!$scope.objKey) { $scope.objKey = 'id'; }
|
|
41
43
|
if (!$scope.list) { $scope.list = []; }
|
|
42
44
|
if (!$scope.noOptionsText) { $scope.noOptionsText = gettextCatalog.getString("No options", null, "Nice"); }
|
|
43
|
-
if(!$scope.addButtonFunction) { $scope.addButtonFunction = null; }
|
|
44
|
-
if(!$scope.listenKeydown) { $scope.listenKeydown = false; }
|
|
45
|
+
if (!$scope.addButtonFunction) { $scope.addButtonFunction = null; }
|
|
46
|
+
if (!$scope.listenKeydown) { $scope.listenKeydown = false; }
|
|
45
47
|
$scope.valid = $scope.formDropdown;
|
|
46
48
|
|
|
47
49
|
|
|
@@ -56,13 +58,13 @@ angular.module('niceElements')
|
|
|
56
58
|
$scope.id = Math.random().toString(36).substring(7);
|
|
57
59
|
|
|
58
60
|
$scope.isOpen = false;
|
|
59
|
-
$scope.toggle = function(){ $scope.isOpen = !$scope.isOpen; };
|
|
60
|
-
$scope.close = function(){ $scope.isOpen = false; };
|
|
61
|
-
$scope.open = function(){ $scope.isOpen = true; };
|
|
61
|
+
$scope.toggle = function () { $scope.isOpen = !$scope.isOpen; };
|
|
62
|
+
$scope.close = function () { $scope.isOpen = false; };
|
|
63
|
+
$scope.open = function () { $scope.isOpen = true; };
|
|
62
64
|
|
|
63
65
|
|
|
64
66
|
// ----------------------------------- Get filter -----------------------------------
|
|
65
|
-
var getFilter = function(item){
|
|
67
|
+
var getFilter = function (item) {
|
|
66
68
|
// Create filter for finding object by objValue with _.where()
|
|
67
69
|
var filter = {};
|
|
68
70
|
if (item.hasOwnProperty($scope.objKey))
|
|
@@ -74,13 +76,13 @@ angular.module('niceElements')
|
|
|
74
76
|
|
|
75
77
|
|
|
76
78
|
// ----------------------------------- Set internal list -----------------------------------
|
|
77
|
-
var _set_internal_list = function(){
|
|
79
|
+
var _set_internal_list = function () {
|
|
78
80
|
$scope.internalList = angular.copy($scope.list);
|
|
79
81
|
};
|
|
80
82
|
|
|
81
83
|
|
|
82
84
|
// ----------------------------------- Add null object to internal list -----------------------------------
|
|
83
|
-
var _add_null_object_to_internal = function(){
|
|
85
|
+
var _add_null_object_to_internal = function () {
|
|
84
86
|
if ($scope.nullable && !$scope.multiple) {
|
|
85
87
|
var nullObj = {};
|
|
86
88
|
nullObj[$scope.objKey] = null;
|
|
@@ -91,7 +93,7 @@ angular.module('niceElements')
|
|
|
91
93
|
|
|
92
94
|
|
|
93
95
|
// ----------------------------------- Get selected object -----------------------------------
|
|
94
|
-
var _get_selected_object = function(selected){
|
|
96
|
+
var _get_selected_object = function (selected) {
|
|
95
97
|
if (!selected) return null;
|
|
96
98
|
if ($scope.selectedIsObj) {
|
|
97
99
|
return selected;
|
|
@@ -102,12 +104,12 @@ angular.module('niceElements')
|
|
|
102
104
|
|
|
103
105
|
|
|
104
106
|
// ----------------------------------- Init -----------------------------------
|
|
105
|
-
var _set_internal_selected_one = function(selected){
|
|
107
|
+
var _set_internal_selected_one = function (selected) {
|
|
106
108
|
var obj = {};
|
|
107
109
|
|
|
108
110
|
var selectedObj = _get_selected_object(selected);
|
|
109
111
|
// console.log('_set_internal_selected_one', selected, selectedObj);
|
|
110
|
-
if(selectedObj && _.find($scope.internalList, getFilter(selected))){
|
|
112
|
+
if (selectedObj && _.find($scope.internalList, getFilter(selected))) {
|
|
111
113
|
obj = selectedObj;
|
|
112
114
|
} else {
|
|
113
115
|
obj = $scope.internalList[0];
|
|
@@ -118,7 +120,7 @@ angular.module('niceElements')
|
|
|
118
120
|
|
|
119
121
|
|
|
120
122
|
// ----------------------------------- Get selected objects -----------------------------------
|
|
121
|
-
var _get_selected_objects = function(selected){
|
|
123
|
+
var _get_selected_objects = function (selected) {
|
|
122
124
|
if (!selected)
|
|
123
125
|
return null;
|
|
124
126
|
|
|
@@ -134,9 +136,9 @@ angular.module('niceElements')
|
|
|
134
136
|
|
|
135
137
|
|
|
136
138
|
// ----------------------------------- Set internal selected multiple -----------------------------------
|
|
137
|
-
var _set_internal_selected_multiple = function(item){
|
|
139
|
+
var _set_internal_selected_multiple = function (item) {
|
|
138
140
|
var _selected_objects = _get_selected_objects(item);
|
|
139
|
-
if (_selected_objects){
|
|
141
|
+
if (_selected_objects) {
|
|
140
142
|
$scope.internalSelected = _selected_objects;
|
|
141
143
|
_set_model($scope.internalSelected);
|
|
142
144
|
} else {
|
|
@@ -147,21 +149,21 @@ angular.module('niceElements')
|
|
|
147
149
|
|
|
148
150
|
|
|
149
151
|
// ----------------------------------- Set model -----------------------------------
|
|
150
|
-
var _set_model = function(value){
|
|
152
|
+
var _set_model = function (value) {
|
|
151
153
|
var _new = angular.copy($scope.model);
|
|
152
154
|
|
|
153
|
-
if(!$scope.multiple){
|
|
154
|
-
if (value[$scope.objKey]==null){
|
|
155
|
+
if (!$scope.multiple) {
|
|
156
|
+
if (value[$scope.objKey] == null) {
|
|
155
157
|
_new = null;
|
|
156
158
|
} else {
|
|
157
|
-
if ($scope.selectedIsObj){
|
|
159
|
+
if ($scope.selectedIsObj) {
|
|
158
160
|
_new = value;
|
|
159
161
|
} else {
|
|
160
162
|
_new = value[$scope.objKey];
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
165
|
} else {
|
|
164
|
-
if ($scope.selectedIsObj){
|
|
166
|
+
if ($scope.selectedIsObj) {
|
|
165
167
|
_new = value;
|
|
166
168
|
} else {
|
|
167
169
|
_new = _.map(value, function (val) {
|
|
@@ -171,7 +173,7 @@ angular.module('niceElements')
|
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
// update model only if it is changed
|
|
174
|
-
if (!_.isEqual(_new, $scope.model)){
|
|
176
|
+
if (!_.isEqual(_new, $scope.model)) {
|
|
175
177
|
$scope.model = _new;
|
|
176
178
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
177
179
|
}
|
|
@@ -179,11 +181,11 @@ angular.module('niceElements')
|
|
|
179
181
|
|
|
180
182
|
|
|
181
183
|
// ----------------------------------- Init -----------------------------------
|
|
182
|
-
var init = function() {
|
|
184
|
+
var init = function () {
|
|
183
185
|
_set_internal_list();
|
|
184
186
|
_add_null_object_to_internal();
|
|
185
187
|
|
|
186
|
-
if($scope.multiple && $scope.model){
|
|
188
|
+
if ($scope.multiple && $scope.model) {
|
|
187
189
|
if ($scope.internalSelected) {
|
|
188
190
|
// remove already selected but not in list - this happens when list changes from outside
|
|
189
191
|
_set_internal_selected_multiple(_.filter($scope.internalSelected, function (obj) {
|
|
@@ -195,7 +197,7 @@ angular.module('niceElements')
|
|
|
195
197
|
}
|
|
196
198
|
|
|
197
199
|
// Set internalSelected
|
|
198
|
-
if($scope.internalList && $scope.internalList.length>0){
|
|
200
|
+
if ($scope.internalList && $scope.internalList.length > 0) {
|
|
199
201
|
$scope.emptyList = false;
|
|
200
202
|
|
|
201
203
|
if ($scope.multiple) {
|
|
@@ -204,7 +206,7 @@ angular.module('niceElements')
|
|
|
204
206
|
_set_internal_selected_one($scope.model);
|
|
205
207
|
}
|
|
206
208
|
|
|
207
|
-
if($scope.formDropdown && $scope.required){
|
|
209
|
+
if ($scope.formDropdown && $scope.required) {
|
|
208
210
|
$scope.formDropdown.$setValidity('required', true);
|
|
209
211
|
}
|
|
210
212
|
} else {
|
|
@@ -215,7 +217,7 @@ angular.module('niceElements')
|
|
|
215
217
|
sel[$scope.objValue] = $scope.noOptionsText;
|
|
216
218
|
$scope.internalList = [sel];
|
|
217
219
|
|
|
218
|
-
if($scope.formDropdown && $scope.required){
|
|
220
|
+
if ($scope.formDropdown && $scope.required) {
|
|
219
221
|
$scope.formDropdown.$setValidity('required', false); // Form is not valid because dropdown is empty and required
|
|
220
222
|
}
|
|
221
223
|
|
|
@@ -229,12 +231,12 @@ angular.module('niceElements')
|
|
|
229
231
|
|
|
230
232
|
|
|
231
233
|
// ----------------------------------- Is Item selected -----------------------------------
|
|
232
|
-
$scope.isItemSelected = function(item){
|
|
234
|
+
$scope.isItemSelected = function (item) {
|
|
233
235
|
if (!$scope.internalSelected) return false;
|
|
234
236
|
|
|
235
237
|
// Which item is selected
|
|
236
238
|
if ($scope.multiple) {
|
|
237
|
-
return _.where($scope.internalSelected, {'id':item.id}).length > 0;
|
|
239
|
+
return _.where($scope.internalSelected, { 'id': item.id }).length > 0;
|
|
238
240
|
} else {
|
|
239
241
|
return $scope.internalSelected[$scope.objKey] == item[$scope.objKey];
|
|
240
242
|
}
|
|
@@ -242,12 +244,12 @@ angular.module('niceElements')
|
|
|
242
244
|
|
|
243
245
|
|
|
244
246
|
// ----------------------------------- Item clicked -----------------------------------
|
|
245
|
-
$scope.clicked = function(item){
|
|
247
|
+
$scope.clicked = function (item) {
|
|
246
248
|
$scope.formDropdown.$setDirty();
|
|
247
|
-
if($scope.multiple){
|
|
249
|
+
if ($scope.multiple) {
|
|
248
250
|
// This actually toggles selection
|
|
249
251
|
var _current = angular.copy($scope.internalSelected);
|
|
250
|
-
if(!_.find(_current, getFilter(item))){
|
|
252
|
+
if (!_.find(_current, getFilter(item))) {
|
|
251
253
|
_current.push(item);
|
|
252
254
|
} else {
|
|
253
255
|
_current = _.reject(_current, getFilter(item[$scope.objKey]));
|
|
@@ -262,7 +264,7 @@ angular.module('niceElements')
|
|
|
262
264
|
|
|
263
265
|
|
|
264
266
|
// ----------------------------------- Get label -----------------------------------
|
|
265
|
-
$scope.getLabel = function(item){
|
|
267
|
+
$scope.getLabel = function (item) {
|
|
266
268
|
if (item) {
|
|
267
269
|
return item[$scope.objValue];
|
|
268
270
|
} else {
|
|
@@ -285,14 +287,14 @@ angular.module('niceElements')
|
|
|
285
287
|
var _new_model_object = _get_selected_objects(value_new);
|
|
286
288
|
}
|
|
287
289
|
|
|
288
|
-
if (!_.isEqual(_new_model_object, $scope.internalSelected)){
|
|
290
|
+
if (!_.isEqual(_new_model_object, $scope.internalSelected)) {
|
|
289
291
|
init();
|
|
290
292
|
}
|
|
291
293
|
});
|
|
292
294
|
|
|
293
295
|
|
|
294
296
|
// ----------------------------------- Listen keydown -----------------------------------
|
|
295
|
-
$scope.bindKeypress = function(){
|
|
297
|
+
$scope.bindKeypress = function () {
|
|
296
298
|
if ($scope.listenKeydown) {
|
|
297
299
|
$element.bind('keyup', function (e) {
|
|
298
300
|
// bind to keypress events if dropdown list is opened
|
|
@@ -319,8 +321,8 @@ angular.module('niceElements')
|
|
|
319
321
|
}
|
|
320
322
|
};
|
|
321
323
|
|
|
322
|
-
$scope.unbindKeypress = function(){
|
|
323
|
-
$element.off('keyup', function (e) {});
|
|
324
|
+
$scope.unbindKeypress = function () {
|
|
325
|
+
$element.off('keyup', function (e) { });
|
|
324
326
|
};
|
|
325
327
|
|
|
326
328
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<div class="dtp-actual-num" ng-click="initDate()">{{actualNum}}</div>
|
|
21
21
|
<div>
|
|
22
22
|
<div class="left center p10">
|
|
23
|
-
<a href="javascript:void(0);" class="dtp-select-year-before" ng-click="onYearBeforeClick()" ng-class="{'disabled': !btnYearBeforeEnabled}""><i class="fa fa-chevron-left"></i></a>
|
|
23
|
+
<a href="javascript:void(0);" class="dtp-select-year-before" ng-click="onYearBeforeClick()" ng-class="{'disabled': !btnYearBeforeEnabled}""><i class=" fa fa-chevron-left"></i></a>
|
|
24
24
|
</div>
|
|
25
25
|
<div class="dtp-actual-year p80" ng-click="initDate()">{{actualYear}}</div>
|
|
26
26
|
<div class="right center p10">
|
|
@@ -48,15 +48,15 @@
|
|
|
48
48
|
|
|
49
49
|
<table class="table dtp-picker-days">
|
|
50
50
|
<thead>
|
|
51
|
-
|
|
51
|
+
<th ng-repeat="weekDay in weekDays track by $index">{{weekDay}}</th>
|
|
52
52
|
</thead>
|
|
53
53
|
<tbody>
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
<tr ng-repeat="week in weeks">
|
|
55
|
+
<td ng-repeat="day in week">
|
|
56
|
+
<span ng-if="day.disabled" class="dtp-select-day">{{day.label}}</span>
|
|
57
|
+
<a ng-if="!day.disabled" ng-click="onSelectDate(day)" href="javascript:void(0);" class="dtp-select-day" ng-class="{'selected': day.selected}">{{day.label}}</a>
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
60
|
</tbody>
|
|
61
61
|
</table>
|
|
62
62
|
|
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
</div>
|
|
84
84
|
</div>
|
|
85
85
|
<!--<div class="dtp-buttons" ng-if="enableOkButtons">-->
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
<!--<button class="dtp-btn-cancel btn btn-flat" ng-click="onCancelClick()">{{cancelText}}</button>-->
|
|
87
|
+
<!--<button class="dtp-btn-ok btn btn-flat" ng-click="onOKClick()"> {{okText}} </button>-->
|
|
88
|
+
<!--<div class="clearfix"></div>-->
|
|
89
89
|
<!--</div>-->
|
|
90
90
|
</div>
|
|
91
91
|
</div>
|
|
92
|
-
</div>
|
|
92
|
+
</div>
|
|
@@ -36,6 +36,7 @@ angular.module('niceElements')
|
|
|
36
36
|
},
|
|
37
37
|
templateUrl: 'src/components/nice-dtp/nice-dtp.html',
|
|
38
38
|
controller: function ($scope, $element, $attrs, gettextCatalog) {
|
|
39
|
+
console.warn("[NICE ELEMENTS] nice-dtp component is deprecated!");
|
|
39
40
|
|
|
40
41
|
// default parameters
|
|
41
42
|
var params = {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<div class="nice-help" ng-mouseover="onHover()">
|
|
2
|
-
<i class="fa fa-question-circle nice-help-button" aria-label=""></i>
|
|
2
|
+
<!-- <i class="fa fa-question-circle nice-help-button" aria-label=""></i> -->
|
|
3
|
+
<nice-icon icon="icon-help-circle" class="nice-help-button"></nice-icon>
|
|
3
4
|
<div class="nice-help-popup">
|
|
4
5
|
<span ng-bind-html="text">{{ text }}</span>
|
|
5
6
|
<div data-popper-arrow class="nice-help-arrow"></div>
|
|
@@ -8,51 +8,16 @@
|
|
|
8
8
|
|
|
9
9
|
<!------------------------- Field ------------------------->
|
|
10
10
|
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
11
|
-
<div
|
|
12
|
-
class="form-group"
|
|
13
|
-
ng-class="{
|
|
11
|
+
<div class="form-group" ng-class="{
|
|
14
12
|
'has-feedback': showValid && !hideValid,
|
|
15
13
|
'has-warning': !isDisabled && forma.$invalid && forma.$dirty && !hideValid,
|
|
16
14
|
'has-success': !isDisabled && forma.$valid && forma.$dirty && showValid,
|
|
17
15
|
'symbol': symbol,
|
|
18
16
|
'nice-disabled': isDisabled
|
|
19
|
-
}"
|
|
20
|
-
|
|
21
|
-
<textarea
|
|
22
|
-
|
|
23
|
-
class="form-control"
|
|
24
|
-
ng-model="model"
|
|
25
|
-
id="{{ id }}"
|
|
26
|
-
tabindex="{{ tabIndex }}"
|
|
27
|
-
placeholder="{{ placeholder }}"
|
|
28
|
-
rows="{{textAreaLines}}"
|
|
29
|
-
max="{{ max }}"
|
|
30
|
-
min="{{ min }}"
|
|
31
|
-
ng-minlength="minlength"
|
|
32
|
-
ng-maxlength="maxlength"
|
|
33
|
-
ng-required="required"
|
|
34
|
-
ng-pattern="regexexp"
|
|
35
|
-
ng-disabled="isDisabled"
|
|
36
|
-
></textarea>
|
|
37
|
-
|
|
38
|
-
<input
|
|
39
|
-
ng-show="!textArea"
|
|
40
|
-
class="form-control"
|
|
41
|
-
type="{{ internalType }}"
|
|
42
|
-
ng-model="model"
|
|
43
|
-
name="{{ name }}"
|
|
44
|
-
id="{{ id }}"
|
|
45
|
-
tabindex="{{ tabIndex }}"
|
|
46
|
-
placeholder="{{ placeholder }}"
|
|
47
|
-
max="{{ max }}"
|
|
48
|
-
min="{{ min }}"
|
|
49
|
-
ng-minlength="minlength"
|
|
50
|
-
ng-maxlength="maxlength"
|
|
51
|
-
ng-required="required"
|
|
52
|
-
ng-keypress="keypress($event)"
|
|
53
|
-
ng-pattern="regexexp"
|
|
54
|
-
ng-disabled="isDisabled"
|
|
55
|
-
/>
|
|
17
|
+
}">
|
|
18
|
+
|
|
19
|
+
<textarea ng-show="textArea" class="form-control" ng-model="model" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" rows="{{textAreaLines}}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-pattern="regexexp" ng-disabled="isDisabled"></textarea>
|
|
20
|
+
<input ng-show="!textArea" class="form-control" type="{{ internalType }}" ng-model="model" name="{{ name }}" id="{{ id }}" tabindex="{{ tabIndex }}" placeholder="{{ placeholder }}" max="{{ max }}" min="{{ min }}" ng-minlength="minlength" ng-maxlength="maxlength" ng-required="required" ng-keypress="keypress($event)" ng-pattern="regexexp" ng-disabled="isDisabled" />
|
|
56
21
|
|
|
57
22
|
<span class="input-group-addon" ng-if="symbol">{{ symbol }}</span>
|
|
58
23
|
<!--<span ng-if="!disabled && showValid && form.$valid && form.$dirty" class="glyphicon glyphicon-ok form-control-feedback feedback-valid" aria-hidden="true"></span>-->
|
|
@@ -62,7 +27,9 @@
|
|
|
62
27
|
<div ng-if="forma.$error && forma.$dirty">
|
|
63
28
|
<div class="error-message" ng-if="forma.$dirty && forma.$error.email" translate translate-context="Nice">Email is not valid.</div>
|
|
64
29
|
<div class="error-message" ng-if="forma.$dirty && forma.$error.pattern" translate translate-context="Nice">This field requires a specific pattern.</div>
|
|
65
|
-
<div class="error-message" ng-if="forma.$error.minlength"
|
|
30
|
+
<div class="error-message" ng-if="forma.$error.minlength">
|
|
31
|
+
<translate translate-context="Nice">Your input is too short. It must contain at least</translate> {{ minlength }} <translate translate-context="Nice">characters</translate>.
|
|
32
|
+
</div>
|
|
66
33
|
<div class="error-message" ng-if="forma.$error.maxlength" translate translate-context="Nice">Your input is too long</div>
|
|
67
34
|
<div class="error-message" ng-if="forma.$error.required" ng-if="forma.$dirty" translate translate-context="Nice">This field is required.</div>
|
|
68
35
|
<div class="error-message" ng-if="forma.$error.unique" translate translate-context="Nice">This field must be unique.</div>
|
|
@@ -71,4 +38,4 @@
|
|
|
71
38
|
<!-- <pre>{{ forma | json }}</pre> -->
|
|
72
39
|
</div>
|
|
73
40
|
</div>
|
|
74
|
-
</ng-form>
|
|
41
|
+
</ng-form>
|