nice-elements 1.8.1 → 1.8.3
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 +12 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +232 -217
- package/dist/nice.min.js +1 -1
- package/dist/style.css +16 -1
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +1 -1
- package/package.json +1 -1
- package/src/components/nice-checkbox/nice-checkbox.js +2 -1
- package/src/components/nice-choice/nice-choice.html +1 -1
- package/src/components/nice-choice/nice-choice.js +6 -0
- package/src/components/nice-dropdown/nice-dropdown.js +1 -1
- package/src/components/nice-dropdown-date/nice-dropdown-date.js +105 -103
- package/src/components/nice-number/nice-number.js +12 -8
- package/src/components/nice-search/nice-search.js +1 -1
- package/src/components/nice-time-picker/nice-time-picker.js +16 -16
- package/src/components/nice-wrapper/_nice-wrapper.scss +20 -1
- package/src/components/nice-wrapper/nice-wrapper.html +2 -2
- package/src/components/nice-wrapper/nice-wrapper.js +3 -1
- package/src/services/nice-service.js +1 -1
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
|
}
|
|
@@ -419,6 +419,7 @@ angular.module('niceElements')
|
|
|
419
419
|
model: '=',
|
|
420
420
|
title: '@',
|
|
421
421
|
noMargin: '@',
|
|
422
|
+
clickDisabled: '@',
|
|
422
423
|
onChange: '&?',
|
|
423
424
|
isDisabled: '=',
|
|
424
425
|
},
|
|
@@ -426,7 +427,7 @@ angular.module('niceElements')
|
|
|
426
427
|
if ($scope.model === undefined) $scope.model = false;
|
|
427
428
|
|
|
428
429
|
$scope.toggle = function () {
|
|
429
|
-
if ($scope.isDisabled) return;
|
|
430
|
+
if ($scope.isDisabled || $scope.clickDisabled) return;
|
|
430
431
|
$scope.model = !$scope.model;
|
|
431
432
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
432
433
|
};
|
|
@@ -538,6 +539,12 @@ angular.module('niceElements')
|
|
|
538
539
|
return filter;
|
|
539
540
|
};
|
|
540
541
|
|
|
542
|
+
$scope.itemHover = function (event, item) {
|
|
543
|
+
if (event.which == 1) {
|
|
544
|
+
$scope.toggle(item);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
541
548
|
$scope.setDefault = function () {
|
|
542
549
|
if (!$scope.multiple) {
|
|
543
550
|
$scope.internalSelected = $scope.internalList[0];
|
|
@@ -648,14 +655,14 @@ angular.module('niceElements')
|
|
|
648
655
|
* # clickOutside
|
|
649
656
|
*/
|
|
650
657
|
angular.module('niceElements')
|
|
651
|
-
.directive('clickOutside', function($document, $parse, $timeout){
|
|
658
|
+
.directive('clickOutside', function ($document, $parse, $timeout) {
|
|
652
659
|
return {
|
|
653
660
|
restrict: 'A',
|
|
654
661
|
link: function ($scope, elem, attr) {
|
|
655
662
|
$scope.isOpen = false;
|
|
656
663
|
|
|
657
664
|
// watch for is open
|
|
658
|
-
attr.$observe('isOpen', function(value){
|
|
665
|
+
attr.$observe('isOpen', function (value) {
|
|
659
666
|
$scope.isOpen = value == 'true';
|
|
660
667
|
});
|
|
661
668
|
|
|
@@ -710,7 +717,7 @@ angular.module('niceElements')
|
|
|
710
717
|
// if we have got this far, then we are good to go with processing the command passed in via the click-outside attribute
|
|
711
718
|
$timeout(function () {
|
|
712
719
|
fn = $parse(attr['clickOutside']);
|
|
713
|
-
fn($scope, {event: e});
|
|
720
|
+
fn($scope, { event: e });
|
|
714
721
|
});
|
|
715
722
|
}
|
|
716
723
|
}
|
|
@@ -744,7 +751,7 @@ angular.module('niceElements')
|
|
|
744
751
|
});
|
|
745
752
|
}
|
|
746
753
|
};
|
|
747
|
-
});
|
|
754
|
+
});
|
|
748
755
|
'use strict';
|
|
749
756
|
|
|
750
757
|
/**
|
|
@@ -935,7 +942,7 @@ angular.module('niceElements')
|
|
|
935
942
|
*/
|
|
936
943
|
angular.module('niceElements')
|
|
937
944
|
|
|
938
|
-
.directive('niceDateRange', function() {
|
|
945
|
+
.directive('niceDateRange', function () {
|
|
939
946
|
return {
|
|
940
947
|
restrict: 'E',
|
|
941
948
|
transclude: true,
|
|
@@ -955,16 +962,16 @@ angular.module('niceElements')
|
|
|
955
962
|
onChange: '&?'
|
|
956
963
|
},
|
|
957
964
|
|
|
958
|
-
link: function(scope, attrs){
|
|
965
|
+
link: function (scope, attrs) {
|
|
959
966
|
if (!attrs.title) { attrs.title = ''; }
|
|
960
967
|
if (!attrs.fieldWidth) { attrs.fieldWidth = 'col-sm-8'; }
|
|
961
968
|
if (!attrs.labelWidth) { attrs.labelWidth = 'col-sm-4'; }
|
|
962
969
|
if (!attrs.format) { attrs.format = 'dd.MM.yyyy'; }
|
|
963
970
|
attrs.noMargin = angular.isDefined(attrs.noMargin);
|
|
964
971
|
|
|
965
|
-
if(!angular.isDefined(scope.model)) {
|
|
972
|
+
if (!angular.isDefined(scope.model)) {
|
|
966
973
|
var model = null;
|
|
967
|
-
if(!angular.isDefined(scope.startOfTheYear)){
|
|
974
|
+
if (!angular.isDefined(scope.startOfTheYear)) {
|
|
968
975
|
model = {
|
|
969
976
|
startDate: moment().format(),
|
|
970
977
|
endDate: moment().format()
|
|
@@ -980,7 +987,7 @@ angular.module('niceElements')
|
|
|
980
987
|
}
|
|
981
988
|
},
|
|
982
989
|
|
|
983
|
-
controller: function($scope) {
|
|
990
|
+
controller: function ($scope) {
|
|
984
991
|
$scope.opts = {
|
|
985
992
|
locale: {
|
|
986
993
|
applyClass: 'btn-green',
|
|
@@ -996,7 +1003,7 @@ angular.module('niceElements')
|
|
|
996
1003
|
$scope.opts.ranges[gettextCatalog.getString("Last 30 days", null, "Nice")] = [moment().subtract(30, 'days'), moment()];
|
|
997
1004
|
$scope.opts.ranges[gettextCatalog.getString("This month", null, "Nice")] = [moment().startOf('month'), moment().endOf('month')];
|
|
998
1005
|
|
|
999
|
-
if(angular.isDefined($scope.format)) $scope.opts.format = format;
|
|
1006
|
+
if (angular.isDefined($scope.format)) $scope.opts.format = format;
|
|
1000
1007
|
}
|
|
1001
1008
|
|
|
1002
1009
|
};
|
|
@@ -1848,121 +1855,123 @@ angular.module('niceElements')
|
|
|
1848
1855
|
*/
|
|
1849
1856
|
angular.module('niceElements')
|
|
1850
1857
|
.directive('niceDropdownDate', function (gettextCatalog) {
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
// Set the years drop down from attributes or defaults
|
|
1888
|
-
var currentYear = parseInt($scope.startingYear, 10) || new Date().getFullYear();
|
|
1889
|
-
var numYears = parseInt($scope.numYears, 10) || 100;
|
|
1890
|
-
var oldestYear = currentYear - numYears;
|
|
1891
|
-
var newestYear = currentYear;
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
// If mature
|
|
1895
|
-
if($scope.mature) newestYear -= 17;
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
// Create years array
|
|
1899
|
-
$scope.years = [];
|
|
1900
|
-
for(var i = currentYear; i >= oldestYear; i-- ){
|
|
1901
|
-
if (i <= newestYear){
|
|
1902
|
-
$scope.years.push(i);
|
|
1903
|
-
}
|
|
1904
|
-
}
|
|
1858
|
+
return {
|
|
1859
|
+
restrict: 'E',
|
|
1860
|
+
replace: true,
|
|
1861
|
+
templateUrl: "src/components/nice-dropdown-date/nice-dropdown-date.html",
|
|
1862
|
+
scope: {
|
|
1863
|
+
model: '=',
|
|
1864
|
+
title: '@',
|
|
1865
|
+
fieldWidth: '@',
|
|
1866
|
+
labelWidth: '@',
|
|
1867
|
+
noMargin: '@',
|
|
1868
|
+
isDisabled: '=',
|
|
1869
|
+
numYears: '@',
|
|
1870
|
+
startingYear: '@',
|
|
1871
|
+
mature: '@',
|
|
1872
|
+
help: '@',
|
|
1873
|
+
isInline: '=',
|
|
1874
|
+
onChange: '&?'
|
|
1875
|
+
},
|
|
1876
|
+
link: function ($scope) {
|
|
1877
|
+
$scope.days = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];
|
|
1878
|
+
$scope.months = [
|
|
1879
|
+
{ value: 0, name: gettextCatalog.getString('Jan', null, 'Nice') },
|
|
1880
|
+
{ value: 1, name: gettextCatalog.getString('Feb', null, 'Nice') },
|
|
1881
|
+
{ value: 2, name: gettextCatalog.getString('Mar', null, 'Nice') },
|
|
1882
|
+
{ value: 3, name: gettextCatalog.getString('Apr', null, 'Nice') },
|
|
1883
|
+
{ value: 4, name: gettextCatalog.getString('May', null, 'Nice') },
|
|
1884
|
+
{ value: 5, name: gettextCatalog.getString('Jun', null, 'Nice') },
|
|
1885
|
+
{ value: 6, name: gettextCatalog.getString('Jul', null, 'Nice') },
|
|
1886
|
+
{ value: 7, name: gettextCatalog.getString('Aug', null, 'Nice') },
|
|
1887
|
+
{ value: 8, name: gettextCatalog.getString('Sep', null, 'Nice') },
|
|
1888
|
+
{ value: 9, name: gettextCatalog.getString('Oct', null, 'Nice') },
|
|
1889
|
+
{ value: 10, name: gettextCatalog.getString('Nov', null, 'Nice') },
|
|
1890
|
+
{ value: 11, name: gettextCatalog.getString('Dec', null, 'Nice') }
|
|
1891
|
+
];
|
|
1905
1892
|
|
|
1906
1893
|
|
|
1907
|
-
|
|
1908
|
-
|
|
1894
|
+
// Set the years drop down from attributes or defaults
|
|
1895
|
+
var currentYear = parseInt($scope.startingYear, 10) || new Date().getFullYear();
|
|
1896
|
+
var numYears = parseInt($scope.numYears, 10) || 100;
|
|
1897
|
+
var oldestYear = currentYear - numYears;
|
|
1898
|
+
var newestYear = currentYear;
|
|
1909
1899
|
|
|
1910
1900
|
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1901
|
+
// If mature
|
|
1902
|
+
if ($scope.mature) newestYear -= 17;
|
|
1903
|
+
|
|
1904
|
+
|
|
1905
|
+
// Create years array
|
|
1906
|
+
$scope.years = [];
|
|
1907
|
+
for (var i = currentYear; i >= oldestYear; i--) {
|
|
1908
|
+
if (i <= newestYear) {
|
|
1909
|
+
$scope.years.push(i);
|
|
1910
|
+
}
|
|
1919
1911
|
}
|
|
1920
|
-
});
|
|
1921
1912
|
|
|
1922
1913
|
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
var date = moment($scope.dateFields.day + "." + ($scope.dateFields.month + 1) + "." + $scope.dateFields.year, "D.M.YYYY");
|
|
1914
|
+
// Split the current date into sections
|
|
1915
|
+
$scope.dateFields = {};
|
|
1926
1916
|
|
|
1927
|
-
if(date.isValid()){
|
|
1928
|
-
// Format
|
|
1929
|
-
$scope.model = date.format();
|
|
1930
|
-
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
1931
1917
|
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1918
|
+
// Watch for model change
|
|
1919
|
+
$scope.$watch('model', function (newDate, oldDate) {
|
|
1920
|
+
if (newDate && newDate != oldDate) {
|
|
1921
|
+
var date = moment(newDate);
|
|
1922
|
+
$scope.dateFields.day = date.get('date');
|
|
1923
|
+
$scope.dateFields.month = date.get('month');
|
|
1924
|
+
$scope.dateFields.year = date.get('year');
|
|
1925
|
+
$scope.checkDate();
|
|
1936
1926
|
}
|
|
1927
|
+
});
|
|
1937
1928
|
|
|
1938
|
-
// Valid
|
|
1939
|
-
$scope.dropdownDateForm.$setValidity('validDate', true);
|
|
1940
|
-
$scope.dropdownDateForm.$setDirty();
|
|
1941
|
-
} else {
|
|
1942
|
-
// Invalid
|
|
1943
|
-
$scope.dropdownDateForm.$setValidity('validDate', false);
|
|
1944
|
-
}
|
|
1945
|
-
};
|
|
1946
1929
|
|
|
1930
|
+
// validate that the date selected is accurate
|
|
1931
|
+
$scope.checkDate = function () {
|
|
1932
|
+
var date = moment($scope.dateFields.day + "." + ($scope.dateFields.month + 1) + "." + $scope.dateFields.year, "D.M.YYYY");
|
|
1933
|
+
|
|
1934
|
+
if (date.isValid()) {
|
|
1935
|
+
// Format
|
|
1936
|
+
$scope.model = date.format();
|
|
1937
|
+
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
1938
|
+
|
|
1939
|
+
// Change dates
|
|
1940
|
+
$scope.days = [];
|
|
1941
|
+
for (i = 1; i <= date.daysInMonth(); i++) {
|
|
1942
|
+
$scope.days.push(i);
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
// Valid
|
|
1946
|
+
if ($scope.dropdownDateForm) {
|
|
1947
|
+
$scope.dropdownDateForm.$setValidity('validDate', true);
|
|
1948
|
+
$scope.dropdownDateForm.$setDirty();
|
|
1949
|
+
}
|
|
1950
|
+
} else {
|
|
1951
|
+
// Invalid
|
|
1952
|
+
if ($scope.dropdownDateForm) $scope.dropdownDateForm.$setValidity('validDate', false);
|
|
1953
|
+
}
|
|
1954
|
+
};
|
|
1947
1955
|
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1956
|
+
|
|
1957
|
+
// Set current date
|
|
1958
|
+
if (!$scope.model) {
|
|
1959
|
+
var date = moment();
|
|
1960
|
+
$scope.dateFields.day = date.get('date');
|
|
1961
|
+
$scope.dateFields.month = date.get('month');
|
|
1962
|
+
$scope.dateFields.year = date.get('year');
|
|
1963
|
+
if ($scope.mature) $scope.dateFields.year -= 18;
|
|
1964
|
+
$scope.checkDate();
|
|
1965
|
+
} else {
|
|
1966
|
+
var date = moment($scope.model);
|
|
1967
|
+
$scope.dateFields.day = date.get('date');
|
|
1968
|
+
$scope.dateFields.month = date.get('month');
|
|
1969
|
+
$scope.dateFields.year = date.get('year');
|
|
1970
|
+
$scope.checkDate();
|
|
1971
|
+
}
|
|
1962
1972
|
}
|
|
1963
|
-
}
|
|
1964
|
-
};
|
|
1965
|
-
});
|
|
1973
|
+
};
|
|
1974
|
+
});
|
|
1966
1975
|
'use strict';
|
|
1967
1976
|
|
|
1968
1977
|
/**
|
|
@@ -2677,7 +2686,7 @@ angular.module('niceElements')
|
|
|
2677
2686
|
|
|
2678
2687
|
// Handle required
|
|
2679
2688
|
$timeout(function () {
|
|
2680
|
-
$scope.formDropdown.$setValidity('required', !(!$scope.selected && $scope.required));
|
|
2689
|
+
if ($scope.formDropdown) $scope.formDropdown.$setValidity('required', !(!$scope.selected && $scope.required));
|
|
2681
2690
|
});
|
|
2682
2691
|
}
|
|
2683
2692
|
|
|
@@ -3624,24 +3633,24 @@ angular.module('niceElements')
|
|
|
3624
3633
|
};
|
|
3625
3634
|
});
|
|
3626
3635
|
|
|
3627
|
-
'use strict';
|
|
3628
|
-
|
|
3629
|
-
/**
|
|
3630
|
-
* @ngdoc directive
|
|
3631
|
-
* @name niceElements.directive:niceIcon
|
|
3632
|
-
* @description
|
|
3633
|
-
* # niceIcon
|
|
3634
|
-
*/
|
|
3635
|
-
angular.module('niceElements')
|
|
3636
|
-
.directive('niceIcon', function () {
|
|
3637
|
-
return {
|
|
3638
|
-
templateUrl: 'src/components/nice-icon/nice-icon.html',
|
|
3639
|
-
restrict: 'E',
|
|
3640
|
-
replace: true,
|
|
3641
|
-
scope: {
|
|
3642
|
-
icon: '@'
|
|
3643
|
-
},
|
|
3644
|
-
};
|
|
3636
|
+
'use strict';
|
|
3637
|
+
|
|
3638
|
+
/**
|
|
3639
|
+
* @ngdoc directive
|
|
3640
|
+
* @name niceElements.directive:niceIcon
|
|
3641
|
+
* @description
|
|
3642
|
+
* # niceIcon
|
|
3643
|
+
*/
|
|
3644
|
+
angular.module('niceElements')
|
|
3645
|
+
.directive('niceIcon', function () {
|
|
3646
|
+
return {
|
|
3647
|
+
templateUrl: 'src/components/nice-icon/nice-icon.html',
|
|
3648
|
+
restrict: 'E',
|
|
3649
|
+
replace: true,
|
|
3650
|
+
scope: {
|
|
3651
|
+
icon: '@'
|
|
3652
|
+
},
|
|
3653
|
+
};
|
|
3645
3654
|
});
|
|
3646
3655
|
angular.module('niceElements')
|
|
3647
3656
|
.directive('niceInput', function () {
|
|
@@ -3881,42 +3890,42 @@ angular.module('niceElements')
|
|
|
3881
3890
|
|
|
3882
3891
|
var messageElements = [];
|
|
3883
3892
|
|
|
3884
|
-
var notify = function(args, t){
|
|
3893
|
+
var notify = function (args, t) {
|
|
3885
3894
|
|
|
3886
|
-
if (typeof args !== 'object'){
|
|
3887
|
-
args = {message:args};
|
|
3895
|
+
if (typeof args !== 'object') {
|
|
3896
|
+
args = { message: args };
|
|
3888
3897
|
}
|
|
3889
3898
|
|
|
3890
3899
|
args.template = args.template ? args.template : 'src/components/nice-notification/nice-notification.html';
|
|
3891
3900
|
args.delay = !angular.isUndefined(args.delay) ? args.delay : delay;
|
|
3892
3901
|
args.type = t ? t : '';
|
|
3893
3902
|
|
|
3894
|
-
$http.get(args.template,{cache: $templateCache}).success(function(template) {
|
|
3903
|
+
$http.get(args.template, { cache: $templateCache }).success(function (template) {
|
|
3895
3904
|
|
|
3896
3905
|
var scope = $rootScope.$new();
|
|
3897
3906
|
scope.message = $sce.trustAsHtml(args.message);
|
|
3898
3907
|
scope.title = $sce.trustAsHtml(args.title);
|
|
3899
|
-
scope.t = args.type.substr(0,1);
|
|
3908
|
+
scope.t = args.type.substr(0, 1);
|
|
3900
3909
|
scope.delay = args.delay;
|
|
3901
3910
|
|
|
3902
|
-
if (typeof args.scope === 'object'){
|
|
3903
|
-
for (var key in args.scope){
|
|
3911
|
+
if (typeof args.scope === 'object') {
|
|
3912
|
+
for (var key in args.scope) {
|
|
3904
3913
|
scope[key] = args.scope[key];
|
|
3905
3914
|
}
|
|
3906
3915
|
}
|
|
3907
3916
|
|
|
3908
|
-
var reposite = function() {
|
|
3917
|
+
var reposite = function () {
|
|
3909
3918
|
var j = 0;
|
|
3910
3919
|
var k = 0;
|
|
3911
3920
|
var lastTop = startTop;
|
|
3912
3921
|
var lastRight = startRight;
|
|
3913
|
-
for(var i = messageElements.length - 1; i >= 0; i
|
|
3922
|
+
for (var i = messageElements.length - 1; i >= 0; i--) {
|
|
3914
3923
|
var element = messageElements[i];
|
|
3915
3924
|
var elHeight = parseInt(element[0].offsetHeight);
|
|
3916
3925
|
var elWidth = parseInt(element[0].offsetWidth);
|
|
3917
3926
|
if ((top + elHeight) > window.innerHeight) {
|
|
3918
3927
|
lastTop = startTop;
|
|
3919
|
-
k
|
|
3928
|
+
k++;
|
|
3920
3929
|
j = 0;
|
|
3921
3930
|
}
|
|
3922
3931
|
var top = lastTop + (j === 0 ? 0 : verticalSpacing);
|
|
@@ -3926,22 +3935,22 @@ angular.module('niceElements')
|
|
|
3926
3935
|
element.css('right', right + 'px');
|
|
3927
3936
|
|
|
3928
3937
|
lastTop = top + elHeight;
|
|
3929
|
-
j
|
|
3938
|
+
j++;
|
|
3930
3939
|
}
|
|
3931
3940
|
};
|
|
3932
3941
|
|
|
3933
3942
|
var templateElement = $compile(template)(scope);
|
|
3934
3943
|
templateElement.addClass(args.type);
|
|
3935
|
-
templateElement.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd click', function(e){
|
|
3944
|
+
templateElement.bind('transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd click', function (e) {
|
|
3936
3945
|
e = e.originalEvent || e;
|
|
3937
|
-
if (e.type === 'click' || (e.propertyName === 'opacity' && e.elapsedTime >= 0.4)){
|
|
3946
|
+
if (e.type === 'click' || (e.propertyName === 'opacity' && e.elapsedTime >= 0.4)) {
|
|
3938
3947
|
templateElement.remove();
|
|
3939
3948
|
messageElements.splice(messageElements.indexOf(templateElement), 1);
|
|
3940
3949
|
reposite();
|
|
3941
3950
|
}
|
|
3942
3951
|
});
|
|
3943
3952
|
|
|
3944
|
-
$timeout(function() {
|
|
3953
|
+
$timeout(function () {
|
|
3945
3954
|
templateElement.addClass('killed');
|
|
3946
3955
|
templateElement.remove();
|
|
3947
3956
|
messageElements.splice(messageElements.indexOf(templateElement), 1);
|
|
@@ -3953,34 +3962,34 @@ angular.module('niceElements')
|
|
|
3953
3962
|
|
|
3954
3963
|
$timeout(reposite);
|
|
3955
3964
|
|
|
3956
|
-
}).error(function(data){
|
|
3957
|
-
throw new Error('Template ('+args.template+') could not be loaded. ' + data);
|
|
3965
|
+
}).error(function (data) {
|
|
3966
|
+
throw new Error('Template (' + args.template + ') could not be loaded. ' + data);
|
|
3958
3967
|
});
|
|
3959
3968
|
|
|
3960
3969
|
};
|
|
3961
3970
|
|
|
3962
|
-
notify.config = function(args){
|
|
3963
|
-
|
|
3964
|
-
|
|
3971
|
+
notify.config = function (args) {
|
|
3972
|
+
startTop = args.top ? args.top : startTop;
|
|
3973
|
+
verticalSpacing = args.verticalSpacing ? args.verticalSpacing : verticalSpacing;
|
|
3965
3974
|
};
|
|
3966
3975
|
|
|
3967
|
-
notify.primary = function() {
|
|
3976
|
+
notify.primary = function () {
|
|
3968
3977
|
this(args, '');
|
|
3969
3978
|
};
|
|
3970
3979
|
|
|
3971
|
-
notify.error = function(args) {
|
|
3980
|
+
notify.error = function (args) {
|
|
3972
3981
|
this(args, 'error');
|
|
3973
3982
|
};
|
|
3974
3983
|
|
|
3975
|
-
notify.success = function(args) {
|
|
3984
|
+
notify.success = function (args) {
|
|
3976
3985
|
this(args, 'success');
|
|
3977
3986
|
};
|
|
3978
3987
|
|
|
3979
|
-
notify.info = function(args) {
|
|
3988
|
+
notify.info = function (args) {
|
|
3980
3989
|
this(args, 'info');
|
|
3981
3990
|
};
|
|
3982
3991
|
|
|
3983
|
-
notify.warning = function(args) {
|
|
3992
|
+
notify.warning = function (args) {
|
|
3984
3993
|
this(args, 'warning');
|
|
3985
3994
|
};
|
|
3986
3995
|
|
|
@@ -4073,10 +4082,12 @@ angular.module('niceElements')
|
|
|
4073
4082
|
|
|
4074
4083
|
// Check canAdd or canSubtract
|
|
4075
4084
|
$scope.check = function () {
|
|
4076
|
-
if ($scope.
|
|
4077
|
-
$scope.
|
|
4078
|
-
|
|
4079
|
-
|
|
4085
|
+
if ($scope.niceNumberForm) {
|
|
4086
|
+
if ($scope.required && ($scope.model == undefined || $scope.model == null)) {
|
|
4087
|
+
$scope.niceNumberForm.$setValidity("no-value", false);
|
|
4088
|
+
} else {
|
|
4089
|
+
$scope.niceNumberForm.$setValidity("no-value", null);
|
|
4090
|
+
}
|
|
4080
4091
|
}
|
|
4081
4092
|
|
|
4082
4093
|
if ($scope.min && parseFloat($scope.model) <= $scope.min) {
|
|
@@ -4093,10 +4104,12 @@ angular.module('niceElements')
|
|
|
4093
4104
|
$scope.canAdd = true;
|
|
4094
4105
|
}
|
|
4095
4106
|
|
|
4096
|
-
if ($scope.
|
|
4097
|
-
$scope.
|
|
4098
|
-
|
|
4099
|
-
|
|
4107
|
+
if ($scope.niceNumberForm) {
|
|
4108
|
+
if ($scope.preventZero && parseFloat($scope.model) == 0) {
|
|
4109
|
+
$scope.niceNumberForm.$setValidity("zero", false);
|
|
4110
|
+
} else {
|
|
4111
|
+
$scope.niceNumberForm.$setValidity("zero", null);
|
|
4112
|
+
}
|
|
4100
4113
|
}
|
|
4101
4114
|
|
|
4102
4115
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
@@ -4377,7 +4390,7 @@ angular.module('niceElements')
|
|
|
4377
4390
|
* # niceProgressBar
|
|
4378
4391
|
*/
|
|
4379
4392
|
angular.module('niceElements')
|
|
4380
|
-
.directive('niceProgressBar', function() {
|
|
4393
|
+
.directive('niceProgressBar', function () {
|
|
4381
4394
|
return {
|
|
4382
4395
|
restrict: 'E',
|
|
4383
4396
|
replace: true,
|
|
@@ -4392,29 +4405,29 @@ angular.module('niceElements')
|
|
|
4392
4405
|
help: '@'
|
|
4393
4406
|
},
|
|
4394
4407
|
|
|
4395
|
-
controller: function($scope, $element, $timeout) {
|
|
4408
|
+
controller: function ($scope, $element, $timeout) {
|
|
4396
4409
|
$scope.width = 0;
|
|
4397
|
-
$scope.resize = function(){
|
|
4398
|
-
$timeout(function() {
|
|
4410
|
+
$scope.resize = function () {
|
|
4411
|
+
$timeout(function () {
|
|
4399
4412
|
$scope.width = $element[0].getElementsByClassName("progress")[0].offsetWidth;
|
|
4400
|
-
},100);
|
|
4413
|
+
}, 100);
|
|
4401
4414
|
};
|
|
4402
|
-
window.onresize = function() {
|
|
4415
|
+
window.onresize = function () {
|
|
4403
4416
|
$scope.resize();
|
|
4404
4417
|
};
|
|
4405
4418
|
$scope.resize();
|
|
4406
4419
|
|
|
4407
|
-
|
|
4408
4420
|
|
|
4409
|
-
|
|
4421
|
+
|
|
4422
|
+
$scope.$watch("value", function (valueNew, valueOld) {
|
|
4410
4423
|
$scope.calculate();
|
|
4411
4424
|
});
|
|
4412
4425
|
|
|
4413
|
-
$scope.$watch("max", function(valueNew, valueOld){
|
|
4426
|
+
$scope.$watch("max", function (valueNew, valueOld) {
|
|
4414
4427
|
$scope.calculate();
|
|
4415
4428
|
});
|
|
4416
4429
|
|
|
4417
|
-
$scope.calculate = function(){
|
|
4430
|
+
$scope.calculate = function () {
|
|
4418
4431
|
$scope.percentage = ($scope.value / $scope.max) * 100;
|
|
4419
4432
|
};
|
|
4420
4433
|
|
|
@@ -4552,7 +4565,7 @@ angular.module('niceElements')
|
|
|
4552
4565
|
}
|
|
4553
4566
|
|
|
4554
4567
|
var setValid = function (isValid) {
|
|
4555
|
-
if (scope.required) {
|
|
4568
|
+
if (scope.required && scope.form) {
|
|
4556
4569
|
scope.form.$setValidity('objectSelected', isValid);
|
|
4557
4570
|
}
|
|
4558
4571
|
};
|
|
@@ -5032,7 +5045,7 @@ angular.module('niceElements')
|
|
|
5032
5045
|
* # niceTimePicker
|
|
5033
5046
|
*/
|
|
5034
5047
|
angular.module('niceElements')
|
|
5035
|
-
.directive('niceTimePicker', function() {
|
|
5048
|
+
.directive('niceTimePicker', function () {
|
|
5036
5049
|
return {
|
|
5037
5050
|
scope: {
|
|
5038
5051
|
model: '=',
|
|
@@ -5047,60 +5060,60 @@ angular.module('niceElements')
|
|
|
5047
5060
|
},
|
|
5048
5061
|
restrict: 'E',
|
|
5049
5062
|
templateUrl: 'src/components/nice-time-picker/nice-time-picker.html',
|
|
5050
|
-
link: function($scope, $element, $attrs) {
|
|
5051
|
-
if(!$scope.model) $scope.model = moment();
|
|
5063
|
+
link: function ($scope, $element, $attrs) {
|
|
5064
|
+
if (!$scope.model) $scope.model = moment();
|
|
5052
5065
|
$scope.open = false;
|
|
5053
5066
|
|
|
5054
5067
|
|
|
5055
|
-
$scope.close = function(){
|
|
5068
|
+
$scope.close = function () {
|
|
5056
5069
|
$scope.open = false;
|
|
5057
5070
|
};
|
|
5058
5071
|
|
|
5059
5072
|
|
|
5060
|
-
$scope.validateDate = function(){
|
|
5073
|
+
$scope.validateDate = function () {
|
|
5061
5074
|
$scope.checkDate($scope.modelString);
|
|
5062
5075
|
};
|
|
5063
5076
|
|
|
5064
5077
|
|
|
5065
|
-
$scope.checkDate = function(date){
|
|
5078
|
+
$scope.checkDate = function (date) {
|
|
5066
5079
|
var parsedDate = moment(date, "HH:mm");
|
|
5067
|
-
if(parsedDate.isValid()){
|
|
5068
|
-
$scope.forma.$setValidity("valid-time", true);
|
|
5080
|
+
if (parsedDate.isValid()) {
|
|
5081
|
+
if ($scope.forma) $scope.forma.$setValidity("valid-time", true);
|
|
5069
5082
|
$scope.model = parsedDate;
|
|
5070
5083
|
$scope.refreshTime();
|
|
5071
5084
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
5072
5085
|
} else {
|
|
5073
|
-
$scope.forma.$setValidity("valid-time", false);
|
|
5086
|
+
if ($scope.forma) $scope.forma.$setValidity("valid-time", false);
|
|
5074
5087
|
$scope.modelString = "";
|
|
5075
5088
|
}
|
|
5076
5089
|
};
|
|
5077
5090
|
|
|
5078
5091
|
|
|
5079
|
-
$scope.refreshTime = function(){
|
|
5092
|
+
$scope.refreshTime = function () {
|
|
5080
5093
|
$scope.hours = $scope.model.format("HH");
|
|
5081
5094
|
$scope.minutes = $scope.model.format("mm");
|
|
5082
5095
|
$scope.modelString = $scope.model.format("HH:mm");
|
|
5083
5096
|
};
|
|
5084
5097
|
|
|
5085
5098
|
|
|
5086
|
-
$scope.changeHour = function(add){
|
|
5087
|
-
if(add) $scope.model.add(1, 'hour');
|
|
5099
|
+
$scope.changeHour = function (add) {
|
|
5100
|
+
if (add) $scope.model.add(1, 'hour');
|
|
5088
5101
|
else $scope.model.subtract(1, 'hour');
|
|
5089
5102
|
$scope.refreshTime();
|
|
5090
5103
|
$scope.forma.$setDirty();
|
|
5091
5104
|
};
|
|
5092
5105
|
|
|
5093
|
-
$scope.changeMinutes = function(add){
|
|
5094
|
-
if(add) $scope.model.add(1, 'minutes');
|
|
5106
|
+
$scope.changeMinutes = function (add) {
|
|
5107
|
+
if (add) $scope.model.add(1, 'minutes');
|
|
5095
5108
|
else $scope.model.subtract(1, 'minutes');
|
|
5096
5109
|
$scope.refreshTime();
|
|
5097
5110
|
$scope.forma.$setDirty();
|
|
5098
5111
|
};
|
|
5099
5112
|
|
|
5100
5113
|
|
|
5101
|
-
$scope.$watch("model", function(value, oldValue){
|
|
5114
|
+
$scope.$watch("model", function (value, oldValue) {
|
|
5102
5115
|
$scope.refreshTime();
|
|
5103
|
-
if(!value.isSame(oldValue)){
|
|
5116
|
+
if (!value.isSame(oldValue)) {
|
|
5104
5117
|
$scope.checkDate(value);
|
|
5105
5118
|
}
|
|
5106
5119
|
})
|
|
@@ -5391,11 +5404,13 @@ angular.module('niceElements')
|
|
|
5391
5404
|
subtitle: '@',
|
|
5392
5405
|
collapsable: '=',
|
|
5393
5406
|
collapsed: '@',
|
|
5407
|
+
noPadding: '@',
|
|
5408
|
+
stickyHeader: '@',
|
|
5409
|
+
stickyFooter: '@',
|
|
5394
5410
|
},
|
|
5395
5411
|
controller: function ($scope, $transclude) {
|
|
5396
5412
|
$scope.isOpen = true;
|
|
5397
5413
|
if ($scope.collapsed) $scope.isOpen = false;
|
|
5398
|
-
|
|
5399
5414
|
$scope.hasTitle = $transclude.isSlotFilled('title');
|
|
5400
5415
|
$scope.hasSubtitle = $transclude.isSlotFilled('subtitle');
|
|
5401
5416
|
$scope.hasFooter = $transclude.isSlotFilled('footer');
|
|
@@ -5438,24 +5453,24 @@ angular.module('niceElements')
|
|
|
5438
5453
|
isInline: '=',
|
|
5439
5454
|
help: '@'
|
|
5440
5455
|
},
|
|
5441
|
-
controller: function($scope, gettextCatalog) {
|
|
5456
|
+
controller: function ($scope, gettextCatalog) {
|
|
5442
5457
|
if (!$scope.yes) { $scope.yes = gettextCatalog.getString('Yes', null, "Nice"); }
|
|
5443
5458
|
if (!$scope.no) { $scope.no = gettextCatalog.getString('No', null, "Nice"); }
|
|
5444
5459
|
if (!$scope.title) { $scope.title = ''; }
|
|
5445
5460
|
if (!$scope.fieldWidth) { $scope.fieldWidth = 'col-sm-8'; }
|
|
5446
5461
|
if (!$scope.labelWidth) { $scope.labelWidth = 'col-sm-4'; }
|
|
5447
|
-
if(!angular.isDefined($scope.model) && !angular.isDefined($scope.options)) $scope.model = !angular.isDefined($scope.defaultFalse);
|
|
5448
|
-
if(!angular.isDefined($scope.modelValue) && angular.isDefined($scope.options)) $scope.modelValue = $scope.options[0];
|
|
5462
|
+
if (!angular.isDefined($scope.model) && !angular.isDefined($scope.options)) $scope.model = !angular.isDefined($scope.defaultFalse);
|
|
5463
|
+
if (!angular.isDefined($scope.modelValue) && angular.isDefined($scope.options)) $scope.modelValue = $scope.options[0];
|
|
5449
5464
|
|
|
5450
5465
|
$scope.defaultFalse = angular.isDefined($scope.defaultFalse);
|
|
5451
5466
|
$scope.noMargin = angular.isDefined($scope.noMargin);
|
|
5452
5467
|
|
|
5453
5468
|
$scope.buttonClass = "";
|
|
5454
|
-
|
|
5469
|
+
|
|
5455
5470
|
|
|
5456
5471
|
// ------------------------- Set overlay button position based on passed state in $scope.model -------------------------
|
|
5457
|
-
$scope.setButtonPosition = function(state) {
|
|
5458
|
-
if(state) {
|
|
5472
|
+
$scope.setButtonPosition = function (state) {
|
|
5473
|
+
if (state) {
|
|
5459
5474
|
$scope.buttonClass = "yesno-button-yes";
|
|
5460
5475
|
} else {
|
|
5461
5476
|
$scope.buttonClass = "yesno-button-no";
|
|
@@ -5463,48 +5478,48 @@ angular.module('niceElements')
|
|
|
5463
5478
|
};
|
|
5464
5479
|
|
|
5465
5480
|
// ------------------------- Watch for changes from outside -------------------------
|
|
5466
|
-
$scope.$watch('model', function(value_new, value_old){
|
|
5467
|
-
if(angular.isDefined($scope.model)){
|
|
5481
|
+
$scope.$watch('model', function (value_new, value_old) {
|
|
5482
|
+
if (angular.isDefined($scope.model)) {
|
|
5468
5483
|
$scope.setButtonLabel($scope.model);
|
|
5469
5484
|
$scope.setButtonPosition($scope.model);
|
|
5470
5485
|
}
|
|
5471
5486
|
});
|
|
5472
5487
|
|
|
5473
5488
|
// ------------------------- Watch for model value -------------------------
|
|
5474
|
-
$scope.$watch('modelValue', function(value_new, value_old){
|
|
5475
|
-
if($scope.options){
|
|
5489
|
+
$scope.$watch('modelValue', function (value_new, value_old) {
|
|
5490
|
+
if ($scope.options) {
|
|
5476
5491
|
$scope.model = $scope.modelValue == $scope.options[0];
|
|
5477
5492
|
}
|
|
5478
5493
|
});
|
|
5479
5494
|
|
|
5480
5495
|
// ------------------------- Set button label -------------------------
|
|
5481
|
-
$scope.setButtonLabel = function(state){
|
|
5496
|
+
$scope.setButtonLabel = function (state) {
|
|
5482
5497
|
if (state) {
|
|
5483
5498
|
$scope.state = $scope.yes;
|
|
5484
5499
|
} else {
|
|
5485
5500
|
$scope.state = $scope.no;
|
|
5486
5501
|
}
|
|
5487
5502
|
};
|
|
5488
|
-
|
|
5503
|
+
|
|
5489
5504
|
// ------------------------- Set width -------------------------
|
|
5490
|
-
$scope.setWidth = function(width, el){
|
|
5505
|
+
$scope.setWidth = function (width, el) {
|
|
5491
5506
|
el.style.width = width;
|
|
5492
5507
|
};
|
|
5493
|
-
|
|
5508
|
+
|
|
5494
5509
|
|
|
5495
5510
|
// ------------------------- Switch -------------------------
|
|
5496
|
-
$scope.switch = function(){
|
|
5497
|
-
if(!$scope.isDisabled){
|
|
5511
|
+
$scope.switch = function () {
|
|
5512
|
+
if (!$scope.isDisabled) {
|
|
5498
5513
|
$scope.model = !$scope.model;
|
|
5499
|
-
|
|
5500
|
-
if($scope.options){
|
|
5501
|
-
if($scope.model){
|
|
5514
|
+
|
|
5515
|
+
if ($scope.options) {
|
|
5516
|
+
if ($scope.model) {
|
|
5502
5517
|
$scope.modelValue = $scope.options[0];
|
|
5503
5518
|
} else {
|
|
5504
5519
|
$scope.modelValue = $scope.options[1];
|
|
5505
5520
|
}
|
|
5506
5521
|
}
|
|
5507
|
-
|
|
5522
|
+
|
|
5508
5523
|
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
5509
5524
|
$scope.formYesno.$setDirty();
|
|
5510
5525
|
}
|
|
@@ -5566,7 +5581,7 @@ angular.module('niceElements')
|
|
|
5566
5581
|
.service('NiceService', function () {
|
|
5567
5582
|
var service = {
|
|
5568
5583
|
name: "Nice elements",
|
|
5569
|
-
version: "1.8.
|
|
5584
|
+
version: "1.8.3",
|
|
5570
5585
|
getHeader: function () {
|
|
5571
5586
|
return {};
|
|
5572
5587
|
}
|
|
@@ -5574,7 +5589,7 @@ angular.module('niceElements')
|
|
|
5574
5589
|
|
|
5575
5590
|
return service;
|
|
5576
5591
|
})
|
|
5577
|
-
angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
5592
|
+
angular.module('niceElements').run(['$templateCache', function ($templateCache) {
|
|
5578
5593
|
'use strict';
|
|
5579
5594
|
|
|
5580
5595
|
$templateCache.put('src/components/nice-button-toggle/nice-button-toggle.html',
|
|
@@ -5697,7 +5712,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
5697
5712
|
"<div class=\"nice-field col-xs-12\" ng-class=\"fieldWidth ? fieldWidth : 'col-sm-8'\">\n" +
|
|
5698
5713
|
"<ul class=\"list-unstyled\" ng-class=\"{ 'disabled': isDisabled }\">\n" +
|
|
5699
5714
|
"<li ng-repeat=\"item in internalList\" ng-class=\"{ 'selected' : isItemSelected(item) }\" ng-click=\"toggle(item)\">\n" +
|
|
5700
|
-
"<button class=\"choice-checkbox\" type=\"button\" ng-class=\"{'circle' : !multiple }\" ng-disabled=\"isDisabled\">\n" +
|
|
5715
|
+
"<button class=\"choice-checkbox\" type=\"button\" ng-class=\"{'circle' : !multiple }\" ng-mouseenter=\"itemHover($event, item)\" ng-disabled=\"isDisabled\">\n" +
|
|
5701
5716
|
"<nice-icon ng-if=\"multiple\" icon=\"icon-check\"></nice-icon>\n" +
|
|
5702
5717
|
"<div ng-if=\"!multiple\" class=\"multiple-circle\"></div>\n" +
|
|
5703
5718
|
"</button>\n" +
|
|
@@ -7369,7 +7384,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7369
7384
|
|
|
7370
7385
|
|
|
7371
7386
|
$templateCache.put('src/components/nice-wrapper/nice-wrapper.html',
|
|
7372
|
-
"<div class=\"nice-wrapper\" ng-class=\"{ 'collapsable': collapsable, 'has-header': hasHeader, 'has-footer': hasFooter }\">\n" +
|
|
7387
|
+
"<div class=\"nice-wrapper\" ng-class=\"{ 'collapsable': collapsable, 'has-header': hasHeader, 'has-footer': hasFooter, 'nice-wrapper-sticky-footer': stickyFooter, 'nice-wrapper-sticky-header': stickyHeader }\">\n" +
|
|
7373
7388
|
"<div class=\"nice-wrapper-header\" ng-if=\"hasHeader\" ng-click=\"toggle()\">\n" +
|
|
7374
7389
|
"<div class=\"nice-wrapper-info\">\n" +
|
|
7375
7390
|
"<div class=\"nice-wrapper-title\" ng-transclude=\"title\">{{ title }}</div>\n" +
|
|
@@ -7379,7 +7394,7 @@ angular.module('niceElements').run(['$templateCache', function($templateCache) {
|
|
|
7379
7394
|
"<nice-icon icon=\"icon-chevron-down\"></nice-icon>\n" +
|
|
7380
7395
|
"</button>\n" +
|
|
7381
7396
|
"</div>\n" +
|
|
7382
|
-
"<div class=\"nice-wrapper-body\" ng-transclude ng-if=\"isOpen\"></div>\n" +
|
|
7397
|
+
"<div class=\"nice-wrapper-body\" ng-class=\" {'no-padding': noPadding }\" ng-transclude ng-if=\"isOpen\"></div>\n" +
|
|
7383
7398
|
"<div class=\"nice-wrapper-footer\" ng-if=\"isOpen && hasFooter\" ng-transclude=\"footer\"></div>\n" +
|
|
7384
7399
|
"</div>"
|
|
7385
7400
|
);
|