Skip to content

Commit 24b39ce

Browse files
authored
Merge branch '19.2.x' into mpopov/fix-input-label-position-19-2
2 parents f6e5f58 + df32cbc commit 24b39ce

File tree

6 files changed

+97
-7
lines changed

6 files changed

+97
-7
lines changed

projects/igniteui-angular/src/lib/core/styles/components/column-actions/_column-actions-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100

101101
%column-actions-input {
102102
font-size: rem(16px) !important;
103-
margin: rem(-16px) 0 0 !important;
103+
margin: 0 !important;
104104
padding: rem(8px) rem(16px);
105105
}
106106

projects/igniteui-angular/src/lib/core/styles/components/combo/_combo-theme.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@
263263
padding: 0;
264264
}
265265
}
266+
267+
&:not(.igx-input-group--disabled){
268+
%igx-combo__clear-button {
269+
color: var-get($theme, 'clear-button-foreground');
270+
background: var-get($theme, 'clear-button-background');
271+
}
272+
}
266273
}
267274

268275
%form-group-bundle:not(%form-group-bundle--disabled):focus-within {

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

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,23 @@
492492
}
493493
}
494494
}
495+
496+
&:not(%form-group-display--focused, %form-group-display--filled) {
497+
&:has(input:not(:placeholder-shown, [type='file'])) {
498+
%form-group-label {
499+
@include type-style('subtitle-1');
500+
transform: translateY(0);
501+
}
502+
}
503+
}
495504
}
496505
}
497506

498507
%form-group-placeholder {
499-
%form-group-label {
500-
transition: none !important;
508+
&:has(input:placeholder-shown, textarea:placeholder-shown) {
509+
%form-group-label {
510+
transition: none !important;
511+
}
501512
}
502513
}
503514

@@ -998,13 +1009,20 @@
9981009

9991010
%form-group-label--focused-border,
10001011
%form-group-label--filled-border,
1001-
%form-group-label--placeholder-border,
10021012
%form-group-label--file-border {
10031013
%igx-input-group__notch {
10041014
border-block-start-color: transparent !important;
10051015
}
10061016
}
10071017

1018+
%form-group-label--placeholder-border {
1019+
&:has(input:placeholder-shown, textarea:placeholder-shown) {
1020+
%igx-input-group__notch {
1021+
border-block-start-color: transparent !important;
1022+
}
1023+
}
1024+
}
1025+
10081026
%form-group-label--focused-border {
10091027
%form-group-bundle-start {
10101028
border-inline-start-width: rem(2px);
@@ -1099,6 +1117,26 @@
10991117
width: calc(100% - #{rem(2px)});
11001118
}
11011119
}
1120+
1121+
%textarea-group:not(%form-group-display--focused, %form-group-display--filled) {
1122+
&:has(textarea:not(:placeholder-shown)) {
1123+
%form-group-textarea-label:not(%textarea-group-label--focused) {
1124+
@include type-style('subtitle-1');
1125+
1126+
top: calc($input-top-padding - #{rem(3px)});
1127+
transform: translateY(0);
1128+
margin-bottom: auto;
1129+
}
1130+
}
1131+
}
1132+
1133+
%textarea-group:not(%form-group-display--focused, %form-group-display--filled) {
1134+
&:has(%form-group-display--border, textarea:not(:placeholder-shown)) {
1135+
%igx-input-group__notch {
1136+
border-block-start-width: rem(1px);
1137+
}
1138+
}
1139+
}
11021140
}
11031141

11041142
%form-group-textarea-group-bundle {

projects/igniteui-angular/src/lib/grids/grid/grid-filtering-advanced.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { QueryBuilderFunctions } from '../../query-builder/query-builder-functio
2727
import { By } from '@angular/platform-browser';
2828
import { IgxDateTimeEditorDirective } from '../../directives/date-time-editor/date-time-editor.directive';
2929
import { QueryBuilderSelectors } from '../../query-builder/query-builder.common';
30-
import { IgxHGridRemoteOnDemandComponent } from '../hierarchical-grid/hierarchical-grid.spec';
30+
import { IgxHGridRemoteOnDemandComponent, IgxHierarchicalGridMissingChildDataComponent } from '../hierarchical-grid/hierarchical-grid.spec';
3131
import { IGridResourceStrings } from '../../core/i18n/grid-resources';
3232

3333
describe('IgxGrid - Advanced Filtering #grid - ', () => {
@@ -1899,6 +1899,19 @@ describe('IgxGrid - Advanced Filtering #grid - ', () => {
18991899
expect(Array.from(operatorSelect.querySelectorAll('igx-select-item')).pop().textContent).toBe('My Not In');
19001900
}));
19011901
});
1902+
1903+
it('Should not throw an error when some child data is missing.', fakeAsync(() => {
1904+
const fixture = TestBed.createComponent(IgxHierarchicalGridMissingChildDataComponent);
1905+
const hierarchicalGrid = fixture.componentInstance.hGrid;
1906+
hierarchicalGrid.allowAdvancedFiltering = true;
1907+
fixture.detectChanges();
1908+
1909+
// Open Advanced Filtering dialog.
1910+
expect(() => {
1911+
hierarchicalGrid.openAdvancedFilteringDialog();
1912+
fixture.detectChanges();
1913+
}).not.toThrow();
1914+
}));
19021915
});
19031916

