@energycap/components 0.36.5-ECAP-18591-link-button-disabled-state.20230808-0954 → 0.37.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energycap/components",
3
- "version": "0.36.5-ECAP-18591-link-button-disabled-state.20230808-0954",
3
+ "version": "0.37.0",
4
4
  "dependencies": {
5
5
  "tslib": "^2.0.0"
6
6
  },
@@ -10,7 +10,6 @@
10
10
  "@angular/forms": ">=15.2.0",
11
11
  "@angular/router": ">=15.2.0",
12
12
  "@angular/cdk": ">=15.2.0",
13
- "@energycap/energycap-icons": "^4.0.0",
14
13
  "@ngx-translate/core": "^14.0.0",
15
14
  "popper.js": "~1.11.1",
16
15
  "lodash": "^4.17.21",
@@ -1,7 +1,7 @@
1
1
  $fa-font-path: '/assets/webfonts';
2
2
  @import '@fortawesome/fontawesome-pro/scss/solid';
3
3
  @import '@angular/cdk/overlay-prebuilt.css';
4
- @import '../../../icons/src/styles/core';
4
+ @import '../../../icons/styles/core';
5
5
 
6
6
  html,
7
7
  body {
@@ -1,26 +1,16 @@
1
- // TODO: replace these background image icons with icon font icons. Requires updating ng1 form controls in energycap project (ECAP-9608)
2
-
3
1
  $icon-url-prefix: 'data:image/svg+xml;charset=utf8,';
4
2
 
5
- // Deprecated SCSS variables for legacy background-image icons.
3
+ // Deprecated SCSS variables and functions for legacy background-image icons.
6
4
  $icon-color-base: rgba(26, 26, 35, .66);
5
+ $required-icon: none; // Unused variable. Need to keep reference for backwards compatability. Overridden for ng1 controls in energycap repo.
6
+ $invalid-icon: none; // Unused variable. Need to keep reference for backwards compatability. Overridden for ng1 controls in energycap repo.
7
7
 
8
- $required-icon: str-replace(url('#{$icon-url-prefix}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#{$yellow-4}" d="M31.32 21.69l-.09.18-2.48 4.35c-.36.54-.77.62-1.25.27-.12 0-.2 0-.2-.09L19.53 22v9.37a1.26 1.26 0 0 1-.72.67h-5.26c-.59 0-.83-.3-.83-.89 0-.12.15-.21.15-.27V22l-8 4.71h-.12c-.42.66-.8.21-1.16-.27L1 21.82a.82.82 0 0 1 .35-1.26l.18-.1L9 16 .87 11.47v-.09c0-.36-.39-.74-.09-1.16l2.75-4.35v-.09c0-.42.82-.54 1.29-.36l8 4.62V.89c0-.59.18-.89.77-.89h5c.65 0 .91.3.91.89V10l7.94-4.53c.48-.29.72-.21 1.08.27l2.32 4.35v.09c.66.48.45.89-.08 1.25L23 16l7.91 4.53v.09c-.04.18.53.54.41 1.07z"/></svg>'), '#', '%23');
9
-
10
- $invalid-icon: str-replace(url('#{$icon-url-prefix}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path fill="#{$icon-color-base}" d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zm0-384c-13.3 0-24 10.7-24 24V264c0 13.3 10.7 24 24 24s24-10.7 24-24V152c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>'), '#', '%23');
11
-
12
- @function pending-icon($color: '#0084a9') {
13
- @return str-replace(url('#{$icon-url-prefix}<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 50 50"><path fill="#{$color}" d="M43.935 25.145c0-10.318-8.364-18.683-18.683-18.683-10.318 0-18.683 8.365-18.683 18.683h4.068c0-8.071 6.543-14.615 14.615-14.615s14.615 6.543 14.615 14.615h4.068z"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.8s" repeatCount="indefinite"/></path></svg>'), '#', '%23');
14
- }
15
-
16
- @function icon-sort-asc-bg($color: $icon-color-base) {
17
- @return str-replace(url('#{$icon-url-prefix}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#{$color}" d="M14 8.828V27a2 2 0 1 0 4 0V8.828l4.586 4.586a2 2 0 0 0 2.828-2.828l-8-8a2 2 0 0 0-2.828 0l-8 8a2 2 0 0 0 2.828 2.828L14 8.828z"/></svg>'), '#', '%23');
18
- }
19
-
20
- @function icon-caret-down-bg($color: $icon-color-base) {
21
- @return str-replace(url('#{$icon-url-prefix}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="#{$color}" d="M32 8L16 24 0 8z"/></svg>'), '#', '%23');
22
- }
8
+ // Unused function. Need to keep reference for backwards compatability. Overridden for ng1 controls in energycap repo.
9
+ @function pending-icon() {
10
+ @return '';
11
+ }
23
12
 
13
+ // Needed for backwards compatablity of ng1 form controls in energycap repo
24
14
  @mixin icon-bg-image(
25
15
  $icon,
26
16
  $position: 0 50%,
@@ -98,6 +98,10 @@ $control-bg-read-only: rgba($black, .12);
98
98
  background-color: $control-bg-disabled;
99
99
  border-color: var(--ec-border-color-control-disabled);
100
100
  }
101
+
102
+ & + .icon-required {
103
+ display: none;
104
+ }
101
105
  }
102
106
  }
103
107
  }
