Skip to content

Commit 2fe8c40

Browse files
authored
Merge pull request #12071 from IgniteUI/14.1.x
Mass merge from 14.1.x to master
2 parents 0742fd6 + 107ea90 commit 2fe8c40

24 files changed

+231
-59
lines changed

projects/igniteui-angular/package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@
1717
"angular",
1818
"UI components",
1919
"accordion",
20-
"auto complete",
2120
"autocomplete",
2221
"avatar",
2322
"badge",
2423
"banner",
2524
"bottom nav",
2625
"button",
26+
"button group",
2727
"calendar",
2828
"card",
2929
"carousel",
@@ -34,14 +34,11 @@
3434
"combo",
3535
"csv export",
3636
"data table",
37-
"date picker",
3837
"datepicker",
3938
"datetime editor",
4039
"dialog",
4140
"drag drop",
42-
"drag",
4341
"drop down",
44-
"drop",
4542
"excel export",
4643
"expansion panel",
4744
"grid",
@@ -56,12 +53,13 @@
5653
"navdrawer",
5754
"progress bar",
5855
"radio",
56+
"rating",
5957
"select",
6058
"slider",
6159
"snackbar",
60+
"stepper",
6261
"switch",
6362
"tabs",
64-
"time picker",
6563
"timepicker",
6664
"toast",
6765
"toggle",

projects/igniteui-angular/src/lib/combo/combo.common.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -980,6 +980,13 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
980980
});
981981
}
982982

