nice-elements 1.11.1 → 1.12.0

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.
Files changed (154) hide show
  1. package/.vscode/settings.json +18 -18
  2. package/CHANGELOG.md +520 -510
  3. package/LICENSE.md +21 -21
  4. package/README.md +98 -98
  5. package/bower.json +18 -10
  6. package/dist/nice.js +8399 -8387
  7. package/dist/nice.min.js +1 -1
  8. package/dist/style.css +55 -11
  9. package/dist/style.css.map +2 -1
  10. package/dist/style.min.css +8 -8
  11. package/eslint.config.mjs +32 -32
  12. package/package.json +45 -45
  13. package/src/components/nice-alert/nice-alert.html +7 -0
  14. package/src/components/nice-alert/nice-alert.js +27 -0
  15. package/src/components/nice-alert/nice-alert.scss +41 -0
  16. package/src/components/nice-button/nice-button.html +4 -4
  17. package/src/components/nice-button/nice-button.js +41 -41
  18. package/src/components/nice-button/nice-button.scss +16 -16
  19. package/src/components/nice-button-toggle/nice-button-toggle.html +9 -9
  20. package/src/components/nice-button-toggle/nice-button-toggle.js +23 -23
  21. package/src/components/nice-button-toggle/nice-button-toggle.scss +2 -2
  22. package/src/components/nice-calendar/nice-calendar.html +91 -91
  23. package/src/components/nice-calendar/nice-calendar.js +346 -336
  24. package/src/components/nice-calendar/nice-calendar.scss +288 -285
  25. package/src/components/nice-checkbox/nice-checkbox.html +5 -5
  26. package/src/components/nice-checkbox/nice-checkbox.js +34 -34
  27. package/src/components/nice-checkbox/nice-checkbox.scss +91 -91
  28. package/src/components/nice-choice/nice-choice.html +18 -18
  29. package/src/components/nice-choice/nice-choice.js +212 -212
  30. package/src/components/nice-choice/nice-choice.scss +110 -110
  31. package/src/components/nice-click-outside/nice-click-outside.js +105 -105
  32. package/src/components/nice-comment/nice-comment.html +10 -10
  33. package/src/components/nice-comment/nice-comment.js +71 -71
  34. package/src/components/nice-comment/nice-comment.scss +39 -39
  35. package/src/components/nice-date/nice-date.html +79 -79
  36. package/src/components/nice-date/nice-date.js +333 -333
  37. package/src/components/nice-date/nice-date.scss +305 -305
  38. package/src/components/nice-date-input/nice-date-input.html +41 -41
  39. package/src/components/nice-date-input/nice-date-input.js +111 -111
  40. package/src/components/nice-date-input/nice-date-input.scss +45 -45
  41. package/src/components/nice-date-range/nice-date-range.html +15 -15
  42. package/src/components/nice-date-range/nice-date-range.js +78 -78
  43. package/src/components/nice-date-range/nice-date-range.scss +390 -390
  44. package/src/components/nice-datetime-picker/nice-datetime-picker.html +29 -29
  45. package/src/components/nice-datetime-picker/nice-datetime-picker.js +89 -89
  46. package/src/components/nice-datetime-picker/nice-datetime-picker.scss +428 -428
  47. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +55 -55
  48. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +248 -248
  49. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.scss +73 -73
  50. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +44 -44
  51. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +175 -175
  52. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +127 -127
  53. package/src/components/nice-dropdown/nice-dropdown.html +61 -61
  54. package/src/components/nice-dropdown/nice-dropdown.js +517 -517
  55. package/src/components/nice-dropdown/nice-dropdown.scss +262 -262
  56. package/src/components/nice-dropdown-date/nice-dropdown-date.html +28 -28
  57. package/src/components/nice-dropdown-date/nice-dropdown-date.js +132 -132
  58. package/src/components/nice-dropdown-date/nice-dropdown-date.scss +87 -87
  59. package/src/components/nice-dropdown-old/nice-dropdown-old.html +44 -44
  60. package/src/components/nice-dropdown-old/nice-dropdown-old.js +330 -330
  61. package/src/components/nice-dropdown-old/nice-dropdown-old.scss +129 -129
  62. package/src/components/nice-dtp/nice-dtp.html +91 -91
  63. package/src/components/nice-dtp/nice-dtp.js +835 -835
  64. package/src/components/nice-help/nice-help.html +6 -6
  65. package/src/components/nice-help/nice-help.js +58 -58
  66. package/src/components/nice-help/nice-help.scss +78 -78
  67. package/src/components/nice-input/nice-input.html +48 -48
  68. package/src/components/nice-input/nice-input.js +249 -246
  69. package/src/components/nice-input/nice-input.scss +130 -130
  70. package/src/components/nice-label/nice-label.html +10 -10
  71. package/src/components/nice-label/nice-label.js +32 -32
  72. package/src/components/nice-loader/nice-loader.html +6 -6
  73. package/src/components/nice-loader/nice-loader.js +28 -28
  74. package/src/components/nice-loader/nice-loader.scss +47 -47
  75. package/src/components/nice-no-data/nice-no-data.html +3 -3
  76. package/src/components/nice-no-data/nice-no-data.js +27 -27
  77. package/src/components/nice-no-data/nice-no-data.scss +26 -26
  78. package/src/components/nice-notification/nice-notification.html +3 -3
  79. package/src/components/nice-notification/nice-notification.js +124 -124
  80. package/src/components/nice-notification/nice-notification.scss +66 -66
  81. package/src/components/nice-number/nice-number.html +40 -40
  82. package/src/components/nice-number/nice-number.js +172 -172
  83. package/src/components/nice-number/nice-number.scss +18 -18
  84. package/src/components/nice-on-scroll/nice-on-scroll.js +17 -17
  85. package/src/components/nice-percent/nice-percent.html +24 -24
  86. package/src/components/nice-percent/nice-percent.js +95 -95
  87. package/src/components/nice-pill/nice-pill.html +3 -3
  88. package/src/components/nice-pill/nice-pill.js +29 -29
  89. package/src/components/nice-pill/nice-pill.scss +25 -25
  90. package/src/components/nice-popup/nice-popup.html +6 -6
  91. package/src/components/nice-popup/nice-popup.js +122 -122
  92. package/src/components/nice-popup/nice-popup.scss +43 -43
  93. package/src/components/nice-progress-bar/nice-progress-bar.html +15 -15
  94. package/src/components/nice-progress-bar/nice-progress-bar.js +55 -55
  95. package/src/components/nice-progress-bar/nice-progress-bar.scss +47 -47
  96. package/src/components/nice-quantity/nice-quantity.html +22 -22
  97. package/src/components/nice-quantity/nice-quantity.js +57 -57
  98. package/src/components/nice-quantity/nice-quantity.scss +51 -51
  99. package/src/components/nice-search/nice-search.html +44 -44
  100. package/src/components/nice-search/nice-search.js +243 -243
  101. package/src/components/nice-search/nice-search.scss +90 -90
  102. package/src/components/nice-search2/nice-search2.html +32 -32
  103. package/src/components/nice-search2/nice-search2.js +267 -267
  104. package/src/components/nice-search2/nice-search2.scss +80 -80
  105. package/src/components/nice-slot/nice-slot.html +10 -10
  106. package/src/components/nice-slot/nice-slot.js +31 -31
  107. package/src/components/nice-steps/nice-steps.scss +81 -81
  108. package/src/components/nice-svgs/nice-svgs.html +1275 -1275
  109. package/src/components/nice-svgs/nice-svgs.js +19 -19
  110. package/src/components/nice-table/nice-table.html +38 -38
  111. package/src/components/nice-table/nice-table.js +60 -60
  112. package/src/components/nice-table/nice-table.scss +112 -112
  113. package/src/components/nice-time-picker/nice-time-picker.html +43 -43
  114. package/src/components/nice-time-picker/nice-time-picker.js +85 -85
  115. package/src/components/nice-time-picker/nice-time-picker.scss +37 -37
  116. package/src/components/nice-title/nice-title.html +3 -3
  117. package/src/components/nice-title/nice-title.js +21 -21
  118. package/src/components/nice-toast/nice-toast.html +2 -2
  119. package/src/components/nice-toast/nice-toast.js +56 -56
  120. package/src/components/nice-toast/nice-toast.scss +74 -74
  121. package/src/components/nice-toggle/nice-toggle.html +12 -12
  122. package/src/components/nice-toggle/nice-toggle.js +55 -55
  123. package/src/components/nice-toggle/nice-toggle.scss +131 -131
  124. package/src/components/nice-tooltip/_nice-tooltip.scss +55 -55
  125. package/src/components/nice-tooltip/nice-tooltip.js +84 -84
  126. package/src/components/nice-upload/nice-upload.html +22 -22
  127. package/src/components/nice-upload/nice-upload.js +159 -159
  128. package/src/components/nice-upload/nice-upload.scss +85 -85
  129. package/src/components/nice-view/_nice-view.scss +62 -62
  130. package/src/components/nice-view/nice-view.html +12 -12
  131. package/src/components/nice-view/nice-view.js +30 -30
  132. package/src/components/nice-virtual-scroll/_nice-virtual-scroll.scss +17 -17
  133. package/src/components/nice-virtual-scroll/nice-virtual-scroll.html +12 -12
  134. package/src/components/nice-virtual-scroll/nice-virtual-scroll.js +70 -70
  135. package/src/components/nice-wrapper/_nice-wrapper.scss +87 -87
  136. package/src/components/nice-wrapper/nice-wrapper.html +12 -12
  137. package/src/components/nice-wrapper/nice-wrapper.js +44 -44
  138. package/src/components/nice-yesno/nice-yesno.html +14 -14
  139. package/src/components/nice-yesno/nice-yesno.js +111 -111
  140. package/src/components/nice-yesno/nice-yesno.scss +95 -95
  141. package/src/filters/nice-date.js +17 -17
  142. package/src/filters/nice-highlight.js +16 -16
  143. package/src/modals/nice-multilangual-modal/nice-multilangual-modal.html +30 -30
  144. package/src/modals/nice-multilangual-modal/nice-multilangual-modal.js +67 -67
  145. package/src/modals/nice-multilangual-modal/nice-multilangual-modal.scss +19 -19
  146. package/src/nice.js +2 -2
  147. package/src/services/nice-service.js +22 -22
  148. package/src/styles/_bootstrap-variables.scss +178 -178
  149. package/src/styles/_nice-buttons.scss +612 -612
  150. package/src/styles/_nice-common.scss +471 -471
  151. package/src/styles/_nice-ngdialog.scss +85 -85
  152. package/src/styles/_nice-spacing.scss +283 -283
  153. package/src/styles/_nice.scss +71 -70
  154. package/src/styles/_variables.scss +191 -191
