nice-elements 1.4.1 → 1.4.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/.vscode/settings.json +5 -0
- package/CHANGELOG.md +17 -1
- package/LICENSE.md +1 -1
- package/README.md +8 -10
- package/bower.json +1 -1
- package/dist/nice.js +160 -94
- package/dist/nice.min.js +1 -1
- package/dist/style.css +66 -20
- package/dist/style.css.map +3 -2
- package/dist/style.min.css +1 -1
- package/package.json +5 -5
- package/src/components/nice-calendar/nice-calendar.html +42 -42
- package/src/components/nice-calendar/nice-calendar.js +91 -53
- package/src/components/nice-calendar/nice-calendar.scss +12 -14
- package/src/components/nice-help/nice-help.scss +8 -9
- package/src/components/nice-number/nice-number.html +17 -10
- package/src/components/nice-number/nice-number.js +8 -8
- package/src/components/nice-tooltip/_nice-tooltip.scss +72 -0
- package/src/components/nice-tooltip/nice-tooltip.js +20 -0
- package/src/components/nice-yesno/nice-yesno.js +8 -9
- package/src/styles/_nice.scss +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## v1.4.
|
|
3
|
+
## v1.4.4 (1.8.2022)
|
|
4
|
+
|
|
5
|
+
- fixed nice-calendar update on time select
|
|
6
|
+
|
|
7
|
+
## v1.4.3 (28.4.2022)
|
|
8
|
+
|
|
9
|
+
- worked on nice calendar time prop,
|
|
10
|
+
- added nice calendar demo
|
|
11
|
+
|
|
12
|
+
## v1.4.2 (22.4.2022)
|
|
13
|
+
|
|
14
|
+
- created nice-tooltip component,
|
|
15
|
+
- fixed nice-yesno state not visible,
|
|
16
|
+
- worked on demo project
|
|
17
|
+
|
|
18
|
+
## v1.4.1 (1.12.2021)
|
|
4
19
|
|
|
5
20
|
- added more translation tags
|
|
21
|
+
|
|
6
22
|
## v1.4.0 (1.12.2021)
|
|
7
23
|
|
|
8
24
|
- added translation tags,
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,39 +1,37 @@
|
|
|
1
|
-
# Nice elements v1.4.
|
|
2
|
-
Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
|
|
1
|
+
# Nice elements v1.4.4
|
|
3
2
|
|
|
3
|
+
Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
8
7
|
## How to build
|
|
9
8
|
|
|
10
|
-
```
|
|
9
|
+
```bash
|
|
11
10
|
grunt build
|
|
12
11
|
```
|
|
13
12
|
|
|
14
13
|
It should compile all the js and html files into `dist/nice.js`, and all the styles into `dist/style.css`.
|
|
15
14
|
|
|
16
|
-
|
|
17
15
|
---
|
|
18
16
|
|
|
19
|
-
|
|
20
17
|
## How to run develop?
|
|
21
18
|
|
|
22
|
-
```
|
|
19
|
+
```bash
|
|
23
20
|
node server.js
|
|
24
21
|
or
|
|
25
22
|
npm run serve
|
|
26
23
|
```
|
|
27
24
|
|
|
28
|
-
A demo project from `demo` directory will be available on [http://localhost:3031]().
|
|
29
|
-
|
|
25
|
+
A demo project from `demo` directory will be available on [http://localhost:3031](http://localhost:3031).
|
|
30
26
|
|
|
31
27
|
---
|
|
32
28
|
|
|
33
29
|
## LICENSE
|
|
30
|
+
|
|
34
31
|
See [LICENSE.md](./LICENSE.md)
|
|
35
32
|
|
|
36
33
|
---
|
|
37
34
|
|
|
38
35
|
## CHANGELOG
|
|
39
|
-
|
|
36
|
+
|
|
37
|
+
See [CHANGELOG.md](./CHANGELOG.md)
|
package/bower.json
CHANGED
package/dist/nice.js
CHANGED
|
@@ -75,7 +75,7 @@ angular.module('niceElements')
|
|
|
75
75
|
* # niceCalendar
|
|
76
76
|
*/
|
|
77
77
|
angular.module('niceElements')
|
|
78
|
-
.directive("niceCalendar", function($timeout, gettextCatalog) {
|
|
78
|
+
.directive("niceCalendar", function ($timeout, gettextCatalog) {
|
|
79
79
|
return {
|
|
80
80
|
restrict: "E",
|
|
81
81
|
templateUrl: "src/components/nice-calendar/nice-calendar.html",
|
|
@@ -86,7 +86,7 @@ angular.module('niceElements')
|
|
|
86
86
|
minDate: '=',
|
|
87
87
|
maxDate: '=',
|
|
88
88
|
hideHover: '=',
|
|
89
|
-
time: '
|
|
89
|
+
time: '=',
|
|
90
90
|
noMargin: '@',
|
|
91
91
|
color: '@',
|
|
92
92
|
endDate: '=',
|
|
@@ -96,7 +96,7 @@ angular.module('niceElements')
|
|
|
96
96
|
isInline: '=',
|
|
97
97
|
onChange: '&?'
|
|
98
98
|
},
|
|
99
|
-
link: function(scope, element) {
|
|
99
|
+
link: function (scope, element) {
|
|
100
100
|
// ------------------ Init default values ------------------
|
|
101
101
|
scope.selectStart = true;
|
|
102
102
|
scope.popupText = gettextCatalog.getString("Select start date", null, "Nice");
|
|
@@ -111,37 +111,52 @@ angular.module('niceElements')
|
|
|
111
111
|
|
|
112
112
|
|
|
113
113
|
// ------------------ Check if attributes are set ------------------
|
|
114
|
-
if(!scope.startDate) scope.startDate = moment().minutes(0).second(0).millisecond(0);
|
|
115
|
-
if(!scope.endDate) scope.endDate = moment().minutes(0).second(0).millisecond(0);
|
|
114
|
+
if (!scope.startDate) scope.startDate = moment().minutes(0).second(0).millisecond(0);
|
|
115
|
+
if (!scope.endDate) scope.endDate = moment().minutes(0).second(0).millisecond(0);
|
|
116
116
|
|
|
117
117
|
|
|
118
118
|
// ------------------ Look for model changes ------------------
|
|
119
|
-
scope.$watch("startDate", function(value, valueOld){
|
|
119
|
+
scope.$watch("startDate", function (value, valueOld) {
|
|
120
120
|
bootstrap();
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
scope.$watch("endDate", function(value, valueOld){
|
|
123
|
+
scope.$watch("endDate", function (value, valueOld) {
|
|
124
124
|
bootstrap();
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
scope.$watch("minDate", function(value, valueOld){
|
|
127
|
+
scope.$watch("minDate", function (value, valueOld) {
|
|
128
128
|
bootstrap();
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
scope.$watch("maxDate", function(value, valueOld){
|
|
131
|
+
scope.$watch("maxDate", function (value, valueOld) {
|
|
132
132
|
bootstrap();
|
|
133
133
|
});
|
|
134
134
|
|
|
135
135
|
|
|
136
136
|
// ------------------ Bootstrap calendar ------------------
|
|
137
137
|
function bootstrap() {
|
|
138
|
-
//scope.startDate = moment(scope.startDate.second(0).millisecond(0));
|
|
139
|
-
//scope.endDate = moment(scope.endDate.second(0).millisecond(0));
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
138
|
+
// scope.startDate = moment(scope.startDate.second(0).millisecond(0));
|
|
139
|
+
// scope.endDate = moment(scope.endDate.second(0).millisecond(0));
|
|
140
|
+
|
|
141
|
+
if (!scope.time) {
|
|
142
|
+
scope.startDateHour = 0;
|
|
143
|
+
scope.startDateMinute = 0;
|
|
144
|
+
scope.startDate.hours(0);
|
|
145
|
+
scope.startDate.minutes(0);
|
|
146
|
+
scope.startDate.seconds(0);
|
|
147
|
+
scope.startDate.millisecond(0);
|
|
148
|
+
scope.endDateHour = 0;
|
|
149
|
+
scope.endDateMinut = 0;
|
|
150
|
+
scope.endDate.hours(23);
|
|
151
|
+
scope.endDate.minutes(59);
|
|
152
|
+
scope.endDate.seconds(59);
|
|
153
|
+
scope.endDate.millisecond(999);
|
|
154
|
+
} else {
|
|
155
|
+
scope.startDateHour = moment(scope.startDate).hours();
|
|
156
|
+
scope.startDateMinute = moment(scope.startDate).minutes();
|
|
157
|
+
scope.endDateHour = moment(scope.endDate).hours();
|
|
158
|
+
scope.endDateMinute = moment(scope.endDate).minutes();
|
|
159
|
+
}
|
|
145
160
|
|
|
146
161
|
scope.month = angular.copy(moment(scope.startDate));
|
|
147
162
|
var start = angular.copy(moment(scope.startDate));
|
|
@@ -153,13 +168,20 @@ angular.module('niceElements')
|
|
|
153
168
|
|
|
154
169
|
|
|
155
170
|
// ------------------ Day was selected ------------------
|
|
156
|
-
scope.select = function(day) {
|
|
157
|
-
if(!day.isDisabled){
|
|
171
|
+
scope.select = function (day) {
|
|
172
|
+
if (!day.isDisabled) {
|
|
158
173
|
var selectedDate = angular.copy(day.date);
|
|
159
174
|
|
|
160
|
-
if(scope.selectStart){
|
|
161
|
-
|
|
162
|
-
|
|
175
|
+
if (scope.selectStart) {
|
|
176
|
+
if (!scope.time) {
|
|
177
|
+
selectedDate.hours(0);
|
|
178
|
+
selectedDate.minutes(0);
|
|
179
|
+
selectedDate.seconds(0);
|
|
180
|
+
selectedDate.millisecond(0);
|
|
181
|
+
} else {
|
|
182
|
+
selectedDate.hours(scope.startDateHour);
|
|
183
|
+
selectedDate.minutes(scope.startDateMinute);
|
|
184
|
+
}
|
|
163
185
|
|
|
164
186
|
// Set start date
|
|
165
187
|
scope.startDate = selectedDate;
|
|
@@ -169,12 +191,19 @@ angular.module('niceElements')
|
|
|
169
191
|
scope.displayStartChange();
|
|
170
192
|
|
|
171
193
|
// If start date is after end date
|
|
172
|
-
if(scope.startDate.isAfter(scope.endDate)){
|
|
194
|
+
if (scope.startDate.isAfter(scope.endDate)) {
|
|
173
195
|
scope.endDate = angular.copy(scope.startDate);
|
|
174
196
|
}
|
|
175
197
|
} else {
|
|
176
|
-
|
|
177
|
-
|
|
198
|
+
if (!scope.time) {
|
|
199
|
+
selectedDate.hours(23);
|
|
200
|
+
selectedDate.minutes(59);
|
|
201
|
+
selectedDate.seconds(59);
|
|
202
|
+
selectedDate.millisecond(999);
|
|
203
|
+
} else {
|
|
204
|
+
selectedDate.hours(scope.endDateHour);
|
|
205
|
+
selectedDate.minutes(scope.endDateMinute);
|
|
206
|
+
}
|
|
178
207
|
|
|
179
208
|
// Set end date
|
|
180
209
|
scope.endDate = selectedDate;
|
|
@@ -184,85 +213,94 @@ angular.module('niceElements')
|
|
|
184
213
|
scope.displayEndChange();
|
|
185
214
|
|
|
186
215
|
// If end date is before start date
|
|
187
|
-
if(scope.endDate.isBefore(scope.startDate)){
|
|
216
|
+
if (scope.endDate.isBefore(scope.startDate)) {
|
|
188
217
|
scope.startDate = angular.copy(scope.endDate);
|
|
189
218
|
}
|
|
190
219
|
}
|
|
191
220
|
|
|
192
|
-
if (scope.onChange) scope.onChange({ model: {startDate: scope.startDate, endDate: scope.endDate}, element: element });
|
|
221
|
+
if (scope.onChange) scope.onChange({ model: { startDate: scope.startDate, endDate: scope.endDate }, element: element });
|
|
193
222
|
}
|
|
194
223
|
};
|
|
195
224
|
|
|
196
225
|
|
|
197
226
|
// ------------------ Display date changes ------------------
|
|
198
|
-
scope.displayStartChange = function(){
|
|
227
|
+
scope.displayStartChange = function () {
|
|
199
228
|
scope.startTimeClass = "change";
|
|
200
|
-
$timeout(function(){
|
|
229
|
+
$timeout(function () {
|
|
201
230
|
scope.startTimeClass = "";
|
|
202
231
|
}, 1000);
|
|
203
232
|
};
|
|
204
233
|
|
|
205
|
-
scope.displayEndChange = function(){
|
|
234
|
+
scope.displayEndChange = function () {
|
|
206
235
|
scope.endTimeClass = "change";
|
|
207
|
-
$timeout(function(){
|
|
236
|
+
$timeout(function () {
|
|
208
237
|
scope.endTimeClass = "";
|
|
209
238
|
}, 1000);
|
|
210
239
|
};
|
|
211
240
|
|
|
212
241
|
|
|
213
242
|
// ------------------ Time changes ------------------
|
|
214
|
-
scope.startHourChange = function(value){
|
|
243
|
+
scope.startHourChange = function (value) {
|
|
215
244
|
scope.startDateHour = value;
|
|
216
245
|
scope.startDate = moment(scope.startDate).hours(scope.startDateHour);
|
|
217
246
|
scope.formCalendar.$setDirty();
|
|
218
247
|
scope.displayStartChange();
|
|
248
|
+
scope.handleUpdate();
|
|
219
249
|
};
|
|
220
250
|
|
|
221
251
|
|
|
222
|
-
scope.startMinuteChange = function(value) {
|
|
252
|
+
scope.startMinuteChange = function (value) {
|
|
223
253
|
scope.startDateMinute = value;
|
|
224
254
|
scope.startDate = moment(scope.startDate).minutes(scope.startDateMinute);
|
|
225
255
|
scope.formCalendar.$setDirty();
|
|
226
256
|
scope.displayStartChange();
|
|
257
|
+
scope.handleUpdate();
|
|
227
258
|
};
|
|
228
259
|
|
|
229
260
|
|
|
230
|
-
scope.endHourChange = function(value){
|
|
261
|
+
scope.endHourChange = function (value) {
|
|
231
262
|
scope.endDateHour = value;
|
|
232
263
|
scope.endDate = moment(scope.endDate).hours(scope.endDateHour);
|
|
233
264
|
scope.formCalendar.$setDirty();
|
|
234
265
|
scope.displayEndChange();
|
|
266
|
+
scope.handleUpdate();
|
|
235
267
|
};
|
|
236
268
|
|
|
237
269
|
|
|
238
|
-
scope.endMinuteChange = function(value) {
|
|
270
|
+
scope.endMinuteChange = function (value) {
|
|
239
271
|
scope.endDateMinute = value;
|
|
240
272
|
scope.endDate = moment(scope.endDate).minutes(scope.endDateMinute);
|
|
241
273
|
scope.formCalendar.$setDirty();
|
|
242
274
|
scope.displayEndChange();
|
|
275
|
+
scope.handleUpdate();
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
scope.handleUpdate = function () {
|
|
280
|
+
if (scope.onChange) scope.onChange({ model: { startDate: scope.startDate, endDate: scope.endDate }, element: element });
|
|
243
281
|
};
|
|
244
282
|
|
|
245
283
|
|
|
246
284
|
// ------------------ Go to next month ------------------
|
|
247
|
-
scope.next = function() {
|
|
285
|
+
scope.next = function () {
|
|
248
286
|
var next = angular.copy(scope.month);
|
|
249
|
-
_removeTimeWithDate(next.month(next.month()+1).date(0));
|
|
250
|
-
scope.month.month(scope.month.month()+1);
|
|
287
|
+
_removeTimeWithDate(next.month(next.month() + 1).date(0));
|
|
288
|
+
scope.month.month(scope.month.month() + 1);
|
|
251
289
|
_buildMonth(scope, next, scope.month);
|
|
252
290
|
};
|
|
253
291
|
|
|
254
292
|
|
|
255
293
|
// ------------------ Go to previous month ------------------
|
|
256
|
-
scope.previous = function() {
|
|
294
|
+
scope.previous = function () {
|
|
257
295
|
var previous = angular.copy(scope.month);
|
|
258
|
-
_removeTimeWithDate(previous.month(previous.month()-1).date(0));
|
|
259
|
-
scope.month.month(scope.month.month()-1);
|
|
296
|
+
_removeTimeWithDate(previous.month(previous.month() - 1).date(0));
|
|
297
|
+
scope.month.month(scope.month.month() - 1);
|
|
260
298
|
_buildMonth(scope, previous, scope.month);
|
|
261
299
|
};
|
|
262
300
|
|
|
263
301
|
|
|
264
302
|
// ------------------ Check if dates are equal without time ------------------
|
|
265
|
-
scope.isSameDay = function(date1, date2){
|
|
303
|
+
scope.isSameDay = function (date1, date2) {
|
|
266
304
|
var d1 = _removeTime(angular.copy(date1));
|
|
267
305
|
var d2 = _removeTime(angular.copy(date2));
|
|
268
306
|
return d1.isSame(d2);
|
|
@@ -270,20 +308,20 @@ angular.module('niceElements')
|
|
|
270
308
|
|
|
271
309
|
|
|
272
310
|
// ------------------ Check if date is between start and end date ------------------
|
|
273
|
-
scope.isBetweenRange = function(date){
|
|
311
|
+
scope.isBetweenRange = function (date) {
|
|
274
312
|
return (date.isBefore(moment(scope.endDate)) && date.isAfter(moment(scope.startDate)));
|
|
275
313
|
};
|
|
276
314
|
|
|
277
315
|
|
|
278
316
|
// ------------------ Format date ------------------
|
|
279
|
-
scope.formatDate = function(date){
|
|
280
|
-
if(scope.time) return moment(date).format('D.M.YYYY • H:mm');
|
|
317
|
+
scope.formatDate = function (date) {
|
|
318
|
+
if (scope.time) return moment(date).format('D.M.YYYY • H:mm');
|
|
281
319
|
else return moment(date).format('D.M.YYYY');
|
|
282
320
|
};
|
|
283
321
|
|
|
284
322
|
|
|
285
323
|
// ------------------ Lighten color by 20% ------------------
|
|
286
|
-
scope.lighten = function(col){
|
|
324
|
+
scope.lighten = function (col) {
|
|
287
325
|
var amt = 20;
|
|
288
326
|
var usePound = false;
|
|
289
327
|
|
|
@@ -292,21 +330,21 @@ angular.module('niceElements')
|
|
|
292
330
|
usePound = true;
|
|
293
331
|
}
|
|
294
332
|
|
|
295
|
-
var num = parseInt(col,16);
|
|
333
|
+
var num = parseInt(col, 16);
|
|
296
334
|
var r = (num >> 16) + amt;
|
|
297
335
|
|
|
298
336
|
if (r > 255) r = 255;
|
|
299
|
-
else if
|
|
337
|
+
else if (r < 0) r = 0;
|
|
300
338
|
|
|
301
339
|
var b = ((num >> 8) & 0x00FF) + amt;
|
|
302
340
|
if (b > 255) b = 255;
|
|
303
|
-
else if
|
|
341
|
+
else if (b < 0) b = 0;
|
|
304
342
|
|
|
305
343
|
var g = (num & 0x0000FF) + amt;
|
|
306
344
|
if (g > 255) g = 255;
|
|
307
345
|
else if (g < 0) g = 0;
|
|
308
346
|
|
|
309
|
-
return (usePound?"#":"") + (g | (b << 8) | (r << 16)).toString(16);
|
|
347
|
+
return (usePound ? "#" : "") + (g | (b << 8) | (r << 16)).toString(16);
|
|
310
348
|
};
|
|
311
349
|
|
|
312
350
|
|
|
@@ -348,9 +386,9 @@ angular.module('niceElements')
|
|
|
348
386
|
date: date
|
|
349
387
|
};
|
|
350
388
|
|
|
351
|
-
if(scope.minDate) day.isDisabled = date.isBefore(moment(scope.minDate));
|
|
352
|
-
if(scope.maxDate) day.isDisabled = date.isAfter(moment(scope.maxDate));
|
|
353
|
-
if(scope.minDate && scope.maxDate) day.isDisabled = !date.isBetween(moment(scope.minDate), moment(scope.maxDate));
|
|
389
|
+
if (scope.minDate) day.isDisabled = date.isBefore(moment(scope.minDate));
|
|
390
|
+
if (scope.maxDate) day.isDisabled = date.isAfter(moment(scope.maxDate));
|
|
391
|
+
if (scope.minDate && scope.maxDate) day.isDisabled = !date.isBetween(moment(scope.minDate), moment(scope.maxDate));
|
|
354
392
|
|
|
355
393
|
days.push(day);
|
|
356
394
|
date = date.clone();
|
|
@@ -361,7 +399,7 @@ angular.module('niceElements')
|
|
|
361
399
|
}
|
|
362
400
|
}
|
|
363
401
|
};
|
|
364
|
-
});
|
|
402
|
+
});
|
|
365
403
|
|
|
366
404
|
'use strict';
|
|
367
405
|
|
|
@@ -3674,7 +3712,7 @@ angular.module('niceElements')
|
|
|
3674
3712
|
|
|
3675
3713
|
// Link form object with valid object
|
|
3676
3714
|
if ($scope.valid) {
|
|
3677
|
-
$scope.valid = $scope.
|
|
3715
|
+
$scope.valid = $scope.forma;
|
|
3678
3716
|
}
|
|
3679
3717
|
|
|
3680
3718
|
// Fix min
|
|
@@ -3718,9 +3756,9 @@ angular.module('niceElements')
|
|
|
3718
3756
|
// Check canAdd or canSubtract
|
|
3719
3757
|
$scope.check = function() {
|
|
3720
3758
|
if ($scope.required && ($scope.model == undefined || $scope.model == null)) {
|
|
3721
|
-
$scope.
|
|
3759
|
+
$scope.niceNumberForm.$setValidity("no-value", false);
|
|
3722
3760
|
} else {
|
|
3723
|
-
$scope.
|
|
3761
|
+
$scope.niceNumberForm.$setValidity("no-value", null);
|
|
3724
3762
|
}
|
|
3725
3763
|
|
|
3726
3764
|
if ($scope.min && parseFloat($scope.model) <= $scope.min) {
|
|
@@ -3738,9 +3776,9 @@ angular.module('niceElements')
|
|
|
3738
3776
|
}
|
|
3739
3777
|
|
|
3740
3778
|
if ($scope.preventZero && parseFloat($scope.model) == 0) {
|
|
3741
|
-
$scope.
|
|
3779
|
+
$scope.niceNumberForm.$setValidity("zero", false);
|
|
3742
3780
|
} else {
|
|
3743
|
-
$scope.
|
|
3781
|
+
$scope.niceNumberForm.$setValidity("zero", null);
|
|
3744
3782
|
}
|
|
3745
3783
|
|
|
3746
3784
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
@@ -3771,11 +3809,11 @@ angular.module('niceElements')
|
|
|
3771
3809
|
if ($scope.max) {
|
|
3772
3810
|
if (result <= parseFloat($scope.max)) {
|
|
3773
3811
|
$scope.model = result;
|
|
3774
|
-
$scope.
|
|
3812
|
+
$scope.niceNumberForm.$setDirty();
|
|
3775
3813
|
}
|
|
3776
3814
|
} else {
|
|
3777
3815
|
$scope.model = result;
|
|
3778
|
-
$scope.
|
|
3816
|
+
$scope.niceNumberForm.$setDirty();
|
|
3779
3817
|
}
|
|
3780
3818
|
$scope.check();
|
|
3781
3819
|
};
|
|
@@ -3786,7 +3824,7 @@ angular.module('niceElements')
|
|
|
3786
3824
|
var result = new Decimal($scope.model != undefined ? $scope.model : $scope.defaultValue).minus($scope.step).toNumber();
|
|
3787
3825
|
if (result >= Number($scope.min)) {
|
|
3788
3826
|
$scope.model = result;
|
|
3789
|
-
$scope.
|
|
3827
|
+
$scope.niceNumberForm.$setDirty();
|
|
3790
3828
|
}
|
|
3791
3829
|
$scope.check();
|
|
3792
3830
|
};
|
|
@@ -4563,6 +4601,27 @@ angular.module('niceElements')
|
|
|
4563
4601
|
});
|
|
4564
4602
|
'use strict';
|
|
4565
4603
|
|
|
4604
|
+
/**
|
|
4605
|
+
* @ngdoc directive
|
|
4606
|
+
* @name niceElements.directive:niceTooltip
|
|
4607
|
+
* @description
|
|
4608
|
+
* # niceTooltip
|
|
4609
|
+
*/
|
|
4610
|
+
angular.module('niceElements')
|
|
4611
|
+
.directive('niceTooltip', function() {
|
|
4612
|
+
return {
|
|
4613
|
+
restrict: 'EA',
|
|
4614
|
+
link: function(scope, element, attrs) {
|
|
4615
|
+
var html = element.html();
|
|
4616
|
+
element.addClass("nice-tooltip");
|
|
4617
|
+
html = html + "<span class='nice-tooltip-window'>" + attrs.niceTooltip + "</span>"
|
|
4618
|
+
element.html(html);
|
|
4619
|
+
}
|
|
4620
|
+
};
|
|
4621
|
+
});
|
|
4622
|
+
|
|
4623
|
+
'use strict';
|
|
4624
|
+
|
|
4566
4625
|
/**
|
|
4567
4626
|
* @ngdoc directive
|
|
4568
4627
|
* @name niceElements.directive:niceUpload
|
|
@@ -4715,18 +4774,17 @@ angular.module('niceElements')
|
|
|
4715
4774
|
isInline: '=',
|
|
4716
4775
|
help: '@'
|
|
4717
4776
|
},
|
|
4718
|
-
controller: function($scope,
|
|
4719
|
-
if (!$
|
|
4720
|
-
if (!$
|
|
4721
|
-
if (!$
|
|
4722
|
-
if (!$
|
|
4723
|
-
if (!$
|
|
4777
|
+
controller: function($scope, gettextCatalog) {
|
|
4778
|
+
if (!$scope.yes) { $scope.yes = gettextCatalog.getString('Yes', null, "Nice"); }
|
|
4779
|
+
if (!$scope.no) { $scope.no = gettextCatalog.getString('No', null, "Nice"); }
|
|
4780
|
+
if (!$scope.title) { $scope.title = ''; }
|
|
4781
|
+
if (!$scope.fieldWidth) { $scope.fieldWidth = 'col-sm-8'; }
|
|
4782
|
+
if (!$scope.labelWidth) { $scope.labelWidth = 'col-sm-4'; }
|
|
4724
4783
|
if(!angular.isDefined($scope.model) && !angular.isDefined($scope.options)) $scope.model = !angular.isDefined($scope.defaultFalse);
|
|
4725
4784
|
if(!angular.isDefined($scope.modelValue) && angular.isDefined($scope.options)) $scope.modelValue = $scope.options[0];
|
|
4726
4785
|
|
|
4727
|
-
$
|
|
4728
|
-
$
|
|
4729
|
-
$attrs.isDisabled = angular.isDefined($attrs.isDisabled);
|
|
4786
|
+
$scope.defaultFalse = angular.isDefined($scope.defaultFalse);
|
|
4787
|
+
$scope.noMargin = angular.isDefined($scope.noMargin);
|
|
4730
4788
|
|
|
4731
4789
|
$scope.buttonClass = "";
|
|
4732
4790
|
|
|
@@ -4864,6 +4922,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
4864
4922
|
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
4865
4923
|
"<div class=\"disabled-shield\" ng-if=\"isDisabled\"></div>\n" +
|
|
4866
4924
|
"<div class=\"nice-calendar-wrapper\">\n" +
|
|
4925
|
+
"<div class=\"nice-calendar-weeks\">\n" +
|
|
4867
4926
|
"<div class=\"header\">\n" +
|
|
4868
4927
|
"<i class=\"fa fa-angle-left\" ng-click=\"previous()\" title=\"{{ 'Previous month' | translate:'Nice' }}\"></i>\n" +
|
|
4869
4928
|
"<span title=\"{{ month.format('M.YYYY' )}}\">{{ month.format(\"MMMM, YYYY\" )}}</span>\n" +
|
|
@@ -4880,25 +4939,25 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
4880
4939
|
"</div>\n" +
|
|
4881
4940
|
"<div class=\"week\" ng-repeat=\"week in weeks\">\n" +
|
|
4882
4941
|
"<span class=\"day\" title=\"{{ day.date.format('D.M.YYYY') }}\" ng-class=\"{\n" +
|
|
4883
|
-
"
|
|
4884
|
-
"
|
|
4885
|
-
"
|
|
4886
|
-
"
|
|
4887
|
-
"
|
|
4888
|
-
"
|
|
4889
|
-
"
|
|
4890
|
-
"
|
|
4891
|
-
"
|
|
4892
|
-
"
|
|
4893
|
-
"
|
|
4894
|
-
"
|
|
4895
|
-
"
|
|
4896
|
-
"
|
|
4942
|
+
" today: day.isToday,\n" +
|
|
4943
|
+
" 'different-month': !day.isCurrentMonth,\n" +
|
|
4944
|
+
" 'start-selected': isSameDay(day.date, startDate),\n" +
|
|
4945
|
+
" 'end-selected': isSameDay(day.date, endDate),\n" +
|
|
4946
|
+
" 'selected': isBetweenRange(day.date),\n" +
|
|
4947
|
+
" 'selecting-start': selectStart,\n" +
|
|
4948
|
+
" 'selecting-end': !selectStart,\n" +
|
|
4949
|
+
" 'weekend': day.isWeekday,\n" +
|
|
4950
|
+
" 'disabled': day.isDisabled\n" +
|
|
4951
|
+
" }\" ng-style=\"\n" +
|
|
4952
|
+
" (color && isBetweenRange(day.date)) && {'background-color': lighten(color) } ||\n" +
|
|
4953
|
+
" (color && isSameDay(day.date, startDate)) && {'background-color': color } ||\n" +
|
|
4954
|
+
" (color && isSameDay(day.date, endDate)) && {'background-color': color }\n" +
|
|
4955
|
+
" \" ng-click=\"select(day)\" ng-repeat=\"day in week.days\">\n" +
|
|
4897
4956
|
"{{ day.number }}\n" +
|
|
4898
4957
|
"<p class=\"popup\" ng-if=\"!hideHover\">{{ popupText }}</p>\n" +
|
|
4899
4958
|
"</span>\n" +
|
|
4900
4959
|
"</div>\n" +
|
|
4901
|
-
"
|
|
4960
|
+
"</div>\n" +
|
|
4902
4961
|
"<div class=\"nice-calendar-time\" ng-if=\"time\">\n" +
|
|
4903
4962
|
"<div class=\"time-picker\">\n" +
|
|
4904
4963
|
"<select title=\"{{ 'Select start time' | translate:'Nice' }}\" class=\"time-picker-hour\" ng-model=\"startDateHour\" ng-change=\"startHourChange(startDateHour)\" ng-options=\"hour for hour in hours\">\n" +
|
|
@@ -4929,7 +4988,6 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
4929
4988
|
"<label translate translate-context=\"Nice\">End</label>\n" +
|
|
4930
4989
|
"<div ng-class=\"endTimeClass\">{{ formatDate(endDate) }}</div>\n" +
|
|
4931
4990
|
"</div>\n" +
|
|
4932
|
-
"<div class=\"clearfix\"></div>\n" +
|
|
4933
4991
|
"</div>\n" +
|
|
4934
4992
|
"</div>\n" +
|
|
4935
4993
|
"</div>\n" +
|
|
@@ -5459,14 +5517,14 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5459
5517
|
|
|
5460
5518
|
|
|
5461
5519
|
$templateCache.put('src/components/nice-number/nice-number.html',
|
|
5462
|
-
"<div class=\"nice-component nice-number\" ng-form=\"
|
|
5520
|
+
"<div class=\"nice-component nice-number\" ng-form=\"niceNumberForm\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\">\n" +
|
|
5463
5521
|
"<div ng-class=\"{'row' : !disableRow}\">\n" +
|
|
5464
5522
|
"<div class=\"nice-title col-xs-12\" ng-class=\"labelWidth ? labelWidth : 'col-sm-4'\" ng-if=\"title\">\n" +
|
|
5465
5523
|
"<div class=\"nice-title-text\">{{ title }}<span ng-if=\"required\">*</span></div>\n" +
|
|
5466
5524
|
"<nice-help class=\"nice-title-help\" ng-if=\"help\" text=\"{{ help }}\"></nice-help>\n" +
|
|
5467
5525
|
"</div>\n" +
|
|
5468
5526
|
"<div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
5469
|
-
"<div class=\"input-group\" ng-class=\"{'has-warning': !disabled &&
|
|
5527
|
+
"<div class=\"input-group\" ng-class=\"{'has-warning': !disabled && niceNumberForm.$invalid && niceNumberForm.$dirty}\">\n" +
|
|
5470
5528
|
"<span class=\"input-group-btn\">\n" +
|
|
5471
5529
|
"<button class=\"btn btn-default\" type=\"button\" ng-disabled=\"!canSubstract\" ng-click=\"subtract()\">-</button>\n" +
|
|
5472
5530
|
"</span>\n" +
|
|
@@ -5475,12 +5533,20 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5475
5533
|
"<button class=\"btn btn-default\" type=\"button\" ng-disabled=\"!canAdd\" ng-click=\"add()\">+</button>\n" +
|
|
5476
5534
|
"</span>\n" +
|
|
5477
5535
|
"</div>\n" +
|
|
5478
|
-
"<div class=\"error-messages\" ng-if=\"
|
|
5479
|
-
"<div class=\"error-message\" ng-if=\"
|
|
5480
|
-
"<div class=\"error-message\" ng-if=\"
|
|
5481
|
-
"<
|
|
5482
|
-
"
|
|
5483
|
-
"<div class=\"error-message\" ng-if=\"
|
|
5536
|
+
"<div class=\"error-messages\" ng-if=\"niceNumberForm.$error && !hideError\" ng-class=\"{ 'floating-error': floatingError }\">\n" +
|
|
5537
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$dirty && niceNumberForm.$error.number\" translate translate-context=\"Nice\">This field requires a number</div>\n" +
|
|
5538
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.min\">\n" +
|
|
5539
|
+
"<translate translate-context=\"Nice\">Minimum value is</translate>{{ min }}\n" +
|
|
5540
|
+
"</div>\n" +
|
|
5541
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.max\">\n" +
|
|
5542
|
+
"<translate translate-context=\"Nice\">Maximum value is</translate>{{ max }}\n" +
|
|
5543
|
+
"</div>\n" +
|
|
5544
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.zero\">\n" +
|
|
5545
|
+
"<translate translate-context=\"Nice\">0 is not allowed</translate>\n" +
|
|
5546
|
+
"</div>\n" +
|
|
5547
|
+
"<div class=\"error-message\" ng-if=\"niceNumberForm.$error.no-value && !niceNumberForm.$error.zero && !niceNumberForm.$error.min && !niceNumberForm.$error.max\">\n" +
|
|
5548
|
+
"<translate translate-context=\"Nice\">Value is missing</translate>\n" +
|
|
5549
|
+
"</div>\n" +
|
|
5484
5550
|
"</div>\n" +
|
|
5485
5551
|
"</div>\n" +
|
|
5486
5552
|
"</div>\n" +
|