nice-elements 1.6.0 → 1.6.2

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.
@@ -8,14 +8,17 @@
8
8
 
9
9
  <!------------------------- Field ------------------------->
10
10
  <div class="nice-field col-xs-12" ng-class="[fieldWidth ? fieldWidth : 'col-sm-8', { 'nice-disabled': isDisabled }]">
11
- <input class="input-file" type="file" accept="{{ accept }}" ng-model="file" ng-disabled="isDisabled" />
12
- <div class="input-area" ng-class="{ 'dragging': dragging || draggingGlobal }">
13
- <div class="middle-text" ng-if="!imageSource && !loading">
14
- <div class="text text-placeholder" ng-if="!dragging">{{ text }}</div>
15
- <div class="text text-placeholder" ng-if="dragging" translate translate-group="Nice">Drop file here</div>
16
- <div class="error" ng-if="error">{{ error }}</div>
11
+ <div class="nice-upload-area">
12
+ <div class="input-area" ng-class="{ 'dragging': dragging || draggingGlobal }">
13
+ <div class="middle-text" ng-if="!imageSource && !loading">
14
+ <nice-icon icon="icon-upload"></nice-icon>
15
+ <div class="text text-placeholder" ng-if="!dragging">{{ text }}</div>
16
+ <div class="text text-placeholder" ng-if="dragging" translate translate-group="Nice">Drop file here</div>
17
+ <div class="error" ng-if="error">{{ error }}</div>
18
+ </div>
19
+ <img ng-if="imageSource" data-ng-src="{{ imageSource }}" />
17
20
  </div>
18
- <img ng-if="imageSource" data-ng-src="{{ imageSource }}" />
21
+ <input class="input-file" type="file" accept="{{ accept }}" ng-model="file" ng-disabled="isDisabled || loading" />
19
22
  <nice-loader fulldiv="true" ng-if="loading"></nice-loader>
20
23
  </div>
21
24
  </div>
@@ -10,6 +10,14 @@
10
10
  }
11
11
  }
12
12
 
13
+ .nice-upload-area {
14
+ height: 150px;
15
+ position: relative;
16
+
17
+ border-radius: var(--nice-border-radius);
18
+ border: 1px solid var(--nice-border-color);
19
+ }
20
+
13
21
  input {
14
22
  position: absolute;
15
23
  top: 0;
@@ -17,7 +25,6 @@
17
25
  width: 100%;
18
26
  height: 100%;
19
27
  opacity: 0;
20
- z-index: 10;
21
28
  cursor: pointer;
22
29
 
23
30
  &:disabled {
@@ -26,15 +33,17 @@
26
33
  }
27
34
 
28
35
  .input-area {
29
- border-radius: $nice-border-radius;
30
36
  width: 100%;
31
- height: 150px;
32
- border: 1px solid #cbd4d9;
33
- position: relative;
34
- text-align: center;
35
- cursor: pointer;
36
- display: table;
37
- padding: 15px;
37
+ height: 100%;
38
+ top: 0;
39
+ left: 0;
40
+ position: absolute;
41
+ padding: 1rem;
42
+ border-radius: $nice-border-radius;
43
+ overflow: hidden;
44
+ display: flex;
45
+ justify-content: center;
46
+ align-items: center;
38
47
 
39
48
  &.dragging {
40
49
  outline: 2px dashed var(--nice-primary-color);
@@ -48,6 +57,11 @@
48
57
  flex-direction: column;
49
58
  height: 100%;
50
59
 
60
+ svg {
61
+ opacity: 0.6;
62
+ margin-bottom: 2px;
63
+ }
64
+
51
65
  .text-placeholder {
52
66
  font-size: 0.9em;
53
67
  opacity: 0.6;
@@ -59,28 +73,9 @@
59
73
  }
60
74
 
61
75
  img {
62
- max-width: 100%;
63
- max-height: 148px;
64
- }
65
- }
66
-
67
- .loading {
68
- position: absolute;
69
- width: 100%;
70
- height: 100%;
71
- top: 0;
72
- left: 0;
73
- background-color: rgba(255, 255, 255, 0.50);
74
-
75
- .nice-loader {
76
- position: absolute;
77
- top: 50%;
78
- left: 50%;
79
- width: 40px;
80
- height: 40px;
81
- margin-top: -20px;
82
- margin-left: -20px;
83
- padding: 0;
76
+ width: 100%;
77
+ height: 100%;
78
+ object-fit: contain;
84
79
  }
85
80
  }
86
81
  }
@@ -21,10 +21,12 @@
21
21
  flex-shrink: 0;
22
22
  }
23
23
 
24
+ i+span,
24
25
  svg+span,
25
26
  nice-icon+span,
26
27
  span+svg,
27
- span+nice-icon {
28
+ span+nice-icon,
29
+ span+i {
28
30
  margin-left: 0.5rem;
29
31
  }
30
32
 
@@ -20,34 +20,66 @@ $length in $spacers {
20
20
  margin-top: $length !important;
21
21
  }
22
22
 
23
+ .-mt-#{$size} {
24
+ margin-top: -$length !important;
25
+ }
26
+
23
27
  .mb-#{$size} {
24
28
  margin-bottom: $length !important;
25
29
  }
26
30
 
31
+ .-mb-#{$size} {
32
+ margin-bottom: -$length !important;
33
+ }
34
+
27
35
  .ml-#{$size} {
28
36
  margin-left: $length !important;
29
37
  }
30
38
 
39
+ .-ml-#{$size} {
40
+ margin-left: -$length !important;
41
+ }
42
+
31
43
  .mr-#{$size} {
32
44
  margin-right: $length !important;
33
45
  }
34
46
 
47
+ .-mr-#{$size} {
48
+ margin-right: -$length !important;
49
+ }
50
+
35
51
  .pt-#{$size} {
36
52
  padding-top: $length !important;
37
53
  }
38
54
 
55
+ .-pt-#{$size} {
56
+ padding-top: -$length !important;
57
+ }
58
+
39
59
  .pb-#{$size} {
40
60
  padding-bottom: $length !important;
41
61
  }
42
62
 
63
+ .-pb-#{$size} {
64
+ padding-bottom: -$length !important;
65
+ }
66
+
43
67
  .pl-#{$size} {
44
68
  padding-left: $length !important;
45
69
  }
46
70
 
71
+ .-pl-#{$size} {
72
+ padding-left: -$length !important;
73
+ }
74
+
47
75
  .pr-#{$size} {
48
76
  padding-right: $length !important;
49
77
  }
50
78
 
79
+ .-pr-#{$size} {
80
+ padding-right: -$length !important;
81
+ }
82
+
51
83
  .w-#{$size} {
52
84
  width: $length !important;
53
85
  }