nice-elements 1.9.7 → 1.9.9
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 +10 -0
- package/README.md +2 -1
- package/bower.json +1 -1
- package/dist/nice.js +209 -90
- package/dist/nice.min.js +1 -1
- package/dist/style.css +55 -1
- package/dist/style.css.map +2 -1
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-input/nice-input.html +1 -1
- package/src/components/nice-input/nice-input.js +10 -1
- package/src/components/nice-toggle/nice-toggle.html +13 -0
- package/src/components/nice-toggle/nice-toggle.js +95 -0
- package/src/components/nice-toggle/nice-toggle.scss +68 -0
- package/src/services/nice-service.js +1 -1
- package/src/styles/_nice.scss +1 -0
- package/src/styles/_variables.scss +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v1.9.9 (5.12.2023)
|
|
4
|
+
|
|
5
|
+
- changed input internal type to text if type is number,
|
|
6
|
+
- added input modes to nice input,
|
|
7
|
+
- worked on demo page
|
|
8
|
+
|
|
9
|
+
## v1.9.8 (17.11.2023)
|
|
10
|
+
|
|
11
|
+
-
|
|
12
|
+
|
|
3
13
|
## v1.9.7 (26.10.2023)
|
|
4
14
|
|
|
5
15
|
- fixed nice search on update
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|

