nice-elements 1.10.8 → 1.10.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/.vscode/settings.json +17 -17
- package/CHANGELOG.md +458 -454
- package/LICENSE.md +21 -21
- package/README.md +95 -95
- package/bower.json +10 -10
- package/dist/nice.js +8154 -8113
- package/dist/nice.min.js +1 -1
- package/dist/style.css +7 -7
- package/dist/style.min.css +7 -7
- package/eslint.config.mjs +27 -27
- package/package.json +45 -45
- package/src/components/nice-button/nice-button.html +4 -4
- package/src/components/nice-button/nice-button.js +41 -41
- package/src/components/nice-button/nice-button.scss +16 -16
- package/src/components/nice-button-toggle/nice-button-toggle.html +9 -9
- package/src/components/nice-button-toggle/nice-button-toggle.js +23 -23
- package/src/components/nice-button-toggle/nice-button-toggle.scss +2 -2
- package/src/components/nice-calendar/nice-calendar.html +91 -91
- package/src/components/nice-calendar/nice-calendar.js +336 -336
- package/src/components/nice-calendar/nice-calendar.scss +285 -285
- package/src/components/nice-checkbox/nice-checkbox.html +5 -5
- package/src/components/nice-checkbox/nice-checkbox.js +34 -34
- package/src/components/nice-checkbox/nice-checkbox.scss +91 -91
- package/src/components/nice-choice/nice-choice.html +18 -18
- package/src/components/nice-choice/nice-choice.js +212 -212
- package/src/components/nice-choice/nice-choice.scss +110 -110
- package/src/components/nice-click-outside/nice-click-outside.js +105 -105
- package/src/components/nice-comment/nice-comment.html +10 -10
- package/src/components/nice-comment/nice-comment.js +71 -71
- package/src/components/nice-comment/nice-comment.scss +39 -39
- package/src/components/nice-date/nice-date.html +75 -75
- package/src/components/nice-date/nice-date.js +329 -329
- package/src/components/nice-date/nice-date.scss +302 -302
- package/src/components/nice-date-input/nice-date-input.html +41 -41
- package/src/components/nice-date-input/nice-date-input.js +111 -111
- package/src/components/nice-date-input/nice-date-input.scss +45 -45
- package/src/components/nice-date-range/nice-date-range.html +15 -15
- package/src/components/nice-date-range/nice-date-range.js +78 -78
- package/src/components/nice-date-range/nice-date-range.scss +390 -390
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +29 -29
- package/src/components/nice-datetime-picker/nice-datetime-picker.js +89 -89
- package/src/components/nice-datetime-picker/nice-datetime-picker.scss +428 -428
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +55 -55
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +248 -248
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.scss +73 -73
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +44 -44
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +174 -174
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +127 -127
- package/src/components/nice-dropdown/nice-dropdown.html +61 -61
- package/src/components/nice-dropdown/nice-dropdown.js +510 -510
- package/src/components/nice-dropdown/nice-dropdown.scss +261 -261
- package/src/components/nice-dropdown-date/nice-dropdown-date.html +28 -28
- package/src/components/nice-dropdown-date/nice-dropdown-date.js +128 -128
- package/src/components/nice-dropdown-date/nice-dropdown-date.scss +82 -82
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +44 -44
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +331 -331
- package/src/components/nice-dropdown-old/nice-dropdown-old.scss +129 -129
- package/src/components/nice-dtp/nice-dtp.html +91 -91
- package/src/components/nice-dtp/nice-dtp.js +835 -835
- package/src/components/nice-help/nice-help.html +6 -6
- package/src/components/nice-help/nice-help.js +55 -55
- package/src/components/nice-help/nice-help.scss +78 -78
- package/src/components/nice-input/nice-input.html +48 -48
- package/src/components/nice-input/nice-input.js +245 -245
- package/src/components/nice-input/nice-input.scss +130 -130
- package/src/components/nice-label/nice-label.html +10 -10
- package/src/components/nice-label/nice-label.js +32 -32
- package/src/components/nice-loader/nice-loader.html +6 -6
- package/src/components/nice-loader/nice-loader.js +28 -28
- package/src/components/nice-loader/nice-loader.scss +47 -47
- package/src/components/nice-no-data/nice-no-data.html +3 -3
- package/src/components/nice-no-data/nice-no-data.js +27 -27
- package/src/components/nice-no-data/nice-no-data.scss +30 -30
- package/src/components/nice-notification/nice-notification.html +3 -3
- package/src/components/nice-notification/nice-notification.js +124 -124
- package/src/components/nice-notification/nice-notification.scss +66 -66
- package/src/components/nice-number/nice-number.html +40 -40
- package/src/components/nice-number/nice-number.js +170 -170
- package/src/components/nice-number/nice-number.scss +18 -18
- package/src/components/nice-percent/nice-percent.html +24 -24
- package/src/components/nice-percent/nice-percent.js +95 -95
- package/src/components/nice-pill/nice-pill.html +3 -3
- package/src/components/nice-pill/nice-pill.js +29 -29
- package/src/components/nice-pill/nice-pill.scss +25 -25
- package/src/components/nice-popup/nice-popup.html +6 -6
- package/src/components/nice-popup/nice-popup.js +122 -122
- package/src/components/nice-popup/nice-popup.scss +43 -43
- package/src/components/nice-progress-bar/nice-progress-bar.html +15 -15
- package/src/components/nice-progress-bar/nice-progress-bar.js +55 -55
- package/src/components/nice-progress-bar/nice-progress-bar.scss +47 -47
- package/src/components/nice-quantity/nice-quantity.html +22 -22
- package/src/components/nice-quantity/nice-quantity.js +57 -57
- package/src/components/nice-quantity/nice-quantity.scss +51 -51
- package/src/components/nice-search/nice-search.html +44 -44
- package/src/components/nice-search/nice-search.js +240 -240
- package/src/components/nice-search/nice-search.scss +90 -90
- package/src/components/nice-search2/nice-search2.html +32 -32
- package/src/components/nice-search2/nice-search2.js +265 -265
- package/src/components/nice-search2/nice-search2.scss +80 -80
- package/src/components/nice-slot/nice-slot.html +10 -10
- package/src/components/nice-slot/nice-slot.js +31 -31
- package/src/components/nice-steps/nice-steps.scss +81 -81
- package/src/components/nice-svgs/nice-svgs.html +1275 -1275
- package/src/components/nice-svgs/nice-svgs.js +16 -16
- package/src/components/nice-table/nice-table.html +38 -38
- package/src/components/nice-table/nice-table.js +60 -60
- package/src/components/nice-table/nice-table.scss +111 -111
- package/src/components/nice-time-picker/nice-time-picker.html +43 -43
- package/src/components/nice-time-picker/nice-time-picker.js +85 -85
- package/src/components/nice-time-picker/nice-time-picker.scss +37 -37
- package/src/components/nice-title/nice-title.html +3 -3
- package/src/components/nice-title/nice-title.js +21 -21
- package/src/components/nice-toast/nice-toast.html +2 -2
- package/src/components/nice-toast/nice-toast.js +56 -56
- package/src/components/nice-toast/nice-toast.scss +74 -74
- package/src/components/nice-toggle/nice-toggle.html +12 -12
- package/src/components/nice-toggle/nice-toggle.js +55 -54
- package/src/components/nice-toggle/nice-toggle.scss +131 -131
- package/src/components/nice-tooltip/_nice-tooltip.scss +71 -71
- package/src/components/nice-tooltip/nice-tooltip.js +23 -23
- package/src/components/nice-upload/nice-upload.html +22 -22
- package/src/components/nice-upload/nice-upload.js +159 -159
- package/src/components/nice-upload/nice-upload.scss +85 -85
- package/src/components/nice-wrapper/_nice-wrapper.scss +87 -87
- package/src/components/nice-wrapper/nice-wrapper.html +12 -12
- package/src/components/nice-wrapper/nice-wrapper.js +44 -44
- package/src/components/nice-yesno/nice-yesno.html +14 -14
- package/src/components/nice-yesno/nice-yesno.js +111 -111
- package/src/components/nice-yesno/nice-yesno.scss +95 -95
- package/src/filters/nice-date.js +17 -17
- package/src/filters/nice-highlight.js +16 -16
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.html +30 -30
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.js +67 -67
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.scss +19 -19
- package/src/nice.js +2 -2
- package/src/services/nice-service.js +22 -22
- package/src/styles/_bootstrap-variables.scss +178 -178
- package/src/styles/_nice-buttons.scss +612 -612
- package/src/styles/_nice-common.scss +471 -471
- package/src/styles/_nice-ngdialog.scss +85 -85
- package/src/styles/_nice-spacing.scss +283 -283
- package/src/styles/_nice.scss +67 -67
- package/src/styles/_variables.scss +198 -198
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:nicePill
|
|
6
|
-
* @description
|
|
7
|
-
* # nicePill
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('nicePill', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-pill/nice-pill.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
transclude: true,
|
|
15
|
-
scope: {
|
|
16
|
-
model: '=',
|
|
17
|
-
valueKey: '@',
|
|
18
|
-
canDelete: '@',
|
|
19
|
-
onDelete: '=?',
|
|
20
|
-
},
|
|
21
|
-
controller: function ($scope) {
|
|
22
|
-
if (!$scope.valueKey) $scope.valueKey = "value";
|
|
23
|
-
|
|
24
|
-
$scope.handleDelete = function () {
|
|
25
|
-
$scope.onDelete($scope.model)
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:nicePill
|
|
6
|
+
* @description
|
|
7
|
+
* # nicePill
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('nicePill', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-pill/nice-pill.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
transclude: true,
|
|
15
|
+
scope: {
|
|
16
|
+
model: '=',
|
|
17
|
+
valueKey: '@',
|
|
18
|
+
canDelete: '@',
|
|
19
|
+
onDelete: '=?',
|
|
20
|
+
},
|
|
21
|
+
controller: function ($scope) {
|
|
22
|
+
if (!$scope.valueKey) $scope.valueKey = "value";
|
|
23
|
+
|
|
24
|
+
$scope.handleDelete = function () {
|
|
25
|
+
$scope.onDelete($scope.model)
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
.nice-pills {
|
|
2
|
-
display: flex;
|
|
3
|
-
gap: 0.2rem;
|
|
4
|
-
flex-wrap: wrap;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.nice-pill {
|
|
8
|
-
background: var(--nice-primary-color);
|
|
9
|
-
color: white;
|
|
10
|
-
border-radius: 1rem;
|
|
11
|
-
padding: 2px 8px;
|
|
12
|
-
font-size: 0.8em;
|
|
13
|
-
position: relative;
|
|
14
|
-
|
|
15
|
-
display: flex;
|
|
16
|
-
align-items: center;
|
|
17
|
-
gap: 0.2rem;
|
|
18
|
-
|
|
19
|
-
.nice-pill-remove {
|
|
20
|
-
margin: 0;
|
|
21
|
-
padding: 0;
|
|
22
|
-
min-height: auto;
|
|
23
|
-
border: 0 none;
|
|
24
|
-
color: white;
|
|
25
|
-
}
|
|
1
|
+
.nice-pills {
|
|
2
|
+
display: flex;
|
|
3
|
+
gap: 0.2rem;
|
|
4
|
+
flex-wrap: wrap;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.nice-pill {
|
|
8
|
+
background: var(--nice-primary-color);
|
|
9
|
+
color: white;
|
|
10
|
+
border-radius: 1rem;
|
|
11
|
+
padding: 2px 8px;
|
|
12
|
+
font-size: 0.8em;
|
|
13
|
+
position: relative;
|
|
14
|
+
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 0.2rem;
|
|
18
|
+
|
|
19
|
+
.nice-pill-remove {
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
min-height: auto;
|
|
23
|
+
border: 0 none;
|
|
24
|
+
color: white;
|
|
25
|
+
}
|
|
26
26
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<div class="nice-popup" click-outside="close()">
|
|
2
|
-
<div class="nice-popup-target" ng-transclude="target" ng-click="toggle()"></div>
|
|
3
|
-
<div class="nice-popup-content">
|
|
4
|
-
<div class="nice-popup-arrow" data-popper-arrow ng-show="isOpen && showArrow"></div>
|
|
5
|
-
<div ng-transclude="content" ng-if="isOpen"></div>
|
|
6
|
-
</div>
|
|
1
|
+
<div class="nice-popup" click-outside="close()">
|
|
2
|
+
<div class="nice-popup-target" ng-transclude="target" ng-click="toggle()"></div>
|
|
3
|
+
<div class="nice-popup-content">
|
|
4
|
+
<div class="nice-popup-arrow" data-popper-arrow ng-show="isOpen && showArrow"></div>
|
|
5
|
+
<div ng-transclude="content" ng-if="isOpen"></div>
|
|
6
|
+
</div>
|
|
7
7
|
</div>
|
|
@@ -1,123 +1,123 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:nicePopup
|
|
6
|
-
* @description
|
|
7
|
-
* # nicePopup
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('nicePopup', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-popup/nice-popup.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
transclude: {
|
|
15
|
-
'target': '?nicePopupTarget',
|
|
16
|
-
'content': '?nicePopupContent'
|
|
17
|
-
},
|
|
18
|
-
scope: {
|
|
19
|
-
offsetDistance: '@', // distance, displaces the popper away from, or toward, the reference element in the direction of its placement
|
|
20
|
-
offsetSkidding: '@', // skidding, displaces the popper along the reference element.
|
|
21
|
-
placement: '@', // Describes the preferred placement of the popper
|
|
22
|
-
strategy: '@',
|
|
23
|
-
showArrow: '@',
|
|
24
|
-
onChange: '&?',
|
|
25
|
-
},
|
|
26
|
-
controller: function ($scope, $element, $timeout) {
|
|
27
|
-
$scope.isOpen = false;
|
|
28
|
-
if (!$scope.showArrow) { $scope.showArrow = false; }
|
|
29
|
-
if (!$scope.offsetDistance && $scope.showArrow) { $scope.offsetDistance = 8; }
|
|
30
|
-
if (!$scope.offsetDistance) { $scope.offsetDistance = 5; }
|
|
31
|
-
if (!$scope.offsetSkidding) { $scope.offsetSkidding = 0; }
|
|
32
|
-
if (!$scope.placement) { $scope.placement = "auto"; }
|
|
33
|
-
if (!$scope.strategy) { $scope.strategy = "fixed"; }
|
|
34
|
-
|
|
35
|
-
// Placements
|
|
36
|
-
// [
|
|
37
|
-
// 'auto',
|
|
38
|
-
// 'auto-start',
|
|
39
|
-
// 'auto-end',
|
|
40
|
-
// 'top',
|
|
41
|
-
// 'top-start',
|
|
42
|
-
// 'top-end',
|
|
43
|
-
// 'bottom',
|
|
44
|
-
// 'bottom-start',
|
|
45
|
-
// 'bottom-end',
|
|
46
|
-
// 'right',
|
|
47
|
-
// 'right-start',
|
|
48
|
-
// 'right-end',
|
|
49
|
-
// 'left',
|
|
50
|
-
// 'left-start',
|
|
51
|
-
// 'left-end'
|
|
52
|
-
// ]
|
|
53
|
-
|
|
54
|
-
// Setup popper
|
|
55
|
-
// https://popper.js.org/docs/v2/constructors/
|
|
56
|
-
$scope.setupPopper = function () {
|
|
57
|
-
var target = $element[0].getElementsByClassName('nice-popup-target')[0];
|
|
58
|
-
var content = $element[0].getElementsByClassName('nice-popup-content')[0];
|
|
59
|
-
$scope.popper = Popper.createPopper(target, content, {
|
|
60
|
-
placement: $scope.placement,
|
|
61
|
-
strategy: $scope.strategy,
|
|
62
|
-
scroll: true,
|
|
63
|
-
resize: true,
|
|
64
|
-
modifiers: [
|
|
65
|
-
{
|
|
66
|
-
name: 'offset',
|
|
67
|
-
options: {
|
|
68
|
-
offset: [$scope.offsetSkidding, $scope.offsetDistance],
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
name: 'arrow',
|
|
73
|
-
options: {
|
|
74
|
-
padding: 5, // 5px from the edges of the popper
|
|
75
|
-
},
|
|
76
|
-
},
|
|
77
|
-
// {
|
|
78
|
-
// name: "sameWidth",
|
|
79
|
-
// enabled: true,
|
|
80
|
-
// phase: "beforeWrite",
|
|
81
|
-
// requires: ["computeStyles"],
|
|
82
|
-
// fn: function (e) {
|
|
83
|
-
// var state = e.state;
|
|
84
|
-
// state.styles.popper.width = state.rects.reference.width + "px";
|
|
85
|
-
// },
|
|
86
|
-
// effect: function (e) {
|
|
87
|
-
// var state = e.state;
|
|
88
|
-
// state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
|
|
89
|
-
// }
|
|
90
|
-
// }
|
|
91
|
-
],
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
$timeout(function () {
|
|
96
|
-
$scope.setupPopper();
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
// -----------------------------------Open -----------------------------------
|
|
100
|
-
$scope.toggle = function () {
|
|
101
|
-
if ($scope.isOpen) {
|
|
102
|
-
$scope.close();
|
|
103
|
-
} else {
|
|
104
|
-
$scope.open();
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
$scope.close = function () {
|
|
109
|
-
$scope.isOpen = false;
|
|
110
|
-
if ($scope.onChange) $scope.onChange($scope.isOpen);
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
$scope.open = function () {
|
|
114
|
-
$scope.popper.update();
|
|
115
|
-
$scope.isOpen = true;
|
|
116
|
-
if ($scope.onChange) $scope.onChange($scope.isOpen);
|
|
117
|
-
$timeout(function () {
|
|
118
|
-
$scope.popper.update();
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:nicePopup
|
|
6
|
+
* @description
|
|
7
|
+
* # nicePopup
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('nicePopup', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-popup/nice-popup.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
transclude: {
|
|
15
|
+
'target': '?nicePopupTarget',
|
|
16
|
+
'content': '?nicePopupContent'
|
|
17
|
+
},
|
|
18
|
+
scope: {
|
|
19
|
+
offsetDistance: '@', // distance, displaces the popper away from, or toward, the reference element in the direction of its placement
|
|
20
|
+
offsetSkidding: '@', // skidding, displaces the popper along the reference element.
|
|
21
|
+
placement: '@', // Describes the preferred placement of the popper
|
|
22
|
+
strategy: '@',
|
|
23
|
+
showArrow: '@',
|
|
24
|
+
onChange: '&?',
|
|
25
|
+
},
|
|
26
|
+
controller: function ($scope, $element, $timeout) {
|
|
27
|
+
$scope.isOpen = false;
|
|
28
|
+
if (!$scope.showArrow) { $scope.showArrow = false; }
|
|
29
|
+
if (!$scope.offsetDistance && $scope.showArrow) { $scope.offsetDistance = 8; }
|
|
30
|
+
if (!$scope.offsetDistance) { $scope.offsetDistance = 5; }
|
|
31
|
+
if (!$scope.offsetSkidding) { $scope.offsetSkidding = 0; }
|
|
32
|
+
if (!$scope.placement) { $scope.placement = "auto"; }
|
|
33
|
+
if (!$scope.strategy) { $scope.strategy = "fixed"; }
|
|
34
|
+
|
|
35
|
+
// Placements
|
|
36
|
+
// [
|
|
37
|
+
// 'auto',
|
|
38
|
+
// 'auto-start',
|
|
39
|
+
// 'auto-end',
|
|
40
|
+
// 'top',
|
|
41
|
+
// 'top-start',
|
|
42
|
+
// 'top-end',
|
|
43
|
+
// 'bottom',
|
|
44
|
+
// 'bottom-start',
|
|
45
|
+
// 'bottom-end',
|
|
46
|
+
// 'right',
|
|
47
|
+
// 'right-start',
|
|
48
|
+
// 'right-end',
|
|
49
|
+
// 'left',
|
|
50
|
+
// 'left-start',
|
|
51
|
+
// 'left-end'
|
|
52
|
+
// ]
|
|
53
|
+
|
|
54
|
+
// Setup popper
|
|
55
|
+
// https://popper.js.org/docs/v2/constructors/
|
|
56
|
+
$scope.setupPopper = function () {
|
|
57
|
+
var target = $element[0].getElementsByClassName('nice-popup-target')[0];
|
|
58
|
+
var content = $element[0].getElementsByClassName('nice-popup-content')[0];
|
|
59
|
+
$scope.popper = Popper.createPopper(target, content, {
|
|
60
|
+
placement: $scope.placement,
|
|
61
|
+
strategy: $scope.strategy,
|
|
62
|
+
scroll: true,
|
|
63
|
+
resize: true,
|
|
64
|
+
modifiers: [
|
|
65
|
+
{
|
|
66
|
+
name: 'offset',
|
|
67
|
+
options: {
|
|
68
|
+
offset: [$scope.offsetSkidding, $scope.offsetDistance],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'arrow',
|
|
73
|
+
options: {
|
|
74
|
+
padding: 5, // 5px from the edges of the popper
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
// {
|
|
78
|
+
// name: "sameWidth",
|
|
79
|
+
// enabled: true,
|
|
80
|
+
// phase: "beforeWrite",
|
|
81
|
+
// requires: ["computeStyles"],
|
|
82
|
+
// fn: function (e) {
|
|
83
|
+
// var state = e.state;
|
|
84
|
+
// state.styles.popper.width = state.rects.reference.width + "px";
|
|
85
|
+
// },
|
|
86
|
+
// effect: function (e) {
|
|
87
|
+
// var state = e.state;
|
|
88
|
+
// state.elements.popper.style.width = state.elements.reference.offsetWidth + "px";
|
|
89
|
+
// }
|
|
90
|
+
// }
|
|
91
|
+
],
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
$timeout(function () {
|
|
96
|
+
$scope.setupPopper();
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// -----------------------------------Open -----------------------------------
|
|
100
|
+
$scope.toggle = function () {
|
|
101
|
+
if ($scope.isOpen) {
|
|
102
|
+
$scope.close();
|
|
103
|
+
} else {
|
|
104
|
+
$scope.open();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
$scope.close = function () {
|
|
109
|
+
$scope.isOpen = false;
|
|
110
|
+
if ($scope.onChange) $scope.onChange($scope.isOpen);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
$scope.open = function () {
|
|
114
|
+
$scope.popper.update();
|
|
115
|
+
$scope.isOpen = true;
|
|
116
|
+
if ($scope.onChange) $scope.onChange($scope.isOpen);
|
|
117
|
+
$timeout(function () {
|
|
118
|
+
$scope.popper.update();
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
123
|
});
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
.nice-popup {
|
|
2
|
-
.nice-popup-target {
|
|
3
|
-
display: inline-block;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.nice-popup-arrow[data-hide] {
|
|
7
|
-
visibility: hidden;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.nice-popup-arrow,
|
|
11
|
-
.nice-popup-arrow::before {
|
|
12
|
-
position: absolute;
|
|
13
|
-
width: 8px;
|
|
14
|
-
height: 8px;
|
|
15
|
-
z-index: -1;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.nice-popup-arrow::before {
|
|
19
|
-
content: '';
|
|
20
|
-
transform: rotate(45deg);
|
|
21
|
-
background: #ffffff;
|
|
22
|
-
border: 1px solid $nice-border-color;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.nice-popup-content {
|
|
26
|
-
z-index: 1;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.nice-popup-content[data-popper-placement^='top']>.nice-popup-arrow {
|
|
30
|
-
bottom: -4px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.nice-popup-content[data-popper-placement^='bottom']>.nice-popup-arrow {
|
|
34
|
-
top: -4px;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.nice-popup-content[data-popper-placement^='left']>.nice-popup-arrow {
|
|
38
|
-
right: -4px;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.nice-popup-content[data-popper-placement^='right']>.nice-popup-arrow {
|
|
42
|
-
left: -4px;
|
|
43
|
-
}
|
|
1
|
+
.nice-popup {
|
|
2
|
+
.nice-popup-target {
|
|
3
|
+
display: inline-block;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.nice-popup-arrow[data-hide] {
|
|
7
|
+
visibility: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.nice-popup-arrow,
|
|
11
|
+
.nice-popup-arrow::before {
|
|
12
|
+
position: absolute;
|
|
13
|
+
width: 8px;
|
|
14
|
+
height: 8px;
|
|
15
|
+
z-index: -1;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.nice-popup-arrow::before {
|
|
19
|
+
content: '';
|
|
20
|
+
transform: rotate(45deg);
|
|
21
|
+
background: #ffffff;
|
|
22
|
+
border: 1px solid $nice-border-color;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.nice-popup-content {
|
|
26
|
+
z-index: 1;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.nice-popup-content[data-popper-placement^='top']>.nice-popup-arrow {
|
|
30
|
+
bottom: -4px;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.nice-popup-content[data-popper-placement^='bottom']>.nice-popup-arrow {
|
|
34
|
+
top: -4px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.nice-popup-content[data-popper-placement^='left']>.nice-popup-arrow {
|
|
38
|
+
right: -4px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.nice-popup-content[data-popper-placement^='right']>.nice-popup-arrow {
|
|
42
|
+
left: -4px;
|
|
43
|
+
}
|
|
44
44
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<div class="nice-component nice-progress-bar" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
|
-
<div class="row">
|
|
3
|
-
<!------------------------- Title ------------------------->
|
|
4
|
-
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
5
|
-
|
|
6
|
-
<!------------------------- Field ------------------------->
|
|
7
|
-
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
8
|
-
<div class="progress">
|
|
9
|
-
<div class="progress-value">{{ value }} / {{ max }}</div>
|
|
10
|
-
<div class="progress-bar" ng-style="{'width': percentage+'%', 'background': color}">
|
|
11
|
-
<div class="progress-value" ng-style="{'width': width+'px'}">{{ value }} / {{ max }}</div>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
1
|
+
<div class="nice-component nice-progress-bar" ng-class="{ 'margin-bottom-0': noMargin, 'nice-component-inline': isInline }">
|
|
2
|
+
<div class="row">
|
|
3
|
+
<!------------------------- Title ------------------------->
|
|
4
|
+
<nice-title text="title || niceTitle" help="help" required="required" label-width="labelWidth"></nice-title>
|
|
5
|
+
|
|
6
|
+
<!------------------------- Field ------------------------->
|
|
7
|
+
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
8
|
+
<div class="progress">
|
|
9
|
+
<div class="progress-value">{{ value }} / {{ max }}</div>
|
|
10
|
+
<div class="progress-bar" ng-style="{'width': percentage+'%', 'background': color}">
|
|
11
|
+
<div class="progress-value" ng-style="{'width': width+'px'}">{{ value }} / {{ max }}</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
16
|
</div>
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceProgressBar
|
|
6
|
-
* @description
|
|
7
|
-
* # niceProgressBar
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceProgressBar', function() {
|
|
11
|
-
return {
|
|
12
|
-
restrict: 'E',
|
|
13
|
-
replace: true,
|
|
14
|
-
templateUrl: 'src/components/nice-progress-bar/nice-progress-bar.html',
|
|
15
|
-
scope: {
|
|
16
|
-
niceTitle: '@',
|
|
17
|
-
title: '@',
|
|
18
|
-
noMargin: '@',
|
|
19
|
-
value: '=',
|
|
20
|
-
max: '=',
|
|
21
|
-
color: '=',
|
|
22
|
-
isInline: '=',
|
|
23
|
-
help: '@'
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
controller: function($scope, $element, $timeout) {
|
|
27
|
-
$scope.width = 0;
|
|
28
|
-
$scope.resize = function(){
|
|
29
|
-
$timeout(function() {
|
|
30
|
-
$scope.width = $element[0].getElementsByClassName("progress")[0].offsetWidth;
|
|
31
|
-
},100);
|
|
32
|
-
};
|
|
33
|
-
window.onresize = function() {
|
|
34
|
-
$scope.resize();
|
|
35
|
-
};
|
|
36
|
-
$scope.resize();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
$scope.$watch("value", function(valueNew, valueOld){
|
|
41
|
-
$scope.calculate();
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
$scope.$watch("max", function(valueNew, valueOld){
|
|
45
|
-
$scope.calculate();
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
$scope.calculate = function(){
|
|
49
|
-
$scope.percentage = ($scope.value / $scope.max) * 100;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
$scope.calculate();
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceProgressBar
|
|
6
|
+
* @description
|
|
7
|
+
* # niceProgressBar
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceProgressBar', function() {
|
|
11
|
+
return {
|
|
12
|
+
restrict: 'E',
|
|
13
|
+
replace: true,
|
|
14
|
+
templateUrl: 'src/components/nice-progress-bar/nice-progress-bar.html',
|
|
15
|
+
scope: {
|
|
16
|
+
niceTitle: '@',
|
|
17
|
+
title: '@',
|
|
18
|
+
noMargin: '@',
|
|
19
|
+
value: '=',
|
|
20
|
+
max: '=',
|
|
21
|
+
color: '=',
|
|
22
|
+
isInline: '=',
|
|
23
|
+
help: '@'
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
controller: function($scope, $element, $timeout) {
|
|
27
|
+
$scope.width = 0;
|
|
28
|
+
$scope.resize = function(){
|
|
29
|
+
$timeout(function() {
|
|
30
|
+
$scope.width = $element[0].getElementsByClassName("progress")[0].offsetWidth;
|
|
31
|
+
},100);
|
|
32
|
+
};
|
|
33
|
+
window.onresize = function() {
|
|
34
|
+
$scope.resize();
|
|
35
|
+
};
|
|
36
|
+
$scope.resize();
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
$scope.$watch("value", function(valueNew, valueOld){
|
|
41
|
+
$scope.calculate();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
$scope.$watch("max", function(valueNew, valueOld){
|
|
45
|
+
$scope.calculate();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
$scope.calculate = function(){
|
|
49
|
+
$scope.percentage = ($scope.value / $scope.max) * 100;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
$scope.calculate();
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
});
|