Skip to content

Commit bcf2777

Browse files
authored
Merge branch '19.2.x' into ttonev/fix-14970-master
2 parents 1ae9b03 + 1b2f329 commit bcf2777

File tree

12 files changed

+226
-33
lines changed

12 files changed

+226
-33
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import {
2121
Output,
2222
QueryList,
2323
TemplateRef,
24-
ViewChild
24+
ViewChild,
25+
ViewChildren
2526
} from '@angular/core';
2627
import { AbstractControl, ControlValueAccessor, NgControl } from '@angular/forms';
2728
import { caseSensitive } from '@igniteui/material-icons-extended';
@@ -748,6 +749,9 @@ export abstract class IgxComboBaseDirective implements IgxComboBase, AfterViewCh
748749
@ContentChildren(IgxSuffixDirective, { descendants: true })
749750
protected suffixes: QueryList<IgxSuffixDirective>;
750751

752+
@ViewChildren(IgxSuffixDirective)
753+
protected internalSuffixes: QueryList<IgxSuffixDirective>;
754+
751755
/** @hidden @internal */
752756
public get searchValue(): string {
753757
return this._searchValue;
@@ -984,8 +988,15 @@ export abstract class IgxComboBaseDirective implements IgxComboBase, AfterViewCh
984988
this.inputGroup.prefixes = this.prefixes;
985989
}
986990

987-
if (this.inputGroup && this.suffixes?.length > 0) {
988-
this.inputGroup.suffixes = this.suffixes;
991+
if (this.inputGroup) {
992+
const suffixesArray = this.suffixes?.toArray() ?? [];
993+
const internalSuffixesArray = this.internalSuffixes?.toArray() ?? [];
994+
const mergedSuffixes = new QueryList<IgxSuffixDirective>();
995+
mergedSuffixes.reset([
996+
...suffixesArray,
997+
...internalSuffixesArray
998+
]);
999+
this.inputGroup.suffixes = mergedSuffixes;
9891000
}
9901001
}
9911002

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-component.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,36 @@
10001000
}
10011001
}
10021002

1003+
@include mx(bootstrap, warning) {
1004+
@include e(input) {
1005+
@extend %bootstrap-input--warning !optional;
1006+
1007+
&:hover {
1008+
@extend %bootstrap-input--warning !optional;
1009+
}
1010+
}
1011+
1012+
@include e(file-input) {
1013+
@extend %bootstrap-input--warning !optional;
1014+
1015+
&:hover {
1016+
@extend %bootstrap-input--warning !optional;
1017+
}
1018+
}
1019+
1020+
@include e(label) {
1021+
@extend %bootstrap-label !optional;
1022+
}
1023+
1024+
@include e(textarea) {
1025+
@extend %bootstrap-input--warning !optional;
1026+
1027+
&:hover {
1028+
@extend %bootstrap-input--warning !optional;
1029+
}
1030+
}
1031+
}
1032+
10031033
@include mx(bootstrap, textarea-group) {
10041034
@include e(bundle) {
10051035
@extend %form-group-bundle-bootstrap--textarea !optional;

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

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,23 @@
496496
}
497497
}
498498
}
499+
500+
&:not(%form-group-display--focused, %form-group-display--filled) {
501+
&:has(input:not(:placeholder-shown, [type='file'])) {
502+
%form-group-label {
503+
@include type-style('subtitle-1');
504+
transform: translateY(0);
505+
}
506+
}
507+
}
499508
}
500509
}
501510