19041917

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,9 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
12561256
];
12571257

12581258
entities[0].childEntities = this.childLayoutList.reduce((acc, rowIsland) => {
1259-
return acc.concat(this.generateChildEntity(rowIsland, this.data[0][rowIsland.key][0]));
1259+
const childFirstRowData = this.data?.length > 0 && this.data[0][rowIsland.key]?.length > 0 ?
1260+
this.data[0][rowIsland.key][0] : null;
1261+
return acc.concat(this.generateChildEntity(rowIsland, childFirstRowData));
12601262
}
12611263
, []);
12621264
}
@@ -1289,7 +1291,9 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
12891291
if (!firstRowData) {
12901292
return null;
12911293
}
1292-
return acc.concat(this.generateChildEntity(childRowIsland, firstRowData[childRowIsland.key][0]));
1294+
const childFirstRowData = firstRowData.length > 0 && firstRowData[childRowIsland.key]?.length > 0 ?
1295+
firstRowData[childRowIsland.key][0] : null;
1296+
return acc.concat(this.generateChildEntity(childRowIsland, childFirstRowData));
12931297
}, []);
12941298

12951299
if (rowIslandChildEntities?.length > 0) {

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.spec.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2477,3 +2477,31 @@ export class IgxHierarchicalGridEmptyTemplateComponent extends IgxHierarchicalGr
24772477
this.childGridRef = grid;
24782478
}
24792479
}
2480+
2481+
@Component({
2482+
template: `
2483+
<igx-hierarchical-grid #hGrid [data]="data" [autoGenerate]="false"
2484+
[height]="'400px'" [width]="'500px'">
2485+
<igx-column field="root1" [dataType]="'number'"></igx-column>
2486+
<igx-column field="root2" [dataType]="'number'"></igx-column>
2487+
<igx-row-island [key]="'level1data'" [autoGenerate]="false">
2488+
<igx-column field="level1child1" [dataType]="'number'"></igx-column>
2489+
<igx-column field="level1child2" [dataType]="'number'"></igx-column>
2490+
<igx-row-island [key]="'level2data'" [autoGenerate]="false">
2491+
<igx-column field="level2child1" [dataType]="'number'"></igx-column>
2492+
<igx-column field="level2child2" [dataType]="'number'"></igx-column>
2493+
</igx-row-island>
2494+
</igx-row-island>
2495+
</igx-hierarchical-grid>`,
2496+
imports: [IgxHierarchicalGridComponent, IgxColumnComponent, IgxRowIslandComponent]
2497+
})
2498+
export class IgxHierarchicalGridMissingChildDataComponent {
2499+
@ViewChild('hGrid', { read: IgxHierarchicalGridComponent, static: true })
2500+
public hGrid: IgxHierarchicalGridComponent;
2501+
2502+
public data = [
2503+
{ root1: 1, root2: 1, level1data: [{ level1child1: 11, level1child2: 12 }] }, // missing level2data
2504+
{ root1: 2, root2: 2, level1data: [{ level1child1: 21, level1child2: 22, level2data: [{ level2child1: 31, level2child2: 32 }] }] },
2505+
{ root1: 3, root2: 3, level1data: [] }
2506+
];
2507+
}

0 commit comments

Comments
 (0)