nice-elements 1.12.9 → 1.12.11
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 +18 -18
- package/CHANGELOG.md +585 -573
- package/LICENSE.md +21 -21
- package/README.md +102 -102
- package/bower.json +17 -17
- package/dist/nice.js +9187 -11517
- package/dist/nice.min.js +1 -1
- package/dist/style.css +12 -12
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +8 -8
- package/eslint.config.mjs +32 -32
- package/package.json +44 -44
- package/src/components/nice-alert/nice-alert.html +6 -6
- package/src/components/nice-alert/nice-alert.js +29 -29
- package/src/components/nice-alert/nice-alert.scss +59 -59
- package/src/components/nice-avatar/nice-avatar.js +122 -122
- package/src/components/nice-avatar/nice-avatar.scss +4 -4
- 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 +346 -346
- package/src/components/nice-calendar/nice-calendar.scss +288 -288
- package/src/components/nice-checkbox/nice-checkbox.html +20 -9
- package/src/components/nice-checkbox/nice-checkbox.js +38 -37
- package/src/components/nice-checkbox/nice-checkbox.scss +120 -120
- package/src/components/nice-choice/nice-choice.html +18 -18
- package/src/components/nice-choice/nice-choice.js +211 -211
- package/src/components/nice-choice/nice-choice.scss +110 -110
- 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 +82 -82
- package/src/components/nice-date/nice-date.js +350 -350
- package/src/components/nice-date/nice-date.scss +305 -305
- package/src/components/nice-date-input/nice-date-input.html +56 -56
- package/src/components/nice-date-input/nice-date-input.js +143 -143
- package/src/components/nice-date-input/nice-date-input.scss +55 -55
- 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 +175 -175
- 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 +517 -517
- package/src/components/nice-dropdown/nice-dropdown.scss +262 -262
- package/src/components/nice-dropdown-date/nice-dropdown-date.html +28 -28
- package/src/components/nice-dropdown-date/nice-dropdown-date.js +132 -132
- package/src/components/nice-dropdown-date/nice-dropdown-date.scss +87 -87
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +44 -44
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +330 -330
- 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 +58 -58
- package/src/components/nice-help/nice-help.scss +78 -78
- package/src/components/nice-input/nice-input.html +47 -47
- package/src/components/nice-input/nice-input.js +251 -251
- 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 +26 -26
- 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 +172 -172
- package/src/components/nice-number/nice-number.scss +18 -18
- package/src/components/nice-on-scroll/nice-on-scroll.js +17 -17
- 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 +243 -243
- 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 +267 -267
- 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 +1332 -1320
- package/src/components/nice-svgs/nice-svgs.js +19 -19
- 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 +112 -112
- 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 +6 -6
- package/src/components/nice-title/nice-title.js +22 -22
- 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 +57 -57
- package/src/components/nice-toggle/nice-toggle.scss +131 -131
- package/src/components/nice-upload/nice-upload.html +22 -22
- package/src/components/nice-upload/nice-upload.js +160 -159
- package/src/components/nice-upload/nice-upload.scss +85 -85
- package/src/components/nice-view/_nice-view.scss +63 -63
- package/src/components/nice-view/nice-view.html +12 -12
- package/src/components/nice-view/nice-view.js +29 -30
- package/src/components/nice-virtual-scroll/_nice-virtual-scroll.scss +17 -17
- package/src/components/nice-virtual-scroll/nice-virtual-scroll.html +12 -12
- package/src/components/nice-virtual-scroll/nice-virtual-scroll.js +70 -70
- 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/directives/nice-click-outside.js +105 -105
- package/src/directives/nice-infinite-loader.js +27 -27
- package/src/directives/nice-tooltip/_nice-tooltip.scss +55 -55
- package/src/directives/nice-tooltip/nice-tooltip.js +84 -84
- 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 +479 -479
- package/src/styles/_nice-ngdialog.scss +85 -85
- package/src/styles/_nice-spacing.scss +283 -283
- package/src/styles/_nice.scss +75 -75
- package/src/styles/_variables.scss +194 -194
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceView
|
|
6
|
-
* @description
|
|
7
|
-
* # niceView
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceView', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-view/nice-view.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
$scope.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceView
|
|
6
|
+
* @description
|
|
7
|
+
* # niceView
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceView', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-view/nice-view.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
transclude: {
|
|
15
|
+
'header': '?niceViewHeader',
|
|
16
|
+
'footer': '?niceViewFooter'
|
|
17
|
+
},
|
|
18
|
+
scope: {
|
|
19
|
+
niceTitle: '@',
|
|
20
|
+
niceSubtitle: '@',
|
|
21
|
+
niceIcon: '@',
|
|
22
|
+
niceSubmit: '&?',
|
|
23
|
+
},
|
|
24
|
+
controller: function ($scope, $transclude) {
|
|
25
|
+
$scope.hasHeader = $transclude.isSlotFilled('header') || $scope.niceTitle || $scope.niceSubtitle || $scope.niceIcon;
|
|
26
|
+
$scope.hasFooter = $transclude.isSlotFilled('footer');
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
.nice-virtual-scroll {
|
|
2
|
-
position: relative;
|
|
3
|
-
width: 100%;
|
|
4
|
-
overflow-y: scroll;
|
|
5
|
-
|
|
6
|
-
.nice-virtual-scroll-content {
|
|
7
|
-
position: relative;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.nice-virtual-scroll-item, .nice-virtual-scroll-append {
|
|
11
|
-
position: absolute;
|
|
12
|
-
width: 100%;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.nice-virtual-scroll-append {
|
|
16
|
-
bottom: 0;
|
|
17
|
-
}
|
|
1
|
+
.nice-virtual-scroll {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
overflow-y: scroll;
|
|
5
|
+
|
|
6
|
+
.nice-virtual-scroll-content {
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.nice-virtual-scroll-item, .nice-virtual-scroll-append {
|
|
11
|
+
position: absolute;
|
|
12
|
+
width: 100%;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.nice-virtual-scroll-append {
|
|
16
|
+
bottom: 0;
|
|
17
|
+
}
|
|
18
18
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<div class="nice-virtual-scroll" nice-on-scroll="onScroll()">
|
|
2
|
-
<div class="nice-virtual-scroll-content" ng-style="{ height: totalContentHeight + 'px' }">
|
|
3
|
-
<div
|
|
4
|
-
class="nice-virtual-scroll-item"
|
|
5
|
-
ng-repeat="item in visibleItems track by $index"
|
|
6
|
-
ng-style="{ top: item.offsetTop + 'px', height: item.height + 'px' }"
|
|
7
|
-
>
|
|
8
|
-
<ng-transclude item="item">{{ item.data }}</ng-transclude>
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
<div class="nice-virtual-scroll-append" ng-if="hasAppend" ng-style="{ height: rowHeight + 'px' }" ng-transclude="append"></div>
|
|
12
|
-
</div>
|
|
1
|
+
<div class="nice-virtual-scroll" nice-on-scroll="onScroll()">
|
|
2
|
+
<div class="nice-virtual-scroll-content" ng-style="{ height: totalContentHeight + 'px' }">
|
|
3
|
+
<div
|
|
4
|
+
class="nice-virtual-scroll-item"
|
|
5
|
+
ng-repeat="item in visibleItems track by $index"
|
|
6
|
+
ng-style="{ top: item.offsetTop + 'px', height: item.height + 'px' }"
|
|
7
|
+
>
|
|
8
|
+
<ng-transclude item="item">{{ item.data }}</ng-transclude>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="nice-virtual-scroll-append" ng-if="hasAppend" ng-style="{ height: rowHeight + 'px' }" ng-transclude="append"></div>
|
|
12
|
+
</div>
|
|
13
13
|
</div>
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceVirtualScroll
|
|
6
|
-
* @description
|
|
7
|
-
* # niceVirtualScroll
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceVirtualScroll', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-virtual-scroll/nice-virtual-scroll.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
transclude: {
|
|
15
|
-
'append': '?niceVirtualScrollAppend',
|
|
16
|
-
},
|
|
17
|
-
replace: true,
|
|
18
|
-
scope: {
|
|
19
|
-
data: "=",
|
|
20
|
-
rowHeight: "@"
|
|
21
|
-
},
|
|
22
|
-
controller: function ($scope, $element, $timeout, $transclude) {
|
|
23
|
-
$scope.hasAppend = $transclude.isSlotFilled('append');
|
|
24
|
-
if (!$scope.rowHeight) $scope.rowHeight = 50;
|
|
25
|
-
|
|
26
|
-
// ------------------------- Prepare data -------------------------
|
|
27
|
-
$scope.prepareData = function() {
|
|
28
|
-
$scope.items = Array.from($scope.data, (data, index) => ({
|
|
29
|
-
id: index + 1,
|
|
30
|
-
height: Number($scope.rowHeight), // Default placeholder height
|
|
31
|
-
offsetTop: index * Number($scope.rowHeight), // Approximate offset
|
|
32
|
-
data: data
|
|
33
|
-
}));
|
|
34
|
-
|
|
35
|
-
$scope.totalContentHeight = $scope.items.length * Number($scope.rowHeight); // Initial placeholder height * number of items
|
|
36
|
-
if ($scope.hasAppend) $scope.totalContentHeight += Number($scope.rowHeight);
|
|
37
|
-
$scope.onScroll();
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
// ------------------------- On scroll -------------------------
|
|
41
|
-
$scope.onScroll = function() {
|
|
42
|
-
const container = $element[0].getBoundingClientRect();
|
|
43
|
-
const scrollTop = $element[0].scrollTop;
|
|
44
|
-
const viewportHeight = container.height;
|
|
45
|
-
|
|
46
|
-
const startIndex = $scope.items.findIndex(item => item.offsetTop + item.height > scrollTop);
|
|
47
|
-
let endIndex = $scope.items.findIndex(item => item.offsetTop > scrollTop + viewportHeight);
|
|
48
|
-
if (endIndex == -1) endIndex = $scope.items.length - 1;
|
|
49
|
-
|
|
50
|
-
$scope.visibleItems = $scope.items.slice(startIndex, endIndex + 1);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
// ------------------------- Watch for changes from outside -------------------------
|
|
54
|
-
$scope.$watchCollection('data', function () {
|
|
55
|
-
$timeout(function() {
|
|
56
|
-
$scope.prepareData();
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// ------------------------- Watch for element resize -------------------------
|
|
61
|
-
new ResizeObserver(function() {
|
|
62
|
-
$timeout(function() {
|
|
63
|
-
$scope.onScroll();
|
|
64
|
-
});
|
|
65
|
-
}).observe($element[0]);
|
|
66
|
-
|
|
67
|
-
// Initial render
|
|
68
|
-
$scope.prepareData();
|
|
69
|
-
}
|
|
70
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceVirtualScroll
|
|
6
|
+
* @description
|
|
7
|
+
* # niceVirtualScroll
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceVirtualScroll', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-virtual-scroll/nice-virtual-scroll.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
transclude: {
|
|
15
|
+
'append': '?niceVirtualScrollAppend',
|
|
16
|
+
},
|
|
17
|
+
replace: true,
|
|
18
|
+
scope: {
|
|
19
|
+
data: "=",
|
|
20
|
+
rowHeight: "@"
|
|
21
|
+
},
|
|
22
|
+
controller: function ($scope, $element, $timeout, $transclude) {
|
|
23
|
+
$scope.hasAppend = $transclude.isSlotFilled('append');
|
|
24
|
+
if (!$scope.rowHeight) $scope.rowHeight = 50;
|
|
25
|
+
|
|
26
|
+
// ------------------------- Prepare data -------------------------
|
|
27
|
+
$scope.prepareData = function() {
|
|
28
|
+
$scope.items = Array.from($scope.data, (data, index) => ({
|
|
29
|
+
id: index + 1,
|
|
30
|
+
height: Number($scope.rowHeight), // Default placeholder height
|
|
31
|
+
offsetTop: index * Number($scope.rowHeight), // Approximate offset
|
|
32
|
+
data: data
|
|
33
|
+
}));
|
|
34
|
+
|
|
35
|
+
$scope.totalContentHeight = $scope.items.length * Number($scope.rowHeight); // Initial placeholder height * number of items
|
|
36
|
+
if ($scope.hasAppend) $scope.totalContentHeight += Number($scope.rowHeight);
|
|
37
|
+
$scope.onScroll();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// ------------------------- On scroll -------------------------
|
|
41
|
+
$scope.onScroll = function() {
|
|
42
|
+
const container = $element[0].getBoundingClientRect();
|
|
43
|
+
const scrollTop = $element[0].scrollTop;
|
|
44
|
+
const viewportHeight = container.height;
|
|
45
|
+
|
|
46
|
+
const startIndex = $scope.items.findIndex(item => item.offsetTop + item.height > scrollTop);
|
|
47
|
+
let endIndex = $scope.items.findIndex(item => item.offsetTop > scrollTop + viewportHeight);
|
|
48
|
+
if (endIndex == -1) endIndex = $scope.items.length - 1;
|
|
49
|
+
|
|
50
|
+
$scope.visibleItems = $scope.items.slice(startIndex, endIndex + 1);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// ------------------------- Watch for changes from outside -------------------------
|
|
54
|
+
$scope.$watchCollection('data', function () {
|
|
55
|
+
$timeout(function() {
|
|
56
|
+
$scope.prepareData();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// ------------------------- Watch for element resize -------------------------
|
|
61
|
+
new ResizeObserver(function() {
|
|
62
|
+
$timeout(function() {
|
|
63
|
+
$scope.onScroll();
|
|
64
|
+
});
|
|
65
|
+
}).observe($element[0]);
|
|
66
|
+
|
|
67
|
+
// Initial render
|
|
68
|
+
$scope.prepareData();
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
71
|
});
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
.nice-wrapper {
|
|
2
|
-
border: 1px solid var(--nice-card-border);
|
|
3
|
-
background: var(--nice-card-bg);
|
|
4
|
-
border-radius: var(--nice-border-radius);
|
|
5
|
-
margin-bottom: 2rem;
|
|
6
|
-
position: relative;
|
|
7
|
-
|
|
8
|
-
&.collapsable {
|
|
9
|
-
.nice-wrapper-header {
|
|
10
|
-
cursor: pointer;
|
|
11
|
-
|
|
12
|
-
&:hover {
|
|
13
|
-
background: var(--nice-hover-color);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.nice-wrapper-header,
|
|
19
|
-
.nice-wrapper-body,
|
|
20
|
-
.nice-wrapper-footer {
|
|
21
|
-
padding: var(--nice-card-padding);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.nice-wrapper-header {
|
|
25
|
-
display: flex;
|
|
26
|
-
align-items: center;
|
|
27
|
-
padding: var(--nice-card-padding);
|
|
28
|
-
|
|
29
|
-
.nice-wrapper-info {
|
|
30
|
-
flex-grow: 1;
|
|
31
|
-
|
|
32
|
-
.nice-wrapper-title {
|
|
33
|
-
font-size: 1.2em;
|
|
34
|
-
line-height: 1.2;
|
|
35
|
-
color: var(--nice-primary-color);
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.nice-wrapper-subtitle {
|
|
39
|
-
font-style: italic;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.nice-wrapper-toggle {
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
transition: transform 0.3s;
|
|
46
|
-
height: 20px;
|
|
47
|
-
width: 20px;
|
|
48
|
-
padding: 0px;
|
|
49
|
-
min-height: auto !important;
|
|
50
|
-
|
|
51
|
-
&.is-open {
|
|
52
|
-
transform: rotate(180deg);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
&.has-header {
|
|
58
|
-
.nice-wrapper-body {
|
|
59
|
-
padding-top: 0;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&.has-footer {
|
|
64
|
-
.nice-wrapper-body {
|
|
65
|
-
padding-bottom: 0;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&.nice-wrapper-sticky-footer {
|
|
70
|
-
.nice-wrapper-footer {
|
|
71
|
-
position: sticky;
|
|
72
|
-
bottom: calc(-1 * var(--nice-card-padding));
|
|
73
|
-
background: var(--nice-card-bg);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
&.nice-wrapper-sticky-header {
|
|
78
|
-
.nice-wrapper-header {
|
|
79
|
-
position: sticky;
|
|
80
|
-
top: calc(-1 * var(--nice-card-padding));
|
|
81
|
-
background: var(--nice-card-bg);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.no-padding {
|
|
86
|
-
padding: 0;
|
|
87
|
-
}
|
|
1
|
+
.nice-wrapper {
|
|
2
|
+
border: 1px solid var(--nice-card-border);
|
|
3
|
+
background: var(--nice-card-bg);
|
|
4
|
+
border-radius: var(--nice-border-radius);
|
|
5
|
+
margin-bottom: 2rem;
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
&.collapsable {
|
|
9
|
+
.nice-wrapper-header {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
background: var(--nice-hover-color);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.nice-wrapper-header,
|
|
19
|
+
.nice-wrapper-body,
|
|
20
|
+
.nice-wrapper-footer {
|
|
21
|
+
padding: var(--nice-card-padding);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.nice-wrapper-header {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: var(--nice-card-padding);
|
|
28
|
+
|
|
29
|
+
.nice-wrapper-info {
|
|
30
|
+
flex-grow: 1;
|
|
31
|
+
|
|
32
|
+
.nice-wrapper-title {
|
|
33
|
+
font-size: 1.2em;
|
|
34
|
+
line-height: 1.2;
|
|
35
|
+
color: var(--nice-primary-color);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.nice-wrapper-subtitle {
|
|
39
|
+
font-style: italic;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.nice-wrapper-toggle {
|
|
44
|
+
flex-shrink: 0;
|
|
45
|
+
transition: transform 0.3s;
|
|
46
|
+
height: 20px;
|
|
47
|
+
width: 20px;
|
|
48
|
+
padding: 0px;
|
|
49
|
+
min-height: auto !important;
|
|
50
|
+
|
|
51
|
+
&.is-open {
|
|
52
|
+
transform: rotate(180deg);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&.has-header {
|
|
58
|
+
.nice-wrapper-body {
|
|
59
|
+
padding-top: 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
&.has-footer {
|
|
64
|
+
.nice-wrapper-body {
|
|
65
|
+
padding-bottom: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.nice-wrapper-sticky-footer {
|
|
70
|
+
.nice-wrapper-footer {
|
|
71
|
+
position: sticky;
|
|
72
|
+
bottom: calc(-1 * var(--nice-card-padding));
|
|
73
|
+
background: var(--nice-card-bg);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&.nice-wrapper-sticky-header {
|
|
78
|
+
.nice-wrapper-header {
|
|
79
|
+
position: sticky;
|
|
80
|
+
top: calc(-1 * var(--nice-card-padding));
|
|
81
|
+
background: var(--nice-card-bg);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.no-padding {
|
|
86
|
+
padding: 0;
|
|
87
|
+
}
|
|
88
88
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<div class="nice-wrapper" ng-class="{ 'collapsable': collapsable, 'has-header': hasHeader, 'has-footer': hasFooter, 'nice-wrapper-sticky-footer': stickyFooter, 'nice-wrapper-sticky-header': stickyHeader }">
|
|
2
|
-
<div class="nice-wrapper-header" ng-if="hasHeader" ng-click="toggle()">
|
|
3
|
-
<div class="nice-wrapper-info">
|
|
4
|
-
<div class="nice-wrapper-title" ng-transclude="title">{{ title || niceTitle }}</div>
|
|
5
|
-
<div class="nice-wrapper-subtitle" ng-transclude="subtitle">{{ subtitle }}</div>
|
|
6
|
-
</div>
|
|
7
|
-
<button type="button" class="nice-wrapper-toggle btn btn-icon btn-default-naked" ng-if="collapsable" ng-class="{ 'is-open': isOpen }">
|
|
8
|
-
<nice-icon icon="icon-chevron-down"></nice-icon>
|
|
9
|
-
</button>
|
|
10
|
-
</div>
|
|
11
|
-
<div class="nice-wrapper-body" ng-class=" {'no-padding': noPadding }" ng-transclude ng-if="isOpen"></div>
|
|
12
|
-
<div class="nice-wrapper-footer" ng-if="isOpen && hasFooter" ng-transclude="footer"></div>
|
|
1
|
+
<div class="nice-wrapper" ng-class="{ 'collapsable': collapsable, 'has-header': hasHeader, 'has-footer': hasFooter, 'nice-wrapper-sticky-footer': stickyFooter, 'nice-wrapper-sticky-header': stickyHeader }">
|
|
2
|
+
<div class="nice-wrapper-header" ng-if="hasHeader" ng-click="toggle()">
|
|
3
|
+
<div class="nice-wrapper-info">
|
|
4
|
+
<div class="nice-wrapper-title" ng-transclude="title">{{ title || niceTitle }}</div>
|
|
5
|
+
<div class="nice-wrapper-subtitle" ng-transclude="subtitle">{{ subtitle }}</div>
|
|
6
|
+
</div>
|
|
7
|
+
<button type="button" class="nice-wrapper-toggle btn btn-icon btn-default-naked" ng-if="collapsable" ng-class="{ 'is-open': isOpen }">
|
|
8
|
+
<nice-icon icon="icon-chevron-down"></nice-icon>
|
|
9
|
+
</button>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="nice-wrapper-body" ng-class=" {'no-padding': noPadding }" ng-transclude ng-if="isOpen"></div>
|
|
12
|
+
<div class="nice-wrapper-footer" ng-if="isOpen && hasFooter" ng-transclude="footer"></div>
|
|
13
13
|
</div>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceWrapper
|
|
6
|
-
* @description
|
|
7
|
-
* # niceWrapper
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceWrapper', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-wrapper/nice-wrapper.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
replace: true,
|
|
15
|
-
transclude: {
|
|
16
|
-
'title': '?niceWrapperTitle',
|
|
17
|
-
'subtitle': '?niceWrapperSubtitle',
|
|
18
|
-
'footer': '?niceWrapperFooter'
|
|
19
|
-
},
|
|
20
|
-
scope: {
|
|
21
|
-
niceTitle: '@',
|
|
22
|
-
title: '@',
|
|
23
|
-
subtitle: '@',
|
|
24
|
-
collapsable: '=',
|
|
25
|
-
collapsed: '@',
|
|
26
|
-
noPadding: '@',
|
|
27
|
-
stickyHeader: '@',
|
|
28
|
-
stickyFooter: '@',
|
|
29
|
-
},
|
|
30
|
-
controller: function ($scope, $transclude) {
|
|
31
|
-
$scope.isOpen = true;
|
|
32
|
-
if ($scope.collapsed) $scope.isOpen = false;
|
|
33
|
-
$scope.hasTitle = $transclude.isSlotFilled('title');
|
|
34
|
-
$scope.hasSubtitle = $transclude.isSlotFilled('subtitle');
|
|
35
|
-
$scope.hasFooter = $transclude.isSlotFilled('footer');
|
|
36
|
-
$scope.hasHeader = $scope.hasTitle || $scope.hasSubtitle || $scope.title || $scope.niceTitle || $scope.subtitle || $scope.collapsable;
|
|
37
|
-
|
|
38
|
-
$scope.toggle = function () {
|
|
39
|
-
if (!$scope.collapsable) return;
|
|
40
|
-
$scope.isOpen = !$scope.isOpen;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceWrapper
|
|
6
|
+
* @description
|
|
7
|
+
* # niceWrapper
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceWrapper', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-wrapper/nice-wrapper.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
replace: true,
|
|
15
|
+
transclude: {
|
|
16
|
+
'title': '?niceWrapperTitle',
|
|
17
|
+
'subtitle': '?niceWrapperSubtitle',
|
|
18
|
+
'footer': '?niceWrapperFooter'
|
|
19
|
+
},
|
|
20
|
+
scope: {
|
|
21
|
+
niceTitle: '@',
|
|
22
|
+
title: '@',
|
|
23
|
+
subtitle: '@',
|
|
24
|
+
collapsable: '=',
|
|
25
|
+
collapsed: '@',
|
|
26
|
+
noPadding: '@',
|
|
27
|
+
stickyHeader: '@',
|
|
28
|
+
stickyFooter: '@',
|
|
29
|
+
},
|
|
30
|
+
controller: function ($scope, $transclude) {
|
|
31
|
+
$scope.isOpen = true;
|
|
32
|
+
if ($scope.collapsed) $scope.isOpen = false;
|
|
33
|
+
$scope.hasTitle = $transclude.isSlotFilled('title');
|
|
34
|
+
$scope.hasSubtitle = $transclude.isSlotFilled('subtitle');
|
|
35
|
+
$scope.hasFooter = $transclude.isSlotFilled('footer');
|
|
36
|
+
$scope.hasHeader = $scope.hasTitle || $scope.hasSubtitle || $scope.title || $scope.niceTitle || $scope.subtitle || $scope.collapsable;
|
|
37
|
+
|
|
38
|
+
$scope.toggle = function () {
|
|
39
|
+
if (!$scope.collapsable) return;
|
|
40
|
+
$scope.isOpen = !$scope.isOpen;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<div class="nice-component nice-yesno" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" ng-form="formYesno">
|
|
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', { 'nice-disabled': isDisabled }]">
|
|
8
|
-
<div class="yesno-wrapper noselect">
|
|
9
|
-
<button type="button" class="yesno-yes-bg" ng-click="switch()" tabindex="-1" ng-disabled="isDisabled">{{ yes }}</button>
|
|
10
|
-
<button type="button" class="yesno-no-bg" ng-click="switch()" tabindex="-1" ng-disabled="isDisabled">{{ no }}</button>
|
|
11
|
-
<button type="button" class="yesno-button btn btn-primary" ng-class="buttonClass" ng-click="switch()" ng-disabled="isDisabled">{{ state }}</button>
|
|
12
|
-
</div>
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
1
|
+
<div class="nice-component nice-yesno" ng-class="{ 'margin-bottom-0' : noMargin, 'nice-component-inline': isInline }" ng-form="formYesno">
|
|
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', { 'nice-disabled': isDisabled }]">
|
|
8
|
+
<div class="yesno-wrapper noselect">
|
|
9
|
+
<button type="button" class="yesno-yes-bg" ng-click="switch()" tabindex="-1" ng-disabled="isDisabled">{{ yes }}</button>
|
|
10
|
+
<button type="button" class="yesno-no-bg" ng-click="switch()" tabindex="-1" ng-disabled="isDisabled">{{ no }}</button>
|
|
11
|
+
<button type="button" class="yesno-button btn btn-primary" ng-class="buttonClass" ng-click="switch()" ng-disabled="isDisabled">{{ state }}</button>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
15
|
</div>
|