nice-elements 1.7.12 → 1.8.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/CHANGELOG.md +15 -0
- package/LICENSE.md +1 -1
- package/README.md +2 -1
- package/bower.json +1 -1
- package/dist/nice.js +99 -38
- package/dist/nice.min.js +1 -1
- package/dist/style.css +91 -59
- package/dist/style.css.map +3 -2
- package/dist/style.min.css +2 -2
- package/package.json +1 -1
- package/src/components/nice-button/nice-button.html +5 -6
- package/src/components/nice-button/nice-button.js +14 -13
- package/src/components/nice-button/nice-button.scss +12 -36
- package/src/components/nice-date/nice-date.js +1 -2
- package/src/components/nice-dropdown/nice-dropdown.html +1 -1
- package/src/components/nice-loader/nice-loader.html +4 -4
- package/src/components/nice-loader/nice-loader.js +6 -0
- package/src/components/nice-loader/nice-loader.scss +15 -25
- package/src/components/nice-search/nice-search.html +5 -8
- package/src/components/nice-search/nice-search.scss +28 -12
- package/src/components/nice-search2/nice-search2.html +4 -3
- package/src/components/nice-search2/nice-search2.js +1 -0
- package/src/components/nice-wrapper/_nice-wrapper.scss +69 -0
- package/src/components/nice-wrapper/nice-wrapper.html +13 -0
- package/src/components/nice-wrapper/nice-wrapper.js +41 -0
- package/src/services/nice-service.js +1 -1
- package/src/styles/_nice-common.scss +1 -1
- package/src/styles/_nice.scss +2 -1
- package/src/styles/_variables.scss +5 -0
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
.nice-loader{
|
|
2
|
-
padding: 25px;
|
|
1
|
+
.nice-loader {
|
|
3
2
|
display: flex;
|
|
4
3
|
flex-direction: column;
|
|
5
4
|
align-items: center;
|
|
6
5
|
justify-content: center;
|
|
6
|
+
gap: 3px;
|
|
7
|
+
color: var(--nice-primary-color);
|
|
7
8
|
|
|
8
|
-
svg{
|
|
9
|
-
width: 40px;
|
|
10
|
-
height: 40px;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
svg path,
|
|
14
|
-
svg rect{
|
|
15
|
-
fill: $nice-loader-color;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
#loader{
|
|
9
|
+
svg {
|
|
19
10
|
animation: spin 0.5s infinite;
|
|
20
11
|
animation-delay: 0s;
|
|
12
|
+
width: 40px;
|
|
13
|
+
height: 40px;
|
|
14
|
+
fill: currentColor;
|
|
21
15
|
}
|
|
22
16
|
|
|
23
17
|
.nice-loader-message {
|
|
@@ -34,6 +28,7 @@
|
|
|
34
28
|
height: 100%;
|
|
35
29
|
background: rgba(255, 255, 255, 0.65);
|
|
36
30
|
z-index: 9999;
|
|
31
|
+
padding: 0;
|
|
37
32
|
}
|
|
38
33
|
|
|
39
34
|
&.nice-loader-fulldiv {
|
|
@@ -42,17 +37,12 @@
|
|
|
42
37
|
}
|
|
43
38
|
}
|
|
44
39
|
|
|
45
|
-
@-moz-keyframes spin {
|
|
46
|
-
from { -moz-transform: rotate(0deg); }
|
|
47
|
-
to { -moz-transform: rotate(360deg); }
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@-webkit-keyframes spin {
|
|
51
|
-
from { -webkit-transform: rotate(0deg); }
|
|
52
|
-
to { -webkit-transform: rotate(360deg); }
|
|
53
|
-
}
|
|
54
|
-
|
|
55
40
|
@keyframes spin {
|
|
56
|
-
from {
|
|
57
|
-
|
|
41
|
+
from {
|
|
42
|
+
transform: rotate(0deg);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
to {
|
|
46
|
+
transform: rotate(360deg);
|
|
47
|
+
}
|
|
58
48
|
}
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
|
|
8
|
-
<div class="input-group" ng-class="{
|
|
9
|
-
'disabled': isDisabled,
|
|
10
|
-
'has-warning': !isDisabled && form.$invalid && form.$dirty,
|
|
11
|
-
'has-success': !isDisabled && form.$valid && form.$dirty}
|
|
12
|
-
">
|
|
8
|
+
<div class="input-group" ng-class="{ 'disabled': isDisabled }">
|
|
13
9
|
<input class="form-control" type="text" id="{{ id }}" ng-model="modelString" ng-keypress="keypress($event)" placeholder="{{ placeholder }}" ng-disabled="isDisabled" ng-change="updateSearch()" ng-required="required" tabindex="{{ tabIndex }}">
|
|
14
10
|
|
|
15
11
|
<span class="input-group-addon clickable" ng-click="search()" ng-if="!model">
|
|
16
12
|
<!-- <i ng-show="!loading" class="fa fa-search"></i>
|
|
17
13
|
<i ng-show="loading" class="fa fa-refresh fa-spin"></i> -->
|
|
14
|
+
<!-- <nice-icon ng-show="loading" icon="icon-loader" class="d-block nice-animation-spin"></nice-icon> -->
|
|
18
15
|
<nice-icon ng-show="!loading" icon="icon-search"></nice-icon>
|
|
19
|
-
<nice-
|
|
16
|
+
<nice-loader ng-if="loading"></nice-loader>
|
|
20
17
|
</span>
|
|
21
18
|
|
|
22
19
|
<span class="input-group-addon clickable" ng-click="remove()" ng-if="model">
|
|
@@ -27,9 +24,9 @@
|
|
|
27
24
|
</div>
|
|
28
25
|
</div>
|
|
29
26
|
|
|
30
|
-
<div class="row">
|
|
27
|
+
<div class="row" ng-if="noResults || results.length">
|
|
31
28
|
<div ng-class="labelWidth ? labelWidth : 'col-sm-4'" ng-if="title"></div>
|
|
32
|
-
<div ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
29
|
+
<div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
|
|
33
30
|
<div class="nice-dropdown-empty" ng-if="noResults">
|
|
34
31
|
<div class="nice-search-row" translate translate-context="Nice">No results found.</div>
|
|
35
32
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.nice-search{
|
|
1
|
+
.nice-search {
|
|
2
2
|
position: relative;
|
|
3
3
|
|
|
4
4
|
i.ng-hide {
|
|
@@ -6,15 +6,25 @@
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.symbol {
|
|
9
|
-
input{
|
|
9
|
+
input {
|
|
10
10
|
text-align: left;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
|
|
13
|
+
.form-control {
|
|
13
14
|
padding-left: 12px;
|
|
14
15
|
}
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
.
|
|
18
|
+
.input-group-addon {
|
|
19
|
+
.nice-loader {
|
|
20
|
+
svg {
|
|
21
|
+
height: 18px;
|
|
22
|
+
width: 18px;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.nice-dropdown {
|
|
18
28
|
position: absolute;
|
|
19
29
|
z-index: 999;
|
|
20
30
|
//top: 35px;
|
|
@@ -34,10 +44,11 @@
|
|
|
34
44
|
margin: 15px;
|
|
35
45
|
right: 0;
|
|
36
46
|
|
|
37
|
-
.nice-search-row{
|
|
47
|
+
.nice-search-row {
|
|
38
48
|
padding: 10px 15px;
|
|
39
49
|
z-index: 1000;
|
|
40
50
|
width: 100%;
|
|
51
|
+
|
|
41
52
|
&:hover {
|
|
42
53
|
//color: white !important;
|
|
43
54
|
//background-color: $nice-base-color !important;
|
|
@@ -45,7 +56,7 @@
|
|
|
45
56
|
cursor: pointer;
|
|
46
57
|
}
|
|
47
58
|
|
|
48
|
-
&.active{
|
|
59
|
+
&.active {
|
|
49
60
|
// color: white;
|
|
50
61
|
background-color: $nice-hover-color;
|
|
51
62
|
cursor: pointer;
|
|
@@ -54,22 +65,27 @@
|
|
|
54
65
|
}
|
|
55
66
|
}
|
|
56
67
|
|
|
57
|
-
&:hover{
|
|
58
|
-
.active{
|
|
68
|
+
&:hover {
|
|
69
|
+
.active {
|
|
59
70
|
color: $text-color;
|
|
60
71
|
background-color: white;
|
|
61
|
-
|
|
62
|
-
|
|
72
|
+
|
|
73
|
+
p {
|
|
74
|
+
color: $text-color;
|
|
63
75
|
}
|
|
64
76
|
}
|
|
65
77
|
}
|
|
66
78
|
}
|
|
67
79
|
|
|
68
|
-
.nice-dropdown-empty{
|
|
80
|
+
.nice-dropdown-empty {
|
|
69
81
|
@extend .nice-dropdown;
|
|
70
82
|
top: -13px;
|
|
71
83
|
margin: 15px;
|
|
72
84
|
right: 0;
|
|
73
85
|
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
86
|
+
|
|
87
|
+
.nice-search-row {
|
|
88
|
+
opacity: 0.4;
|
|
89
|
+
}
|
|
74
90
|
}
|
|
75
|
-
}
|
|
91
|
+
}
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
<!------------------------- Field ------------------------->
|
|
7
7
|
<div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]" click-outside="close()">
|
|
8
|
-
<div class="nice-search-button input-group" ng-class="{ 'disabled': isDisabled
|
|
8
|
+
<div class="nice-search-button input-group" ng-class="{ 'disabled': isDisabled }">
|
|
9
9
|
<input class="form-control" type="text" id="{{ id }}" ng-model="model" placeholder="{{ placeholder }}" ng-disabled="isDisabled" ng-change="updateSearch()" ng-focus="onFocus()" tabindex="{{ tabIndex }}">
|
|
10
10
|
|
|
11
11
|
<span class="input-group-addon clickable" ng-click="onFocus()">
|
|
12
12
|
<nice-icon ng-show="!loading" icon="icon-search"></nice-icon>
|
|
13
|
-
<nice-icon ng-show="loading" icon="icon-loader" class="d-block nice-animation-spin"></nice-icon>
|
|
13
|
+
<!-- <nice-icon ng-show="loading" icon="icon-loader" class="d-block nice-animation-spin"></nice-icon> -->
|
|
14
|
+
<nice-loader ng-if="loading"></nice-loader>
|
|
14
15
|
<!-- <i ng-show="!loading" class="fa fa-search"></i>
|
|
15
16
|
<i ng-show="loading" class="fa fa-refresh fa-spin"></i> -->
|
|
16
17
|
</span>
|
|
@@ -19,7 +20,7 @@
|
|
|
19
20
|
<div class="nice-search-dropdown-wrapper">
|
|
20
21
|
<div class="nice-search-dropdown" ng-if="showDropdown && isOpen">
|
|
21
22
|
<div class="nice-search-row nice-search-row-loading" ng-if="loading && results.length == 0">
|
|
22
|
-
<nice-loader
|
|
23
|
+
<nice-loader ng-if="loading"></nice-loader>
|
|
23
24
|
</div>
|
|
24
25
|
|
|
25
26
|
<div class="nice-search-row nice-search-row-empty" ng-if="!loading && results.length == 0" translate translate-context="Nice">No results found.</div>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
.nice-wrapper {
|
|
2
|
+
border: 1px solid var(--nice-card-border);
|
|
3
|
+
background: var(--nice-card-bg);
|
|
4
|
+
border-radius: var(--nice-border-radius);
|
|
5
|
+
margin-bottom: 2rem;
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
&.collapsable {
|
|
9
|
+
.nice-wrapper-header {
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
|
|
12
|
+
&:hover {
|
|
13
|
+
background: var(--nice-hover-color);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.nice-wrapper-header,
|
|
19
|
+
.nice-wrapper-body,
|
|
20
|
+
.nice-wrapper-footer {
|
|
21
|
+
padding: var(--nice-card-padding);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.nice-wrapper-header {
|
|
25
|
+
display: flex;
|
|
26
|
+
align-items: center;
|
|
27
|
+
padding: var(--nice-card-padding);
|
|
28
|
+
|
|
29
|
+
.nice-wrapper-info {
|
|
30
|
+
flex-grow: 1;
|
|
31
|
+
|
|
32
|
+
.nice-wrapper-title {
|
|
33
|
+
font-size: 1.2em;
|
|
34
|
+
font-weight: bold;
|
|
35
|
+
line-height: 1.2;
|
|
36
|
+
color: var(--nice-primary-color);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.nice-wrapper-subtitle {
|
|
40
|
+
font-style: italic;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.nice-wrapper-toggle {
|
|
45
|
+
flex-shrink: 0;
|
|
46
|
+
transition: transform 0.3s;
|
|
47
|
+
height: 20px;
|
|
48
|
+
width: 20px;
|
|
49
|
+
padding: 0px;
|
|
50
|
+
min-height: auto !important;
|
|
51
|
+
|
|
52
|
+
&.is-open {
|
|
53
|
+
transform: rotate(180deg);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.has-header {
|
|
59
|
+
.nice-wrapper-body {
|
|
60
|
+
padding-top: 0;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.has-footer {
|
|
65
|
+
.nice-wrapper-body {
|
|
66
|
+
padding-bottom: 0;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="nice-wrapper" ng-class="{ 'collapsable': collapsable, 'has-header': hasHeader, 'has-footer': hasFooter }">
|
|
2
|
+
<div class="nice-wrapper-header" ng-if="hasHeader" ng-click="toggle()">
|
|
3
|
+
<div class="nice-wrapper-info">
|
|
4
|
+
<div class="nice-wrapper-title" ng-transclude="title">{{ title }}</div>
|
|
5
|
+
<div class="nice-wrapper-subtitle" ng-transclude="subtitle">{{ subtitle }}</div>
|
|
6
|
+
</div>
|
|
7
|
+
<button class="nice-wrapper-toggle btn btn-icon btn-default-naked" ng-if="collapsable" ng-class="{ 'is-open': isOpen }">
|
|
8
|
+
<nice-icon icon="icon-chevron-down"></nice-icon>
|
|
9
|
+
</button>
|
|
10
|
+
</div>
|
|
11
|
+
<div class="nice-wrapper-body" ng-transclude ng-if="isOpen"></div>
|
|
12
|
+
<div class="nice-wrapper-footer" ng-if="isOpen && hasFooter" ng-transclude="footer"></div>
|
|
13
|
+
</div>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @ngdoc directive
|
|
5
|
+
* @name niceElements.directive:niceWrapper
|
|
6
|
+
* @description
|
|
7
|
+
* # niceWrapper
|
|
8
|
+
*/
|
|
9
|
+
angular.module('niceElements')
|
|
10
|
+
.directive('niceWrapper', function () {
|
|
11
|
+
return {
|
|
12
|
+
templateUrl: 'src/components/nice-wrapper/nice-wrapper.html',
|
|
13
|
+
restrict: 'E',
|
|
14
|
+
replace: true,
|
|
15
|
+
transclude: {
|
|
16
|
+
'title': '?niceWrapperTitle',
|
|
17
|
+
'subtitle': '?niceWrapperSubtitle',
|
|
18
|
+
'footer': '?niceWrapperFooter'
|
|
19
|
+
},
|
|
20
|
+
scope: {
|
|
21
|
+
title: '@',
|
|
22
|
+
subtitle: '@',
|
|
23
|
+
collapsable: '=',
|
|
24
|
+
collapsed: '@',
|
|
25
|
+
},
|
|
26
|
+
controller: function ($scope, $transclude) {
|
|
27
|
+
$scope.isOpen = true;
|
|
28
|
+
if ($scope.collapsed) $scope.isOpen = false;
|
|
29
|
+
|
|
30
|
+
$scope.hasTitle = $transclude.isSlotFilled('title');
|
|
31
|
+
$scope.hasSubtitle = $transclude.isSlotFilled('subtitle');
|
|
32
|
+
$scope.hasFooter = $transclude.isSlotFilled('footer');
|
|
33
|
+
$scope.hasHeader = $scope.hasTitle || $scope.hasSubtitle || $scope.title || $scope.subtitle || $scope.collapsable;
|
|
34
|
+
|
|
35
|
+
$scope.toggle = function () {
|
|
36
|
+
if (!$scope.collapsable) return;
|
|
37
|
+
$scope.isOpen = !$scope.isOpen;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
});
|
package/src/styles/_nice.scss
CHANGED
|
@@ -54,4 +54,5 @@
|
|
|
54
54
|
@import "../components/nice-popup/nice-popup";
|
|
55
55
|
@import "../components/nice-icon/nice-icon";
|
|
56
56
|
@import "../components/nice-toast/nice-toast";
|
|
57
|
-
@import "../components/nice-date-input/nice-date-input.scss";
|
|
57
|
+
@import "../components/nice-date-input/nice-date-input.scss";
|
|
58
|
+
@import "../components/nice-wrapper/nice-wrapper.scss";
|
|
@@ -185,4 +185,9 @@ $nice-table-bg-active: #f5f5f5 !default;
|
|
|
185
185
|
--nice-disabled-color: #{$nice-disabled-color};
|
|
186
186
|
--nice-disabled-border: #{$nice-disabled-border};
|
|
187
187
|
--nice-disabled-bg: #{$nice-disabled-bg};
|
|
188
|
+
|
|
189
|
+
// ---------- Card ----------
|
|
190
|
+
--nice-card-border: #{$nice-border-color};
|
|
191
|
+
--nice-card-bg: white;
|
|
192
|
+
--nice-card-padding: 2rem;
|
|
188
193
|
}
|