@@ -37,6 +37,20 @@ $checkbox-indicator-size: $form-control-icon-size;
37
37
  .textbox-group-input ::ng-deep .control input.ng-invalid,
38
38
  .textbox-group-input ::ng-deep .control input.ng-valid {
39
39
  @include form-control-state(invalid, input);
40
+
41
+ background-image: none;
42
+
43
+ & ~ .icon-invalid {
44
+ display: inline-flex;
45
+ position: absolute;
46
+ left: .5rem;
47
+ top: .5rem;
48
+ z-index: 1;
49
+ }
50
+
51
+ & ~ .icon-required {
52
+ display: none
53
+ }
40
54
  }
41
55
 
42
56
  &:not(.open) {
@@ -78,7 +92,7 @@ $checkbox-indicator-size: $form-control-icon-size;
78
92
 
79
93
  /// Pending
80
94
  } @else if $state == pending {
81
- @include form-control-input-icon(pending-icon(), $position: $icon-position)
95
+ @include form-control-input-icon(pending-icon(), $position: $icon-position);
82
96
 
83
97
  /// Invalid
84
98
  } @else if $state == invalid {
@@ -106,7 +120,7 @@ $checkbox-indicator-size: $form-control-icon-size;
106
120
 
107
121
  /// The default form control element in the control component
108
122
  /// @param {string} $tag [input] - The HTML tag name of the input element (e.g. input, textarea)
109
- @mixin form-control-input($selector: input) {
123
+ @mixin form-control-input($selector: input, $new-state-icons: false) {
110
124
  @include control-default;
111
125
  @include form-control-input-base;
112
126
  background-image: none;
@@ -125,6 +139,19 @@ $checkbox-indicator-size: $form-control-icon-size;
125
139
  &:required {
126
140
  &.is-empty {
127
141
  @include form-control-state(required, $selector);
142
+
143
+ @if $new-state-icons {
144
+ background-image: none;
145
+
146
+ & ~ .icon-required {
147
+ display: inline-flex;
148
+ position: absolute;
149
+ left: .5rem;
150
+ top: .5rem;
151
+ z-index: 1;
152
+ color: var(--ec-color-yellow-4);
153
+ }
154
+ }
128
155
  }
129
156
  }
130
157
 
@@ -132,6 +159,22 @@ $checkbox-indicator-size: $form-control-icon-size;
132
159
  &.ng-invalid {
133
160
  &.ng-touched {
134
161
  @include form-control-state(invalid, $selector);
162
+
163
+ @if $new-state-icons {
164
+ background-image: none;
165
+
166
+ & ~ .icon-invalid {
167
+ display: inline-flex;
168
+ position: absolute;
169
+ left: .5rem;
170
+ top: .5rem;
171
+ z-index: 1;
172
+ }
173
+
174
+ & ~ .icon-required {
175
+ display: none
176
+ }
177
+ }
135
178
  }
136
179
  }
137
180
 
@@ -140,6 +183,21 @@ $checkbox-indicator-size: $form-control-icon-size;
140
183
  &.ng-invalid,
141
184
  &.ng-pending {
142
185
  @include form-control-state(pending, $selector);
186
+
187
+ @if $new-state-icons {
188
+ & ~ .icon-loading {
189
+ display: inline-flex;
190
+ position: absolute;
191
+ left: .5rem;
192
+ top: .5rem;
193
+ z-index: 1;
194
+ }
195
+
196
+ & ~ .icon-required,
197
+ & ~ .icon-invalid {
198
+ display: none;
199
+ }
200
+ }
143
201
  }
144
202
  }
145
203
 
@@ -138,14 +138,18 @@ $table-z-indexes: (
138
138
  }
139
139
 
140
140
  @mixin table-col-sort-icon() {
141
- content: '';
142
- background-repeat: no-repeat;
143
- background-position: center;
144
141
  width: .875rem;
145
142
  height: .875rem;
146
143
  margin: 0 .25rem;
147
- vertical-align: top;
144
+ font-size: .75rem;
148
145
  display: none;
146
+ align-items: center;
147
+ justify-content: center;
148
+ }
149
+
150
+ @mixin icon-sort-asc {
151
+ font: var(--fa-font-solid);
152
+ content: "\f063";
149
153
  }
150
154
 
151
155
  @mixin table-col-sort() {
@@ -167,8 +171,8 @@ $table-z-indexes: (
167
171
  &.is-sorted-desc,
168
172
  &.is-sorted-asc {
169
173
  .content-wrapper::after {
170
- background-image: icon-sort-asc-bg();
171
- display: inline-block;
174
+ @include icon-sort-asc;
175
+ display: inline-flex;
172
176
  }
173
177
  }
174
178
 
@@ -195,8 +199,8 @@ $table-z-indexes: (
195
199
  &.is-sorted-desc,
196
200
  &.is-sorted-asc {
197
201
  &::after {
198
- background-image: icon-sort-asc-bg();
199
- display: inline-block;
202
+ @include icon-sort-asc;
203
+ display: inline-flex;
200
204
  }
201
205
  }
202
206
 
@@ -217,7 +221,7 @@ $table-z-indexes: (
217
221
  &.is-sorted-desc,
218
222
  &.is-sorted-asc {
219
223
  &::before {
220
- background-image: icon-sort-asc-bg();
224
+ @include icon-sort-asc;
221
225
  display: inline-block;
222
226
  }
223
227
  }