nice-elements 1.5.0 → 1.6.0

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.
Files changed (41) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/CHANGELOG.md +20 -0
  3. package/README.md +48 -1
  4. package/bower.json +1 -1
  5. package/dist/nice.js +144 -100
  6. package/dist/nice.min.js +1 -1
  7. package/dist/style.css +870 -66
  8. package/dist/style.css.map +3 -1
  9. package/dist/style.min.css +2 -2
  10. package/package.json +1 -1
  11. package/src/components/nice-calendar/nice-calendar.html +10 -37
  12. package/src/components/nice-calendar/nice-calendar.scss +25 -24
  13. package/src/components/nice-checkbox/nice-checkbox.html +2 -2
  14. package/src/components/nice-checkbox/nice-checkbox.scss +5 -4
  15. package/src/components/nice-choice/nice-choice.html +1 -1
  16. package/src/components/nice-choice/nice-choice.scss +22 -22
  17. package/src/components/nice-date/nice-date.html +14 -34
  18. package/src/components/nice-date/nice-date.scss +41 -17
  19. package/src/components/nice-datetimerange-picker/nice-datetimerange-picker.html +4 -34
  20. package/src/components/nice-datetimerange-picker-2/nice-datetimerange-picker-2.scss +18 -14
  21. package/src/components/nice-dropdown/nice-dropdown.js +5 -0
  22. package/src/components/nice-dropdown/nice-dropdown.scss +5 -4
  23. package/src/components/nice-dropdown-old/nice-dropdown-old.scss +27 -26
  24. package/src/components/nice-number/nice-number.html +2 -2
  25. package/src/components/nice-number/nice-number.scss +9 -0
  26. package/src/components/nice-popup/nice-popup.js +3 -0
  27. package/src/components/nice-popup/nice-popup.scss +4 -0
  28. package/src/components/nice-quantity/nice-quantity.html +3 -10
  29. package/src/components/nice-quantity/nice-quantity.scss +17 -10
  30. package/src/components/nice-search2/nice-search2.html +2 -12
  31. package/src/components/nice-search2/nice-search2.js +34 -27
  32. package/src/components/nice-upload/nice-upload.html +4 -5
  33. package/src/components/nice-upload/nice-upload.js +73 -41
  34. package/src/components/nice-upload/nice-upload.scss +32 -13
  35. package/src/components/nice-yesno/nice-yesno.html +1 -1
  36. package/src/components/nice-yesno/nice-yesno.scss +23 -15
  37. package/src/styles/_nice-buttons.scss +335 -0
  38. package/src/styles/_nice-common.scss +84 -47
  39. package/src/styles/_nice-spacing.scss +58 -0
  40. package/src/styles/_nice.scss +2 -0
  41. package/src/styles/_variables.scss +108 -32
@@ -8,10 +8,11 @@
8
8
  width: 34px;
9
9
  border: 1px solid $nice-border-color;
10
10
  border-radius: $nice-border-radius-small;
11
+ background: transparent;
11
12
  margin: 0;
12
13
  padding: 4px;
13
14
 
14
- .check{
15
+ .check {
15
16
  opacity: 0;
16
17
  }
17
18
 
@@ -44,7 +45,7 @@
44
45
  border-color: $nice-border-color;
45
46
  background: white;
46
47
 
47
- .check{
48
+ .check {
48
49
  opacity: 1;
49
50
  }
50
51
 
@@ -53,10 +54,10 @@
53
54
  }
54
55
  }
55
56
 
56
- &:hover{
57
+ &:hover {
57
58
  .checkbox {
58
59
  border-color: darken($nice-border-color, 15%);
59
60
  }
60
61
  }
61
62
  }
62
- }
63
+ }
@@ -10,7 +10,7 @@
10
10
  <div class="nice-field col-xs-12" ng-class="fieldWidth ? fieldWidth : 'col-sm-8'">
11
11
  <ul class="list-unstyled" ng-class="{ 'disabled': isDisabled }">
