nice-elements 1.10.11 → 1.10.13
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 +4 -2
- package/CHANGELOG.md +10 -0
- package/README.md +1 -1
- package/bower.json +1 -1
- package/dist/nice.js +130 -66
- package/dist/nice.min.js +1 -1
- package/dist/style.css +10175 -10165
- package/dist/style.css.map +53 -53
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-choice/nice-choice.scss +1 -1
- package/src/components/nice-svgs/nice-svgs.js +4 -1
- package/src/components/nice-tooltip/_nice-tooltip.scss +44 -61
- package/src/components/nice-tooltip/nice-tooltip.js +67 -6
- package/src/services/nice-service.js +1 -1
- package/src/styles/_variables.scss +11 -20
package/package.json
CHANGED
|
@@ -1,72 +1,55 @@
|
|
|
1
1
|
.nice-tooltip {
|
|
2
|
-
$nice-help-popup-color: #3e3e3e;
|
|
3
|
-
position: relative;
|
|
4
|
-
display: inline-block;
|
|
5
2
|
cursor: help;
|
|
3
|
+
}
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
.nice-tooltip-window {
|
|
6
|
+
display: none;
|
|
7
|
+
position: relative;
|
|
8
|
+
background: var(--nice-help-popup-bg);
|
|
9
|
+
color: var(--nice-help-popup-color);
|
|
10
|
+
max-width: 200px;
|
|
11
|
+
width: max-content;
|
|
12
|
+
border-radius: var(--nice-border-radius);
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
padding: 5px 10px;
|
|
15
|
+
font-weight: normal;
|
|
16
|
+
text-transform: none;
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
18
|
+
&[data-show] {
|
|
19
|
+
display: block;
|
|
15
20
|
}
|
|
16
21
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
// display: none;
|
|
20
|
-
// position: absolute;
|
|
21
|
-
// background: $nice-help-popup-color;
|
|
22
|
-
// color: white;
|
|
23
|
-
// max-width: 200px;
|
|
24
|
-
// width: max-content;
|
|
25
|
-
// bottom: 100%;
|
|
26
|
-
// left: 50%;
|
|
27
|
-
// border-radius: $nice-border-radius;
|
|
28
|
-
// font-size: 12px;
|
|
29
|
-
// z-index: 99999;
|
|
30
|
-
// transform: translate(-50%, -5px);
|
|
31
|
-
// line-height: 1.3;
|
|
32
|
-
// padding: 7px 10px;
|
|
33
|
-
// font-weight: normal;
|
|
34
|
-
// text-align: center;
|
|
35
|
-
// text-transform: none;
|
|
36
|
-
// }
|
|
37
|
-
|
|
38
|
-
.nice-tooltip-window {
|
|
39
|
-
display: none;
|
|
22
|
+
.nice-tooltip-window-arrow,
|
|
23
|
+
.nice-tooltip-window-arrow::before {
|
|
40
24
|
position: absolute;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
bottom: 100%;
|
|
46
|
-
left: 50%;
|
|
47
|
-
border-radius: $nice-border-radius;
|
|
48
|
-
font-size: 12px;
|
|
49
|
-
z-index: 99999;
|
|
50
|
-
transform: translate(-50%, -5px);
|
|
51
|
-
line-height: 1.3;
|
|
52
|
-
padding: 7px 10px;
|
|
53
|
-
font-weight: normal;
|
|
54
|
-
text-align: center;
|
|
55
|
-
text-transform: none;
|
|
25
|
+
width: 8px;
|
|
26
|
+
height: 8px;
|
|
27
|
+
background: inherit;
|
|
28
|
+
}
|
|
56
29
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
width: 0;
|
|
60
|
-
height: 0;
|
|
61
|
-
position: absolute;
|
|
62
|
-
bottom: -3px;
|
|
63
|
-
left: 50%;
|
|
64
|
-
margin-left: -5px;
|
|
30
|
+
.nice-tooltip-window-arrow {
|
|
31
|
+
visibility: hidden;
|
|
65
32
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
33
|
+
&::before {
|
|
34
|
+
visibility: visible;
|
|
35
|
+
content: "";
|
|
36
|
+
transform: rotate(45deg);
|
|
70
37
|
}
|
|
71
38
|
}
|
|
72
|
-
|
|
39
|
+
|
|
40
|
+
&[data-popper-placement^="top"] > .nice-tooltip-window-arrow {
|
|
41
|
+
bottom: -4px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&[data-popper-placement^="bottom"] > .nice-tooltip-window-arrow {
|
|
45
|
+
top: -4px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&[data-popper-placement^="left"] > .nice-tooltip-window-arrow {
|
|
49
|
+
right: -4px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
&[data-popper-placement^="right"] > .nice-tooltip-window-arrow {
|
|
53
|
+
left: -4px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -9,15 +9,76 @@
|
|
|
9
9
|
angular.module('niceElements')
|
|
10
10
|
.directive('niceTooltip', function () {
|
|
11
11
|
return {
|
|
12
|
-
restrict: '
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
restrict: 'A',
|
|
13
|
+
controller: function ($scope, $element, $attrs) {
|
|
14
|
+
const id = Math.random().toString(36).substring(7);
|
|
15
|
+
const showEvents = ['mouseenter', 'focus'];
|
|
16
|
+
const hideEvents = ['mouseleave', 'blur'];
|
|
17
|
+
const placement = $attrs.niceTooltipPlacement || "top";
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
// Create popper window
|
|
20
|
+
$element.addClass("nice-tooltip");
|
|
21
|
+
const tooltipWindow = document.createElement('div');
|
|
17
22
|
tooltipWindow.className = 'nice-tooltip-window';
|
|
18
|
-
tooltipWindow.
|
|
23
|
+
tooltipWindow.id = 'nice-tooltip-window-' + id;
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
// Popper body
|
|
26
|
+
const tooltipWindowBody = document.createElement('div');
|
|
27
|
+
tooltipWindowBody.innerHTML = $attrs.niceTooltip;
|
|
28
|
+
tooltipWindow.append(tooltipWindowBody);
|
|
29
|
+
|
|
30
|
+
// Popper arrow
|
|
31
|
+
const tooltipWindowArrow = document.createElement('div');
|
|
32
|
+
tooltipWindowArrow.className = 'nice-tooltip-window-arrow';
|
|
33
|
+
tooltipWindowArrow.setAttribute("data-popper-arrow", "");
|
|
34
|
+
tooltipWindow.append(tooltipWindowArrow);
|
|
35
|
+
|
|
36
|
+
// Add to body
|
|
37
|
+
document.body.append(tooltipWindow);
|
|
38
|
+
|
|
39
|
+
// Setup popper
|
|
40
|
+
const popper = Popper.createPopper($element[0], tooltipWindow, {
|
|
41
|
+
placement: placement,
|
|
42
|
+
strategy: 'fixed',
|
|
43
|
+
modifiers: [
|
|
44
|
+
{
|
|
45
|
+
name: 'offset',
|
|
46
|
+
options: {
|
|
47
|
+
offset: [0, 8],
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'arrow',
|
|
52
|
+
options: {
|
|
53
|
+
element: tooltipWindowArrow,
|
|
54
|
+
padding: 3
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
function show() {
|
|
61
|
+
tooltipWindow.setAttribute('data-show', '');
|
|
62
|
+
popper.update();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function hide() {
|
|
66
|
+
tooltipWindow.removeAttribute('data-show');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
showEvents.forEach((event) => {
|
|
70
|
+
$element[0].addEventListener(event, show);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
hideEvents.forEach((event) => {
|
|
74
|
+
$element[0].addEventListener(event, hide);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
// On destroy
|
|
78
|
+
$scope.$on('$destroy', function () {
|
|
79
|
+
tooltipWindow.remove();
|
|
80
|
+
if (popper) popper.destroy();
|
|
81
|
+
});
|
|
21
82
|
}
|
|
22
83
|
};
|
|
23
84
|
});
|
|
@@ -3,7 +3,6 @@ $nice-font-family: "Roboto", "Helvetica Neue", Helvetica, Arial, sans-serif !def
|
|
|
3
3
|
$nice-font-weight: normal !default;
|
|
4
4
|
$nice-font-color: #404040 !default;
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
// ---------- Colors ----------
|
|
8
7
|
$nice-base-color: #3189ff !default;
|
|
9
8
|
$nice-base-color-lighter: lighten($nice-base-color, 10%) !default;
|
|
@@ -19,7 +18,7 @@ $nice-danger-color-lighter: lighten($nice-danger-color, 10%) !default;
|
|
|
19
18
|
$nice-danger-color-darker: darken($nice-danger-color, 10%) !default;
|
|
20
19
|
$nice-danger-color-plain: #ffe4e4 !default;
|
|
21
20
|
|
|
22
|
-
$nice-success-color: #
|
|
21
|
+
$nice-success-color: #49ae50 !default;
|
|
23
22
|
$nice-success-color-lighter: lighten($nice-success-color, 10%) !default;
|
|
24
23
|
$nice-success-color-darker: darken($nice-success-color, 10%) !default;
|
|
25
24
|
$nice-success-color-plain: #e2efe3 !default;
|
|
@@ -34,7 +33,6 @@ $nice-warning-color-lighter: lighten($nice-warning-color, 10%) !default;
|
|
|
34
33
|
$nice-warning-color-darker: darken($nice-warning-color, 10%) !default;
|
|
35
34
|
$nice-warning-color-plain: #fff9e8 !default;
|
|
36
35
|
|
|
37
|
-
|
|
38
36
|
// ---------- Border ----------
|
|
39
37
|
$nice-border-color: #cbd4d9 !default;
|
|
40
38
|
$nice-border-radius: 3px !default;
|
|
@@ -42,25 +40,22 @@ $nice-border-radius-small: $nice-border-radius !default;
|
|
|
42
40
|
|
|
43
41
|
$border-radius-base: 3px;
|
|
44
42
|
|
|
45
|
-
|
|
46
43
|
// ---------- Disabled ----------
|
|
47
|
-
$nice-disabled-color: #
|
|
48
|
-
$nice-disabled-border: #
|
|
44
|
+
$nice-disabled-color: #edeff2 !default;
|
|
45
|
+
$nice-disabled-border: #d2d9d9 !default;
|
|
49
46
|
$nice-disabled-bg: white !default;
|
|
50
47
|
|
|
51
|
-
|
|
52
48
|
// ---------- Nice global settings ----------
|
|
53
49
|
$nice-focus-bg: white !default;
|
|
54
50
|
$nice-focus-border: $nice-base-color !default;
|
|
55
|
-
$nice-focus-color: #
|
|
51
|
+
$nice-focus-color: #474f52 !default;
|
|
56
52
|
|
|
57
53
|
$nice-background: white !default;
|
|
58
|
-
$nice-hover-color: #
|
|
54
|
+
$nice-hover-color: #ededed !default;
|
|
59
55
|
$nice-box-shadow: 0 0 10px rgba(0, 0, 0, 0.1) !default;
|
|
60
56
|
|
|
61
57
|
$nice-navbar-height: 50px;
|
|
62
58
|
|
|
63
|
-
|
|
64
59
|
// ---------- Input colors override ----------
|
|
65
60
|
$nice-label-color: $nice-font-color !default;
|
|
66
61
|
$nice-input-placeholder-color: #999999 !default;
|
|
@@ -71,7 +66,6 @@ $nice-input-valid: $nice-base-color !default;
|
|
|
71
66
|
$nice-input-invalid: $nice-danger-color !default;
|
|
72
67
|
$nice-addon-bg: #f3f3f3 !default;
|
|
73
68
|
|
|
74
|
-
|
|
75
69
|
// ---------- Dropdown colors override ----------
|
|
76
70
|
$nice-dropdown-bg: $nice-background !default;
|
|
77
71
|
$nice-dropdown-border: $nice-border-color !default;
|
|
@@ -79,12 +73,11 @@ $nice-dropdown-color: $nice-font-color !default;
|
|
|
79
73
|
|
|
80
74
|
$nice-dropdown-hover-bg: white !default;
|
|
81
75
|
$nice-dropdown-hover-border: $nice-border-color !default;
|
|
82
|
-
$nice-dropdown-hover-color: #
|
|
76
|
+
$nice-dropdown-hover-color: #474f52 !default;
|
|
83
77
|
|
|
84
78
|
$nice-dropdown-disabled-bg: $nice-disabled-bg !default;
|
|
85
79
|
$nice-dropdown-disabled-border: $nice-disabled-color !default;
|
|
86
80
|
|
|
87
|
-
|
|
88
81
|
// ---------- Yes no colors override ----------
|
|
89
82
|
$nice-yesno-bg: $nice-background !default;
|
|
90
83
|
$nice-yesno-slider-bg: $nice-base-color !default;
|
|
@@ -93,18 +86,15 @@ $nice-yesno-disabled-color: $nice-disabled-color !default;
|
|
|
93
86
|
$nice-yesno-disabled-bg: $nice-disabled-bg !default;
|
|
94
87
|
$nice-yesno-disabled-border: $nice-disabled-border !default;
|
|
95
88
|
|
|
96
|
-
|
|
97
89
|
// ---------- Choice colors override ----------
|
|
98
90
|
$nice-choice-bg: $nice-background !default;
|
|
99
91
|
$nice-choice-hover-border: $nice-base-color !default;
|
|
100
92
|
$nice-choice-selected-bg: $nice-base-color !default;
|
|
101
93
|
$nice-choice-selected-color: white !default;
|
|
102
94
|
|
|
103
|
-
|
|
104
95
|
// ---------- Loader ----------
|
|
105
96
|
$nice-loader-color: $nice-base-color !default;
|
|
106
97
|
|
|
107
|
-
|
|
108
98
|
// ---------- Notifications ----------
|
|
109
99
|
$nice-notification-color: white !default;
|
|
110
100
|
$nice-notification-bg: $nice-base-color !default;
|
|
@@ -121,17 +111,14 @@ $nice-notification-success-bg: $nice-success-color !default;
|
|
|
121
111
|
$nice-notification-info-color: $nice-notification-color !default;
|
|
122
112
|
$nice-notification-info-bg: $nice-info-color !default;
|
|
123
113
|
|
|
124
|
-
|
|
125
114
|
// ---------- Submenu ----------
|
|
126
115
|
$nice-submenu-bg-color: #e1e5e8 !default;
|
|
127
116
|
$nice-submenu-gray-color: #b0bec5 !default;
|
|
128
117
|
|
|
129
|
-
|
|
130
118
|
// ---------- Table ----------
|
|
131
119
|
$nice-table-bg-hover: #f5f5f5 !default;
|
|
132
120
|
$nice-table-bg-active: #f5f5f5 !default;
|
|
133
121
|
|
|
134
|
-
|
|
135
122
|
:root {
|
|
136
123
|
// ---------- Fonts ----------
|
|
137
124
|
--nice-font-family: #{$nice-font-family};
|
|
@@ -196,4 +183,8 @@ $nice-table-bg-active: #f5f5f5 !default;
|
|
|
196
183
|
// ---------- Input ----------
|
|
197
184
|
--nice-input-bg: #{$nice-input-bg};
|
|
198
185
|
--nice-input-bg-hover: #f7f7f7;
|
|
199
|
-
|
|
186
|
+
|
|
187
|
+
// ---------- Tooltip ----------
|
|
188
|
+
--nice-help-popup-bg: #3e3e3e;
|
|
189
|
+
--nice-help-popup-color: white;
|
|
190
|
+
}
|