nice-elements 1.11.0 → 1.11.1
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 +510 -505
- package/LICENSE.md +21 -21
- package/README.md +98 -98
- package/bower.json +10 -10
- package/dist/nice.js +8397 -8356
- package/dist/nice.min.js +1 -1
- package/dist/style.css +7 -7
- package/dist/style.min.css +7 -7
- package/eslint.config.mjs +32 -32
- package/package.json +45 -45
- package/src/components/nice-button/nice-button.html +4 -4
- package/src/components/nice-button/nice-button.js +41 -41
- package/src/components/nice-button/nice-button.scss +16 -16
- package/src/components/nice-button-toggle/nice-button-toggle.html +9 -9
- package/src/components/nice-button-toggle/nice-button-toggle.js +23 -23
- package/src/components/nice-button-toggle/nice-button-toggle.scss +2 -2
- package/src/components/nice-calendar/nice-calendar.html +91 -91
- package/src/components/nice-calendar/nice-calendar.js +336 -336
- package/src/components/nice-calendar/nice-calendar.scss +285 -285
- package/src/components/nice-checkbox/nice-checkbox.html +5 -5
- package/src/components/nice-checkbox/nice-checkbox.js +34 -34
- package/src/components/nice-checkbox/nice-checkbox.scss +91 -91
- package/src/components/nice-choice/nice-choice.html +18 -18
- package/src/components/nice-choice/nice-choice.js +212 -212
- package/src/components/nice-choice/nice-choice.scss +110 -110
- package/src/components/nice-click-outside/nice-click-outside.js +105 -105
- package/src/components/nice-comment/nice-comment.html +10 -10
- package/src/components/nice-comment/nice-comment.js +71 -71
- package/src/components/nice-comment/nice-comment.scss +39 -39
- package/src/components/nice-date/nice-date.html +79 -79
- package/src/components/nice-date/nice-date.js +333 -333
- package/src/components/nice-date/nice-date.scss +305 -305
- package/src/components/nice-date-input/nice-date-input.html +41 -41
- package/src/components/nice-date-input/nice-date-input.js +111 -111
- package/src/components/nice-date-input/nice-date-input.scss +45 -45
- package/src/components/nice-date-range/nice-date-range.html +15 -15
- package/src/components/nice-date-range/nice-date-range.js +78 -78
- package/src/components/nice-date-range/nice-date-range.scss +390 -390
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +29 -29
- package/src/components/nice-datetime-picker/nice-datetime-picker.js +89 -89
- package/src/components/nice-datetime-picker/nice-datetime-picker.scss +428 -428
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +55 -55
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +248 -248
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.scss +73 -73
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +44 -44
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +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 +48 -48
- package/src/components/nice-input/nice-input.js +246 -245
- package/src/components/nice-input/nice-input.scss +130 -130
- package/src/components/nice-label/nice-label.html +10 -10
- package/src/components/nice-label/nice-label.js +32 -32
- package/src/components/nice-loader/nice-loader.html +6 -6
- package/src/components/nice-loader/nice-loader.js +28 -28
- package/src/components/nice-loader/nice-loader.scss +47 -47
- package/src/components/nice-no-data/nice-no-data.html +3 -3
- package/src/components/nice-no-data/nice-no-data.js +27 -27
- package/src/components/nice-no-data/nice-no-data.scss +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 +1275 -1275
- 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 +3 -3
- package/src/components/nice-title/nice-title.js +21 -21
- package/src/components/nice-toast/nice-toast.html +2 -2
- package/src/components/nice-toast/nice-toast.js +56 -56
- package/src/components/nice-toast/nice-toast.scss +74 -74
- package/src/components/nice-toggle/nice-toggle.html +12 -12
- package/src/components/nice-toggle/nice-toggle.js +55 -55
- package/src/components/nice-toggle/nice-toggle.scss +131 -131
- package/src/components/nice-tooltip/_nice-tooltip.scss +55 -55
- package/src/components/nice-tooltip/nice-tooltip.js +84 -84
- package/src/components/nice-upload/nice-upload.html +22 -22
- package/src/components/nice-upload/nice-upload.js +159 -159
- package/src/components/nice-upload/nice-upload.scss +85 -85
- package/src/components/nice-view/_nice-view.scss +62 -62
- package/src/components/nice-view/nice-view.html +12 -12
- package/src/components/nice-view/nice-view.js +30 -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/filters/nice-date.js +17 -17
- package/src/filters/nice-highlight.js +16 -16
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.html +30 -30
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.js +67 -67
- package/src/modals/nice-multilangual-modal/nice-multilangual-modal.scss +19 -19
- package/src/nice.js +2 -2
- package/src/services/nice-service.js +22 -22
- package/src/styles/_bootstrap-variables.scss +178 -178
- package/src/styles/_nice-buttons.scss +612 -612
- package/src/styles/_nice-common.scss +471 -471
- package/src/styles/_nice-ngdialog.scss +85 -85
- package/src/styles/_nice-spacing.scss +283 -283
- package/src/styles/_nice.scss +70 -70
- package/src/styles/_variables.scss +191 -191
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceTimePicker
|
|
6
|
-
* @description
|
|
7
|
-
* # niceTimePicker
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceTimePicker', function () {
|
|
11
|
-
return {
|
|
12
|
-
scope: {
|
|
13
|
-
model: '=',
|
|
14
|
-
niceTitle: '@',
|
|
15
|
-
title: '@',
|
|
16
|
-
isDisabled: '=',
|
|
17
|
-
noMargin: '@',
|
|
18
|
-
fieldWidth: '@',
|
|
19
|
-
labelWidth: '@',
|
|
20
|
-
onChange: '&?',
|
|
21
|
-
isInline: '=',
|
|
22
|
-
help: '@',
|
|
23
|
-
required: '='
|
|
24
|
-
},
|
|
25
|
-
restrict: 'E',
|
|
26
|
-
templateUrl: 'src/components/nice-time-picker/nice-time-picker.html',
|
|
27
|
-
link: function ($scope, $element, $attrs) {
|
|
28
|
-
if (!$scope.model) $scope.model = moment();
|
|
29
|
-
$scope.open = false;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
$scope.close = function () {
|
|
33
|
-
$scope.open = false;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
$scope.validateDate = function () {
|
|
38
|
-
$scope.checkDate($scope.modelString);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
$scope.checkDate = function (date) {
|
|
43
|
-
const parsedDate = moment(date, "HH:mm");
|
|
44
|
-
if (parsedDate.isValid()) {
|
|
45
|
-
if ($scope.forma) $scope.forma.$setValidity("valid-time", true);
|
|
46
|
-
$scope.model = parsedDate;
|
|
47
|
-
$scope.refreshTime();
|
|
48
|
-
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
49
|
-
} else {
|
|
50
|
-
if ($scope.forma) $scope.forma.$setValidity("valid-time", false);
|
|
51
|
-
$scope.modelString = "";
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
$scope.refreshTime = function () {
|
|
57
|
-
$scope.hours = $scope.model.format("HH");
|
|
58
|
-
$scope.minutes = $scope.model.format("mm");
|
|
59
|
-
$scope.modelString = $scope.model.format("HH:mm");
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
$scope.changeHour = function (add) {
|
|
64
|
-
if (add) $scope.model.add(1, 'hour');
|
|
65
|
-
else $scope.model.subtract(1, 'hour');
|
|
66
|
-
$scope.refreshTime();
|
|
67
|
-
$scope.forma.$setDirty();
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
$scope.changeMinutes = function (add) {
|
|
71
|
-
if (add) $scope.model.add(1, 'minutes');
|
|
72
|
-
else $scope.model.subtract(1, 'minutes');
|
|
73
|
-
$scope.refreshTime();
|
|
74
|
-
$scope.forma.$setDirty();
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
$scope.$watch("model", function (value, oldValue) {
|
|
79
|
-
$scope.refreshTime();
|
|
80
|
-
if (!value.isSame(oldValue)) {
|
|
81
|
-
$scope.checkDate(value);
|
|
82
|
-
}
|
|
83
|
-
})
|
|
84
|
-
}
|
|
85
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceTimePicker
|
|
6
|
+
* @description
|
|
7
|
+
* # niceTimePicker
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceTimePicker', function () {
|
|
11
|
+
return {
|
|
12
|
+
scope: {
|
|
13
|
+
model: '=',
|
|
14
|
+
niceTitle: '@',
|
|
15
|
+
title: '@',
|
|
16
|
+
isDisabled: '=',
|
|
17
|
+
noMargin: '@',
|
|
18
|
+
fieldWidth: '@',
|
|
19
|
+
labelWidth: '@',
|
|
20
|
+
onChange: '&?',
|
|
21
|
+
isInline: '=',
|
|
22
|
+
help: '@',
|
|
23
|
+
required: '='
|
|
24
|
+
},
|
|
25
|
+
restrict: 'E',
|
|
26
|
+
templateUrl: 'src/components/nice-time-picker/nice-time-picker.html',
|
|
27
|
+
link: function ($scope, $element, $attrs) {
|
|
28
|
+
if (!$scope.model) $scope.model = moment();
|
|
29
|
+
$scope.open = false;
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
$scope.close = function () {
|
|
33
|
+
$scope.open = false;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
$scope.validateDate = function () {
|
|
38
|
+
$scope.checkDate($scope.modelString);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
$scope.checkDate = function (date) {
|
|
43
|
+
const parsedDate = moment(date, "HH:mm");
|
|
44
|
+
if (parsedDate.isValid()) {
|
|
45
|
+
if ($scope.forma) $scope.forma.$setValidity("valid-time", true);
|
|
46
|
+
$scope.model = parsedDate;
|
|
47
|
+
$scope.refreshTime();
|
|
48
|
+
if ($scope.onChange) $scope.onChange({ model: $scope.model });
|
|
49
|
+
} else {
|
|
50
|
+
if ($scope.forma) $scope.forma.$setValidity("valid-time", false);
|
|
51
|
+
$scope.modelString = "";
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
$scope.refreshTime = function () {
|
|
57
|
+
$scope.hours = $scope.model.format("HH");
|
|
58
|
+
$scope.minutes = $scope.model.format("mm");
|
|
59
|
+
$scope.modelString = $scope.model.format("HH:mm");
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
$scope.changeHour = function (add) {
|
|
64
|
+
if (add) $scope.model.add(1, 'hour');
|
|
65
|
+
else $scope.model.subtract(1, 'hour');
|
|
66
|
+
$scope.refreshTime();
|
|
67
|
+
$scope.forma.$setDirty();
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
$scope.changeMinutes = function (add) {
|
|
71
|
+
if (add) $scope.model.add(1, 'minutes');
|
|
72
|
+
else $scope.model.subtract(1, 'minutes');
|
|
73
|
+
$scope.refreshTime();
|
|
74
|
+
$scope.forma.$setDirty();
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
$scope.$watch("model", function (value, oldValue) {
|
|
79
|
+
$scope.refreshTime();
|
|
80
|
+
if (!value.isSame(oldValue)) {
|
|
81
|
+
$scope.checkDate(value);
|
|
82
|
+
}
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
86
|
});
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
.nice-time-picker {
|
|
2
|
-
position: relative;
|
|
3
|
-
|
|
4
|
-
.nice-time-picker-dropdown {
|
|
5
|
-
z-index: 900;
|
|
6
|
-
border-radius: $nice-border-radius;
|
|
7
|
-
position: absolute;
|
|
8
|
-
top: 100%;
|
|
9
|
-
left: 15px;
|
|
10
|
-
width: 130px;
|
|
11
|
-
background: white;
|
|
12
|
-
border: 1px solid $nice-border-color;
|
|
13
|
-
box-shadow: $nice-box-shadow;
|
|
14
|
-
padding: 10px;
|
|
15
|
-
margin-top: 0.5rem;
|
|
16
|
-
|
|
17
|
-
display: grid;
|
|
18
|
-
grid-template-columns: 1fr 1fr;
|
|
19
|
-
gap: 10px;
|
|
20
|
-
|
|
21
|
-
.numbers {
|
|
22
|
-
font-size: 1.5rem;
|
|
23
|
-
color: $nice-font-color;
|
|
24
|
-
line-height: 1;
|
|
25
|
-
text-align: center;
|
|
26
|
-
padding: 5px 0;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.nice-background {
|
|
31
|
-
position: fixed;
|
|
32
|
-
top: 0;
|
|
33
|
-
left: 0;
|
|
34
|
-
width: 100%;
|
|
35
|
-
z-index: 800;
|
|
36
|
-
height: 100%;
|
|
37
|
-
}
|
|
1
|
+
.nice-time-picker {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.nice-time-picker-dropdown {
|
|
5
|
+
z-index: 900;
|
|
6
|
+
border-radius: $nice-border-radius;
|
|
7
|
+
position: absolute;
|
|
8
|
+
top: 100%;
|
|
9
|
+
left: 15px;
|
|
10
|
+
width: 130px;
|
|
11
|
+
background: white;
|
|
12
|
+
border: 1px solid $nice-border-color;
|
|
13
|
+
box-shadow: $nice-box-shadow;
|
|
14
|
+
padding: 10px;
|
|
15
|
+
margin-top: 0.5rem;
|
|
16
|
+
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: 1fr 1fr;
|
|
19
|
+
gap: 10px;
|
|
20
|
+
|
|
21
|
+
.numbers {
|
|
22
|
+
font-size: 1.5rem;
|
|
23
|
+
color: $nice-font-color;
|
|
24
|
+
line-height: 1;
|
|
25
|
+
text-align: center;
|
|
26
|
+
padding: 5px 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.nice-background {
|
|
31
|
+
position: fixed;
|
|
32
|
+
top: 0;
|
|
33
|
+
left: 0;
|
|
34
|
+
width: 100%;
|
|
35
|
+
z-index: 800;
|
|
36
|
+
height: 100%;
|
|
37
|
+
}
|
|
38
38
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<div class="nice-title col-xs-12" ng-class="[labelWidth ? labelWidth : 'col-sm-4', {'nice-title-empty': !text && !help} ]" ng-if="text">
|
|
2
|
-
<div class="nice-title-text">{{ text }}<span class="nice-title-required" ng-if="required">*</span></div>
|
|
3
|
-
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
1
|
+
<div class="nice-title col-xs-12" ng-class="[labelWidth ? labelWidth : 'col-sm-4', {'nice-title-empty': !text && !help} ]" ng-if="text">
|
|
2
|
+
<div class="nice-title-text">{{ text }}<span class="nice-title-required" ng-if="required">*</span></div>
|
|
3
|
+
<nice-help class="nice-title-help" ng-if="help" text="{{ help }}"></nice-help>
|
|
4
4
|
</div>
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceTitle
|
|
6
|
-
* @description
|
|
7
|
-
* # niceTitle
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive('niceTitle', function () {
|
|
11
|
-
return {
|
|
12
|
-
templateUrl: 'src/components/nice-title/nice-title.html',
|
|
13
|
-
restrict: 'E',
|
|
14
|
-
scope: {
|
|
15
|
-
labelWidth: '=?',
|
|
16
|
-
text: '=?',
|
|
17
|
-
required: '=?',
|
|
18
|
-
help: '=?'
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
});
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceTitle
|
|
6
|
+
* @description
|
|
7
|
+
* # niceTitle
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceTitle', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-title/nice-title.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
scope: {
|
|
15
|
+
labelWidth: '=?',
|
|
16
|
+
text: '=?',
|
|
17
|
+
required: '=?',
|
|
18
|
+
help: '=?'
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
});
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
<div class="nice-toasts" ng-class="position">
|
|
2
|
-
<div class="nice-toast" ng-class="toast.type" ng-repeat="toast in toasts">{{ toast.message }}</div>
|
|
1
|
+
<div class="nice-toasts" ng-class="position">
|
|
2
|
+
<div class="nice-toast" ng-class="toast.type" ng-repeat="toast in toasts">{{ toast.message }}</div>
|
|
3
3
|
</div>
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @ngdoc directive
|
|
5
|
-
* @name niceElements.directive:niceToast
|
|
6
|
-
* @description
|
|
7
|
-
* # niceToast
|
|
8
|
-
*/
|
|
9
|
-
angular.module('niceElements')
|
|
10
|
-
.directive("niceToast", function () {
|
|
11
|
-
return {
|
|
12
|
-
restrict: "E",
|
|
13
|
-
templateUrl: "src/components/nice-toast/nice-toast.html",
|
|
14
|
-
scope: {
|
|
15
|
-
position: '@',
|
|
16
|
-
timeoutTime: '@',
|
|
17
|
-
},
|
|
18
|
-
controller: function ($scope, $timeout) {
|
|
19
|
-
if (!$scope.position) $scope.position = "bottom center";
|
|
20
|
-
if (!$scope.timeoutTime) $scope.timeoutTime = 2000;
|
|
21
|
-
$scope.toasts = [];
|
|
22
|
-
|
|
23
|
-
// -------------------------- Watch for events --------------------------
|
|
24
|
-
$scope.$on('toast', function (e, message, type) {
|
|
25
|
-
$scope.createToast(message, type);
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// -------------------------- Create toast --------------------------
|
|
30
|
-
$scope.createToast = function (message, type) {
|
|
31
|
-
// Create new toast
|
|
32
|
-
const toast = {
|
|
33
|
-
id: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10),
|
|
34
|
-
message: message,
|
|
35
|
-
type: type || "default"
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
// Append toast
|
|
39
|
-
$scope.toasts.push(toast);
|
|
40
|
-
|
|
41
|
-
// Remove after some time
|
|
42
|
-
$timeout(function () {
|
|
43
|
-
$scope.removeToast(toast);
|
|
44
|
-
}, $scope.timeoutTime);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
// -------------------------- Remove toast --------------------------
|
|
49
|
-
$scope.removeToast = function (toast) {
|
|
50
|
-
const toastIndex = $scope.toasts.findIndex(function (a) { return a.id == toast.id })
|
|
51
|
-
if (toastIndex >= 0) {
|
|
52
|
-
$scope.toasts.splice(toastIndex, 1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
};
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceToast
|
|
6
|
+
* @description
|
|
7
|
+
* # niceToast
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive("niceToast", function () {
|
|
11
|
+
return {
|
|
12
|
+
restrict: "E",
|
|
13
|
+
templateUrl: "src/components/nice-toast/nice-toast.html",
|
|
14
|
+
scope: {
|
|
15
|
+
position: '@',
|
|
16
|
+
timeoutTime: '@',
|
|
17
|
+
},
|
|
18
|
+
controller: function ($scope, $timeout) {
|
|
19
|
+
if (!$scope.position) $scope.position = "bottom center";
|
|
20
|
+
if (!$scope.timeoutTime) $scope.timeoutTime = 2000;
|
|
21
|
+
$scope.toasts = [];
|
|
22
|
+
|
|
23
|
+
// -------------------------- Watch for events --------------------------
|
|
24
|
+
$scope.$on('toast', function (e, message, type) {
|
|
25
|
+
$scope.createToast(message, type);
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
// -------------------------- Create toast --------------------------
|
|
30
|
+
$scope.createToast = function (message, type) {
|
|
31
|
+
// Create new toast
|
|
32
|
+
const toast = {
|
|
33
|
+
id: Math.random().toString(36).replace(/[^a-z]+/g, '').substr(2, 10),
|
|
34
|
+
message: message,
|
|
35
|
+
type: type || "default"
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Append toast
|
|
39
|
+
$scope.toasts.push(toast);
|
|
40
|
+
|
|
41
|
+
// Remove after some time
|
|
42
|
+
$timeout(function () {
|
|
43
|
+
$scope.removeToast(toast);
|
|
44
|
+
}, $scope.timeoutTime);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
// -------------------------- Remove toast --------------------------
|
|
49
|
+
$scope.removeToast = function (toast) {
|
|
50
|
+
const toastIndex = $scope.toasts.findIndex(function (a) { return a.id == toast.id })
|
|
51
|
+
if (toastIndex >= 0) {
|
|
52
|
+
$scope.toasts.splice(toastIndex, 1);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
57
|
});
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
.nice-toasts {
|
|
2
|
-
z-index: 9999999;
|
|
3
|
-
position: fixed;
|
|
4
|
-
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
align-items: center;
|
|
8
|
-
|
|
9
|
-
gap: 0.5rem;
|
|
10
|
-
padding: 1rem;
|
|
11
|
-
|
|
12
|
-
&.top {
|
|
13
|
-
top: $nice-navbar-height;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&.bottom {
|
|
17
|
-
bottom: 0;
|
|
18
|
-
flex-direction: column-reverse;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&.center {
|
|
22
|
-
right: 50%;
|
|
23
|
-
transform: translateX(50%);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&.left {
|
|
27
|
-
left: 0;
|
|
28
|
-
align-items: flex-start;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&.right {
|
|
32
|
-
right: 0;
|
|
33
|
-
align-items: flex-end;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
.nice-toast {
|
|
37
|
-
background: $nice-hover-color;
|
|
38
|
-
padding: 0.3rem 1.2rem;
|
|
39
|
-
border-radius: 30px;
|
|
40
|
-
font-size: 0.8em;
|
|
41
|
-
font-weight: bold;
|
|
42
|
-
box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
|
|
43
|
-
max-width: 500px;
|
|
44
|
-
|
|
45
|
-
&.success {
|
|
46
|
-
color: white;
|
|
47
|
-
background: $nice-notification-success-bg;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&.error {
|
|
51
|
-
color: white;
|
|
52
|
-
background: $nice-notification-danger-color-bg;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.toast-enter-active {
|
|
58
|
-
animation: bounce-in .5s;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.toast-leave-active {
|
|
62
|
-
animation: bounce-in .5s reverse;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
@keyframes bounce-in {
|
|
66
|
-
from {
|
|
67
|
-
transform: translateY(100%);
|
|
68
|
-
opacity: 1;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
to {
|
|
72
|
-
transform: translateY(0);
|
|
73
|
-
opacity: 1;
|
|
74
|
-
}
|
|
1
|
+
.nice-toasts {
|
|
2
|
+
z-index: 9999999;
|
|
3
|
+
position: fixed;
|
|
4
|
+
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
|
|
9
|
+
gap: 0.5rem;
|
|
10
|
+
padding: 1rem;
|
|
11
|
+
|
|
12
|
+
&.top {
|
|
13
|
+
top: $nice-navbar-height;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.bottom {
|
|
17
|
+
bottom: 0;
|
|
18
|
+
flex-direction: column-reverse;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
&.center {
|
|
22
|
+
right: 50%;
|
|
23
|
+
transform: translateX(50%);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
&.left {
|
|
27
|
+
left: 0;
|
|
28
|
+
align-items: flex-start;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&.right {
|
|
32
|
+
right: 0;
|
|
33
|
+
align-items: flex-end;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.nice-toast {
|
|
37
|
+
background: $nice-hover-color;
|
|
38
|
+
padding: 0.3rem 1.2rem;
|
|
39
|
+
border-radius: 30px;
|
|
40
|
+
font-size: 0.8em;
|
|
41
|
+
font-weight: bold;
|
|
42
|
+
box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
|
|
43
|
+
max-width: 500px;
|
|
44
|
+
|
|
45
|
+
&.success {
|
|
46
|
+
color: white;
|
|
47
|
+
background: $nice-notification-success-bg;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.error {
|
|
51
|
+
color: white;
|
|
52
|
+
background: $nice-notification-danger-color-bg;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.toast-enter-active {
|
|
58
|
+
animation: bounce-in .5s;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.toast-leave-active {
|
|
62
|
+
animation: bounce-in .5s reverse;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes bounce-in {
|
|
66
|
+
from {
|
|
67
|
+
transform: translateY(100%);
|
|
68
|
+
opacity: 1;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
to {
|
|
72
|
+
transform: translateY(0);
|
|
73
|
+
opacity: 1;
|
|
74
|
+
}
|
|
75
75
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
<div class="nice-component nice-toggle" ng-class="{ 'margin-bottom-0': noMargin, 'title-right': titleRight, 'nice-component-inline': isInline, 'nice-component-block': isBlock, 'active': inverted ? !model : model }" ng-form="formToggle">
|
|
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
|
-
<button type="button" class="nice-toggle-field" ng-click="toggle()" ng-disabled="isDisabled">
|
|
9
|
-
<div class="nice-toggle-field-handle">{{ state }}</div>
|
|
10
|
-
</button>
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
1
|
+
<div class="nice-component nice-toggle" ng-class="{ 'margin-bottom-0': noMargin, 'title-right': titleRight, 'nice-component-inline': isInline, 'nice-component-block': isBlock, 'active': inverted ? !model : model }" ng-form="formToggle">
|
|
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
|
+
<button type="button" class="nice-toggle-field" ng-click="toggle()" ng-disabled="isDisabled">
|
|
9
|
+
<div class="nice-toggle-field-handle">{{ state }}</div>
|
|
10
|
+
</button>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
13
|
</div>
|