nice-elements 1.12.10 โ 1.12.12
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 +589 -580
- package/LICENSE.md +21 -21
- package/README.md +102 -102
- package/bower.json +17 -17
- package/dist/nice.js +9200 -11639
- 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 +518 -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 -1332
- 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 -160
- 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,28 +1,28 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ngdoc directive
|
|
3
|
-
* @name niceElements.directive:niceInfiniteLoader
|
|
4
|
-
* @function
|
|
5
|
-
* @description
|
|
6
|
-
* # niceInfiniteLoader
|
|
7
|
-
* Directive in the niceElements.
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceInfiniteLoader', function () {
|
|
11
|
-
return {
|
|
12
|
-
restrict: 'A',
|
|
13
|
-
replace: true,
|
|
14
|
-
link: function (scope, element, attrs) {
|
|
15
|
-
const isScrolledToBottom = (el) => {
|
|
16
|
-
const tolerance = 5;
|
|
17
|
-
return (el.scrollTop + el.clientHeight) >= (el.scrollHeight - tolerance);
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// Scroll Event Listener
|
|
21
|
-
element[0].addEventListener('scroll', () => {
|
|
22
|
-
if (isScrolledToBottom(element[0]) && !scope.$eval(attrs.niceInfiniteLoaderDisabled)) {
|
|
23
|
-
scope.$eval(attrs.niceInfiniteLoader);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @ngdoc directive
|
|
3
|
+
* @name niceElements.directive:niceInfiniteLoader
|
|
4
|
+
* @function
|
|
5
|
+
* @description
|
|
6
|
+
* # niceInfiniteLoader
|
|
7
|
+
* Directive in the niceElements.
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceInfiniteLoader', function () {
|
|
11
|
+
return {
|
|
12
|
+
restrict: 'A',
|
|
13
|
+
replace: true,
|
|
14
|
+
link: function (scope, element, attrs) {
|
|
15
|
+
const isScrolledToBottom = (el) => {
|
|
16
|
+
const tolerance = 5;
|
|
17
|
+
return (el.scrollTop + el.clientHeight) >= (el.scrollHeight - tolerance);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Scroll Event Listener
|
|
21
|
+
element[0].addEventListener('scroll', () => {
|
|
22
|
+
if (isScrolledToBottom(element[0]) && !scope.$eval(attrs.niceInfiniteLoaderDisabled)) {
|
|
23
|
+
scope.$eval(attrs.niceInfiniteLoader);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
28
|
});
|
|
@@ -1,55 +1,55 @@
|
|
|
1
|
-
.nice-tooltip {
|
|
2
|
-
// cursor: help;
|
|
3
|
-
}
|
|
4
|
-
|
|
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;
|
|
17
|
-
|
|
18
|
-
&[data-show] {
|
|
19
|
-
display: block;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.nice-tooltip-window-arrow,
|
|
23
|
-
.nice-tooltip-window-arrow::before {
|
|
24
|
-
position: absolute;
|
|
25
|
-
width: 8px;
|
|
26
|
-
height: 8px;
|
|
27
|
-
background: inherit;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.nice-tooltip-window-arrow {
|
|
31
|
-
visibility: hidden;
|
|
32
|
-
|
|
33
|
-
&::before {
|
|
34
|
-
visibility: visible;
|
|
35
|
-
content: "";
|
|
36
|
-
transform: rotate(45deg);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
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
|
-
}
|
|
1
|
+
.nice-tooltip {
|
|
2
|
+
// cursor: help;
|
|
3
|
+
}
|
|
4
|
+
|
|
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;
|
|
17
|
+
|
|
18
|
+
&[data-show] {
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.nice-tooltip-window-arrow,
|
|
23
|
+
.nice-tooltip-window-arrow::before {
|
|
24
|
+
position: absolute;
|
|
25
|
+
width: 8px;
|
|
26
|
+
height: 8px;
|
|
27
|
+
background: inherit;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nice-tooltip-window-arrow {
|
|
31
|
+
visibility: hidden;
|
|
32
|
+
|
|
33
|
+
&::before {
|
|
34
|
+
visibility: visible;
|
|
35
|
+
content: "";
|
|
36
|
+
transform: rotate(45deg);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
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
|
+
}
|
|
@@ -1,84 +1,84 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceTooltip
|
|
6
|
-
* @description
|
|
7
|
-
* # niceTooltip
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceTooltip', function () {
|
|
11
|
-
return {
|
|
12
|
-
restrict: 'A',
|
|
13
|
-
controller: function ($scope, $element, $attrs, $compile) {
|
|
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";
|
|
18
|
-
|
|
19
|
-
// Create popper window
|
|
20
|
-
$element.addClass("nice-tooltip");
|
|
21
|
-
const tooltipWindow = document.createElement('div');
|
|
22
|
-
tooltipWindow.className = 'nice-tooltip-window';
|
|
23
|
-
tooltipWindow.id = 'nice-tooltip-window-' + id;
|
|
24
|
-
|
|
25
|
-
// Popper body
|
|
26
|
-
const content = $compile("<div class='nice-tooltip-body'>" + $attrs.niceTooltip + "</div>")($scope);
|
|
27
|
-
tooltipWindow.append(content[0]);
|
|
28
|
-
|
|
29
|
-
// Popper arrow
|
|
30
|
-
const tooltipWindowArrow = document.createElement('div');
|
|
31
|
-
tooltipWindowArrow.className = 'nice-tooltip-window-arrow';
|
|
32
|
-
tooltipWindowArrow.setAttribute("data-popper-arrow", "");
|
|
33
|
-
tooltipWindow.append(tooltipWindowArrow);
|
|
34
|
-
|
|
35
|
-
// Add to body
|
|
36
|
-
document.body.append(tooltipWindow);
|
|
37
|
-
|
|
38
|
-
// Setup popper
|
|
39
|
-
const popper = Popper.createPopper($element[0], tooltipWindow, {
|
|
40
|
-
placement: placement,
|
|
41
|
-
strategy: 'fixed',
|
|
42
|
-
modifiers: [
|
|
43
|
-
{
|
|
44
|
-
name: 'offset',
|
|
45
|
-
options: {
|
|
46
|
-
offset: [0, 8],
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'arrow',
|
|
51
|
-
options: {
|
|
52
|
-
element: tooltipWindowArrow,
|
|
53
|
-
padding: 3
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
function show() {
|
|
60
|
-
if ($attrs.niceTooltipDisabled == true || $attrs.niceTooltipDisabled == "true") return;
|
|
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
|
-
});
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceTooltip
|
|
6
|
+
* @description
|
|
7
|
+
* # niceTooltip
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceTooltip', function () {
|
|
11
|
+
return {
|
|
12
|
+
restrict: 'A',
|
|
13
|
+
controller: function ($scope, $element, $attrs, $compile) {
|
|
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";
|
|
18
|
+
|
|
19
|
+
// Create popper window
|
|
20
|
+
$element.addClass("nice-tooltip");
|
|
21
|
+
const tooltipWindow = document.createElement('div');
|
|
22
|
+
tooltipWindow.className = 'nice-tooltip-window';
|
|
23
|
+
tooltipWindow.id = 'nice-tooltip-window-' + id;
|
|
24
|
+
|
|
25
|
+
// Popper body
|
|
26
|
+
const content = $compile("<div class='nice-tooltip-body'>" + $attrs.niceTooltip + "</div>")($scope);
|
|
27
|
+
tooltipWindow.append(content[0]);
|
|
28
|
+
|
|
29
|
+
// Popper arrow
|
|
30
|
+
const tooltipWindowArrow = document.createElement('div');
|
|
31
|
+
tooltipWindowArrow.className = 'nice-tooltip-window-arrow';
|
|
32
|
+
tooltipWindowArrow.setAttribute("data-popper-arrow", "");
|
|
33
|
+
tooltipWindow.append(tooltipWindowArrow);
|
|
34
|
+
|
|
35
|
+
// Add to body
|
|
36
|
+
document.body.append(tooltipWindow);
|
|
37
|
+
|
|
38
|
+
// Setup popper
|
|
39
|
+
const popper = Popper.createPopper($element[0], tooltipWindow, {
|
|
40
|
+
placement: placement,
|
|
41
|
+
strategy: 'fixed',
|
|
42
|
+
modifiers: [
|
|
43
|
+
{
|
|
44
|
+
name: 'offset',
|
|
45
|
+
options: {
|
|
46
|
+
offset: [0, 8],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'arrow',
|
|
51
|
+
options: {
|
|
52
|
+
element: tooltipWindowArrow,
|
|
53
|
+
padding: 3
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
function show() {
|
|
60
|
+
if ($attrs.niceTooltipDisabled == true || $attrs.niceTooltipDisabled == "true") return;
|
|
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
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
});
|
package/src/filters/nice-date.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ngdoc filter
|
|
3
|
-
* @name niceElements.filter:niceDate
|
|
4
|
-
* @function
|
|
5
|
-
* @description
|
|
6
|
-
* # niceDate
|
|
7
|
-
* Filter in the niceElements.
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements').filter('niceDate', function () {
|
|
10
|
-
return function (object, addTime, addSeconds) {
|
|
11
|
-
let formatString = "D.M.YYYY";
|
|
12
|
-
if (addTime) {
|
|
13
|
-
formatString = "D.M.YYYY โข H:mm";
|
|
14
|
-
if (addSeconds) formatString += ":ss";
|
|
15
|
-
}
|
|
16
|
-
return moment(object).format(formatString);
|
|
17
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @ngdoc filter
|
|
3
|
+
* @name niceElements.filter:niceDate
|
|
4
|
+
* @function
|
|
5
|
+
* @description
|
|
6
|
+
* # niceDate
|
|
7
|
+
* Filter in the niceElements.
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements').filter('niceDate', function () {
|
|
10
|
+
return function (object, addTime, addSeconds) {
|
|
11
|
+
let formatString = "D.M.YYYY";
|
|
12
|
+
if (addTime) {
|
|
13
|
+
formatString = "D.M.YYYY โข H:mm";
|
|
14
|
+
if (addSeconds) formatString += ":ss";
|
|
15
|
+
}
|
|
16
|
+
return moment(object).format(formatString);
|
|
17
|
+
};
|
|
18
18
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @ngdoc filter
|
|
3
|
-
* @name niceElements.filter:niceHighlight
|
|
4
|
-
* @function
|
|
5
|
-
* @description
|
|
6
|
-
* # niceHighlight
|
|
7
|
-
* Filter in the niceElements.
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements').filter('niceHighlight', function () {
|
|
10
|
-
return function (value, highlightedText) {
|
|
11
|
-
if (!value) return "";
|
|
12
|
-
const regex = new RegExp(highlightedText, 'gmi');
|
|
13
|
-
const newValue = String(value).replace(regex, "<span class='nice-highligh'>$&</span>");
|
|
14
|
-
return newValue;
|
|
15
|
-
};
|
|
16
|
-
});
|
|
1
|
+
/**
|
|
2
|
+
* @ngdoc filter
|
|
3
|
+
* @name niceElements.filter:niceHighlight
|
|
4
|
+
* @function
|
|
5
|
+
* @description
|
|
6
|
+
* # niceHighlight
|
|
7
|
+
* Filter in the niceElements.
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements').filter('niceHighlight', function () {
|
|
10
|
+
return function (value, highlightedText) {
|
|
11
|
+
if (!value) return "";
|
|
12
|
+
const regex = new RegExp(highlightedText, 'gmi');
|
|
13
|
+
const newValue = String(value).replace(regex, "<span class='nice-highligh'>$&</span>");
|
|
14
|
+
return newValue;
|
|
15
|
+
};
|
|
16
|
+
});
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
<div class="nice-multilangual-modal">
|
|
2
|
-
<div class="dialog-title" ng-if="!model">
|
|
3
|
-
<translate translate-context="Nice">Translations</translate>
|
|
4
|
-
</div>
|
|
5
|
-
<div class="dialog-title" ng-if="model">
|
|
6
|
-
<div translate class="sub-title" translate-context="Nice">Translations for</div>
|
|
7
|
-
<span class="title">{{ model }}</span>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
<div class="dialog-body" ng-form="forma">
|
|
11
|
-
<div class="nice-multilangual-languages">
|
|
12
|
-
<div class="nice-multilangual-language" ng-repeat="(key, field) in fields">
|
|
13
|
-
<!-- <nice-icon class="nice-multilangual-language-flag" icon="{{ 'flag-' + key }}"></nice-icon> -->
|
|
14
|
-
<nice-input title="{{ languagesMap[key] }}" class="flex-grow" model="fields[key]" is-inline="false" no-margin="true" on-clear="removeLanguage(key)" text-area="true"></nice-input>
|
|
15
|
-
<!-- <button type="button" class="btn btn-danger btn-icon" ng-click="removeLanguage(key)">
|
|
16
|
-
<nice-icon icon="icon-trash-2"></nice-icon>
|
|
17
|
-
</button> -->
|
|
18
|
-
</div>
|
|
19
|
-
</div>
|
|
20
|
-
|
|
21
|
-
<nice-dropdown ng-if="!hide" title="{{ 'Add language' | translate:null:'Nice' }}" is-inline="false" model="selector.newLanguage" list="languages" add-button-function="addLanguage" filter-function="filterLanguages" no-margin="true"></nice-dropdown>
|
|
22
|
-
<!-- <pre class="mb-0">{{ fields | json }}</pre> -->
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<div class="dialog-footer">
|
|
26
|
-
<div class="view-actions">
|
|
27
|
-
<button type="button" class="btn btn-danger btn-navigation" ng-click="close()" translate-context="Nice" translate>Cancel</button>
|
|
28
|
-
<button type="button" class="btn btn-success btn-navigation" ng-click="save()" translate-context="Nice" translate>Save</button>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
1
|
+
<div class="nice-multilangual-modal">
|
|
2
|
+
<div class="dialog-title" ng-if="!model">
|
|
3
|
+
<translate translate-context="Nice">Translations</translate>
|
|
4
|
+
</div>
|
|
5
|
+
<div class="dialog-title" ng-if="model">
|
|
6
|
+
<div translate class="sub-title" translate-context="Nice">Translations for</div>
|
|
7
|
+
<span class="title">{{ model }}</span>
|
|
8
|
+
</div>
|
|
9
|
+
|
|
10
|
+
<div class="dialog-body" ng-form="forma">
|
|
11
|
+
<div class="nice-multilangual-languages">
|
|
12
|
+
<div class="nice-multilangual-language" ng-repeat="(key, field) in fields">
|
|
13
|
+
<!-- <nice-icon class="nice-multilangual-language-flag" icon="{{ 'flag-' + key }}"></nice-icon> -->
|
|
14
|
+
<nice-input title="{{ languagesMap[key] }}" class="flex-grow" model="fields[key]" is-inline="false" no-margin="true" on-clear="removeLanguage(key)" text-area="true"></nice-input>
|
|
15
|
+
<!-- <button type="button" class="btn btn-danger btn-icon" ng-click="removeLanguage(key)">
|
|
16
|
+
<nice-icon icon="icon-trash-2"></nice-icon>
|
|
17
|
+
</button> -->
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
|
|
21
|
+
<nice-dropdown ng-if="!hide" title="{{ 'Add language' | translate:null:'Nice' }}" is-inline="false" model="selector.newLanguage" list="languages" add-button-function="addLanguage" filter-function="filterLanguages" no-margin="true"></nice-dropdown>
|
|
22
|
+
<!-- <pre class="mb-0">{{ fields | json }}</pre> -->
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="dialog-footer">
|
|
26
|
+
<div class="view-actions">
|
|
27
|
+
<button type="button" class="btn btn-danger btn-navigation" ng-click="close()" translate-context="Nice" translate>Cancel</button>
|
|
28
|
+
<button type="button" class="btn btn-success btn-navigation" ng-click="save()" translate-context="Nice" translate>Save</button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
31
|
</div>
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
angular.module('niceElements')
|
|
2
|
-
.directive('niceMultilangualModal', function () {
|
|
3
|
-
return {
|
|
4
|
-
templateUrl: 'src/modals/nice-multilangual-modal/nice-multilangual-modal.html',
|
|
5
|
-
restrict: 'E',
|
|
6
|
-
scope: {
|
|
7
|
-
model: '=',
|
|
8
|
-
callback: '=',
|
|
9
|
-
dialog: '=',
|
|
10
|
-
multilanguage: '=', // Multiple languages object
|
|
11
|
-
multilanguageField: '@', // Multiple languages field name
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
controller: function ($scope, $timeout) {
|
|
15
|
-
$scope.selector = {
|
|
16
|
-
newLanguage: null
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
if (!$scope.multilanguage) $scope.multilanguage = {};
|
|
20
|
-
if (!$scope.multilanguage[$scope.multilanguageField]) $scope.multilanguage[$scope.multilanguageField] = {};
|
|
21
|
-
$scope.fields = angular.copy($scope.multilanguage[$scope.multilanguageField]);
|
|
22
|
-
|
|
23
|
-
$scope.languages = [
|
|
24
|
-
{ id: 'sl', icon: '๐ธ๐ฎ', value: "๐ธ๐ฎ Slovenลกฤina" },
|
|
25
|
-
{ id: 'en', icon: '๐ฌ๐ง', value: "๐ฌ๐ง English" },
|
|
26
|
-
{ id: 'hr', icon: '๐ญ๐ท', value: "๐ญ๐ท Hrvatski" },
|
|
27
|
-
{ id: 'de', icon: '๐ฉ๐ช', value: "๐ฉ๐ช Deutsch" },
|
|
28
|
-
{ id: 'it', icon: '๐ฎ๐น', value: "๐ฎ๐น Italiano" },
|
|
29
|
-
{ id: 'fr', icon: '๐ซ๐ท', value: "๐ซ๐ท Franรงais" },
|
|
30
|
-
];
|
|
31
|
-
$scope.languagesMap = {};
|
|
32
|
-
angular.forEach($scope.languages, function (l) { $scope.languagesMap[l.id] = l.value; });
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
$scope.filterLanguages = function (list) {
|
|
36
|
-
return _.filter(list, function (l) { return !Object.keys($scope.fields).includes(l.id); });
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
$scope.addLanguage = function () {
|
|
40
|
-
if (!$scope.selector.newLanguage) return;
|
|
41
|
-
$scope.fields[$scope.selector.newLanguage.id] = "";
|
|
42
|
-
$scope.selector.newLanguage = null;
|
|
43
|
-
$scope.hide = true;
|
|
44
|
-
$timeout(function () {
|
|
45
|
-
$scope.hide = false;
|
|
46
|
-
});
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
$scope.removeLanguage = function (key) {
|
|
50
|
-
delete $scope.fields[key];
|
|
51
|
-
$scope.hide = true;
|
|
52
|
-
$timeout(function () {
|
|
53
|
-
$scope.hide = false;
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
$scope.save = function () {
|
|
58
|
-
$scope.callback($scope.fields);
|
|
59
|
-
$scope.dialog.close();
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
$scope.close = function () {
|
|
63
|
-
$scope.dialog.close();
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
});
|
|
1
|
+
angular.module('niceElements')
|
|
2
|
+
.directive('niceMultilangualModal', function () {
|
|
3
|
+
return {
|
|
4
|
+
templateUrl: 'src/modals/nice-multilangual-modal/nice-multilangual-modal.html',
|
|
5
|
+
restrict: 'E',
|
|
6
|
+
scope: {
|
|
7
|
+
model: '=',
|
|
8
|
+
callback: '=',
|
|
9
|
+
dialog: '=',
|
|
10
|
+
multilanguage: '=', // Multiple languages object
|
|
11
|
+
multilanguageField: '@', // Multiple languages field name
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
controller: function ($scope, $timeout) {
|
|
15
|
+
$scope.selector = {
|
|
16
|
+
newLanguage: null
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
if (!$scope.multilanguage) $scope.multilanguage = {};
|
|
20
|
+
if (!$scope.multilanguage[$scope.multilanguageField]) $scope.multilanguage[$scope.multilanguageField] = {};
|
|
21
|
+
$scope.fields = angular.copy($scope.multilanguage[$scope.multilanguageField]);
|
|
22
|
+
|
|
23
|
+
$scope.languages = [
|
|
24
|
+
{ id: 'sl', icon: '๐ธ๐ฎ', value: "๐ธ๐ฎ Slovenลกฤina" },
|
|
25
|
+
{ id: 'en', icon: '๐ฌ๐ง', value: "๐ฌ๐ง English" },
|
|
26
|
+
{ id: 'hr', icon: '๐ญ๐ท', value: "๐ญ๐ท Hrvatski" },
|
|
27
|
+
{ id: 'de', icon: '๐ฉ๐ช', value: "๐ฉ๐ช Deutsch" },
|
|
28
|
+
{ id: 'it', icon: '๐ฎ๐น', value: "๐ฎ๐น Italiano" },
|
|
29
|
+
{ id: 'fr', icon: '๐ซ๐ท', value: "๐ซ๐ท Franรงais" },
|
|
30
|
+
];
|
|
31
|
+
$scope.languagesMap = {};
|
|
32
|
+
angular.forEach($scope.languages, function (l) { $scope.languagesMap[l.id] = l.value; });
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
$scope.filterLanguages = function (list) {
|
|
36
|
+
return _.filter(list, function (l) { return !Object.keys($scope.fields).includes(l.id); });
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
$scope.addLanguage = function () {
|
|
40
|
+
if (!$scope.selector.newLanguage) return;
|
|
41
|
+
$scope.fields[$scope.selector.newLanguage.id] = "";
|
|
42
|
+
$scope.selector.newLanguage = null;
|
|
43
|
+
$scope.hide = true;
|
|
44
|
+
$timeout(function () {
|
|
45
|
+
$scope.hide = false;
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
$scope.removeLanguage = function (key) {
|
|
50
|
+
delete $scope.fields[key];
|
|
51
|
+
$scope.hide = true;
|
|
52
|
+
$timeout(function () {
|
|
53
|
+
$scope.hide = false;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
$scope.save = function () {
|
|
58
|
+
$scope.callback($scope.fields);
|
|
59
|
+
$scope.dialog.close();
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
$scope.close = function () {
|
|
63
|
+
$scope.dialog.close();
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
.nice-multilangual-modal {
|
|
2
|
-
.nice-multilangual-languages {
|
|
3
|
-
.nice-multilangual-language {
|
|
4
|
-
margin-bottom: 1rem;
|
|
5
|
-
display: flex;
|
|
6
|
-
align-items: flex-end;
|
|
7
|
-
gap: 1rem;
|
|
8
|
-
|
|
9
|
-
.nice-multilangual-language-flag {
|
|
10
|
-
width: 34px;
|
|
11
|
-
height: 34px;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.add-language {
|
|
17
|
-
width: 200px;
|
|
18
|
-
display: block;
|
|
19
|
-
}
|
|
1
|
+
.nice-multilangual-modal {
|
|
2
|
+
.nice-multilangual-languages {
|
|
3
|
+
.nice-multilangual-language {
|
|
4
|
+
margin-bottom: 1rem;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: flex-end;
|
|
7
|
+
gap: 1rem;
|
|
8
|
+
|
|
9
|
+
.nice-multilangual-language-flag {
|
|
10
|
+
width: 34px;
|
|
11
|
+
height: 34px;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.add-language {
|
|
17
|
+
width: 200px;
|
|
18
|
+
display: block;
|
|
19
|
+
}
|
|
20
20
|
}
|
package/src/nice.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
3
|
angular.module('niceElements', []);
|