983+
/** @hidden @internal */
984+
public ngDoCheck() {
985+
if (this.data?.length && this.selection.length) {
986+
this._value = this.createDisplayText(this.selection, []);
987+
}
988+
}
989+
983990
/** @hidden @internal */
984991
public ngOnDestroy() {
985992
this.destroy$.next();

projects/igniteui-angular/src/lib/combo/combo.component.spec.ts

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,8 @@ describe('igxCombo', () => {
18981898
TestBed.configureTestingModule({
18991899
declarations: [
19001900
IgxComboSampleComponent,
1901-
IgxComboRemoteDataComponent
1901+
IgxComboRemoteDataComponent,
1902+
IgxComboBindingDataAfterInitComponent
19021903
],
19031904
imports: [
19041905
IgxComboModule,
@@ -2187,6 +2188,16 @@ describe('igxCombo', () => {
21872188
expect(combo.selection.length).toEqual(0);
21882189
expect((combo as any)._remoteSelection[0]).toBeUndefined();
21892190
});
2191+
it('should add predefined selection to the input when data is bound after initialization', fakeAsync(() => {
2192+
fixture = TestBed.createComponent(IgxComboBindingDataAfterInitComponent);
2193+
fixture.detectChanges();
2194+
input = fixture.debugElement.query(By.css(`.${CSS_CLASS_COMBO_INPUTGROUP}`));
2195+
tick(1200);
2196+
fixture.detectChanges();
2197+
2198+
const expectedOutput = 'One';
2199+
expect(input.nativeElement.value).toEqual(expectedOutput);
2200+
}));
21902201
});
21912202
describe('Grouping tests: ', () => {
21922203
configureTestSuite();
@@ -3311,6 +3322,29 @@ class="input-container" [filterable]="true" placeholder="Location(s)"
33113322
`
33123323
})
33133324

3325+
@Component({
3326+
template: `
3327+
<form [formGroup]="reactiveForm" (ngSubmit)="onSubmitReactive()">
3328+
<p>
3329+
<label>First Name:</label>
3330+
<input type="text" formControlName="firstName">
3331+
</p>
3332+
<p>
3333+
<label>Password:</label>
3334+
<input type="password" formControlName="password">
3335+
</p>
3336+
<p>
3337+
<igx-combo #comboReactive formControlName="townCombo"
3338+
class="input-container" [filterable]="true" placeholder="Location(s)"
3339+
[data]="items" [displayKey]="'field'" [groupKey]="'region'"><label igxLabel>Town</label></igx-combo>
3340+
</p>
3341+
<p>
3342+
<button type="submit" [disabled]="!reactiveForm.valid">Submit</button>
3343+
</p>
3344+
</form>
3345+
`
3346+
})
3347+
33143348
class IgxComboFormComponent {
33153349
@ViewChild('comboReactive', { read: IgxComboComponent, static: true })
33163350
public combo: IgxComboComponent;
@@ -3583,3 +3617,22 @@ export class ComboModelBindingComponent implements OnInit {
35833617
{ text: 'Four', id: 3 }, { text: 'Five', id: 4 }];
35843618
}
35853619
}
3620+
3621+
@Component({
3622+
template: `
3623+
<igx-combo [(ngModel)]="selectedItems" [data]="items" [valueKey]="'id'" [displayKey]="'text'"></igx-combo>`
3624+
})
3625+
export class IgxComboBindingDataAfterInitComponent implements AfterViewInit {
3626+
public items: any[] = [];
3627+
public selectedItems: any[] = [0];
3628+
3629+
constructor(private cdr: ChangeDetectorRef) { }
3630+
3631+
public ngAfterViewInit() {
3632+
setTimeout(() => {
3633+
this.items = [{ text: 'One', id: 0 }, { text: 'Two', id: 1 }, { text: 'Three', id: 2 },
3634+
{ text: 'Four', id: 3 }, { text: 'Five', id: 4 }];
3635+
this.cdr.detectChanges();
3636+
}, 1000);
3637+
}
3638+
}

projects/igniteui-angular/src/lib/core/styles/components/avatar/_avatar-theme.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
width: 100%;
125125
height: 100%;
126126
border-radius: inherit;
127-
background-color: var-get($theme, 'background');
128127
background-size: cover;
129128
background-repeat: no-repeat;
130129
background-position: center;

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,7 @@
14041404
padding-inline-end: rem(4px) !important;
14051405

14061406
> igx-icon {
1407+
margin-inline-start: auto;
14071408
color: color($palette, 'error', 500);
14081409
width: var(--igx-icon-size, rem(18px));
14091410
height: var(--igx-icon-size, rem(18px));

projects/igniteui-angular/src/lib/core/styles/components/navbar/_navbar-theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@
140140
}
141141

142142
%igx-navbar-icon-display {
143-
igx-icon,
144-
button[igxButton='icon'] {
143+
>igx-icon,
144+
[igxButton='icon'] {
145145
cursor: pointer;
146146
color: var-get($theme, 'idle-icon-color');
147147
transition: color .15s $ease-out-quad;

projects/igniteui-angular/src/lib/core/styles/themes/schemas/light/_calendar.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
///
2222
/// @prop {Map} inactive-text-color [color: ('grays', 400)] - The text color for previous and next month dates.
2323
/// @prop {Map} label-color [color: ('grays', 400)] - The text color for weekday labels.
24-
/// @prop {Map} weekend-text-color [color: ('grays', 500)] - The text color for weekend days.
24+
/// @prop {Map} weekend-text-color [contrast-color: 'surface'] - The text color for weekend days.
2525
///
2626
/// @prop {Map} year-current-text-color [color: ('secondary', 500)] - The text color for the current/selected year.
2727
/// @prop {Map} year-hover-text-color [color: ('secondary', 500)] - The year hover text color.
@@ -124,7 +124,7 @@ $light-calendar: extend(
124124
),
125125

126126
weekend-text-color: (
127-
color: ('grays', 500),
127+
contrast-color: 'surface',
128128
),
129129

130130
year-current-text-color: (
@@ -504,7 +504,6 @@ $bootstrap-calendar: extend(
504504
color: ('primary', 500)
505505
),
506506

507-
508507
date-selected-background: (
509508
color: ('primary', 300),
510509
),
@@ -564,7 +563,7 @@ $bootstrap-calendar: extend(
564563
/// @prop {Map} date-disabled-text-color [color: ('grays', 300)] - The text color for disabled dates.
565564
/// @prop {Map} inactive-text-color [color: ('grays', 600)] - The text color for previous and next month dates.
566565
/// @prop {Map} label-color [color: ('grays', 600)] - The text color for weekday labels.
567-
/// @prop {Map} weekend-text-color [color: ('grays', 600)] - The text color for weekend days.
566+
/// @prop {Map} weekend-text-color [color: ('grays', 900)] - The text color for weekend days.
568567
/// @prop {Color} month-hover-background [transparent] - The month hover text color.
569568
/// @prop {Map} month-hover-text-color [color: ('primary', 500)] - The month hover text color.
570569
/// @prop {Map} date-selected-current-hover-foreground [contrast-color: ('primary', 500)] - The hover text color for the selected/current date.
@@ -634,7 +633,7 @@ $indigo-calendar: extend(
634633
),
635634

636635
weekend-text-color: (
637-
color: ('grays', 600)
636+
color: ('grays', 900)
638637
),
639638

640639
month-hover-background: transparent,

projects/igniteui-angular/src/lib/grids/cell.component.html

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@
7474
<igx-input-group displayDensity="compact" >
7575
<input
7676
igxInput
77-
[attr.aria-errormessage]="ariaErrorMessage"
77+
[attr.aria-describedby]="ariaDescribeBy"
78+
[attr.aria-invalid]="isInvalid"
7879
[igxFocus]="true"
7980
[formControl]="formControl"
8081
(compositionstart)="grid.crudService.isInCompositionMode = true"
@@ -86,7 +87,8 @@
8687
<igx-input-group displayDensity="compact" [formGroup]="formGroup">
8788
<input
8889
igxInput
89-
[attr.aria-errormessage]="ariaErrorMessage"
90+
[attr.aria-describedby]="ariaDescribeBy"
91+
[attr.aria-invalid]="isInvalid"
9092
[igxFocus]="true"
9193
[step]="step"
9294
type="number"
@@ -131,7 +133,8 @@
131133
<igx-input-group [formGroup]="formGroup">
132134
<input
133135
type="text"
134-
[attr.aria-errormessage]="ariaErrorMessage"
136+
[attr.aria-describedby]="ariaDescribeBy"
137+
[attr.aria-invalid]="isInvalid"
135138
[formControl]="formControl"
136139
igxInput
137140
[igxDateTimeEditor]="column.defaultDateTimeFormat"
@@ -144,7 +147,8 @@
144147
<igx-prefix *ngIf="grid.currencyPositionLeft">{{ currencyCodeSymbol }}</igx-prefix>
145148
<input
146149
igxInput
147-
[attr.aria-errormessage]="ariaErrorMessage"
150+
[attr.aria-describedby]="ariaDescribeBy"
151+
[attr.aria-invalid]="isInvalid"
148152
[igxFocus]="true"
149153
[step]="step"
150154
type="number"
@@ -157,7 +161,8 @@
157161
<igx-input-group displayDensity="compact" [formGroup]="formGroup">
158162
<input
159163
igxInput
160-
[attr.aria-errormessage]="ariaErrorMessage"
164+
[attr.aria-describedby]="ariaDescribeBy"
165+
[attr.aria-invalid]="isInvalid"
161166
[igxFocus]="true"
162167
[step]="step"
163168
type="number"
@@ -172,7 +177,7 @@
172177
<ng-container *ngTemplateOutlet="template; context: context"></ng-container>
173178

174179
<ng-container *ngIf="isInvalid">
175-
<igx-icon #errorIcon [igxTooltipTarget]="tooltipRef"
180+
<igx-icon #errorIcon [igxTooltipTarget]="tooltipRef" [igxToggleOutlet]="grid.outlet"
176181
(mouseover)='errorShowing = true' (mouseout)='errorShowing = false'>error</igx-icon>
177182
<div [id]="ariaErrorMessage"
178183
igxTooltip #error #tooltipRef="tooltip">

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -469,14 +469,18 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy, CellT
469469
public get readonly(): boolean {
470470
return !this.editable;
471471
}
472+
472473
/** @hidden @internal */
473474
@HostBinding('attr.aria-describedby')
474-
public get describeBy() {
475-
return this.grid.id + '_' + this.column.field;
475+
public get ariaDescribeBy() {
476+
let describeBy = (this.gridID + '_' + this.column.field).replace('.', '_');
477+
if (this.isInvalid) {
478+
describeBy += ' ' + this.ariaErrorMessage;
479+
}
480+
return describeBy;
476481
}
477482

478483
/** @hidden @internal */
479-
@HostBinding('attr.aria-errormessage')
480484
public get ariaErrorMessage() {
481485
return this.grid.id + '_' + this.column.field + '_' + this.intRow.index + '_error';
482486
}

projects/igniteui-angular/src/lib/grids/common/pipes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ export class IgxGridRowStylesPipe implements PipeTransform {
136136
}
137137
for (const prop of Object.keys(styles)) {
138138
const cb = styles[prop];
139-
const row = new IgxGridRow((this.grid as any), index, rowData);
139+
const data = this.grid.isTreeRow && this.grid.isTreeRow(rowData) ? rowData.data : rowData;
140+
const row = new IgxGridRow((this.grid as any), index, data);
140141
css[prop] = typeof cb === 'function' ? cb(row) : cb;
141142
}
142143
return css;

0 commit comments

Comments
 (0)