@energycap/components 0.45.1 → 0.45.2-multi-select-component.20260303-0733
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/README.md +188 -188
- package/fesm2022/energycap-components.mjs +681 -163
- package/fesm2022/energycap-components.mjs.map +1 -1
- package/package.json +1 -1
- package/schematics/collection.json +4 -4
- package/src/assets/images/favicon-ech.svg +14 -14
- package/src/assets/images/favicon-esa.svg +6 -6
- package/src/assets/images/favicon-eum.svg +13 -13
- package/src/assets/images/favicon-whitelabel.svg +4 -4
- package/src/assets/images/favicon.svg +12 -12
- package/src/assets/images/icon-carbonhub.svg +10 -10
- package/src/assets/images/icon-eum.svg +5 -5
- package/src/assets/images/icon-ucp.svg +12 -12
- package/src/assets/images/icon-wattics.svg +5 -5
- package/src/assets/images/icon.svg +11 -11
- package/src/assets/images/logo.svg +10 -10
- package/src/assets/images/splash-electric.svg +3 -3
- package/src/assets/images/splash-interval.svg +3 -3
- package/src/assets/images/splash-seedling.svg +11 -11
- package/src/assets/images/splash-water.svg +3 -3
- package/src/assets/locales/en_US.json +60 -60
- package/src/assets/scripts/unsupported-browser.js +17 -17
- package/src/styles/_base.scss +38 -38
- package/src/styles/_colors.scss +96 -96
- package/src/styles/_core.scss +3 -3
- package/src/styles/_functions.scss +114 -114
- package/src/styles/_global-variables.scss +230 -230
- package/src/styles/_icons.scss +23 -23
- package/src/styles/bootstrap/_grid.scss +33 -33
- package/src/styles/bootstrap/_reboot.scss +322 -322
- package/src/styles/components/_badge.scss +14 -14
- package/src/styles/components/_card.scss +21 -21
- package/src/styles/components/_link-icons.scss +37 -37
- package/src/styles/components/_splash.scss +188 -188
- package/src/styles/components/_tag.scss +18 -18
- package/src/styles/components/_unsupported-browsers.scss +23 -23
- package/src/styles/email/_email-base.scss +227 -227
- package/src/styles/email/email.scss +42 -42
- package/src/styles/index.scss +29 -29
- package/src/styles/mixins/_animations.scss +17 -17
- package/src/styles/mixins/_button-base.scss +206 -206
- package/src/styles/mixins/_card-base.scss +40 -40
- package/src/styles/mixins/_common.scss +51 -51
- package/src/styles/mixins/_dialog-base.scss +95 -95
- package/src/styles/mixins/_form-control-base.scss +662 -662
- package/src/styles/mixins/_login.scss +74 -74
- package/src/styles/mixins/_menu-base.scss +153 -153
- package/src/styles/mixins/_overlay-base.scss +32 -32
- package/src/styles/mixins/_resizable-base.scss +57 -57
- package/src/styles/mixins/_spinner-base.scss +34 -34
- package/src/styles/mixins/_table-base.scss +297 -297
- package/src/styles/mixins/_tabs-base.scss +146 -146
- package/src/styles/mixins/_tags-base.scss +121 -121
- package/src/styles/mixins/_text.scss +89 -89
- package/src/styles/mixins.scss +14 -14
- package/src/styles/utilities/_borders.scss +29 -29
- package/src/styles/utilities/_common.scss +49 -49
- package/src/styles/utilities/_layout.scss +115 -115
- package/src/styles/utilities/_spacing.scss +64 -64
- package/src/styles/utilities/_text.scss +139 -139
- package/types/energycap-components.d.ts +208 -9
|
@@ -1,663 +1,663 @@
|
|
|
1
|
-
@use "sass:math";
|
|
2
|
-
|
|
3
|
-
@import '../icons';
|
|
4
|
-
|
|
5
|
-
$form-control-icon-size: 1rem;
|
|
6
|
-
$form-control-font-size: 1rem;
|
|
7
|
-
$form-control-icon-position: .5rem center;
|
|
8
|
-
$form-control-label-size: var(--ec-font-size-label);
|
|
9
|
-
$form-control-height: 2rem;
|
|
10
|
-
$form-control-line-height: 1.25rem;
|
|
11
|
-
$form-control-padding-x: .5rem;
|
|
12
|
-
$form-control-spacing-y: 1rem;
|
|
13
|
-
$form-control-padding-y: .3125rem;
|
|
14
|
-
|
|
15
|
-
$checkbox-indicator-size: $form-control-icon-size;
|
|
16
|
-
|
|
17
|
-
@mixin form-control-input-base {
|
|
18
|
-
&::selection {
|
|
19
|
-
background-color: var(--ec-form-control-background-color-selection);
|
|
20
|
-
color: var(--ec-form-control-color-selection);
|
|
21
|
-
}
|
|
22
|
-
&::-webkit-input-placeholder { /* Chrome/Opera/Safari */
|
|
23
|
-
color: var(--ec-form-control-color-placeholder);
|
|
24
|
-
}
|
|
25
|
-
&::-moz-placeholder { /* Firefox 19+ */
|
|
26
|
-
color: var(--ec-form-control-color-placeholder);
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
&:-ms-input-placeholder { /* IE 10+ */
|
|
30
|
-
color: var(--ec-form-control-color-placeholder);
|
|
31
|
-
}
|
|
32
|
-
&:-moz-placeholder { /* Firefox 18- */
|
|
33
|
-
color: var(--ec-form-control-color-placeholder);
|
|
34
|
-
opacity: 1;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@mixin form-control-input-group-invalid {
|
|
39
|
-
.textbox-group-input ::ng-deep .control input.ng-invalid,
|
|
40
|
-
.textbox-group-input ::ng-deep .control input.ng-valid {
|
|
41
|
-
@include form-control-state(invalid, input);
|
|
42
|
-
|
|
43
|
-
background-image: none;
|
|
44
|
-
|
|
45
|
-
& ~ .icon-invalid {
|
|
46
|
-
display: inline-flex;
|
|
47
|
-
position: absolute;
|
|
48
|
-
left: .5rem;
|
|
49
|
-
top: .5rem;
|
|
50
|
-
z-index: 1;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
& ~ .icon-required {
|
|
54
|
-
display: none
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&:not(.open) {
|
|
59
|
-
.textbox-group-btn-right ::ng-deep button{
|
|
60
|
-
&:not(:focus) {
|
|
61
|
-
border-color: var(--ec-form-control-border-color-invalid);
|
|
62
|
-
}
|
|
63
|
-
background-color: var(--ec-form-control-background-color-invalid);
|
|
64
|
-
|
|
65
|
-
&:hover:not(:disabled):not(:focus) {
|
|
66
|
-
border-color: var(--ec-form-control-border-color-hover);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/// Calculate the background properties for an input icon
|
|
73
|
-
/// @param {string} $icon - The classname of the icon (matches the filename)
|
|
74
|
-
/// @param {number} $width [$form-control-icon-size] - The width of the icon, converted to ems
|
|
75
|
-
/// @param {number} $height [$form-control-icon-size] - The height of the icon, converted to ems
|
|
76
|
-
/// @param {string|number|list} $position [$form-control-icon-position] - The background-position of the icon
|
|
77
|
-
/// @param {number} $indent [$form-control-icon-size] - The amount to indent the text to allow room for the icon
|
|
78
|
-
@mixin form-control-input-icon(
|
|
79
|
-
$icon,
|
|
80
|
-
$width: $form-control-icon-size,
|
|
81
|
-
$height: $form-control-icon-size,
|
|
82
|
-
$position: $form-control-icon-position,
|
|
83
|
-
$indent: $form-control-icon-size + .25rem,
|
|
84
|
-
) {
|
|
85
|
-
$size: $width, $height;
|
|
86
|
-
@include icon-bg-image($icon, $position, $size);
|
|
87
|
-
padding-left: ($indent + $form-control-padding-x);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
@mixin form-control-state($state, $selector) {
|
|
91
|
-
$icon-position: $form-control-icon-position;
|
|
92
|
-
|
|
93
|
-
@if $selector == textarea {
|
|
94
|
-
$icon-position: .5rem .5rem;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/// Required
|
|
98
|
-
@if $state == required {
|
|
99
|
-
// TODO: remove when all bootstrap and kendo controls have been replaced in EUM
|
|
100
|
-
@include form-control-input-icon($required-icon, $position: $icon-position);
|
|
101
|
-
|
|
102
|
-
/// Pending
|
|
103
|
-
} @else if $state == pending {
|
|
104
|
-
|
|
105
|
-
// TODO: remove when all bootstrap and kendo controls have been replaced in EUM
|
|
106
|
-
@include form-control-input-icon(pending-icon(), $position: $icon-position);
|
|
107
|
-
|
|
108
|
-
/// Invalid
|
|
109
|
-
} @else if $state == invalid {
|
|
110
|
-
background-color: var(--ec-form-control-background-color-invalid);
|
|
111
|
-
border-color: var(--ec-form-control-border-color-invalid);
|
|
112
|
-
|
|
113
|
-
&:focus {
|
|
114
|
-
border-color: var(--ec-form-control-background-color-invalid);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
&:hover:not(:disabled):not(:focus) {
|
|
118
|
-
border-color: var(--ec-form-control-border-color-hover);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// TODO: remove when all bootstrap and kendo controls have been replaced in EUM
|
|
122
|
-
@include form-control-input-icon($invalid-icon, $position: $icon-position);
|
|
123
|
-
|
|
124
|
-
/// Focus
|
|
125
|
-
} @else if $state == focus {
|
|
126
|
-
border-color: var(--ec-form-control-border-color-focus);
|
|
127
|
-
box-shadow: var(--ec-form-control-box-shadow-focus);
|
|
128
|
-
position: relative;
|
|
129
|
-
z-index: 1;
|
|
130
|
-
|
|
131
|
-
/// Disabled
|
|
132
|
-
} @else if $state == disabled {
|
|
133
|
-
background-color: var(--ec-form-control-background-color-disabled);
|
|
134
|
-
border-color: var(--ec-form-control-border-color-disabled);
|
|
135
|
-
color: var(--ec-form-control-color-disabled);
|
|
136
|
-
opacity: var(--ec-form-control-opacity-disabled);
|
|
137
|
-
|
|
138
|
-
&:required,
|
|
139
|
-
&:required.is-empty {
|
|
140
|
-
background-image: none;
|
|
141
|
-
padding-left: $form-control-padding-x;
|
|
142
|
-
|
|
143
|
-
// We need to define these again because the :required styles override
|
|
144
|
-
// the background-color and border-color we set above
|
|
145
|
-
background-color: var(--ec-form-control-background-color-disabled);
|
|
146
|
-
border-color: var(--ec-form-control-border-color-disabled);
|
|
147
|
-
|
|
148
|
-
& + .icon-required {
|
|
149
|
-
display: none;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
} @else if $state == hover {
|
|
153
|
-
&:not(:disabled):not(:focus) {
|
|
154
|
-
border-color: var(--ec-form-control-border-color-hover);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
/// A form control label
|
|
160
|
-
@mixin form-control-label {
|
|
161
|
-
color: var(--ec-form-control-label-color, var(--ec-color-secondary-dark));
|
|
162
|
-
display: block;
|
|
163
|
-
font-size: $form-control-label-size;
|
|
164
|
-
line-height: 1;
|
|
165
|
-
margin: calc(#{$form-control-label-size} / 2) 0;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
/// The default form control element in the control component
|
|
169
|
-
/// @param {string} $tag [input] - The HTML tag name of the input element (e.g. input, textarea)
|
|
170
|
-
@mixin form-control-input($selector: input, $new-state-icons: false) {
|
|
171
|
-
@include form-control-input-base;
|
|
172
|
-
background-color: var(--ec-form-control-background-color);
|
|
173
|
-
border: 1px solid var(--ec-form-control-border-color);
|
|
174
|
-
border-radius: var(--ec-border-radius);
|
|
175
|
-
background-image: none;
|
|
176
|
-
background-clip: padding-box;
|
|
177
|
-
width: 100%;
|
|
178
|
-
line-height: $form-control-line-height;
|
|
179
|
-
padding: $form-control-padding-y $form-control-padding-x;
|
|
180
|
-
|
|
181
|
-
@if $selector == input {
|
|
182
|
-
height: $form-control-height;
|
|
183
|
-
} @else {
|
|
184
|
-
height: auto;
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
& ~ .icon-required,
|
|
188
|
-
& ~ .icon-invalid {
|
|
189
|
-
color: var(--ec-form-control-border-color-invalid);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
&:required {
|
|
193
|
-
&.is-empty {
|
|
194
|
-
@include form-control-state(required, $selector);
|
|
195
|
-
|
|
196
|
-
@if $new-state-icons {
|
|
197
|
-
background-image: none;
|
|
198
|
-
|
|
199
|
-
& ~ .icon-required {
|
|
200
|
-
display: inline-flex;
|
|
201
|
-
position: absolute;
|
|
202
|
-
left: .5rem;
|
|
203
|
-
top: .5rem;
|
|
204
|
-
z-index: 1;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// Use .ng-invalid because not all Angular validators trigger :invalid
|
|
211
|
-
&.ng-invalid {
|
|
212
|
-
&.ng-touched {
|
|
213
|
-
@include form-control-state(invalid, $selector);
|
|
214
|
-
|
|
215
|
-
@if $new-state-icons {
|
|
216
|
-
background-image: none;
|
|
217
|
-
|
|
218
|
-
& ~ .icon-invalid {
|
|
219
|
-
display: inline-flex;
|
|
220
|
-
position: absolute;
|
|
221
|
-
left: .5rem;
|
|
222
|
-
top: .5rem;
|
|
223
|
-
z-index: 1;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
& ~ .icon-required {
|
|
227
|
-
display: none
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
&.is-pending {
|
|
234
|
-
&.ng-valid,
|
|
235
|
-
&.ng-invalid,
|
|
236
|
-
&.ng-pending {
|
|
237
|
-
@include form-control-state(pending, $selector);
|
|
238
|
-
|
|
239
|
-
@if $new-state-icons {
|
|
240
|
-
& ~ .icon-loading {
|
|
241
|
-
display: inline-flex;
|
|
242
|
-
position: absolute;
|
|
243
|
-
left: .5rem;
|
|
244
|
-
top: .5rem;
|
|
245
|
-
z-index: 1;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
& ~ .icon-required,
|
|
249
|
-
& ~ .icon-invalid {
|
|
250
|
-
display: none;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
&:focus,
|
|
257
|
-
&:focus.is-empty {
|
|
258
|
-
@include form-control-state(focus, $selector);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
&:disabled {
|
|
262
|
-
@include form-control-state(disabled, $selector);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
&:hover {
|
|
266
|
-
@include form-control-state(hover, $selector);
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
&.is-uppercase:not(.is-empty) {
|
|
270
|
-
text-transform: uppercase;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/// The base styles of a control component. These styles will be applied to :host
|
|
275
|
-
@mixin form-control-base() {
|
|
276
|
-
color: var(--ec-form-control-color);
|
|
277
|
-
// font-family: $control-font-family;
|
|
278
|
-
font-size: var(--ec-form-control-font-size);
|
|
279
|
-
display: block;
|
|
280
|
-
margin-bottom: 1rem;
|
|
281
|
-
width: 100%;
|
|
282
|
-
|
|
283
|
-
:host-context(.form-condensed) {
|
|
284
|
-
margin-bottom: .5rem;
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.control {
|
|
288
|
-
width: 100%;
|
|
289
|
-
display: flex;
|
|
290
|
-
flex-direction: column;
|
|
291
|
-
|
|
292
|
-
&.control-label-bottom {
|
|
293
|
-
flex-direction: column-reverse;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
&.control-label-left {
|
|
297
|
-
flex-direction: row;
|
|
298
|
-
label {
|
|
299
|
-
margin-right: .25rem;
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
&.control-label-right {
|
|
304
|
-
flex-direction: row-reverse;
|
|
305
|
-
label {
|
|
306
|
-
margin-left: .25rem;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
&.control-label-left,
|
|
311
|
-
&.control-label-right {
|
|
312
|
-
align-items: center;
|
|
313
|
-
|
|
314
|
-
label {
|
|
315
|
-
flex: 1 1;
|
|
316
|
-
margin-top: 0;
|
|
317
|
-
margin-bottom: 0;
|
|
318
|
-
}
|
|
319
|
-
.control-input {
|
|
320
|
-
flex: 2 2;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
&.is-readonly {
|
|
325
|
-
input,
|
|
326
|
-
select,
|
|
327
|
-
textarea {
|
|
328
|
-
@include form-control-read-only;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
|
|
332
|
-
&.invalid {
|
|
333
|
-
@include form-control-input-group-invalid;
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
.textbox-group {
|
|
338
|
-
display: flex;
|
|
339
|
-
position: relative;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
textarea:focus,
|
|
343
|
-
input:focus,
|
|
344
|
-
select:focus {
|
|
345
|
-
outline: none;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
@mixin checkbox-radio {
|
|
350
|
-
cursor: pointer;
|
|
351
|
-
display: inline-flex;
|
|
352
|
-
margin-bottom: 0;
|
|
353
|
-
position: relative;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
@mixin checkbox-radio-input(
|
|
357
|
-
$type,
|
|
358
|
-
$indicator-selector: '.indicator',
|
|
359
|
-
$label-selector: '.label'
|
|
360
|
-
) {
|
|
361
|
-
margin-top: .5rem;
|
|
362
|
-
opacity: 0;
|
|
363
|
-
position: absolute;
|
|
364
|
-
z-index: -1;
|
|
365
|
-
|
|
366
|
-
&:not(:checked) {
|
|
367
|
-
+ #{$indicator-selector} {
|
|
368
|
-
color: var(--ec-form-control-border-color);
|
|
369
|
-
|
|
370
|
-
&::before {
|
|
371
|
-
display: none;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
|
|
376
|
-
@if $type == 'checkbox' {
|
|
377
|
-
&.indeterminate,
|
|
378
|
-
&:indeterminate {
|
|
379
|
-
+ #{$indicator-selector} {
|
|
380
|
-
color: var(--ec-color-interactive);
|
|
381
|
-
|
|
382
|
-
&::before {
|
|
383
|
-
content: '';
|
|
384
|
-
background-color: currentColor;
|
|
385
|
-
display: block;
|
|
386
|
-
width: 10px;
|
|
387
|
-
height: 3px;
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
&:focus {
|
|
394
|
-
+ #{$indicator-selector} {
|
|
395
|
-
color: var(--ec-color-interactive);
|
|
396
|
-
box-shadow: var(--ec-form-control-box-shadow-focus);
|
|
397
|
-
border-color: var(--ec-form-control-border-color-focus);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
&:disabled {
|
|
402
|
-
+ #{$indicator-selector} {
|
|
403
|
-
color: var(--ec-form-control-color-disabled);
|
|
404
|
-
background-color: var(--ec-form-control-background-color-disabled);
|
|
405
|
-
border-color: var(--ec-form-control-border-color-disabled);
|
|
406
|
-
opacity: var(--ec-form-control-opacity-disabled);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
~ #{$label-selector} {
|
|
410
|
-
color: var(--ec-form-control-color-disabled);
|
|
411
|
-
opacity: var(--ec-form-control-opacity-disabled);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
&:hover:not(:disabled):not(:focus) {
|
|
416
|
-
+ #{$indicator-selector} {
|
|
417
|
-
border-color: var(--ec-border-color-control-hover);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
@mixin checkbox-radio-indicator($type) {
|
|
423
|
-
background-color: var(--ec-form-control-background-color);
|
|
424
|
-
background-clip: padding-box;
|
|
425
|
-
border: 1px solid currentColor;
|
|
426
|
-
color: var(--ec-color-interactive);
|
|
427
|
-
margin-top: .5rem;
|
|
428
|
-
flex: none;
|
|
429
|
-
pointer-events: none;
|
|
430
|
-
display: inline-flex;
|
|
431
|
-
align-items: center;
|
|
432
|
-
justify-content: center;
|
|
433
|
-
height: 1em;
|
|
434
|
-
width: 1em;
|
|
435
|
-
|
|
436
|
-
@if $type == 'radio' {
|
|
437
|
-
border-radius: 50%;
|
|
438
|
-
|
|
439
|
-
&::before {
|
|
440
|
-
background-color: currentColor;
|
|
441
|
-
content: "";
|
|
442
|
-
display: block;
|
|
443
|
-
width: .5em;
|
|
444
|
-
height: .5em;
|
|
445
|
-
border-radius: 50%;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
} @else {
|
|
449
|
-
border-radius: .125rem;
|
|
450
|
-
|
|
451
|
-
&::before {
|
|
452
|
-
font-size: .6875em;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
@mixin checkbox-radio-label() {
|
|
458
|
-
line-height: $form-control-line-height;
|
|
459
|
-
padding: 0.375rem 0;
|
|
460
|
-
margin-left: .5rem;
|
|
461
|
-
min-height: $form-control-height;
|
|
462
|
-
height: auto;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
@mixin checkbox-radio-readonly(
|
|
466
|
-
$input-selector: '.input',
|
|
467
|
-
$indicator-selector: '.indicator',
|
|
468
|
-
$label-selector: '.label'
|
|
469
|
-
) {
|
|
470
|
-
pointer-events: none;
|
|
471
|
-
|
|
472
|
-
#{$input-selector} {
|
|
473
|
-
opacity: 0;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
#{$indicator-selector} {
|
|
477
|
-
background-color: var(--ec-form-control-background-color-readonly);
|
|
478
|
-
border-color: var(--ec-form-control-border-color-readonly);
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
#{$label-selector},
|
|
482
|
-
#{$indicator-selector} {
|
|
483
|
-
opacity: 1;
|
|
484
|
-
color: var(--ec-form-control-color);
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
@mixin toggle() {
|
|
489
|
-
font-size: var(--ec-form-control-font-size);
|
|
490
|
-
background-color: var(--ec-border-color);
|
|
491
|
-
border-radius: var(--ec-border-radius);
|
|
492
|
-
border: 1px solid var(--ec-border-color);
|
|
493
|
-
min-height: 2em;
|
|
494
|
-
position: relative;
|
|
495
|
-
color: var(--ec-color-secondary-dark);
|
|
496
|
-
display: flex;
|
|
497
|
-
|
|
498
|
-
input {
|
|
499
|
-
position: absolute;
|
|
500
|
-
z-index: -1;
|
|
501
|
-
opacity: 0;
|
|
502
|
-
|
|
503
|
-
&:checked {
|
|
504
|
-
& + label {
|
|
505
|
-
color: var(--ec-color-interactive);
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
&:last-of-type {
|
|
509
|
-
& ~ a {
|
|
510
|
-
transform: translateX(100%);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
|
|
515
|
-
&:focus ~ .toggle-focused {
|
|
516
|
-
display: block;
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
.toggle-focused {
|
|
521
|
-
position: absolute;
|
|
522
|
-
top: 0;
|
|
523
|
-
left: 0;
|
|
524
|
-
bottom: 0;
|
|
525
|
-
right: 0;
|
|
526
|
-
box-shadow: var(--ec-form-control-box-shadow-focus);
|
|
527
|
-
border-radius: var(--ec-form-control-border-radius);
|
|
528
|
-
display: none;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
label {
|
|
532
|
-
align-items: center;
|
|
533
|
-
cursor: pointer;
|
|
534
|
-
display: flex;
|
|
535
|
-
flex: 1 1 0%;
|
|
536
|
-
justify-content: center;
|
|
537
|
-
line-height: 1.1em;
|
|
538
|
-
margin-bottom: 0;
|
|
539
|
-
padding: 0.375rem .5rem;
|
|
540
|
-
position: relative;
|
|
541
|
-
text-align: center;
|
|
542
|
-
transition: color .3s ease;
|
|
543
|
-
z-index: 2;
|
|
544
|
-
|
|
545
|
-
.ec-icon {
|
|
546
|
-
color: inherit;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
|
|
550
|
-
a {
|
|
551
|
-
border: 0.1875rem solid transparent;
|
|
552
|
-
border-radius: calc(var(--ec-form-control-border-radius) * .75);
|
|
553
|
-
display: block;
|
|
554
|
-
height: 100%;
|
|
555
|
-
left: 0;
|
|
556
|
-
position: absolute;
|
|
557
|
-
top: 0;
|
|
558
|
-
transition: transform .25s ease;
|
|
559
|
-
width: 50%;
|
|
560
|
-
z-index: 1;
|
|
561
|
-
|
|
562
|
-
.toggle-handle {
|
|
563
|
-
background-color: var(--ec-form-control-background-color);
|
|
564
|
-
border-radius: calc(var(--ec-form-control-border-radius) * .75);
|
|
565
|
-
height: 100%;
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
&.is-disabled {
|
|
570
|
-
opacity: var(--ec-form-control-opacity-disabled);
|
|
571
|
-
color: var(--ec-form-control-color-disabled);
|
|
572
|
-
|
|
573
|
-
label {
|
|
574
|
-
color: inherit !important;
|
|
575
|
-
cursor: default;
|
|
576
|
-
}
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
@mixin toggle-options {
|
|
581
|
-
@each $count in (3,4,5) {
|
|
582
|
-
.toggle-options-#{$count} {
|
|
583
|
-
a {
|
|
584
|
-
width: percentage(math.div(1, $count));
|
|
585
|
-
}
|
|
586
|
-
|
|
587
|
-
input:checked:last-of-type ~ a {
|
|
588
|
-
transform: translateX(percentage($count - 1));
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
@while $count > 2 {
|
|
592
|
-
$count: $count - 1;
|
|
593
|
-
input:checked:nth-of-type(#{$count}) ~ a {
|
|
594
|
-
transform: translateX(percentage($count - 1));
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
@mixin form-heading() {
|
|
602
|
-
@include form-control-label;
|
|
603
|
-
font-weight: bold;
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
// Override the presentation of children controls when the parent control is
|
|
607
|
-
// untouched
|
|
608
|
-
@mixin form-control-untouched {
|
|
609
|
-
input {
|
|
610
|
-
&.ng-invalid.ng-touched {
|
|
611
|
-
background-image: none;
|
|
612
|
-
padding-left: $form-control-padding-x;
|
|
613
|
-
|
|
614
|
-
&:not(.is-empty) ~ .units-left {
|
|
615
|
-
left: 0;
|
|
616
|
-
}
|
|
617
|
-
}
|
|
618
|
-
&:required:not(:disabled).is-empty {
|
|
619
|
-
@include form-control-state(required, input);
|
|
620
|
-
|
|
621
|
-
&:focus {
|
|
622
|
-
@include form-control-state(focus, input);
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
}
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
// Shared styles for controls that include a popup when the popup is open (combobox, dateinput)
|
|
629
|
-
@mixin form-control-open() {
|
|
630
|
-
.textbox-group {
|
|
631
|
-
ec-textbox {
|
|
632
|
-
--ec-form-control-box-shadow-focus: none;
|
|
633
|
-
--ec-form-control-border-color-focus: var(--ec-form-control-border-color);
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
ec-button {
|
|
637
|
-
--ec-button-box-shadow-focus-secondary: none;
|
|
638
|
-
--ec-button-background-color-secondary: var(--ec-background-color-selected);
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
@mixin form-control-read-only {
|
|
644
|
-
border-color: var(--ec-form-control-border-color-readonly);
|
|
645
|
-
background-color: var(--ec-form-control-background-color-readonly);
|
|
646
|
-
background-clip: border-box;
|
|
647
|
-
background-image: none;
|
|
648
|
-
color: var(--ec-form-control-color-readonly);
|
|
649
|
-
opacity: 1;
|
|
650
|
-
user-select: none;
|
|
651
|
-
pointer-events: none;
|
|
652
|
-
overflow: hidden;
|
|
653
|
-
white-space: nowrap;
|
|
654
|
-
}
|
|
655
|
-
|
|
656
|
-
@mixin form-control-popup {
|
|
657
|
-
background-color: var(--ec-background-color);
|
|
658
|
-
border-radius: var(--ec-border-radius-card);
|
|
659
|
-
box-shadow: var(--ec-box-shadow-overlay);
|
|
660
|
-
margin-top: .25rem;
|
|
661
|
-
overflow: hidden;
|
|
662
|
-
z-index: var(--ec-z-index-popup);
|
|
1
|
+
@use "sass:math";
|
|
2
|
+
|
|
3
|
+
@import '../icons';
|
|
4
|
+
|
|
5
|
+
$form-control-icon-size: 1rem;
|
|
6
|
+
$form-control-font-size: 1rem;
|
|
7
|
+
$form-control-icon-position: .5rem center;
|
|
8
|
+
$form-control-label-size: var(--ec-font-size-label);
|
|
9
|
+
$form-control-height: 2rem;
|
|
10
|
+
$form-control-line-height: 1.25rem;
|
|
11
|
+
$form-control-padding-x: .5rem;
|
|
12
|
+
$form-control-spacing-y: 1rem;
|
|
13
|
+
$form-control-padding-y: .3125rem;
|
|
14
|
+
|
|
15
|
+
$checkbox-indicator-size: $form-control-icon-size;
|
|
16
|
+
|
|
17
|
+
@mixin form-control-input-base {
|
|
18
|
+
&::selection {
|
|
19
|
+
background-color: var(--ec-form-control-background-color-selection);
|
|
20
|
+
color: var(--ec-form-control-color-selection);
|
|
21
|
+
}
|
|
22
|
+
&::-webkit-input-placeholder { /* Chrome/Opera/Safari */
|
|
23
|
+
color: var(--ec-form-control-color-placeholder);
|
|
24
|
+
}
|
|
25
|
+
&::-moz-placeholder { /* Firefox 19+ */
|
|
26
|
+
color: var(--ec-form-control-color-placeholder);
|
|
27
|
+
opacity: 1;
|
|
28
|
+
}
|
|
29
|
+
&:-ms-input-placeholder { /* IE 10+ */
|
|
30
|
+
color: var(--ec-form-control-color-placeholder);
|
|
31
|
+
}
|
|
32
|
+
&:-moz-placeholder { /* Firefox 18- */
|
|
33
|
+
color: var(--ec-form-control-color-placeholder);
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@mixin form-control-input-group-invalid {
|
|
39
|
+
.textbox-group-input ::ng-deep .control input.ng-invalid,
|
|
40
|
+
.textbox-group-input ::ng-deep .control input.ng-valid {
|
|
41
|
+
@include form-control-state(invalid, input);
|
|
42
|
+
|
|
43
|
+
background-image: none;
|
|
44
|
+
|
|
45
|
+
& ~ .icon-invalid {
|
|
46
|
+
display: inline-flex;
|
|
47
|
+
position: absolute;
|
|
48
|
+
left: .5rem;
|
|
49
|
+
top: .5rem;
|
|
50
|
+
z-index: 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
& ~ .icon-required {
|
|
54
|
+
display: none
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:not(.open) {
|
|
59
|
+
.textbox-group-btn-right ::ng-deep button{
|
|
60
|
+
&:not(:focus) {
|
|
61
|
+
border-color: var(--ec-form-control-border-color-invalid);
|
|
62
|
+
}
|
|
63
|
+
background-color: var(--ec-form-control-background-color-invalid);
|
|
64
|
+
|
|
65
|
+
&:hover:not(:disabled):not(:focus) {
|
|
66
|
+
border-color: var(--ec-form-control-border-color-hover);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/// Calculate the background properties for an input icon
|
|
73
|
+
/// @param {string} $icon - The classname of the icon (matches the filename)
|
|
74
|
+
/// @param {number} $width [$form-control-icon-size] - The width of the icon, converted to ems
|
|
75
|
+
/// @param {number} $height [$form-control-icon-size] - The height of the icon, converted to ems
|
|
76
|
+
/// @param {string|number|list} $position [$form-control-icon-position] - The background-position of the icon
|
|
77
|
+
/// @param {number} $indent [$form-control-icon-size] - The amount to indent the text to allow room for the icon
|
|
78
|
+
@mixin form-control-input-icon(
|
|
79
|
+
$icon,
|
|
80
|
+
$width: $form-control-icon-size,
|
|
81
|
+
$height: $form-control-icon-size,
|
|
82
|
+
$position: $form-control-icon-position,
|
|
83
|
+
$indent: $form-control-icon-size + .25rem,
|
|
84
|
+
) {
|
|
85
|
+
$size: $width, $height;
|
|
86
|
+
@include icon-bg-image($icon, $position, $size);
|
|
87
|
+
padding-left: ($indent + $form-control-padding-x);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@mixin form-control-state($state, $selector) {
|
|
91
|
+
$icon-position: $form-control-icon-position;
|
|
92
|
+
|
|
93
|
+
@if $selector == textarea {
|
|
94
|
+
$icon-position: .5rem .5rem;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/// Required
|
|
98
|
+
@if $state == required {
|
|
99
|
+
// TODO: remove when all bootstrap and kendo controls have been replaced in EUM
|
|
100
|
+
@include form-control-input-icon($required-icon, $position: $icon-position);
|
|
101
|
+
|
|
102
|
+
/// Pending
|
|
103
|
+
} @else if $state == pending {
|
|
104
|
+
|
|
105
|
+
// TODO: remove when all bootstrap and kendo controls have been replaced in EUM
|
|
106
|
+
@include form-control-input-icon(pending-icon(), $position: $icon-position);
|
|
107
|
+
|
|
108
|
+
/// Invalid
|
|
109
|
+
} @else if $state == invalid {
|
|
110
|
+
background-color: var(--ec-form-control-background-color-invalid);
|
|
111
|
+
border-color: var(--ec-form-control-border-color-invalid);
|
|
112
|
+
|
|
113
|
+
&:focus {
|
|
114
|
+
border-color: var(--ec-form-control-background-color-invalid);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&:hover:not(:disabled):not(:focus) {
|
|
118
|
+
border-color: var(--ec-form-control-border-color-hover);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// TODO: remove when all bootstrap and kendo controls have been replaced in EUM
|
|
122
|
+
@include form-control-input-icon($invalid-icon, $position: $icon-position);
|
|
123
|
+
|
|
124
|
+
/// Focus
|
|
125
|
+
} @else if $state == focus {
|
|
126
|
+
border-color: var(--ec-form-control-border-color-focus);
|
|
127
|
+
box-shadow: var(--ec-form-control-box-shadow-focus);
|
|
128
|
+
position: relative;
|
|
129
|
+
z-index: 1;
|
|
130
|
+
|
|
131
|
+
/// Disabled
|
|
132
|
+
} @else if $state == disabled {
|
|
133
|
+
background-color: var(--ec-form-control-background-color-disabled);
|
|
134
|
+
border-color: var(--ec-form-control-border-color-disabled);
|
|
135
|
+
color: var(--ec-form-control-color-disabled);
|
|
136
|
+
opacity: var(--ec-form-control-opacity-disabled);
|
|
137
|
+
|
|
138
|
+
&:required,
|
|
139
|
+
&:required.is-empty {
|
|
140
|
+
background-image: none;
|
|
141
|
+
padding-left: $form-control-padding-x;
|
|
142
|
+
|
|
143
|
+
// We need to define these again because the :required styles override
|
|
144
|
+
// the background-color and border-color we set above
|
|
145
|
+
background-color: var(--ec-form-control-background-color-disabled);
|
|
146
|
+
border-color: var(--ec-form-control-border-color-disabled);
|
|
147
|
+
|
|
148
|
+
& + .icon-required {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
} @else if $state == hover {
|
|
153
|
+
&:not(:disabled):not(:focus) {
|
|
154
|
+
border-color: var(--ec-form-control-border-color-hover);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/// A form control label
|
|
160
|
+
@mixin form-control-label {
|
|
161
|
+
color: var(--ec-form-control-label-color, var(--ec-color-secondary-dark));
|
|
162
|
+
display: block;
|
|
163
|
+
font-size: $form-control-label-size;
|
|
164
|
+
line-height: 1;
|
|
165
|
+
margin: calc(#{$form-control-label-size} / 2) 0;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/// The default form control element in the control component
|
|
169
|
+
/// @param {string} $tag [input] - The HTML tag name of the input element (e.g. input, textarea)
|
|
170
|
+
@mixin form-control-input($selector: input, $new-state-icons: false) {
|
|
171
|
+
@include form-control-input-base;
|
|
172
|
+
background-color: var(--ec-form-control-background-color);
|
|
173
|
+
border: 1px solid var(--ec-form-control-border-color);
|
|
174
|
+
border-radius: var(--ec-border-radius);
|
|
175
|
+
background-image: none;
|
|
176
|
+
background-clip: padding-box;
|
|
177
|
+
width: 100%;
|
|
178
|
+
line-height: $form-control-line-height;
|
|
179
|
+
padding: $form-control-padding-y $form-control-padding-x;
|
|
180
|
+
|
|
181
|
+
@if $selector == input {
|
|
182
|
+
height: $form-control-height;
|
|
183
|
+
} @else {
|
|
184
|
+
height: auto;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
& ~ .icon-required,
|
|
188
|
+
& ~ .icon-invalid {
|
|
189
|
+
color: var(--ec-form-control-border-color-invalid);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
&:required {
|
|
193
|
+
&.is-empty {
|
|
194
|
+
@include form-control-state(required, $selector);
|
|
195
|
+
|
|
196
|
+
@if $new-state-icons {
|
|
197
|
+
background-image: none;
|
|
198
|
+
|
|
199
|
+
& ~ .icon-required {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
position: absolute;
|
|
202
|
+
left: .5rem;
|
|
203
|
+
top: .5rem;
|
|
204
|
+
z-index: 1;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
// Use .ng-invalid because not all Angular validators trigger :invalid
|
|
211
|
+
&.ng-invalid {
|
|
212
|
+
&.ng-touched {
|
|
213
|
+
@include form-control-state(invalid, $selector);
|
|
214
|
+
|
|
215
|
+
@if $new-state-icons {
|
|
216
|
+
background-image: none;
|
|
217
|
+
|
|
218
|
+
& ~ .icon-invalid {
|
|
219
|
+
display: inline-flex;
|
|
220
|
+
position: absolute;
|
|
221
|
+
left: .5rem;
|
|
222
|
+
top: .5rem;
|
|
223
|
+
z-index: 1;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
& ~ .icon-required {
|
|
227
|
+
display: none
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
&.is-pending {
|
|
234
|
+
&.ng-valid,
|
|
235
|
+
&.ng-invalid,
|
|
236
|
+
&.ng-pending {
|
|
237
|
+
@include form-control-state(pending, $selector);
|
|
238
|
+
|
|
239
|
+
@if $new-state-icons {
|
|
240
|
+
& ~ .icon-loading {
|
|
241
|
+
display: inline-flex;
|
|
242
|
+
position: absolute;
|
|
243
|
+
left: .5rem;
|
|
244
|
+
top: .5rem;
|
|
245
|
+
z-index: 1;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
& ~ .icon-required,
|
|
249
|
+
& ~ .icon-invalid {
|
|
250
|
+
display: none;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
&:focus,
|
|
257
|
+
&:focus.is-empty {
|
|
258
|
+
@include form-control-state(focus, $selector);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&:disabled {
|
|
262
|
+
@include form-control-state(disabled, $selector);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&:hover {
|
|
266
|
+
@include form-control-state(hover, $selector);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
&.is-uppercase:not(.is-empty) {
|
|
270
|
+
text-transform: uppercase;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/// The base styles of a control component. These styles will be applied to :host
|
|
275
|
+
@mixin form-control-base() {
|
|
276
|
+
color: var(--ec-form-control-color);
|
|
277
|
+
// font-family: $control-font-family;
|
|
278
|
+
font-size: var(--ec-form-control-font-size);
|
|
279
|
+
display: block;
|
|
280
|
+
margin-bottom: 1rem;
|
|
281
|
+
width: 100%;
|
|
282
|
+
|
|
283
|
+
:host-context(.form-condensed) {
|
|
284
|
+
margin-bottom: .5rem;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.control {
|
|
288
|
+
width: 100%;
|
|
289
|
+
display: flex;
|
|
290
|
+
flex-direction: column;
|
|
291
|
+
|
|
292
|
+
&.control-label-bottom {
|
|
293
|
+
flex-direction: column-reverse;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
&.control-label-left {
|
|
297
|
+
flex-direction: row;
|
|
298
|
+
label {
|
|
299
|
+
margin-right: .25rem;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
&.control-label-right {
|
|
304
|
+
flex-direction: row-reverse;
|
|
305
|
+
label {
|
|
306
|
+
margin-left: .25rem;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
&.control-label-left,
|
|
311
|
+
&.control-label-right {
|
|
312
|
+
align-items: center;
|
|
313
|
+
|
|
314
|
+
label {
|
|
315
|
+
flex: 1 1;
|
|
316
|
+
margin-top: 0;
|
|
317
|
+
margin-bottom: 0;
|
|
318
|
+
}
|
|
319
|
+
.control-input {
|
|
320
|
+
flex: 2 2;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
&.is-readonly {
|
|
325
|
+
input,
|
|
326
|
+
select,
|
|
327
|
+
textarea {
|
|
328
|
+
@include form-control-read-only;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
&.invalid {
|
|
333
|
+
@include form-control-input-group-invalid;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
.textbox-group {
|
|
338
|
+
display: flex;
|
|
339
|
+
position: relative;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
textarea:focus,
|
|
343
|
+
input:focus,
|
|
344
|
+
select:focus {
|
|
345
|
+
outline: none;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
@mixin checkbox-radio {
|
|
350
|
+
cursor: pointer;
|
|
351
|
+
display: inline-flex;
|
|
352
|
+
margin-bottom: 0;
|
|
353
|
+
position: relative;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
@mixin checkbox-radio-input(
|
|
357
|
+
$type,
|
|
358
|
+
$indicator-selector: '.indicator',
|
|
359
|
+
$label-selector: '.label'
|
|
360
|
+
) {
|
|
361
|
+
margin-top: .5rem;
|
|
362
|
+
opacity: 0;
|
|
363
|
+
position: absolute;
|
|
364
|
+
z-index: -1;
|
|
365
|
+
|
|
366
|
+
&:not(:checked) {
|
|
367
|
+
+ #{$indicator-selector} {
|
|
368
|
+
color: var(--ec-form-control-border-color);
|
|
369
|
+
|
|
370
|
+
&::before {
|
|
371
|
+
display: none;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
@if $type == 'checkbox' {
|
|
377
|
+
&.indeterminate,
|
|
378
|
+
&:indeterminate {
|
|
379
|
+
+ #{$indicator-selector} {
|
|
380
|
+
color: var(--ec-color-interactive);
|
|
381
|
+
|
|
382
|
+
&::before {
|
|
383
|
+
content: '';
|
|
384
|
+
background-color: currentColor;
|
|
385
|
+
display: block;
|
|
386
|
+
width: 10px;
|
|
387
|
+
height: 3px;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
&:focus {
|
|
394
|
+
+ #{$indicator-selector} {
|
|
395
|
+
color: var(--ec-color-interactive);
|
|
396
|
+
box-shadow: var(--ec-form-control-box-shadow-focus);
|
|
397
|
+
border-color: var(--ec-form-control-border-color-focus);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
&:disabled {
|
|
402
|
+
+ #{$indicator-selector} {
|
|
403
|
+
color: var(--ec-form-control-color-disabled);
|
|
404
|
+
background-color: var(--ec-form-control-background-color-disabled);
|
|
405
|
+
border-color: var(--ec-form-control-border-color-disabled);
|
|
406
|
+
opacity: var(--ec-form-control-opacity-disabled);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
~ #{$label-selector} {
|
|
410
|
+
color: var(--ec-form-control-color-disabled);
|
|
411
|
+
opacity: var(--ec-form-control-opacity-disabled);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
&:hover:not(:disabled):not(:focus) {
|
|
416
|
+
+ #{$indicator-selector} {
|
|
417
|
+
border-color: var(--ec-border-color-control-hover);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
@mixin checkbox-radio-indicator($type) {
|
|
423
|
+
background-color: var(--ec-form-control-background-color);
|
|
424
|
+
background-clip: padding-box;
|
|
425
|
+
border: 1px solid currentColor;
|
|
426
|
+
color: var(--ec-color-interactive);
|
|
427
|
+
margin-top: .5rem;
|
|
428
|
+
flex: none;
|
|
429
|
+
pointer-events: none;
|
|
430
|
+
display: inline-flex;
|
|
431
|
+
align-items: center;
|
|
432
|
+
justify-content: center;
|
|
433
|
+
height: 1em;
|
|
434
|
+
width: 1em;
|
|
435
|
+
|
|
436
|
+
@if $type == 'radio' {
|
|
437
|
+
border-radius: 50%;
|
|
438
|
+
|
|
439
|
+
&::before {
|
|
440
|
+
background-color: currentColor;
|
|
441
|
+
content: "";
|
|
442
|
+
display: block;
|
|
443
|
+
width: .5em;
|
|
444
|
+
height: .5em;
|
|
445
|
+
border-radius: 50%;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
} @else {
|
|
449
|
+
border-radius: .125rem;
|
|
450
|
+
|
|
451
|
+
&::before {
|
|
452
|
+
font-size: .6875em;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
@mixin checkbox-radio-label() {
|
|
458
|
+
line-height: $form-control-line-height;
|
|
459
|
+
padding: 0.375rem 0;
|
|
460
|
+
margin-left: .5rem;
|
|
461
|
+
min-height: $form-control-height;
|
|
462
|
+
height: auto;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
@mixin checkbox-radio-readonly(
|
|
466
|
+
$input-selector: '.input',
|
|
467
|
+
$indicator-selector: '.indicator',
|
|
468
|
+
$label-selector: '.label'
|
|
469
|
+
) {
|
|
470
|
+
pointer-events: none;
|
|
471
|
+
|
|
472
|
+
#{$input-selector} {
|
|
473
|
+
opacity: 0;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
#{$indicator-selector} {
|
|
477
|
+
background-color: var(--ec-form-control-background-color-readonly);
|
|
478
|
+
border-color: var(--ec-form-control-border-color-readonly);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
#{$label-selector},
|
|
482
|
+
#{$indicator-selector} {
|
|
483
|
+
opacity: 1;
|
|
484
|
+
color: var(--ec-form-control-color);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
@mixin toggle() {
|
|
489
|
+
font-size: var(--ec-form-control-font-size);
|
|
490
|
+
background-color: var(--ec-border-color);
|
|
491
|
+
border-radius: var(--ec-border-radius);
|
|
492
|
+
border: 1px solid var(--ec-border-color);
|
|
493
|
+
min-height: 2em;
|
|
494
|
+
position: relative;
|
|
495
|
+
color: var(--ec-color-secondary-dark);
|
|
496
|
+
display: flex;
|
|
497
|
+
|
|
498
|
+
input {
|
|
499
|
+
position: absolute;
|
|
500
|
+
z-index: -1;
|
|
501
|
+
opacity: 0;
|
|
502
|
+
|
|
503
|
+
&:checked {
|
|
504
|
+
& + label {
|
|
505
|
+
color: var(--ec-color-interactive);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
&:last-of-type {
|
|
509
|
+
& ~ a {
|
|
510
|
+
transform: translateX(100%);
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
&:focus ~ .toggle-focused {
|
|
516
|
+
display: block;
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.toggle-focused {
|
|
521
|
+
position: absolute;
|
|
522
|
+
top: 0;
|
|
523
|
+
left: 0;
|
|
524
|
+
bottom: 0;
|
|
525
|
+
right: 0;
|
|
526
|
+
box-shadow: var(--ec-form-control-box-shadow-focus);
|
|
527
|
+
border-radius: var(--ec-form-control-border-radius);
|
|
528
|
+
display: none;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
label {
|
|
532
|
+
align-items: center;
|
|
533
|
+
cursor: pointer;
|
|
534
|
+
display: flex;
|
|
535
|
+
flex: 1 1 0%;
|
|
536
|
+
justify-content: center;
|
|
537
|
+
line-height: 1.1em;
|
|
538
|
+
margin-bottom: 0;
|
|
539
|
+
padding: 0.375rem .5rem;
|
|
540
|
+
position: relative;
|
|
541
|
+
text-align: center;
|
|
542
|
+
transition: color .3s ease;
|
|
543
|
+
z-index: 2;
|
|
544
|
+
|
|
545
|
+
.ec-icon {
|
|
546
|
+
color: inherit;
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
a {
|
|
551
|
+
border: 0.1875rem solid transparent;
|
|
552
|
+
border-radius: calc(var(--ec-form-control-border-radius) * .75);
|
|
553
|
+
display: block;
|
|
554
|
+
height: 100%;
|
|
555
|
+
left: 0;
|
|
556
|
+
position: absolute;
|
|
557
|
+
top: 0;
|
|
558
|
+
transition: transform .25s ease;
|
|
559
|
+
width: 50%;
|
|
560
|
+
z-index: 1;
|
|
561
|
+
|
|
562
|
+
.toggle-handle {
|
|
563
|
+
background-color: var(--ec-form-control-background-color);
|
|
564
|
+
border-radius: calc(var(--ec-form-control-border-radius) * .75);
|
|
565
|
+
height: 100%;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
&.is-disabled {
|
|
570
|
+
opacity: var(--ec-form-control-opacity-disabled);
|
|
571
|
+
color: var(--ec-form-control-color-disabled);
|
|
572
|
+
|
|
573
|
+
label {
|
|
574
|
+
color: inherit !important;
|
|
575
|
+
cursor: default;
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
@mixin toggle-options {
|
|
581
|
+
@each $count in (3,4,5) {
|
|
582
|
+
.toggle-options-#{$count} {
|
|
583
|
+
a {
|
|
584
|
+
width: percentage(math.div(1, $count));
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
input:checked:last-of-type ~ a {
|
|
588
|
+
transform: translateX(percentage($count - 1));
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
@while $count > 2 {
|
|
592
|
+
$count: $count - 1;
|
|
593
|
+
input:checked:nth-of-type(#{$count}) ~ a {
|
|
594
|
+
transform: translateX(percentage($count - 1));
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
@mixin form-heading() {
|
|
602
|
+
@include form-control-label;
|
|
603
|
+
font-weight: bold;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
// Override the presentation of children controls when the parent control is
|
|
607
|
+
// untouched
|
|
608
|
+
@mixin form-control-untouched {
|
|
609
|
+
input {
|
|
610
|
+
&.ng-invalid.ng-touched {
|
|
611
|
+
background-image: none;
|
|
612
|
+
padding-left: $form-control-padding-x;
|
|
613
|
+
|
|
614
|
+
&:not(.is-empty) ~ .units-left {
|
|
615
|
+
left: 0;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
&:required:not(:disabled).is-empty {
|
|
619
|
+
@include form-control-state(required, input);
|
|
620
|
+
|
|
621
|
+
&:focus {
|
|
622
|
+
@include form-control-state(focus, input);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
// Shared styles for controls that include a popup when the popup is open (combobox, dateinput)
|
|
629
|
+
@mixin form-control-open() {
|
|
630
|
+
.textbox-group {
|
|
631
|
+
ec-textbox {
|
|
632
|
+
--ec-form-control-box-shadow-focus: none;
|
|
633
|
+
--ec-form-control-border-color-focus: var(--ec-form-control-border-color);
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
ec-button {
|
|
637
|
+
--ec-button-box-shadow-focus-secondary: none;
|
|
638
|
+
--ec-button-background-color-secondary: var(--ec-background-color-selected);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
@mixin form-control-read-only {
|
|
644
|
+
border-color: var(--ec-form-control-border-color-readonly);
|
|
645
|
+
background-color: var(--ec-form-control-background-color-readonly);
|
|
646
|
+
background-clip: border-box;
|
|
647
|
+
background-image: none;
|
|
648
|
+
color: var(--ec-form-control-color-readonly);
|
|
649
|
+
opacity: 1;
|
|
650
|
+
user-select: none;
|
|
651
|
+
pointer-events: none;
|
|
652
|
+
overflow: hidden;
|
|
653
|
+
white-space: nowrap;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
@mixin form-control-popup {
|
|
657
|
+
background-color: var(--ec-background-color);
|
|
658
|
+
border-radius: var(--ec-border-radius-card);
|
|
659
|
+
box-shadow: var(--ec-box-shadow-overlay);
|
|
660
|
+
margin-top: .25rem;
|
|
661
|
+
overflow: hidden;
|
|
662
|
+
z-index: var(--ec-z-index-popup);
|
|
663
663
|
}
|