@@ -1,13 +1,13 @@
1
- <form class="nice-view" ng-submit="submit" ng-class="{ 'nice-view-has-header': hasHeader, 'nice-view-has-footer': hasFooter }">
2
- <div class="nice-view-header" ng-if="hasHeader">
3
- <div class="nice-view-header-wrapper">
4
- <nice-icon ng-if="niceIcon" icon="{{ niceIcon }}"></nice-icon>
5
- <div>
6
- <div class="nice-view-header-subtitle">{{ niceSubtitle }}</div>
7
- <div class="nice-view-header-title">{{ niceTitle }}</div>
8
- </div>
9
- </div>
10
- </div>
11
- <div class="nice-view-body" ng-transclude></div>
12
- <div class="nice-view-footer" ng-if="hasFooter" ng-transclude="footer"></div>
1
+ <form class="nice-view" ng-submit="submit" ng-class="{ 'nice-view-has-header': hasHeader, 'nice-view-has-footer': hasFooter }">
2
+ <div class="nice-view-header" ng-if="hasHeader">
3
+ <div class="nice-view-header-wrapper">
4
+ <nice-icon ng-if="niceIcon" icon="{{ niceIcon }}"></nice-icon>
5
+ <div>
6
+ <div class="nice-view-header-subtitle">{{ niceSubtitle }}</div>
7
+ <div class="nice-view-header-title">{{ niceTitle }}</div>
8
+ </div>
9
+ </div>
10
+ </div>
11
+ <div class="nice-view-body" ng-transclude></div>
12
+ <div class="nice-view-footer" ng-if="hasFooter" ng-transclude="footer"></div>
13
13
  </form>
