nice-elements 1.12.6 → 1.12.8
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 +568 -557
- package/LICENSE.md +21 -21
- package/README.md +98 -98
- package/bower.json +17 -17
- package/dist/nice.js +11585 -8987
- package/dist/nice.min.js +1 -1
- package/dist/style.css +15 -8
- package/dist/style.css.map +2 -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.html +1 -0
- package/src/components/nice-avatar/nice-avatar.js +122 -0
- package/src/components/nice-avatar/nice-avatar.scss +5 -0
- 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 +9 -9
- package/src/components/nice-checkbox/nice-checkbox.js +37 -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-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 +82 -82
- package/src/components/nice-date/nice-date.js +350 -350
- package/src/components/nice-date/nice-date.scss +305 -305
- package/src/components/nice-date-input/nice-date-input.html +56 -56
- package/src/components/nice-date-input/nice-date-input.js +143 -143
- package/src/components/nice-date-input/nice-date-input.scss +55 -55
- package/src/components/nice-date-range/nice-date-range.html +15 -15
- package/src/components/nice-date-range/nice-date-range.js +78 -78
- package/src/components/nice-date-range/nice-date-range.scss +390 -390
- package/src/components/nice-datetime-picker/nice-datetime-picker.html +29 -29
- package/src/components/nice-datetime-picker/nice-datetime-picker.js +89 -89
- package/src/components/nice-datetime-picker/nice-datetime-picker.scss +428 -428
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +55 -55
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.js +248 -248
- package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.scss +73 -73
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.html +44 -44
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.js +175 -175
- package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +127 -127
- package/src/components/nice-dropdown/nice-dropdown.html +61 -61
- package/src/components/nice-dropdown/nice-dropdown.js +517 -517
- package/src/components/nice-dropdown/nice-dropdown.scss +262 -262
- package/src/components/nice-dropdown-date/nice-dropdown-date.html +28 -28
- package/src/components/nice-dropdown-date/nice-dropdown-date.js +132 -132
- package/src/components/nice-dropdown-date/nice-dropdown-date.scss +87 -87
- package/src/components/nice-dropdown-old/nice-dropdown-old.html +44 -44
- package/src/components/nice-dropdown-old/nice-dropdown-old.js +330 -330
- package/src/components/nice-dropdown-old/nice-dropdown-old.scss +129 -129
- package/src/components/nice-dtp/nice-dtp.html +91 -91
- package/src/components/nice-dtp/nice-dtp.js +835 -835
- package/src/components/nice-help/nice-help.html +6 -6
- package/src/components/nice-help/nice-help.js +58 -58
- package/src/components/nice-help/nice-help.scss +78 -78
- package/src/components/nice-input/nice-input.html +47 -47
- package/src/components/nice-input/nice-input.js +251 -251
- package/src/components/nice-input/nice-input.scss +130 -130
- package/src/components/nice-label/nice-label.html +10 -10
- package/src/components/nice-label/nice-label.js +32 -32
- package/src/components/nice-loader/nice-loader.html +6 -6
- package/src/components/nice-loader/nice-loader.js +28 -28
- package/src/components/nice-loader/nice-loader.scss +47 -47
- package/src/components/nice-no-data/nice-no-data.html +3 -3
- package/src/components/nice-no-data/nice-no-data.js +27 -27
- package/src/components/nice-no-data/nice-no-data.scss +26 -26
- package/src/components/nice-notification/nice-notification.html +3 -3
- package/src/components/nice-notification/nice-notification.js +124 -124
- package/src/components/nice-notification/nice-notification.scss +66 -66
- package/src/components/nice-number/nice-number.html +40 -40
- package/src/components/nice-number/nice-number.js +172 -172
- package/src/components/nice-number/nice-number.scss +18 -18
- package/src/components/nice-on-scroll/nice-on-scroll.js +17 -17
- package/src/components/nice-percent/nice-percent.html +24 -24
- package/src/components/nice-percent/nice-percent.js +95 -95
- package/src/components/nice-pill/nice-pill.html +3 -3
- package/src/components/nice-pill/nice-pill.js +29 -29
- package/src/components/nice-pill/nice-pill.scss +25 -25
- package/src/components/nice-popup/nice-popup.html +6 -6
- package/src/components/nice-popup/nice-popup.js +122 -122
- package/src/components/nice-popup/nice-popup.scss +43 -43
- package/src/components/nice-progress-bar/nice-progress-bar.html +15 -15
- package/src/components/nice-progress-bar/nice-progress-bar.js +55 -55
- package/src/components/nice-progress-bar/nice-progress-bar.scss +47 -47
- package/src/components/nice-quantity/nice-quantity.html +22 -22
- package/src/components/nice-quantity/nice-quantity.js +57 -57
- package/src/components/nice-quantity/nice-quantity.scss +51 -51
- package/src/components/nice-search/nice-search.html +44 -44
- package/src/components/nice-search/nice-search.js +243 -243
- package/src/components/nice-search/nice-search.scss +90 -90
- package/src/components/nice-search2/nice-search2.html +32 -32
- package/src/components/nice-search2/nice-search2.js +267 -267
- package/src/components/nice-search2/nice-search2.scss +80 -80
- package/src/components/nice-slot/nice-slot.html +10 -10
- package/src/components/nice-slot/nice-slot.js +31 -31
- package/src/components/nice-steps/nice-steps.scss +81 -81
- package/src/components/nice-svgs/nice-svgs.html +1320 -1285
- 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-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 +63 -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 +479 -479
- package/src/styles/_nice-ngdialog.scss +85 -85
- package/src/styles/_nice-spacing.scss +283 -283
- package/src/styles/_nice.scss +72 -71
- package/src/styles/_variables.scss +194 -194
package/eslint.config.mjs
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
import pluginJs from "@eslint/js";
|
|
3
|
-
|
|
4
|
-
export default [
|
|
5
|
-
{
|
|
6
|
-
files: ["**/*.js"],
|
|
7
|
-
languageOptions: {
|
|
8
|
-
sourceType: "script"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
languageOptions: {
|
|
13
|
-
globals: {
|
|
14
|
-
...globals.browser,
|
|
15
|
-
angular: true,
|
|
16
|
-
moment: true,
|
|
17
|
-
Popper: true,
|
|
18
|
-
gettextCatalog: true,
|
|
19
|
-
Decimal: true,
|
|
20
|
-
_: true
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
pluginJs.configs.recommended,
|
|
25
|
-
{
|
|
26
|
-
rules: {
|
|
27
|
-
"no-unused-vars": "warn",
|
|
28
|
-
"no-var": "warn",
|
|
29
|
-
"no-console": "warn",
|
|
30
|
-
"semi": "warn"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import pluginJs from "@eslint/js";
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
files: ["**/*.js"],
|
|
7
|
+
languageOptions: {
|
|
8
|
+
sourceType: "script"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
languageOptions: {
|
|
13
|
+
globals: {
|
|
14
|
+
...globals.browser,
|
|
15
|
+
angular: true,
|
|
16
|
+
moment: true,
|
|
17
|
+
Popper: true,
|
|
18
|
+
gettextCatalog: true,
|
|
19
|
+
Decimal: true,
|
|
20
|
+
_: true
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
pluginJs.configs.recommended,
|
|
25
|
+
{
|
|
26
|
+
rules: {
|
|
27
|
+
"no-unused-vars": "warn",
|
|
28
|
+
"no-var": "warn",
|
|
29
|
+
"no-console": "warn",
|
|
30
|
+
"semi": "warn"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
33
|
];
|
package/package.json
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "nice-elements",
|
|
3
|
-
"version": "1.12.
|
|
4
|
-
"description": "Nice elements used in olaii angular 1.x webapps.",
|
|
5
|
-
"main": "dist/nice.js",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"serve": "node server.js",
|
|
9
|
-
"build": "grunt"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@olaii/ng-infinite-scroll": "1.3.1",
|
|
13
|
-
"angular-infinite-scroll": "3.1.1",
|
|
14
|
-
"@popperjs/core": "2.11.6",
|
|
15
|
-
"angular": "1.5.8",
|
|
16
|
-
"angular-animate": "1.5.8",
|
|
17
|
-
"angular-gettext": "2.4.2",
|
|
18
|
-
"angular-route": "1.5.8",
|
|
19
|
-
"angular-sanitize": "1.5.8",
|
|
20
|
-
"angular-touch": "1.5.8",
|
|
21
|
-
"angular-truncate": "latest",
|
|
22
|
-
"bootstrap": "3.3.7",
|
|
23
|
-
"decimal.js": "10.2.1",
|
|
24
|
-
"font-awesome": "4.7.0",
|
|
25
|
-
"lodash": "3.9.3",
|
|
26
|
-
"moment": "2.29.4",
|
|
27
|
-
"ng-dialog": "0.5.6"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@eslint/js": "^9.2.0",
|
|
31
|
-
"eslint": "^9.2.0",
|
|
32
|
-
"globals": "^15.2.0",
|
|
33
|
-
"express": "4.17.1",
|
|
34
|
-
"grunt": "1.6.1",
|
|
35
|
-
"grunt-angular-templates": "1.2.0",
|
|
36
|
-
"grunt-contrib-clean": "2.0.0",
|
|
37
|
-
"grunt-contrib-concat": "1.0.1",
|
|
38
|
-
"grunt-contrib-cssmin": "4.0.0",
|
|
39
|
-
"grunt-contrib-jshint": "3.0.0",
|
|
40
|
-
"grunt-contrib-uglify": "5.0.1",
|
|
41
|
-
"grunt-sass": "3.1.0",
|
|
42
|
-
"load-grunt-tasks": "5.1.0",
|
|
43
|
-
"node-sass": "9.0.0"
|
|
44
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "nice-elements",
|
|
3
|
+
"version": "1.12.8",
|
|
4
|
+
"description": "Nice elements used in olaii angular 1.x webapps.",
|
|
5
|
+
"main": "dist/nice.js",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"serve": "node server.js",
|
|
9
|
+
"build": "grunt"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@olaii/ng-infinite-scroll": "1.3.1",
|
|
13
|
+
"angular-infinite-scroll": "3.1.1",
|
|
14
|
+
"@popperjs/core": "2.11.6",
|
|
15
|
+
"angular": "1.5.8",
|
|
16
|
+
"angular-animate": "1.5.8",
|
|
17
|
+
"angular-gettext": "2.4.2",
|
|
18
|
+
"angular-route": "1.5.8",
|
|
19
|
+
"angular-sanitize": "1.5.8",
|
|
20
|
+
"angular-touch": "1.5.8",
|
|
21
|
+
"angular-truncate": "latest",
|
|
22
|
+
"bootstrap": "3.3.7",
|
|
23
|
+
"decimal.js": "10.2.1",
|
|
24
|
+
"font-awesome": "4.7.0",
|
|
25
|
+
"lodash": "3.9.3",
|
|
26
|
+
"moment": "2.29.4",
|
|
27
|
+
"ng-dialog": "0.5.6"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@eslint/js": "^9.2.0",
|
|
31
|
+
"eslint": "^9.2.0",
|
|
32
|
+
"globals": "^15.2.0",
|
|
33
|
+
"express": "4.17.1",
|
|
34
|
+
"grunt": "1.6.1",
|
|
35
|
+
"grunt-angular-templates": "1.2.0",
|
|
36
|
+
"grunt-contrib-clean": "2.0.0",
|
|
37
|
+
"grunt-contrib-concat": "1.0.1",
|
|
38
|
+
"grunt-contrib-cssmin": "4.0.0",
|
|
39
|
+
"grunt-contrib-jshint": "3.0.0",
|
|
40
|
+
"grunt-contrib-uglify": "5.0.1",
|
|
41
|
+
"grunt-sass": "3.1.0",
|
|
42
|
+
"load-grunt-tasks": "5.1.0",
|
|
43
|
+
"node-sass": "9.0.0"
|
|
44
|
+
}
|
|
45
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<div class="nice-alert" ng-class="['nice-alert-' + type, { 'nice-alert-large-icon': largeIcon, 'nice-alert-fit': fitContent, 'nice-icon-center': iconCenter }]">
|
|
2
|
-
<nice-icon class="nice-alert-icon" icon="{{ icon }}" ng-if="icon"></nice-icon>
|
|
3
|
-
<div class="nice-alert-body">
|
|
4
|
-
<div class="nice-alert-title" ng-if="niceTitle">{{ niceTitle }}</div>
|
|
5
|
-
<div class="nice-alert-message" ng-transclude>{{ message }}</div>
|
|
6
|
-
</div>
|
|
1
|
+
<div class="nice-alert" ng-class="['nice-alert-' + type, { 'nice-alert-large-icon': largeIcon, 'nice-alert-fit': fitContent, 'nice-icon-center': iconCenter }]">
|
|
2
|
+
<nice-icon class="nice-alert-icon" icon="{{ icon }}" ng-if="icon"></nice-icon>
|
|
3
|
+
<div class="nice-alert-body">
|
|
4
|
+
<div class="nice-alert-title" ng-if="niceTitle">{{ niceTitle }}</div>
|
|
5
|
+
<div class="nice-alert-message" ng-transclude>{{ message }}</div>
|
|
6
|
+
</div>
|
|
7
7
|
</div>
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @ngdoc directive
|
|
4
|
-
* @name niceElements.directive:niceAlert
|
|
5
|
-
* @description
|
|
6
|
-
* # niceAlert
|
|
7
|
-
*/
|
|
8
|
-
angular.module('niceElements')
|
|
9
|
-
.directive('niceAlert', function () {
|
|
10
|
-
return {
|
|
11
|
-
templateUrl: 'src/components/nice-alert/nice-alert.html',
|
|
12
|
-
restrict: 'E',
|
|
13
|
-
transclude: true,
|
|
14
|
-
replace: true,
|
|
15
|
-
scope: {
|
|
16
|
-
icon: '@?',
|
|
17
|
-
type: '@?',
|
|
18
|
-
niceTitle: '@?',
|
|
19
|
-
message: '@?',
|
|
20
|
-
fitContent: '=?',
|
|
21
|
-
iconCenter: '@?',
|
|
22
|
-
largeIcon: '@?'
|
|
23
|
-
},
|
|
24
|
-
controller: function ($scope) {
|
|
25
|
-
if (!$scope.type) $scope.type = "error";
|
|
26
|
-
if (!$scope.icon) $scope.icon = "icon-alert-triangle";
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
});
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @ngdoc directive
|
|
4
|
+
* @name niceElements.directive:niceAlert
|
|
5
|
+
* @description
|
|
6
|
+
* # niceAlert
|
|
7
|
+
*/
|
|
8
|
+
angular.module('niceElements')
|
|
9
|
+
.directive('niceAlert', function () {
|
|
10
|
+
return {
|
|
11
|
+
templateUrl: 'src/components/nice-alert/nice-alert.html',
|
|
12
|
+
restrict: 'E',
|
|
13
|
+
transclude: true,
|
|
14
|
+
replace: true,
|
|
15
|
+
scope: {
|
|
16
|
+
icon: '@?',
|
|
17
|
+
type: '@?',
|
|
18
|
+
niceTitle: '@?',
|
|
19
|
+
message: '@?',
|
|
20
|
+
fitContent: '=?',
|
|
21
|
+
iconCenter: '@?',
|
|
22
|
+
largeIcon: '@?'
|
|
23
|
+
},
|
|
24
|
+
controller: function ($scope) {
|
|
25
|
+
if (!$scope.type) $scope.type = "error";
|
|
26
|
+
if (!$scope.icon) $scope.icon = "icon-alert-triangle";
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
});
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
.nice-alert {
|
|
2
|
-
padding: 2rem;
|
|
3
|
-
border: 1px solid var(--nice-border-color);
|
|
4
|
-
border-radius: var(--nice-border-radius);
|
|
5
|
-
display: flex;
|
|
6
|
-
gap: 1rem;
|
|
7
|
-
|
|
8
|
-
&.nice-alert-fit {
|
|
9
|
-
width: fit-content;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
&.nice-icon-center {
|
|
13
|
-
align-items: center;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&.nice-alert-large-icon {
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
|
|
19
|
-
.nice-alert-icon {
|
|
20
|
-
height: 100px;
|
|
21
|
-
width: auto;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.nice-alert-icon {
|
|
26
|
-
height: 30px;
|
|
27
|
-
width: 30px;
|
|
28
|
-
flex-shrink: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.nice-alert-title {
|
|
32
|
-
font-size: 1.2em;
|
|
33
|
-
font-weight: bold;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&.nice-alert-success {
|
|
37
|
-
color: var(--nice-success-color-darker);
|
|
38
|
-
background: var(--nice-success-color-plain);
|
|
39
|
-
border-color: var(--nice-success-color-lighter);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&.nice-alert-danger,
|
|
43
|
-
&.nice-alert-error {
|
|
44
|
-
color: var(--nice-danger-color);
|
|
45
|
-
background: var(--nice-danger-color-plain);
|
|
46
|
-
border-color: var(--nice-danger-color-lighter);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
&.nice-alert-warning {
|
|
50
|
-
color: var(--nice-warning-color-darker);
|
|
51
|
-
background: var(--nice-warning-color-plain);
|
|
52
|
-
border-color: var(--nice-warning-color-lighter);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
&.nice-alert-info {
|
|
56
|
-
color: var(--nice-info-color-darker);
|
|
57
|
-
background: var(--nice-info-color-plain);
|
|
58
|
-
border-color: var(--nice-info-color-lighter);
|
|
59
|
-
}
|
|
1
|
+
.nice-alert {
|
|
2
|
+
padding: 2rem;
|
|
3
|
+
border: 1px solid var(--nice-border-color);
|
|
4
|
+
border-radius: var(--nice-border-radius);
|
|
5
|
+
display: flex;
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
|
|
8
|
+
&.nice-alert-fit {
|
|
9
|
+
width: fit-content;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.nice-icon-center {
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&.nice-alert-large-icon {
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
|
|
19
|
+
.nice-alert-icon {
|
|
20
|
+
height: 100px;
|
|
21
|
+
width: auto;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.nice-alert-icon {
|
|
26
|
+
height: 30px;
|
|
27
|
+
width: 30px;
|
|
28
|
+
flex-shrink: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.nice-alert-title {
|
|
32
|
+
font-size: 1.2em;
|
|
33
|
+
font-weight: bold;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&.nice-alert-success {
|
|
37
|
+
color: var(--nice-success-color-darker);
|
|
38
|
+
background: var(--nice-success-color-plain);
|
|
39
|
+
border-color: var(--nice-success-color-lighter);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.nice-alert-danger,
|
|
43
|
+
&.nice-alert-error {
|
|
44
|
+
color: var(--nice-danger-color);
|
|
45
|
+
background: var(--nice-danger-color-plain);
|
|
46
|
+
border-color: var(--nice-danger-color-lighter);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&.nice-alert-warning {
|
|
50
|
+
color: var(--nice-warning-color-darker);
|
|
51
|
+
background: var(--nice-warning-color-plain);
|
|
52
|
+
border-color: var(--nice-warning-color-lighter);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&.nice-alert-info {
|
|
56
|
+
color: var(--nice-info-color-darker);
|
|
57
|
+
background: var(--nice-info-color-plain);
|
|
58
|
+
border-color: var(--nice-info-color-lighter);
|
|
59
|
+
}
|
|
60
60
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<canvas class="nice-avatar"></canvas>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @ngdoc directive
|
|
4
|
+
* @name niceElements.directive:niceAvatar
|
|
5
|
+
* @description
|
|
6
|
+
* # niceAvatar
|
|
7
|
+
*/
|
|
8
|
+
angular.module('niceElements')
|
|
9
|
+
.directive('niceAvatar', function () {
|
|
10
|
+
return {
|
|
11
|
+
templateUrl: 'src/components/nice-avatar/nice-avatar.html',
|
|
12
|
+
restrict: 'E',
|
|
13
|
+
replace: true,
|
|
14
|
+
scope: {
|
|
15
|
+
text: '@?',
|
|
16
|
+
},
|
|
17
|
+
controller: function ($scope, $element, $timeout) {
|
|
18
|
+
/**
|
|
19
|
+
* Handles the generation process when the button is clicked or on initial load.
|
|
20
|
+
*/
|
|
21
|
+
function generateAndDraw() {
|
|
22
|
+
|
|
23
|
+
// Get references to DOM elements
|
|
24
|
+
const avatarCanvas = $element[0];
|
|
25
|
+
const ctx = avatarCanvas.getContext('2d');
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Simple Pseudo-Random Number Generator (PRNG) using a seed.
|
|
29
|
+
* This ensures that for the same seed, the sequence of "random" numbers is identical.
|
|
30
|
+
* Based on a common LCG (Linear Congenital Generator) algorithm.
|
|
31
|
+
* @param {number} seed - The initial seed value.
|
|
32
|
+
* @returns {function(): number} A function that generates the next pseudo-random number (0-1).
|
|
33
|
+
*/
|
|
34
|
+
function createSeededRandom(seed) {
|
|
35
|
+
// Use a simple string hashing for the initial seed if it's a string
|
|
36
|
+
let currentSeed = typeof seed === 'string' ? hashString(seed) : seed;
|
|
37
|
+
|
|
38
|
+
// LCG parameters
|
|
39
|
+
const a = 1103515245;
|
|
40
|
+
const c = 12345;
|
|
41
|
+
const m = 2 ** 31; // Modulus (a large prime number or power of 2)
|
|
42
|
+
|
|
43
|
+
return function () {
|
|
44
|
+
currentSeed = (a * currentSeed + c) % m;
|
|
45
|
+
return currentSeed / m; // Normalize to a value between 0 and 1
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Simple string hashing function to convert a string seed into a number.
|
|
51
|
+
* @param {string} str - The string to hash.
|
|
52
|
+
* @returns {number} A numerical hash value.
|
|
53
|
+
*/
|
|
54
|
+
function hashString(str) {
|
|
55
|
+
let hash = 0;
|
|
56
|
+
for (let i = 0; i < str.length; i++) {
|
|
57
|
+
const char = str.charCodeAt(i);
|
|
58
|
+
hash = ((hash << 5) - hash) + char; // Bitwise operations for speed
|
|
59
|
+
hash |= 0; // Convert to 32bit integer
|
|
60
|
+
}
|
|
61
|
+
return Math.abs(hash); // Ensure positive hash
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Generates a random color in HSL format based on the seeded random number generator.
|
|
66
|
+
* HSL (Hue, Saturation, Lightness) is good for generating visually distinct colors.
|
|
67
|
+
* @param {function(): number} randomFunc - The seeded random number generator function.
|
|
68
|
+
* @returns {string} An HSL color string (e.g., "hsl(120, 70%, 50%)").
|
|
69
|
+
*/
|
|
70
|
+
function generateRandomColor(randomFunc) {
|
|
71
|
+
const hue = Math.floor(randomFunc() * 360); // Hue: 0-359 degrees
|
|
72
|
+
const saturation = Math.floor(randomFunc() * 30) + 60; // Saturation: 60-90% (avoiding dull/overly vibrant)
|
|
73
|
+
const lightness = Math.floor(randomFunc() * 20) + 40; // Lightness: 40-60% (avoiding too dark/light)
|
|
74
|
+
return `hsl(${hue}, ${saturation}%, ${lightness}%)`;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Draws a linear gradient avatar on the canvas.
|
|
79
|
+
* @param {string} seed - The seed string for deterministic generation.
|
|
80
|
+
*/
|
|
81
|
+
function drawAvatar(seed) {
|
|
82
|
+
const size = avatarCanvas.width; // Canvas is square
|
|
83
|
+
const seededRandom = createSeededRandom(seed);
|
|
84
|
+
|
|
85
|
+
// Generate two deterministic colors based on the seed
|
|
86
|
+
const color1 = generateRandomColor(seededRandom);
|
|
87
|
+
const color2 = generateRandomColor(seededRandom);
|
|
88
|
+
|
|
89
|
+
// Create a linear gradient
|
|
90
|
+
// The angle of the gradient can also be made deterministic
|
|
91
|
+
const angle = seededRandom() * Math.PI * 2; // Random angle from 0 to 2*PI radians
|
|
92
|
+
|
|
93
|
+
// Calculate start and end points for the gradient based on the angle
|
|
94
|
+
const startX = size / 2 + Math.cos(angle) * size / 2;
|
|
95
|
+
const startY = size / 2 + Math.sin(angle) * size / 2;
|
|
96
|
+
const endX = size / 2 + Math.cos(angle + Math.PI) * size / 2; // Opposite direction
|
|
97
|
+
const endY = size / 2 + Math.sin(angle + Math.PI) * size / 2;
|
|
98
|
+
|
|
99
|
+
const gradient = ctx.createLinearGradient(startX, startY, endX, endY);
|
|
100
|
+
gradient.addColorStop(0, color1);
|
|
101
|
+
gradient.addColorStop(1, color2);
|
|
102
|
+
|
|
103
|
+
// Fill the canvas with the gradient
|
|
104
|
+
ctx.clearRect(0, 0, size, size); // Clear previous drawing
|
|
105
|
+
ctx.fillStyle = gradient;
|
|
106
|
+
ctx.fillRect(0, 0, size, size);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
const seed = $scope.text;
|
|
110
|
+
drawAvatar(seed);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
$timeout(function () {
|
|
114
|
+
generateAndDraw();
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
$scope.$watch('text', function () {
|
|
118
|
+
generateAndDraw();
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
<button type="{{ niceType }}" class="nice-component nice-button btn btn-primary" ng-class="{ 'margin-bottom-0' : noMargin }" ng-click="click()" ng-disabled="niceDisabled == true || niceLoading == true">
|
|
2
|
-
<nice-icon icon="{{ icon }}" ng-if="icon" ng-class="{ 'opacity-0': niceLoading }"></nice-icon>
|
|
3
|
-
<span ng-if="showSlot" ng-transclude ng-class="{ 'opacity-0': niceLoading }"></span>
|
|
4
|
-
<nice-loader ng-if="niceLoading" fulldiv="true" class="nice-button-loader"></nice-loader>
|
|
1
|
+
<button type="{{ niceType }}" class="nice-component nice-button btn btn-primary" ng-class="{ 'margin-bottom-0' : noMargin }" ng-click="click()" ng-disabled="niceDisabled == true || niceLoading == true">
|
|
2
|
+
<nice-icon icon="{{ icon }}" ng-if="icon" ng-class="{ 'opacity-0': niceLoading }"></nice-icon>
|
|
3
|
+
<span ng-if="showSlot" ng-transclude ng-class="{ 'opacity-0': niceLoading }"></span>
|
|
4
|
+
<nice-loader ng-if="niceLoading" fulldiv="true" class="nice-button-loader"></nice-loader>
|
|
5
5
|
</button>
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @ngdoc directive
|
|
4
|
-
* @name niceElements.directive:niceButton
|
|
5
|
-
* @description
|
|
6
|
-
* # niceButton
|
|
7
|
-
*/
|
|
8
|
-
angular.module('niceElements')
|
|
9
|
-
.directive('niceButton', function () {
|
|
10
|
-
return {
|
|
11
|
-
templateUrl: 'src/components/nice-button/nice-button.html',
|
|
12
|
-
restrict: 'E',
|
|
13
|
-
transclude: true,
|
|
14
|
-
replace: true,
|
|
15
|
-
scope: {
|
|
16
|
-
icon: '@?',
|
|
17
|
-
noMargin: '=',
|
|
18
|
-
niceClick: '&',
|
|
19
|
-
niceDisabled: '=',
|
|
20
|
-
addClass: '@',
|
|
21
|
-
niceType: '@?',
|
|
22
|
-
niceLoading: '=?'
|
|
23
|
-
},
|
|
24
|
-
controller: function ($q, $scope, $transclude) {
|
|
25
|
-
if ($scope.addClass != undefined) console.warn("[NICE ELEMENTS] Nice button: add-class attribute is deprecated")
|
|
26
|
-
if ($scope.niceLoading == undefined) $scope.niceLoading = false;
|
|
27
|
-
if (!$scope.niceType) $scope.niceType = "button";
|
|
28
|
-
$scope.showSlot = $transclude().length > 0;
|
|
29
|
-
|
|
30
|
-
$scope.click = function () {
|
|
31
|
-
if ($scope.niceLoading === false && $scope.niceDisabled !== true && $scope.niceClick) {
|
|
32
|
-
$scope.niceLoading = true;
|
|
33
|
-
|
|
34
|
-
$q.when($scope.niceClick()).finally(function () {
|
|
35
|
-
$scope.niceLoading = false;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
});
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* @ngdoc directive
|
|
4
|
+
* @name niceElements.directive:niceButton
|
|
5
|
+
* @description
|
|
6
|
+
* # niceButton
|
|
7
|
+
*/
|
|
8
|
+
angular.module('niceElements')
|
|
9
|
+
.directive('niceButton', function () {
|
|
10
|
+
return {
|
|
11
|
+
templateUrl: 'src/components/nice-button/nice-button.html',
|
|
12
|
+
restrict: 'E',
|
|
13
|
+
transclude: true,
|
|
14
|
+
replace: true,
|
|
15
|
+
scope: {
|
|
16
|
+
icon: '@?',
|
|
17
|
+
noMargin: '=',
|
|
18
|
+
niceClick: '&',
|
|
19
|
+
niceDisabled: '=',
|
|
20
|
+
addClass: '@',
|
|
21
|
+
niceType: '@?',
|
|
22
|
+
niceLoading: '=?'
|
|
23
|
+
},
|
|
24
|
+
controller: function ($q, $scope, $transclude) {
|
|
25
|
+
if ($scope.addClass != undefined) console.warn("[NICE ELEMENTS] Nice button: add-class attribute is deprecated")
|
|
26
|
+
if ($scope.niceLoading == undefined) $scope.niceLoading = false;
|
|
27
|
+
if (!$scope.niceType) $scope.niceType = "button";
|
|
28
|
+
$scope.showSlot = $transclude().length > 0;
|
|
29
|
+
|
|
30
|
+
$scope.click = function () {
|
|
31
|
+
if ($scope.niceLoading === false && $scope.niceDisabled !== true && $scope.niceClick) {
|
|
32
|
+
$scope.niceLoading = true;
|
|
33
|
+
|
|
34
|
+
$q.when($scope.niceClick()).finally(function () {
|
|
35
|
+
$scope.niceLoading = false;
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
.nice-button {
|
|
2
|
-
position: relative;
|
|
3
|
-
|
|
4
|
-
.opacity-0 {
|
|
5
|
-
opacity: 0.2;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.nice-button-loader {
|
|
9
|
-
background: transparent;
|
|
10
|
-
color: white;
|
|
11
|
-
|
|
12
|
-
svg {
|
|
13
|
-
width: 20px;
|
|
14
|
-
height: 20px;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
1
|
+
.nice-button {
|
|
2
|
+
position: relative;
|
|
3
|
+
|
|
4
|
+
.opacity-0 {
|
|
5
|
+
opacity: 0.2;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.nice-button-loader {
|
|
9
|
+
background: transparent;
|
|
10
|
+
color: white;
|
|
11
|
+
|
|
12
|
+
svg {
|
|
13
|
+
width: 20px;
|
|
14
|
+
height: 20px;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
17
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
<div class="nice-component nice-button-toggle row">
|
|
2
|
-
<div class="col-xs-offset-4 col-xs-8">
|
|
3
|
-
<button type="button" class="btn btn-block btn-primary" ng-click="model = !model">
|
|
4
|
-
<span>{{ label }}</span>
|
|
5
|
-
<span ng-show="!model" class="glyphicon glyphicon-menu-down"></span>
|
|
6
|
-
<span ng-show="model" class="glyphicon glyphicon-menu-up"></span>
|
|
7
|
-
</button>
|
|
8
|
-
</div>
|
|
9
|
-
</div>
|
|
1
|
+
<div class="nice-component nice-button-toggle row">
|
|
2
|
+
<div class="col-xs-offset-4 col-xs-8">
|
|
3
|
+
<button type="button" class="btn btn-block btn-primary" ng-click="model = !model">
|
|
4
|
+
<span>{{ label }}</span>
|
|
5
|
+
<span ng-show="!model" class="glyphicon glyphicon-menu-down"></span>
|
|
6
|
+
<span ng-show="model" class="glyphicon glyphicon-menu-up"></span>
|
|
7
|
+
</button>
|
|
8
|
+
</div>
|
|
9
|
+
</div>
|