|
|
2
2
|
|
|
3
|
-
# Nice elements v1.9.
|
|
3
|
+
# Nice elements v1.9.9
|
|
4
4
|
|
|
5
5
|
Nice elements is an AngularJS v1.5.8 module that contains nice form elements like inputs, choice fields, search, toggle, dropdown, etc.
|
|
6
6
|
|
|
@@ -46,6 +46,7 @@ Nice elements is an AngularJS v1.5.8 module that contains nice form elements lik
|
|
|
46
46
|
- nice-upload
|
|
47
47
|
- nice-yesno
|
|
48
48
|
- nice-pill
|
|
49
|
+
- nice-toggle
|
|
49
50
|
- ~~nice-datetime-picker~~ (DEPREACATED)
|
|
50
51
|
- ~~nice-datetimerange-picker~~ (DEPREACATED)
|
|
51
52
|
- ~~nice-dtp~~ (DEPREACATED)
|
package/bower.json
CHANGED
package/dist/nice.js
CHANGED
|
@@ -18,7 +18,7 @@ angular.module('niceElements')
|
|
|
18
18
|
label: '@'
|
|
19
19
|
},
|
|
20
20
|
link: function postLink(scope, element, attrs) {
|
|
21
|
-
if (angular.isDefined(scope.model))
|
|
21
|
+
if (angular.isDefined(scope.model)){
|
|
22
22
|
scope.model = false;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -655,14 +655,14 @@ angular.module('niceElements')
|
|
|
655
655
|
* # clickOutside
|
|
656
656
|
*/
|
|
657
657
|
angular.module('niceElements')
|
|
658
|
-
.directive('clickOutside', function
|
|
658
|
+
.directive('clickOutside', function($document, $parse, $timeout){
|
|
659
659
|
return {
|
|
660
660
|
restrict: 'A',
|
|
661
661
|
link: function ($scope, elem, attr) {
|
|
662
662
|
$scope.isOpen = false;
|
|
663
663
|
|
|
664
664
|
// watch for is open
|
|
665
|
-
attr.$observe('isOpen', function
|
|
665
|
+
attr.$observe('isOpen', function(value){
|
|
666
666
|
$scope.isOpen = value == 'true';
|
|
667
667
|
});
|
|
668
668
|
|
|
@@ -717,7 +717,7 @@ angular.module('niceElements')
|
|
|
717
717
|
// if we have got this far, then we are good to go with processing the command passed in via the click-outside attribute
|
|
718
718
|
$timeout(function () {
|
|
719
719
|
fn = $parse(attr['clickOutside']);
|
|
720
|
-
fn($scope, {
|
|
720
|
+
fn($scope, {event: e});
|
|
721
721
|
});
|
|
722
722
|
}
|
|
723
723
|
}
|
|
@@ -751,7 +751,7 @@ angular.module('niceElements')
|
|
|
751
751
|
});
|
|
752
752
|
}
|
|
753
753
|
};
|
|
754
|
-
|
|
754
|
+
});
|
|
755
755
|
'use strict';
|
|
756
756
|
|
|
757
757
|
/**
|
|
@@ -942,7 +942,7 @@ angular.module('niceElements')
|
|
|
942
942
|
*/
|
|
943
943
|
angular.module('niceElements')
|
|
944
944
|
|
|
945
|
-
.directive('niceDateRange', function
|
|
945
|
+
.directive('niceDateRange', function() {
|
|
946
946
|
return {
|
|
947
947
|
restrict: 'E',
|
|
948
948
|
transclude: true,
|
|
@@ -962,16 +962,16 @@ angular.module('niceElements')
|
|
|
962
962
|
onChange: '&?'
|
|
963
963
|
},
|
|
964
964
|
|
|
965
|
-
link: function
|
|
965
|
+
link: function(scope, attrs){
|
|
966
966
|
if (!attrs.title) { attrs.title = ''; }
|
|
967
967
|
if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
|
|
968
968
|
if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
|
|
969
969
|
if (!attrs.format) { attrs.format = 'dd.MM.yyyy'; }
|
|
970
970
|
attrs.noMargin = angular.isDefined(attrs.noMargin);
|
|
971
971
|
|
|
972
|
-
if
|
|
972
|
+
if(!angular.isDefined(scope.model)) {
|
|
973
973
|
var model = null;
|
|
974
|
-
if
|
|
974
|
+
if(!angular.isDefined(scope.startOfTheYear)){
|
|
975
975
|
model = {
|
|
976
976
|
startDate: moment().format(),
|
|
977
977
|
endDate: moment().format()
|
|
@@ -987,7 +987,7 @@ angular.module('niceElements')
|
|
|
987
987
|
}
|
|
988
988
|
},
|
|
989
989
|
|
|
990
|
-
controller: function
|
|
990
|
+
controller: function($scope) {
|
|
991
991
|
$scope.opts = {
|
|
992
992
|
locale: {
|
|
993
993
|
applyClass: 'btn-green',
|
|
@@ -1003,7 +1003,7 @@ angular.module('niceElements')
|
|
|
1003
1003
|
$scope.opts.ranges[gettextCatalog.getString("Last 30 days", null, "Nice")] = [moment().subtract(30, 'days'), moment()];
|
|
1004
1004
|
$scope.opts.ranges[gettextCatalog.getString("This month", null, "Nice")] = [moment().startOf('month'), moment().endOf('month')];
|
|
1005
1005
|
|
|
1006
|
-
if
|
|
1006
|
+
if(angular.isDefined($scope.format)) $scope.opts.format = format;
|
|
1007
1007
|
}
|
|
1008
1008
|
|
|
1009
1009
|
};
|
|
@@ -3683,25 +3683,25 @@ angular.module('niceElements')
|
|
|
3683
3683
|
};
|
|
3684
3684
|
});
|
|
3685
3685
|
|
|
3686
|
-
'use strict';
|
|
3687
|
-
|
|
3688
|
-
/**
|
|
3689
|
-
* @ngdoc directive
|
|
3690
|
-
* @name niceElements.directive:niceIcon
|
|
3691
|
-
* @description
|
|
3692
|
-
* # niceIcon
|
|
3693
|
-
*/
|
|
3694
|
-
angular.module('niceElements')
|
|
3695
|
-
.directive('niceIcon', function () {
|
|
3696
|
-
return {
|
|
3697
|
-
templateUrl: 'src/components/nice-icon/nice-icon.html',
|
|
3698
|
-
restrict: 'E',
|
|
3699
|
-
replace: true,
|
|
3700
|
-
scope: {
|
|
3701
|
-
icon: '@',
|
|
3702
|
-
size: '=',
|
|
3703
|
-
},
|
|
3704
|
-
};
|
|
3686
|
+
'use strict';
|
|
3687
|
+
|
|
3688
|
+
/**
|
|
3689
|
+
* @ngdoc directive
|
|
3690
|
+
* @name niceElements.directive:niceIcon
|
|
3691
|
+
* @description
|
|
3692
|
+
* # niceIcon
|
|
3693
|
+
*/
|
|
3694
|
+
angular.module('niceElements')
|
|
3695
|
+
.directive('niceIcon', function () {
|
|
3696
|
+
return {
|
|
3697
|
+
templateUrl: 'src/components/nice-icon/nice-icon.html',
|
|
3698
|
+
restrict: 'E',
|
|
3699
|
+
replace: true,
|
|
3700
|
+
scope: {
|
|
3701
|
+
icon: '@',
|
|
3702
|
+
size: '=',
|
|
3703
|
+
},
|
|
3704
|
+
};
|
|
3705
3705
|
});
|
|
3706
3706
|
angular.module('niceElements')
|
|
3707
3707
|
.directive('niceInput', function () {
|
|
@@ -3764,6 +3764,7 @@ angular.module('niceElements')
|
|
|
3764
3764
|
attrs.textArea = angular.isDefined(attrs.textArea);
|
|
3765
3765
|
attrs.noMargin = angular.isDefined(attrs.noMargin);
|
|
3766
3766
|
attrs.required = attrs.required === 'true';
|
|
3767
|
+
scope.inputMode = null;
|
|
3767
3768
|
//attrs.required = angular.isDefined(attrs.required);
|
|
3768
3769
|
|
|
3769
3770
|
if (!scope.textArea) {
|
|
@@ -3777,13 +3778,19 @@ angular.module('niceElements')
|
|
|
3777
3778
|
if (input) input.focus();
|
|
3778
3779
|
}
|
|
3779
3780
|
|
|
3781
|
+
if (scope.numbersOnly) {
|
|
3782
|
+
scope.inputMode = "numeric";
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3780
3785
|
// Set internal type
|
|
3781
3786
|
scope.internalType = attrs.type;
|
|
3782
3787
|
if (attrs.type == "percent") {
|
|
3783
3788
|
scope.internalType = "percent";
|
|
3789
|
+
scope.inputMode = "decimal";
|
|
3784
3790
|
attrs.symbol = '%';
|
|
3785
3791
|
} else if (attrs.type == "number") {
|
|
3786
|
-
scope.internalType = "
|
|
3792
|
+
scope.internalType = "text";
|
|
3793
|
+
scope.inputMode = "decimal";
|
|
3787
3794
|
if (scope.model) {
|
|
3788
3795
|
scope.model = Number(scope.model);
|
|
3789
3796
|
} else {
|
|
@@ -3791,8 +3798,10 @@ angular.module('niceElements')
|
|
|
3791
3798
|
}
|
|
3792
3799
|
} else if (attrs.type == "integer") {
|
|
3793
3800
|
scope.internalType = "text";
|
|
3801
|
+
scope.inputMode = "numeric";
|
|
3794
3802
|
scope.model = Number(scope.model);
|
|
3795
3803
|
} else if (attrs.type == "email") {
|
|
3804
|
+
scope.inputMode = "email";
|
|
3796
3805
|
// TODO: get rid of the errors
|
|
3797
3806
|
scope.regexexp = new RegExp('^[_a-zA-Z0-9]+(.[_a-zA-Z0-9]+)*@[a-zA-Z0-9]+(.[a-zA-Z0-9]+)+(.[a-zA-Z]{2,4})');
|
|
3798
3807
|
}
|
|
@@ -3998,42 +4007,42 @@ angular.module('niceElements')
|
|
|
3998
4007
|
|
|
3999
4008
|
var messageElements = [];
|
|
4000
4009
|
|
|
4001
|
-
var notify = function
|
|
4010
|
+
var notify = function(args, t){
|
|
4002
4011
|
|
|
4003
|
-
if (typeof args !== 'object')
|
|
4004
|
-
args = {
|
|
4012
|
+
if (typeof args !== 'object'){
|
|
4013
|
+
args = {message:args};
|
|
4005
4014
|
}
|
|
4006
4015
|
|
|
4007
4016
|
args.template = args.template ? args.template : 'src/components/nice-notification/nice-notification.html';
|
|
4008
4017
|
args.delay = !angular.isUndefined(args.delay) ? args.delay : delay;
|
|
4009
4018
|
args.type = t ? t : '';
|
|
4010
4019
|
|
|
4011
|
-
$http.get(args.template,
|
|
4020
|
+
$http.get(args.template,{cache: $templateCache}).success(function(template) {
|
|
4012
4021
|
|
|
4013
4022
|
var scope = $rootScope.$new();
|
|
4014
4023
|
scope.message = $sce.trustAsHtml(args.message);
|
|
4015
4024
|
scope.title = $sce.trustAsHtml(args.title);
|
|
4016
|
-
scope.t = args.type.substr(0,
|
|
4025
|
+
scope.t = args.type.substr(0,1);
|
|
4017
4026
|
scope.delay = args.delay;
|
|
4018
4027
|
|
|
4019
|
-
if (typeof args.scope === 'object')
|
|
4020
|
-
for (var key in args.scope)
|
|
4028
|
+
if (typeof args.scope === 'object'){
|
|
4029
|
+
for (var key in args.scope){
|
|
4021
4030
|
scope[key] = args.scope[key];
|
|
4022
4031
|
}
|
|
4023
4032
|
}
|
|
4024
4033
|
|
|
4025
|
-
var reposite = function
|
|
4034
|
+
var reposite = function() {
|
|
4026
4035
|
var j = 0;
|
|
4027
4036
|
var k = 0;
|
|
4028
4037
|
var lastTop = startTop;
|
|
4029
4038
|
var lastRight = startRight;
|
|
4030
|
-
for
|
|
4039
|
+
for(var i = messageElements.length - 1; i >= 0; i --) {
|
|
4031
4040
|
var element = messageElements[i];
|
|
4032
4041
|
var elHeight = parseInt(element[0].offsetHeight);
|
|
4033
4042
|
var elWidth = parseInt(element[0].offsetWidth);
|
|
4034
4043
|
if ((top + elHeight) > window.innerHeight) {
|
|
4035
4044
|
lastTop = startTop;
|
|
4036
|
-
k++;
|
|
4045
|
+
k ++;
|
|
4037
4046
|
j = 0;
|
|
4038
4047
|
}
|
|
4039
4048
|
var top = lastTop + (j === 0 ? 0 : verticalSpacing);
|
|
@@ -4043,22 +4052,22 @@ angular.module('niceElements')
|
|
|
4043
4052
|
element.css('right', right + 'px');
|
|
4044
4053
|
|
|
4045
4054
|
lastTop = top + elHeight;
|
|
4046
|
-
j++;
|
|
4055
|
+
j ++;
|
|
4047
4056
|
}
|
|
4048
4057
|
};
|
|
4049
4058
|
|
|
4050
4059
|
var templateElement = $compile(template)(scope);
|
|
4051
4060
|
templateElement.addClass(args.type);
|
|
4052
|
-
templateElement.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd click', function
|
|
4061
|
+
templateElement.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd click', function(e){
|
|
4053
4062
|
e = e.originalEvent || e;
|
|
4054
|
-
if (e.type === 'click' || (e.propertyName === 'opacity' && e.elapsedTime >= 0.4))
|
|
4063
|
+
if (e.type === 'click' || (e.propertyName === 'opacity' && e.elapsedTime >= 0.4)){
|
|
4055
4064
|
templateElement.remove();
|
|
4056
4065
|
messageElements.splice(messageElements.indexOf(templateElement), 1);
|
|
4057
4066
|
reposite();
|
|
4058
4067
|
}
|
|
4059
4068
|
});
|
|
4060
4069
|
|
|
4061
|
-
$timeout(function
|
|
4070
|
+
$timeout(function() {
|
|
4062
4071
|
templateElement.addClass('killed');
|
|
4063
4072
|
templateElement.remove();
|
|
4064
4073
|
messageElements.splice(messageElements.indexOf(templateElement), 1);
|
|
@@ -4070,34 +4079,34 @@ angular.module('niceElements')
|
|
|
4070
4079
|
|
|
4071
4080
|
$timeout(reposite);
|
|
4072
4081
|
|
|
4073
|
-
}).error(function
|
|
4074
|
-
throw new Error('Template ('
|
|
4082
|
+
}).error(function(data){
|
|
4083
|
+
throw new Error('Template ('+args.template+') could not be loaded. ' + data);
|
|
4075
4084
|
});
|
|
4076
4085
|
|
|
4077
4086
|
};
|
|
4078
4087
|
|
|
4079
|
-
notify.config = function
|
|
4080
|
-
|
|
4081
|
-
|
|
4088
|
+
notify.config = function(args){
|
|
4089
|
+
startTop = args.top ? args.top : startTop;
|
|
4090
|
+
verticalSpacing = args.verticalSpacing ? args.verticalSpacing : verticalSpacing;
|
|
4082
4091
|
};
|
|
4083
4092
|
|
|
4084
|
-
notify.primary = function
|
|
4093
|
+
notify.primary = function() {
|
|
4085
4094
|
this(args, '');
|
|
4086
4095
|
};
|
|
4087
4096
|
|
|
4088
|
-
notify.error = function
|
|
4097
|
+
notify.error = function(args) {
|
|
4089
4098
|
this(args, 'error');
|
|
4090
4099
|
};
|
|
4091
4100
|
|
|
4092
|
-
notify.success = function
|
|
4101
|
+
notify.success = function(args) {
|
|
4093
4102
|
this(args, 'success');
|
|
4094
4103
|
};
|
|
4095
4104
|
|
|
4096
|
-
notify.info = function
|
|
4105
|
+
notify.info = function(args) {
|
|
4097
4106
|
this(args, 'info');
|
|
4098
4107
|
};
|
|
4099
4108
|
|
|
4100
|
-
notify.warning = function
|
|
4109
|
+
notify.warning = function(args) {
|
|
4101
4110
|
this(args, 'warning');
|
|
4102
4111
|
};
|
|
4103
4112
|
|
|
@@ -4528,7 +4537,7 @@ angular.module('niceElements')
|
|
|
4528
4537
|
* # niceProgressBar
|
|
4529
4538
|
*/
|
|
4530
4539
|
angular.module('niceElements')
|
|
4531
|
-
.directive('niceProgressBar', function
|
|
4540
|
+
.directive('niceProgressBar', function() {
|
|
4532
4541
|
return {
|
|
4533
4542
|
restrict: 'E',
|
|
4534
4543
|
replace: true,
|
|
@@ -4543,29 +4552,29 @@ angular.module('niceElements')
|
|
|
4543
4552
|
help: '@'
|
|
4544
4553
|
},
|
|
4545
4554
|
|
|
4546
|
-
controller: function
|
|
4555
|
+
controller: function($scope, $element, $timeout) {
|
|
4547
4556
|
$scope.width = 0;
|
|
4548
|
-
$scope.resize = function
|
|
4549
|
-
$timeout(function
|
|
4557
|
+
$scope.resize = function(){
|
|
4558
|
+
$timeout(function() {
|
|
4550
4559
|
$scope.width = $element[0].getElementsByClassName("progress")[0].offsetWidth;
|
|
4551
|
-
},
|
|
4560
|
+
},100);
|
|
4552
4561
|
};
|
|
4553
|
-
window.onresize = function
|
|
4562
|
+
window.onresize = function() {
|
|
4554
4563
|
$scope.resize();
|
|
4555
4564
|
};
|
|
4556
4565
|
$scope.resize();
|
|
4557
4566
|
|
|
4567
|
+
|
|
4558
4568
|
|
|
4559
|
-
|
|
4560
|
-
$scope.$watch("value", function (valueNew, valueOld) {
|
|
4569
|
+
$scope.$watch("value", function(valueNew, valueOld){
|
|
4561
4570
|
$scope.calculate();
|
|
4562
4571
|
});
|
|
4563
4572
|
|
|
4564
|
-
$scope.$watch("max", function
|
|
4573
|
+
$scope.$watch("max", function(valueNew, valueOld){
|
|
4565
4574
|
$scope.calculate();
|
|
4566
4575
|
});
|
|
4567
4576
|
|
|
4568
|
-
$scope.calculate = function
|
|
4577
|
+
$scope.calculate = function(){
|
|
4569
4578
|
$scope.percentage = ($scope.value / $scope.max) * 100;
|
|
4570
4579
|
};
|
|
4571
4580
|
|
|
@@ -5347,6 +5356,102 @@ angular.module('niceElements')
|
|
|
5347
5356
|
});
|
|
5348
5357
|
'use strict';
|
|
5349
5358
|
|
|
5359
|
+
/**
|
|
5360
|
+
* @ngdoc directive
|
|
5361
|
+
* @name niceElements.directive:niceToggle
|
|
5362
|
+
* @description
|
|
5363
|
+
* # niceToggle
|
|
5364
|
+
*/
|
|
5365
|
+
angular.module('niceElements')
|
|
5366
|
+
.directive('niceToggle', function () {
|
|
5367
|
+
return {
|
|
5368
|
+
templateUrl: 'src/components/nice-toggle/nice-toggle.html',
|
|
5369
|
+
restrict: 'E',
|
|
5370
|
+
scope: {
|
|
5371
|
+
model: '=',
|
|
5372
|
+
title: '@',
|
|
5373
|
+
isDisabled: '=',
|
|
5374
|
+
fieldWidth: '@',
|
|
5375
|
+
labelWidth: '@',
|
|
5376
|
+
defaultFalse: '@',
|
|
5377
|
+
noMargin: '@',
|
|
5378
|
+
onChange: '&?',
|
|
5379
|
+
isInline: '=',
|
|
5380
|
+
help: '@'
|
|
5381
|
+
},
|
|
5382
|
+
controller: function ($scope) {
|
|
5383
|
+
if (!$scope.title) { $scope.title = ''; }
|
|
5384
|
+
if (!$scope.fieldWidth) { $scope.fieldWidth = 'col-sm-8'; }
|
|
5385
|
+
if (!$scope.labelWidth) { $scope.labelWidth = 'col-sm-4'; }
|
|
5386
|
+
|
|
5387
|
+
// ------------------------- Set overlay button position based on passed state in $scope.model -------------------------
|
|
5388
|
+
$scope.setButtonPosition = function (state) {
|
|
5389
|
+
if (state) {
|
|
5390
|
+
$scope.buttonClass = "yesno-button-yes";
|
|
5391
|
+
} else {
|
|
5392
|
+
$scope.buttonClass = "yesno-button-no";
|
|
5393
|
+
}
|
|
5394
|
+
};
|
|
5395
|
+
|
|
5396
|
+
// ------------------------- Watch for changes from outside -------------------------
|
|
5397
|
+
$scope.$watch('model', function (value_new, value_old) {
|
|
5398
|
+
if (angular.isDefined($scope.model)) {
|
|
5399
|
+
$scope.setButtonLabel($scope.model);
|
|
5400
|
+
$scope.setButtonPosition($scope.model);
|
|
5401
|
+
}
|
|
5402
|
+
});
|
|
5403
|
+
|
|
5404
|
+
// ------------------------- Watch for model value -------------------------
|
|
5405
|
+
$scope.$watch('modelValue', function (value_new, value_old) {
|
|
5406
|
+
if ($scope.options) {
|
|
5407
|
+
$scope.model = $scope.modelValue == $scope.options[0];
|
|
5408
|
+
}
|
|
5409
|
+
});
|
|
5410
|
+
|
|
5411
|
+
// ------------------------- Set button label -------------------------
|
|
5412
|
+
$scope.setButtonLabel = function (state) {
|
|
5413
|
+
if (state) {
|
|
5414
|
+
$scope.state = $scope.yes;
|
|
5415
|
+
} else {
|
|
5416
|
+
$scope.state = $scope.no;
|
|
5417
|
+
}
|
|
5418
|
+
};
|
|
5419
|
+
|
|
5420
|
+
// ------------------------- Set width -------------------------
|
|
5421
|
+
$scope.setWidth = function (width, el) {
|
|
5422
|
+
el.style.width = width;
|
|
5423
|
+
};
|
|
5424
|
+
|
|
5425
|
+
|
|
5426
|
+
// ------------------------- Switch -------------------------
|
|
5427
|
+
$scope.switch = function () {
|
|
5428
|
+
if (!$scope.isDisabled) {
|
|
5429
|
+
$scope.model = !$scope.model;
|
|
5430
|
+
|
|
5431
|
+
if ($scope.options) {
|
|
5432
|
+
if ($scope.model) {
|
|
5433
|
+
$scope.modelValue = $scope.options[0];
|
|
5434
|
+
} else {
|
|
5435
|
+
$scope.modelValue = $scope.options[1];
|
|
5436
|
+
}
|
|
5437
|
+
}
|
|
5438
|
+
|
|
5439
|
+
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
5440
|
+
$scope.formYesno.$setDirty();
|
|
5441
|
+
}
|
|
5442
|
+
};
|
|
5443
|
+
|
|
5444
|
+
// Call it first time
|
|
5445
|
+
$scope.setButtonPosition($scope.model);
|
|
5446
|
+
|
|
5447
|
+
// Set label based on state passed in $scope.model
|
|
5448
|
+
$scope.setButtonLabel($scope.model);
|
|
5449
|
+
}
|
|
5450
|
+
};
|
|
5451
|
+
});
|
|
5452
|
+
|
|
5453
|
+
'use strict';
|
|
5454
|
+
|
|
5350
5455
|
/**
|
|
5351
5456
|
* @ngdoc directive
|
|
5352
5457
|
* @name niceElements.directive:niceTooltip
|
|
@@ -5600,24 +5705,24 @@ angular.module('niceElements')
|
|
|
5600
5705
|
isInline: '=',
|
|
5601
5706
|
help: '@'
|
|
5602
5707
|
},
|
|
5603
|
-
controller: function
|
|
5708
|
+
controller: function($scope, gettextCatalog) {
|
|
5604
5709
|
if (!$scope.yes) { $scope.yes = gettextCatalog.getString('Yes', null, "Nice"); }
|
|
5605
5710
|
if (!$scope.no) { $scope.no = gettextCatalog.getString('No', null, "Nice"); }
|
|
5606
5711
|
if (!$scope.title) { $scope.title = ''; }
|
|
5607
5712
|
if (!$scope.fieldWidth) { $scope.fieldWidth = 'col-sm-8'; }
|
|
5608
5713
|
if (!$scope.labelWidth) { $scope.labelWidth = 'col-sm-4'; }
|
|
5609
|
-
if
|
|
5610
|
-
if
|
|
5714
|
+
if(!angular.isDefined($scope.model) && !angular.isDefined($scope.options)) $scope.model = !angular.isDefined($scope.defaultFalse);
|
|
5715
|
+
if(!angular.isDefined($scope.modelValue) && angular.isDefined($scope.options)) $scope.modelValue = $scope.options[0];
|
|
5611
5716
|
|
|
5612
5717
|
$scope.defaultFalse = angular.isDefined($scope.defaultFalse);
|
|
5613
5718
|
$scope.noMargin = angular.isDefined($scope.noMargin);
|
|
5614
5719
|
|
|
5615
5720
|
$scope.buttonClass = "";
|
|
5616
|
-
|
|
5721
|
+
|
|
5617
5722
|
|
|
5618
5723
|
// ------------------------- Set overlay button position based on passed state in $scope.model -------------------------
|
|
5619
|
-
$scope.setButtonPosition = function
|
|
5620
|
-
if
|
|
5724
|
+
$scope.setButtonPosition = function(state) {
|
|
5725
|
+
if(state) {
|
|
5621
5726
|
$scope.buttonClass = "yesno-button-yes";
|
|
5622
5727
|
} else {
|
|
5623
5728
|
$scope.buttonClass = "yesno-button-no";
|
|
@@ -5625,48 +5730,48 @@ angular.module('niceElements')
|
|
|
5625
5730
|
};
|
|
5626
5731
|
|
|
5627
5732
|
// ------------------------- Watch for changes from outside -------------------------
|
|
5628
|
-
$scope.$watch('model', function
|
|
5629
|
-
if
|
|
5733
|
+
$scope.$watch('model', function(value_new, value_old){
|
|
5734
|
+
if(angular.isDefined($scope.model)){
|
|
5630
5735
|
$scope.setButtonLabel($scope.model);
|
|
5631
5736
|
$scope.setButtonPosition($scope.model);
|
|
5632
5737
|
}
|
|
5633
5738
|
});
|
|
5634
5739
|
|
|
5635
5740
|
// ------------------------- Watch for model value -------------------------
|
|
5636
|
-
$scope.$watch('modelValue', function
|
|
5637
|
-
if
|
|
5741
|
+
$scope.$watch('modelValue', function(value_new, value_old){
|
|
5742
|
+
if($scope.options){
|
|
5638
5743
|
$scope.model = $scope.modelValue == $scope.options[0];
|
|
5639
5744
|
}
|
|
5640
5745
|
});
|
|
5641
5746
|
|
|
5642
5747
|
// ------------------------- Set button label -------------------------
|
|
5643
|
-
$scope.setButtonLabel = function
|
|
5748
|
+
$scope.setButtonLabel = function(state){
|
|
5644
5749
|
if (state) {
|
|
5645
5750
|
$scope.state = $scope.yes;
|
|
5646
5751
|
} else {
|
|
5647
5752
|
$scope.state = $scope.no;
|
|
5648
5753
|
}
|
|
5649
5754
|
};
|
|
5650
|
-
|
|
5755
|
+
|
|
5651
5756
|
// ------------------------- Set width -------------------------
|
|
5652
|
-
$scope.setWidth = function
|
|
5757
|
+
$scope.setWidth = function(width, el){
|
|
5653
5758
|
el.style.width = width;
|
|
5654
5759
|
};
|
|
5655
|
-
|
|
5760
|
+
|
|
5656
5761
|
|
|
5657
5762
|
// ------------------------- Switch -------------------------
|
|
5658
|
-
$scope.switch = function
|
|
5659
|
-
if
|
|
5763
|
+
$scope.switch = function(){
|
|
5764
|
+
if(!$scope.isDisabled){
|
|
5660
5765
|
$scope.model = !$scope.model;
|
|
5661
|
-
|
|
5662
|
-
if
|
|
5663
|
-
if
|
|
5766
|
+
|
|
5767
|
+
if($scope.options){
|
|
5768
|
+
if($scope.model){
|
|
5664
5769
|
$scope.modelValue = $scope.options[0];
|
|
5665
5770
|
} else {
|
|
5666
5771
|
$scope.modelValue = $scope.options[1];
|
|
5667
5772
|
}
|
|
5668
5773
|
}
|
|
5669
|
-
|
|
5774
|
+
|
|
5670
5775
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
5671
5776
|
$scope.formYesno.$setDirty();
|
|
5672
5777
|
}
|
|
@@ -5728,7 +5833,7 @@ angular.module('niceElements')
|
|
|
5728
5833
|
.service('NiceService', function () {
|
|
5729
5834
|
var service = {
|
|
5730
5835
|
name: "Nice elements",
|
|
5731
|
-
version: "1.9.
|
|
5836
|
+
version: "1.9.9",
|
|
5732
5837
|
getHeader: function () {
|
|
5733
5838
|
return {};
|
|
5734
5839
|
}
|
|
@@ -5804,7 +5909,7 @@ angular.module('niceElements')
|
|
|
5804
5909
|
};
|
|
5805
5910
|
});
|
|
5806
5911
|
|
|
5807
|
-
angular.module('niceElements').run(['$templateCache', function
|
|
5912
|
+
angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
5808
5913
|
'use strict';
|
|
5809
5914
|
|
|
5810
5915
|
$templateCache.put('src/components/nice-button-toggle/nice-button-toggle.html',
|
|
@@ -6423,7 +6528,7 @@ angular.module('niceElements').run(['$templateCache', function ($templateCache)
|
|
|
6423
6528
|
" 'nice-disabled': isDisabled\n" +
|
|
6424
6529
|
" }\">\n" +
|
|
6425
6530
|
"<textarea ng-if=\"textArea\" class=\"form-control\" ng-model=\"$parent.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>\n" +
|
|
6426
|
-
"<input ng-if=\"!textArea\" class=\"form-control\" type=\"{{ internalType }}\" ng-model=\"$parent.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\">\n" +
|
|
6531
|
+
"<input ng-if=\"!textArea\" class=\"form-control\" type=\"{{ internalType }}\" inputmode=\"{{ inputMode }}\" ng-model=\"$parent.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\">\n" +
|
|
6427
6532
|
"<div class=\"input-group-addon\" ng-if=\"symbol\">{{ symbol }}</div>\n" +
|
|
6428
6533
|
"<button class=\"input-group-btn\" ng-if=\"multilanguageField\" ng-click=\"openMultilanguage()\">\n" +
|
|
6429
6534
|
"<nice-icon icon=\"icon-translate\"></nice-icon>\n" +
|
|
@@ -7625,12 +7730,12 @@ angular.module('niceElements').run(['$templateCache', function ($templateCache)
|
|
|
7625
7730
|
"<path d=\"m364 102.4-1.8-1.4c.4 0 .7 0 1-.2.1-.1.3-.4.3-.8l1.1 1 .6.5v.4a.5.5 0 0 1 0 .2.6.6 0 0 1-.4.2h-.7z\"/>\n" +
|
|
7626
7731
|
"<path d=\"M366.2 103.8a11.8 11.8 0 0 1-2-1.3h.7a.8.8 0 0 0 .4-.2l.1-.4a1 1 0 0 0 0-.2 10.5 10.5 0 0 0 2.1 1.4c0 .3 0 .4-.3.5a3 3 0 0 1-1 .1z\"/>\n" +
|
|
7627
7732
|
"<path d=\"M368.4 104.7a11.9 11.9 0 0 1-2-.8c.4 0 .7 0 1-.2.2 0 .3-.2.3-.5a10.8 10.8 0 0 0 1.3.6v.4l-.5.4s-.1 0 0 0z\"/>\n" +
|
|
7628
|
-
"<path d=\"M373.2 104.2s.4-.1.2 0c-1.4 1-3.1 1-4.8.5.3-.1.5-.2.6-.4a.6.6 0 0 0 0-.5l1.7.4a.4.4 0 0 1-.1.3l-.5.3s-.1 0 0 .1c0 .1 0 0 0 0 .3 0 .5-.2.6-.3a.6.6 0 0 0 .2-.4 9 9 0 0 0 2 0zm-9.7 24-.2.4-1.2.3c0 .3 0 .4.3.4l.7-.3c.1 0 0 .5-.5.8v.1c.4.6 1.4.4 1.9.3a3 3 0 0 0 1.3-1l-.3-.6c-.4.1-.6 0-.5-.2a3.9 3.9 0 0 0-1.5-.2zm-15.1-4.8c-.3.3-.7.5-1 .6-.2 0-.6.1-.6.3 0 .1.2.3.4.2.4-.5.7-.2.2.2v.3c.5.4 1.6.5 2.2.2.3-.2.6-.5.2-.9a1.7 1.7 0 0 1 0-.2h-.6l-.4-.3-.4-.4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.3 0-.5.2-.7.3l.8.1c.3.1.5.4.6.8-.1.1-.1 0-.1 0a1 1 0 0 0-.5-.6c-.4-.2-1.3 0-1.7.2a4.2 4.2 0 0 0-.6.6l2 .4zm-2.3-.4v-.1l.7-.6.7-.4a2 2 0 0 1 1-.5l1.3-.2a1 1 0 0 0-.5-.5l-.8-.1-1.5.8h.5l.1.2h-.4a1.4 1.4 0 0 0-.4 0h-.1l-1.3 1c.3.1.6.2.7.4z\"/>\n" +
|
|
7629
7734
|
"</g>\n" +
|
|
7630
7735
|
"<path fill=\"#0093dd\" d=\"m409 156.5 20.8-47-15.3-24.7-27.3 10-12.7 49.8a219.4 219.4 0 0 1 34.5 11.9z\"/>\n" +
|
|
7631
7736
|
"<path fill=\"#fff\" d=\"M382.6 113a251.7 251.7 0 0 1 39.6 13.7l-8 18.2a232 232 0 0 0-36.5-12.7z\"/>\n" +
|
|
7632
7737
|
"<path fill=\"red\" d=\"m415.4 142 5.4-12.2a248.6 248.6 0 0 0-39-13.5l-3.2 12.4a235.9 235.9 0 0 1 37 12.8l-.1.4z\"/>\n" +
|
|
7633
|
-
"<path d=\"M385.6 125.8c.3-.3.7-.2 1.1-.1.3-.2.7-.2 1-.2l.6-.2c.2 0 .2-.2 0-.3a.6.6 0 0 1 0-.3c-.7-.4-1-1-1.2-1.5-.3 0-.5-.2-.5-.3h-.5c-.8 0-1-.3-1.3-.5a1 1 0 0 1-.6-.4l-.3-.3c-.2-.3-.1-.7.2-.7h.7a2 2 0 0 1 .9-.1c.3 0 .5-.3.9-.6v-.4s0-.2.2-.1a1 1 0 0 1 .8.5c.5 0 1 .3 1.2.7.7 0 1.1.3 1.2.5 0 .2-.2.4-.5.6v.2l.4.4 1 .7c1-.1 2.6.6 4.8 2a18.6 18.6 0 0 1 4.1 1.2h.9c2.4-.4 4.7 0 6.8 1.5.8.1 1.5.4 2.2.7.5.2 1 .3 1.6.3a8 8 0 0 1 2.6.7c1 .2 1.9.
|
|
7738
|
+
"<path d=\"M385.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ateCache', function ($templateCache)
|
|
|
7713
7818
|
);
|
|
7714
7819
|
|
|
7715
7820
|
|
|
7821
|
+
$templateCache.put('src/components/nice-toggle/nice-toggle.html',
|
|
7822
|
+
"<div class=\"nice-component nice-toggle\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" ng-form=\"formToggle\">\n" +
|
|
7823
|
+
"<div class=\"row\">\n" +
|
|
7824
|
+
"<nice-title text=\"title\" help=\"help\" required=\"required\" label-width=\"labelWidth\"></nice-title>\n" +
|
|
7825
|
+
"<div class=\"nice-field col-xs-12\" ng-class=\"[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]\">\n" +
|
|
7826
|
+
"<button class=\"nice-toggle-field\" ng-click=\"switch()\" ng-disabled=\"isDisabled\" type=\"button\">\n" +
|
|
7827
|
+
"<div class=\"nice-toggle-field-handle\" ng-class=\"{ 'active': model }\">{{ state }}</div>\n" +
|
|
7828
|
+
"</button>\n" +
|
|
7829
|
+
"</div>\n" +
|
|
7830
|
+
"</div>\n" +
|
|
7831
|
+
"</div>"
|
|
7832
|
+
);
|
|
7833
|
+
|
|
7834
|
+
|
|
7716
7835
|
$templateCache.put('src/components/nice-upload/nice-upload.html',
|
|
7717
7836
|
"<ng-form class=\"nice-component nice-upload\" ng-class=\"{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }\" name=\"form\">\n" +
|
|
7718
7837
|
"<div class=\"row\">\n" +
|