Skip to content

Commit 86de3a3

Browse files
committed
Merge branch 'sstoychev/master-detail-approach-2' of https://github.com/IgniteUI/igniteui-angular into sstoychev/master-detail-approach-2
2 parents bc03348 + b3fc635 commit 86de3a3

File tree

18 files changed

+294
-135
lines changed

18 files changed

+294
-135
lines changed

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-component.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151

5252
@include e(input) {
5353
@extend %form-group-input !optional;
54-
@extend %chrome-autofill-fix !optional;
54+
@extend %autofill-background-fix !optional;
5555
@extend %edge-clear-icon-fix !optional;
5656

5757
&:hover {
@@ -421,6 +421,7 @@
421421

422422
// Type border START
423423
@include m(border) {
424+
@extend %form-group-display--border !optional;
424425
@extend %form-group-display--no-margin !optional;
425426

426427
@include e(bundle) {

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-theme.scss

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,25 @@
394394
}
395395
}
396396

397+
@if $variant == 'material' {
398+
%form-group-display--border {
399+
&:has(input:-webkit-autofill, input:autofill) {
400+
%igx-input-group__notch--border {
401+
border-block-start-color: transparent;
402+
}
403+
404+
%form-group-label {
405+
--label-position: #{sizable(18px, 22px, 26px)};
406+
407+
transform: translateY(calc(var(--label-position) * -1));
408+
margin-top: 0;
409+
overflow: hidden;
410+
will-change: font-size, color, transform;
411+
}
412+
}
413+
}
414+
}
415+
397416
%form-group-display--box {
398417
%form-group-border {
399418
margin-bottom: 0;
@@ -464,6 +483,20 @@
464483
--size: var(--input-icon) !important;
465484
}
466485
}
486+
487+
@if $variant == 'material' {
488+
&:not(%form-group-display--border) {
489+
&:has(input:-webkit-autofill, input:autofill) {
490+
%form-group-label {
491+
--floating-label-position: -73%;
492+
493+
@include type-style('caption');
494+
495+
transform: translateY(var(--floating-label-position));
496+
}
497+
}
498+
}
499+
}
467500
}
468501

469502
%form-group-placeholder {
@@ -1234,13 +1267,20 @@
12341267
}
12351268
}
12361269

1237-
%chrome-autofill-fix {
1270+
// This is a hack that removes the autofill background and it's essential,
1271+
// otherwise the background is on top of the floating label in material theme.
1272+
// The !important flag is because bootstrap theme(and potentially feature themes) is overriding the transition delay.
1273+
%autofill-background-fix {
12381274
&:-webkit-autofill,
12391275
&:-webkit-autofill:hover,
12401276
&:-webkit-autofill:focus,
1241-
&:-webkit-autofill:active {
1242-
-webkit-transition-delay: 99999s;
1243-
transition-delay: 99999s;
1277+
&:-webkit-autofill:active,
1278+
&:autofill,
1279+
&:autofill:hover,
1280+
&:autofill:focus,
1281+
&:autofill:active, {
1282+
-webkit-transition-delay: 99999s !important;
1283+
transition-delay: 99999s !important;
12441284
}
12451285
}
12461286

@@ -2092,7 +2132,15 @@
20922132
map.get($bootstrap-inline-padding, 'cosy'),
20932133
map.get($bootstrap-inline-padding, 'comfortable')
20942134
);
2095-
transition: box-shadow .15s ease-out, border .15s ease-out;
2135+
}
2136+
2137+
// The :not selector is needed otherwise bootstrap will override the %autofill-background-fix
2138+
%form-group-display--bootstrap {
2139+
:not(:has(input:-webkit-autofill, input:autofill)) {
2140+
%bootstrap-input {
2141+
transition: box-shadow .15s ease-out, border .15s ease-out;
2142+
}
2143+
}
20962144
}
20972145

20982146
%bootstrap-input,

projects/igniteui-angular/src/lib/core/styles/components/label/_label-theme.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111

1212
/// @param {Map} $schema [$light-material-schema] - The schema used as basis for styling the component.
1313
/// @param {Map} $color [null] - The text color.
14+
/// @param {Map} $disabled-color [null] - The disabled text color.
1415
@function label-theme(
1516
$schema: $light-material-schema,
16-
$color: null
17+
$color: null,
18+
$disabled-color: null,
1719
) {
1820
$name: 'igx-label';
1921
$selector: '[igxLabel]';
@@ -31,6 +33,7 @@
3133
name: $name,
3234
selector: $selector,
3335
color: $color,
36+
disabled-color: $disabled-color,
3437
theme: map.get($schema, '_meta', 'theme'),
3538
variant: map.get($schema, '_meta', 'theme'),
3639
));

projects/igniteui-angular/src/lib/core/styles/components/radio/_radio-component.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@
115115
@include e(label) {
116116
@extend %radio-label--disabled !optional;
117117
}
118+
119+
@include e(label, $m: before) {
120+
@extend %radio-label--disabled !optional;
121+
}
118122
}
119123

120124
@include m(invalid) {
@@ -217,5 +221,13 @@
217221
@include m(vertical) {
218222
@extend %radio-group-display--vertical !optional;
219223
}
224+
225+
@include m(before) {
226+
@extend %radio-group-display--before !optional;
227+
}
228+
229+
@include m(disabled) {
230+
@extend %radio-group-display--disabled !optional;
231+
}
220232
}
221233
}

projects/igniteui-angular/src/lib/core/styles/components/radio/_radio-theme.scss

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -597,18 +597,40 @@
597597
}
598598

599599
%radio-group-display {
600-
display: block;
601-
%radio-display:not(:last-of-type) {
602-
margin-inline-end: $horizontal-group-margin;
600+
display: grid;
601+
column-gap: $horizontal-group-margin;
602+
align-items: start;
603+
width: max-content;
604+
}
605+
606+
%radio-group-display:not(%radio-group-display--vertical) {
607+
[igxLabel] {
608+
margin-block-end: rem(16px);
609+
}
610+
611+
igx-radio {
612+
grid-row: 2;
603613
}
604614
}
605615

606616
%radio-group-display--vertical {
607-
display: flex;
608-
flex-flow: column;
609-
%radio-display:not(:last-of-type) {
610-
margin-inline-end: 0;
611-
margin-block-end: $vertical-group-margin;
617+
row-gap: $vertical-group-margin;
618+
619+
[igxLabel] {
620+
margin-block-end: if($variant == 'material', rem(16px), rem(8px));
621+
}
622+
623+
&%radio-group-display--before {
624+
igx-radio,
625+
[igxLabel] {
626+
justify-self: flex-end;
627+
}
628+
}
629+
}
630+
631+
%radio-group-display--disabled {
632+
[igxLabel] {
633+
color: var-get($theme, 'disabled-color');
612634
}
613635
}
614636
}

projects/igniteui-angular/src/lib/directives/radio/radio-group.directive.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,3 +448,4 @@ const dispatchRadioEvent = (eventName, radioNativeElement, fixture) => {
448448
radioNativeElement.dispatchEvent(new Event(eventName));
449449
fixture.detectChanges();
450450
};
451+

0 commit comments

Comments
 (0)