@@ -1,30 +1,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
- replace: true,
15
- transclude: {
16
- 'header': '?niceViewHeader',
17
- 'footer': '?niceViewFooter'
18
- },
19
- scope: {
20
- niceTitle: '@',
21
- niceSubtitle: '@',
22
- niceIcon: '@',
23
- submit: '=',
24
- },
25
- controller: function ($scope, $transclude) {
26
- $scope.hasHeader = $transclude.isSlotFilled('header') || $scope.niceTitle || $scope.niceSubtitle || $scope.niceIcon;
27
- $scope.hasFooter = $transclude.isSlotFilled('footer');
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
+ replace: true,
15
+ transclude: {
16
+ 'header': '?niceViewHeader',
17
+ 'footer': '?niceViewFooter'
18
+ },
19
+ scope: {
20
+ niceTitle: '@',
21
+ niceSubtitle: '@',
22
+ niceIcon: '@',
23
+ submit: '=',
24
+ },
25
+ controller: function ($scope, $transclude) {
26
+ $scope.hasHeader = $transclude.isSlotFilled('header') || $scope.niceTitle || $scope.niceSubtitle || $scope.niceIcon;
27
+ $scope.hasFooter = $transclude.isSlotFilled('footer');
28
+ }
29
+ };
30
+ });
@@ -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>