12
12
  <li ng-repeat="item in internalList" ng-class="{ 'selected' : isItemSelected(item) }" ng-click="toggle(item)">
13
- <div class="choice-checkbox" ng-class="{'circle' : !multiple }"><i class="fa fa-check"></i></div>
13
+ <button class="choice-checkbox" ng-class="{'circle' : !multiple }"><i class="fa fa-check"></i></button>
14
14
  <div ng-transclude class="choice-label">{{ getLabel(item) }}</div>
15
15
  </li>
16
16
  </ul>
@@ -1,5 +1,5 @@
1
- .nice-choice{
2
- .selected{
1
+ .nice-choice {
2
+ .selected {
3
3
  .choice-checkbox {
4
4
  border-color: $nice-choice-selected-bg;
5
5
  background: $nice-choice-selected-bg;
@@ -7,66 +7,66 @@
7
7
  }
8
8
  }
9
9
 
10
- .disabled{
11
- li{
10
+ .disabled {
11
+ li {
12
12
  cursor: not-allowed;
13
13
  opacity: 0.65;
14
14
 
15
- &:hover{
16
- .choice-checkbox{
15
+ &:hover {
16
+ .choice-checkbox {
17
17
  border-color: $nice-border-color !important;
18
18
  }
19
19
  }
20
20
  }
21
21
 
22
- .selected{
23
- &:hover{
22
+ .selected {
23
+ &:hover {
24
24
  .choice-checkbox {
25
- border-color:$nice-choice-selected-bg !important;
25
+ border-color: $nice-choice-selected-bg !important;
26
26
  }
27
27
  }
28
28
  }
29
29
 
30
30
  }
31
31
 
32
- ul{
32
+ ul {
33
33
  margin-bottom: 0;
34
34
  }
35
35
 
36
- li{
37
- padding:5px 0px;
36
+ li {
37
+ padding: 5px 0px;
38
38
  @extend .noselect;
39
39
  cursor: pointer;
40
40
 
41
- .choice-checkbox{
42
- -webkit-transition: all 0.2s;
43
- -moz-transition: all 0.2s;
44
- -ms-transition: all 0.2s;
45
- -o-transition: all 0.2s;
41
+ .choice-checkbox {
46
42
  transition: all 0.2s;
47
-
48
43
  background: $nice-choice-bg;
49
44
  color: $nice-choice-bg;
50
45
  line-height: 22px;
46
+ font-size: 12px;
51
47
  width: 25px;
52
48
  height: 25px;
53
49
  border: 1px solid $nice-border-color;
54
50
  position: absolute;
55
51
  border-radius: $nice-border-radius;
56
52
  text-align: center;
53
+
54
+ &:focus {
55
+ @extend .nice-focus;
56
+ }
57
57
  }
58
58
 
59
- &:hover{
60
- .choice-checkbox{
59
+ &:hover {
60
+ .choice-checkbox {
61
61
  border-color: $nice-choice-hover-border;
62
62
  }
63
63
  }
64
64
 
65
- .circle{
65
+ .circle {
66
66
  border-radius: 100px;
67
67
  }
68
68
 
69
- .choice-label{
69
+ .choice-label {
70
70
  margin-left: 35px;
71
71
  line-height: 26px;
72
72
  }
@@ -24,46 +24,34 @@
24
24
  <div ng-class="{ 'nice-date-dropdown-wrapper': !inline }">
25
25
  <div ng-class="{ 'nice-date-dropdown': !inline }" ng-if="inline || isOpen">
26
26
  <!------------------------------ Date picker ------------------------------>
27
- <div class="nice-date-date" ng-class="{ 'with-time': time }">
27
+ <div class="nice-date-date" ng-class="{ 'with-time': time }" role="grid">
28
28
  <div class="nice-date-header">
29
29
  <span>
30
- <select
31
- class="year-picker"
32
- ng-model="innerDate.year"
33
- ng-change="handleDateChange()"
34
- ng-options="year for year in years">
35
- </select>,
36
- <select
37
- class="month-picker"
38
- ng-model="innerDate.month"
39
- ng-change="handleDateChange()"
40
- ng-options="month.value as month.name for month in months">
30
+ <select class="year-picker" ng-model="innerDate.year" ng-change="handleDateChange()" ng-options="year for year in years">
31
+ </select>,
32
+ <select class="month-picker" ng-model="innerDate.month" ng-change="handleDateChange()" ng-options="month.value as month.name for month in months">
41
33
  </select>
42
34
  </span>
43
- <i class="fa fa-angle-left" ng-click="previous()"></i>
44
- <i class="fa fa-circle" ng-click="today()"></i>
45
- <i class="fa fa-angle-right" ng-click="next()"></i>
35
+ <button class="btn btn-default-naked" ng-click="previous()"><i class="fa fa-angle-left"></i></button>
36
+ <button class="btn btn-default-naked" ng-click="today()"><i class="fa fa-circle"></i></button>
37
+ <button class="btn btn-default-naked" ng-click="next()"><i class="fa fa-angle-right"></i></button>
46
38
  </div>
47
39
 
48
40
  <div class="nice-date-week names">
49
41
  <span class="nice-date-day" ng-class="{ 'weekend': $index == 6 || $index == 5 }" ng-repeat="day in weekdays">{{ day }}</span>
50
42
  </div>
51
43
 
52
- <div class="nice-date-week" ng-repeat="week in weeks">
53
- <span
54
- class="nice-date-day"
55
- title="{{ day.value }}"
56
- ng-class="{
44
+ <div class="nice-date-week" role="row" ng-repeat="week in weeks">
45
+ <button class="nice-date-day" role="gridcell" title="{{ day.value }}" ng-class="{
57
46
  'today': day.isToday,
58
47
  'different-month': !day.isCurrentMonth,
59
48
  'selected': isSameDay(model, day.date),
60
49
  'weekend': day.isWeekday,
61
50
  'disabled': day.isDisabled,
62
51
  'between': isBetween(day.date, model, nextDate)
63
- }"
64
- ng-click="select(day)"
65
- ng-repeat="day in week.days"
66
- >{{ day.number }}</span>
52
+ }" ng-click="select(day)" ng-repeat="day in week.days">
53
+ {{ day.number }}
54
+ </button>
67
55
  </div>
68
56
  </div>
69
57
 
@@ -72,22 +60,14 @@
72
60
  <i class="fa fa-clock-o"></i>
73
61
 
74
62
  <div class="time-picker time-picker-hour">
75
- <select
76
- ng-disabled="isDisabled"
77
- ng-model="innerDate.hour"
78
- ng-change="timeChange()"
79
- ng-options="hour as hour for hour in hours track by hour">
63
+ <select ng-disabled="isDisabled" ng-model="innerDate.hour" ng-change="timeChange()" ng-options="hour as hour for hour in hours track by hour">
80
64
  </select>
81
65
  </div>
82
66
 
83
67
  <div class="divider">:</div>
84
68
 
85
69
  <div class="time-picker time-picker-minute">
86
- <select
87
- ng-disabled="isDisabled"
88
- ng-model="innerDate.minute"
89
- ng-change="timeChange()"
90
- ng-options="minute as minute for minute in minutes track by minute">
70
+ <select ng-disabled="isDisabled" ng-model="innerDate.minute" ng-change="timeChange()" ng-options="minute as minute for minute in minutes track by minute">
91
71
  </select>
92
72
  </div>
93
73
  </div>
@@ -28,13 +28,15 @@
28
28
  .form-control {
29
29
  text-overflow: ellipsis;
30
30
  }
31
-
31
+
32
32
  &.open {
33
- .form-control, .input-group-addon{
33
+
34
+ .form-control,
35
+ .input-group-addon {
34
36
  border-color: $nice-base-color;
35
37
  }
36
38
 
37
- .input-group-addon{
39
+ .input-group-addon {
38
40
  background-color: $nice-base-color;
39
41
  color: white;
40
42
  }
@@ -44,7 +46,7 @@
44
46
  .nice-date-date {
45
47
  border-radius: $nice-border-radius;
46
48
  background: white;
47
- overflow: hidden;
49
+ // overflow: hidden;
48
50
  border: solid 1px $nice-border-color;
49
51
 
50
52
  color: white;
@@ -65,19 +67,29 @@
65
67
  display: flex;
66
68
  padding: 0 0 0 $spacing;
67
69
 
68
- i {
70
+ button {
69
71
  width: 30px;
70
72
  font-size: 1.125em;
71
73
  font-weight: bold;
72
74
  line-height: 40px;
73
- cursor: pointer;
74
- text-align: center;
75
+ border: 0 none;
75
76
 
76
- &:hover {
77
- background: darken($nice-base-color, 5%);
77
+ &:focus {
78
+ outline-color: $nice-base-color-darker;
78
79
  }
79
80
 
80
- &.fa-circle {
81
+ &:hover,
82
+ &:focus {
83
+ background: $nice-base-color-darker;
84
+ color: white;
85
+ }
86
+
87
+ &:active {
88
+ background: $nice-base-color-lighter;
89
+ color: white;
90
+ }
91
+
92
+ .fa-circle {
81
93
  font-size: 8px;
82
94
  }
83
95
  }
@@ -90,14 +102,25 @@
90
102
  border: 0px;
91
103
  -webkit-appearance: none;
92
104
  cursor: pointer;
93
-
94
- &:focus, &:focus {
95
- outline: 0 none;
105
+
106
+ &:focus {
107
+ outline-color: $nice-base-color-darker;
108
+ }
109
+
110
+ &:hover,
111
+ &:focus {
112
+ background: $nice-base-color-darker;
113
+ color: white;
114
+ }
115
+
116
+ &:active {
117
+ background: $nice-base-color-lighter;
118
+ color: white;
96
119
  }
97
120
  }
98
121
  }
99
122
 
100
-
123
+
101
124
  }
102
125
 
103
126
  .nice-date-week {
@@ -111,11 +134,13 @@
111
134
  }
112
135
 
113
136
  .nice-date-day {
137
+ box-shadow: 0 0 0;
114
138
  user-select: none;
115
139
  position: relative;
116
140
  min-height: 20px;
117
141
  width: 14.2857%;
118
142
  border-radius: $nice-border-radius;
143
+ border: 0 none;
119
144
  border-left: solid 1px $nice-border-color;
120
145
  font-size: 12px;
121
146
  text-align: center;
@@ -164,7 +189,7 @@
164
189
  color: white;
165
190
  }
166
191
 
167
- &.between{
192
+ &.between {
168
193
  background: lighten($nice-base-color, 35%);
169
194
  }
170
195
 
@@ -182,7 +207,7 @@
182
207
  height: 21px;
183
208
  flex-shrink: 0;
184
209
 
185
- & > span {
210
+ &>span {
186
211
  color: darken($nice-base-color, 10%);
187
212
  min-height: 20px;
188
213
  cursor: default;
@@ -223,7 +248,6 @@
223
248
  -webkit-appearance: none;
224
249
  -moz-appearance: none;
225
250
  appearance: none;
226
- outline: 0;
227
251
  border-radius: $nice-border-radius;
228
252
  border: 1px solid $nice-border-color;
229
253
  padding: 0 10px;
@@ -14,12 +14,12 @@
14
14
  <div ng-form="formDatetimeRangePicker"></div>
15
15
 
16
16
  <div class="dropdown">
17
- <a class="dropdown-toggle" id="dropdown{{randNum}}" role="button" ng-click="openDtpRange()" href="javascript:void(0);">
17
+ <div class="dropdown-toggle" id="dropdown{{randNum}}" role="button" ng-click="openDtpRange()">
18
18
  <div class="input-group">
19
19
  <input type="text" class="form-control" value="{{value}}" ng-click="openDtpRange()">
20
20
  <span class="input-group-addon clickable"><i class="fa" ng-class="{'fa-clock-o': date=='false', 'fa-calendar': date!='false'}"></i></span>
21
21
  </div>
22
- </a>
22
+ </div>
23
23
  </div>
24
24
 
25
25
  <div class="dtp-range-wrapper" ng-show="showDtpRange">
@@ -35,41 +35,11 @@
35
35
 
36
36
  <div class="dtp-left">
37
37
  <!-- inject nice-dtp here -->
38
- <nice-dtp
39
- model="dateStart"
40
- format="{{format}}"
41
- model-format="{{modelFormat}}"
42
- date="{{date}}"
43
- time="{{time}}"
44
- width="{{width}}"
45
- enable-ok-buttons="{{enableOkButtons}}"
46
- lang="{{lang}}"
47
- min-date="{{minDate}}"
48
- max-date="{{maxDate}}"
49
- week-start="{{weekStart}}"
50
- ok-text="{{okText}}"
51
- cancel-text="{{cancelText}}"
52
- inline="true"
53
- ></nice-dtp>
38
+ <nice-dtp model="dateStart" format="{{format}}" model-format="{{modelFormat}}" date="{{date}}" time="{{time}}" width="{{width}}" enable-ok-buttons="{{enableOkButtons}}" lang="{{lang}}" min-date="{{minDate}}" max-date="{{maxDate}}" week-start="{{weekStart}}" ok-text="{{okText}}" cancel-text="{{cancelText}}" inline="true"></nice-dtp>
54
39
  </div>
55
40
  <div class="dtp-right">
56
41
  <!-- inject nice-dtp here -->
57
- <nice-dtp
58
- model="dateEnd"
59
- format="{{format}}"
60
- model-format="{{modelFormat}}"
61
- date="{{date}}"
62
- time="{{time}}"
63
- width="{{width}}"
64
- enable-ok-buttons="{{enableOkButtons}}"
65
- lang="{{lang}}"
66
- min-date="{{minDate}}"
67
- max-date="{{maxDate}}"
68
- week-start="{{weekStart}}"
69
- ok-text="{{okText}}"
70
- cancel-text="{{cancelText}}"
71
- inline="true"
72
- ></nice-dtp>
42
+ <nice-dtp model="dateEnd" format="{{format}}" model-format="{{modelFormat}}" date="{{date}}" time="{{time}}" width="{{width}}" enable-ok-buttons="{{enableOkButtons}}" lang="{{lang}}" min-date="{{minDate}}" max-date="{{maxDate}}" week-start="{{weekStart}}" ok-text="{{okText}}" cancel-text="{{cancelText}}" inline="true"></nice-dtp>
73
43
  </div>
74
44
 
75
45
  <div class="dtp-buttons-bottom">
@@ -1,18 +1,20 @@
1
1
  .nice-datetimerange-picker-2 {
2
2
  display: block;
3
3
 
4
- .input-group{
5
- .form-control{
4
+ .input-group {
5
+ .form-control {
6
6
  cursor: pointer;
7
7
  text-overflow: ellipsis;
8
8
  }
9
9
 
10
10
  &.open {
11
- .form-control, .input-group-addon{
11
+
12
+ .form-control,
13
+ .input-group-addon {
12
14
  border-color: $nice-base-color;
13
15
  }
14
16
 
15
- .input-group-addon{
17
+ .input-group-addon {
16
18
  background-color: $nice-base-color;
17
19
  color: white;
18
20
  }
@@ -28,14 +30,14 @@
28
30
  .dtp-wrapper {
29
31
  border-radius: $nice-border-radius;
30
32
  box-shadow: $nice-box-shadow;
31
-
33
+
32
34
  padding: 15px;
33
35
  background-color: white;
34
36
  border: 1px solid $nice-border-color;
35
37
  display: flex;
36
38
 
37
39
  .dtp-buttons-left {
38
- min-width: 110px;
40
+ width: 110px;
39
41
  display: flex;
40
42
  flex-direction: column;
41
43
 
@@ -48,7 +50,8 @@
48
50
  }
49
51
  }
50
52
 
51
- .dtp-left, .dtp-right {
53
+ .dtp-left,
54
+ .dtp-right {
52
55
  display: flex;
53
56
  flex-direction: column;
54
57
  flex-grow: 1;
@@ -58,7 +61,7 @@
58
61
  }
59
62
 
60
63
 
61
- .nice-dtp-background{
64
+ .nice-dtp-background {
62
65
  position: fixed;
63
66
  top: 0;
64
67
  left: 0;
@@ -67,20 +70,20 @@
67
70
  height: 100%;
68
71
  }
69
72
 
70
- .btn{
73
+ .btn {
71
74
  border-radius: $nice-border-radius;
72
75
  }
73
76
 
74
- .btn-primary{
77
+ .btn-primary {
75
78
  background: $nice-base-color;
76
79
  border-color: darken($nice-base-color, 5%);
77
80
 
78
- &:hover{
81
+ &:hover {
79
82
  background: darken($nice-base-color, 5%);
80
83
  border-color: darken($nice-base-color, 5%);
81
84
  }
82
85
 
83
- &:active{
86
+ &:active {
84
87
  background: darken($nice-base-color, 10%);
85
88
  border-color: darken($nice-base-color, 10%);
86
89
  }
@@ -92,12 +95,13 @@
92
95
  width: auto;
93
96
  flex-direction: column;
94
97
 
95
- .dtp-left{
98
+ .dtp-left {
96
99
  margin-bottom: 15px;
97
100
  margin-top: 15px;
98
101
  }
99
102
 
100
- .dtp-left, .dtp-right {
103
+ .dtp-left,
104
+ .dtp-right {
101
105
  margin-left: 0;
102
106
  width: 100%;
103
107
  }
@@ -146,6 +146,11 @@ angular.module('niceElements')
146
146
  }
147
147
  };
148
148
 
149
+ // ------------------- On blur -------------------
150
+ $scope.onBlur = function () {
151
+ $scope.close();
152
+ };
153
+
149
154
 
150
155
  // ----------------------------------- Scroll to hover -----------------------------------
151
156
  $scope.scrollToHover = function (notSmooth) {
@@ -10,7 +10,6 @@
10
10
  .open {
11
11
  .btn-dropdown {
12
12
  background: $nice-focus-bg !important;
13
- border-color: $nice-focus-border !important;
14
13
  color: $nice-font-color !important;
15
14
  }
16
15
  }
@@ -32,6 +31,7 @@
32
31
  border-radius: $nice-border-radius;
33
32
  }
34
33
  }
34
+
35
35
  .nice-dropdown-menu-wrapper {
36
36
  z-index: 1000;
37
37
  }
@@ -121,7 +121,8 @@
121
121
  text-align: center;
122
122
  }
123
123
 
124
- &:hover, &.hover {
124
+ &:hover,
125
+ &.hover {
125
126
  background: $nice-hover-color;
126
127
  }
127
128
 
@@ -149,6 +150,7 @@
149
150
  position: relative;
150
151
  overflow: hidden;
151
152
  flex-grow: 1;
153
+ justify-content: flex-start;
152
154
 
153
155
  text-align: left;
154
156
  padding-right: 25px;
@@ -197,9 +199,8 @@
197
199
  &:active,
198
200
  &:focus {
199
201
  background: $nice-focus-bg !important;
200
- border-color: $nice-focus-border !important;
201
202
  color: $nice-focus-color !important;
202
- outline: 0 none;
203
+ @extend .nice-focus;
203
204
  }
204
205
  }
205
206
  }