502511
%form-group-placeholder {
503-
%form-group-label {
504-
transition: none !important;
512+
&:has(input:placeholder-shown, textarea:placeholder-shown) {
513+
%form-group-label {
514+
transition: none !important;
515+
}
505516
}
506517
}
507518

@@ -1004,13 +1015,20 @@
10041015

10051016
%form-group-label--focused-border,
10061017
%form-group-label--filled-border,
1007-
%form-group-label--placeholder-border,
10081018
%form-group-label--file-border {
10091019
%igx-input-group__notch {
10101020
border-block-start-color: transparent !important;
10111021
}
10121022
}
10131023

1024+
%form-group-label--placeholder-border {
1025+
&:has(input:placeholder-shown, textarea:placeholder-shown) {
1026+
%igx-input-group__notch {
1027+
border-block-start-color: transparent !important;
1028+
}
1029+
}
1030+
}
1031+
10141032
%form-group-label--focused-border {
10151033
%form-group-bundle-start {
10161034
border-inline-start-width: rem(2px);
@@ -1098,6 +1116,26 @@
10981116
width: calc(100% - #{rem(2px)});
10991117
}
11001118
}
1119+
1120+
%textarea-group:not(%form-group-display--focused, %form-group-display--filled) {
1121+
&:has(textarea:not(:placeholder-shown)) {
1122+
%form-group-textarea-label:not(%textarea-group-label--focused) {
1123+
@include type-style('subtitle-1');
1124+
1125+
top: calc($input-top-padding - #{rem(3px)});
1126+
transform: translateY(0);
1127+
margin-bottom: auto;
1128+
}
1129+
}
1130+
}
1131+
1132+
%textarea-group:not(%form-group-display--focused, %form-group-display--filled) {
1133+
&:has(%form-group-display--border, textarea:not(:placeholder-shown)) {
1134+
%igx-input-group__notch {
1135+
border-block-start-width: rem(1px);
1136+
}
1137+
}
1138+
}
11011139
}
11021140

11031141
%form-group-textarea-group-bundle {
@@ -2172,12 +2210,38 @@
21722210

21732211
%bootstrap-input--success {
21742212
border: rem(1px) solid var-get($theme, 'success-secondary-color');
2175-
box-shadow: 0 0 0 rem(4px) var-get($theme, 'success-shadow-color');
2213+
2214+
&:focus {
2215+
box-shadow: 0 0 0 rem(4px) var-get($theme, 'success-shadow-color');
2216+
2217+
+ %bootstrap-file-input {
2218+
box-shadow: 0 0 0 rem(4px) var-get($theme, 'success-shadow-color');
2219+
}
2220+
}
21762221
}
21772222

21782223
%bootstrap-input--error {
21792224
border: rem(1px) solid var-get($theme, 'error-secondary-color');
2180-
box-shadow: 0 0 0 rem(4px) var-get($theme, 'error-shadow-color');
2225+
2226+
&:focus {
2227+
box-shadow: 0 0 0 rem(4px) var-get($theme, 'error-shadow-color');
2228+
2229+
+ %bootstrap-file-input {
2230+
box-shadow: 0 0 0 rem(4px) var-get($theme, 'error-shadow-color');
2231+
}
2232+
}
2233+
}
2234+
2235+
%bootstrap-input--warning {
2236+
border: rem(1px) solid var-get($theme, 'warning-secondary-color');
2237+
2238+
&:focus {
2239+
box-shadow: 0 0 0 rem(4px) color($color: 'warn', $variant: 500, $opacity: 0.38);
2240+
2241+
+ %bootstrap-file-input {
2242+
box-shadow: 0 0 0 rem(4px) color($color: 'warn', $variant: 500, $opacity: 0.38);
2243+
}
2244+
}
21812245
}
21822246

21832247
%bootstrap-input--disabled {

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-search.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,10 @@ export class IgxExcelStyleSearchComponent implements AfterViewInit, OnDestroy {
254254
}
255255

256256
public ngAfterViewInit() {
257-
requestAnimationFrame(this.refreshSize);
257+
if (this.platform.isBrowser) {
258+
// SSR workaround
259+
requestAnimationFrame(this.refreshSize);
260+
}
258261
}
259262

260263
public ngOnDestroy(): void {

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+
}

projects/igniteui-angular/src/lib/input-group/input-group.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ export class IgxInputGroupComponent implements IgxInputGroupBase {
284284
}
285285

286286
/** @hidden @internal */
287-
public set suffixes(items: QueryList<IgxPrefixDirective>) {
287+
public set suffixes(items: QueryList<IgxSuffixDirective>) {
288288
this._suffixes = items;
289289
}
290290

0 commit comments

Comments
 (0)