Skip to content

Commit 51bc71a

Browse files
authored
Merge branch '19.2.x' into simeonoff/fix-15845-19.2.x
2 parents d3fa8d4 + 5247280 commit 51bc71a

File tree

17 files changed

+341
-43
lines changed

17 files changed

+341
-43
lines changed

projects/igniteui-angular-elements/src/analyzer/elements.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ import { IgxGridToolbarComponent } from "../../../igniteui-angular/src/lib/grids
1414
import { IgxToolbarToken } from "../../../igniteui-angular/src/lib/grids/toolbar/token";
1515
import { IgxColumnComponent } from "../../../igniteui-angular/src/lib/grids/columns/column.component";
1616
import { IgxColumnGroupComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-group.component";
17+
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
18+
import { IgxGridToolbarExporterComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-exporter.component";
19+
import { IgxGridToolbarHidingComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-hiding.component";
20+
import { IgxGridToolbarPinningComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-pinning.component";
1721
import { IgxRowIslandComponent } from "../../../igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component";
1822
import { IgxActionStripComponent } from "../../../igniteui-angular/src/lib/action-strip/action-strip.component";
1923
import { IgxActionStripToken } from "../../../igniteui-angular/src/lib/action-strip/token";
2024
import { IgxGridEditingActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component";
2125
import { IgxGridActionsBaseDirective } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive";
2226
import { IgxGridPinningActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component";
23-
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
24-
import { IgxGridToolbarExporterComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-exporter.component";
25-
import { IgxGridToolbarHidingComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-hiding.component";
26-
import { IgxGridToolbarPinningComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-pinning.component";
2727
import { IgxGridStateComponent } from "../lib/state.component";
2828

2929
export const registerComponents = [

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/directives/tooltip/tooltip.directive.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import { DOCUMENT } from '@angular/common';
12
import {
2-
Directive, ElementRef, Input, ChangeDetectorRef, Optional, HostBinding, Inject, OnDestroy
3+
Directive, ElementRef, Input, ChangeDetectorRef, Optional, HostBinding, Inject, OnDestroy, inject
34
} from '@angular/core';
45
import { IgxOverlayService } from '../../services/overlay/overlay';
56
import { OverlaySettings } from '../../services/public_api';
@@ -110,6 +111,7 @@ export class IgxTooltipDirective extends IgxToggleDirective implements OnDestroy
110111
public tooltipTarget: IgxTooltipTargetDirective;
111112

112113
private _destroy$ = new Subject<boolean>();
114+
private _document = inject(DOCUMENT);
113115

114116
/** @hidden */
115117
constructor(
@@ -122,18 +124,18 @@ export class IgxTooltipDirective extends IgxToggleDirective implements OnDestroy
122124

123125
this.onDocumentTouchStart = this.onDocumentTouchStart.bind(this);
124126
this.overlayService.opening.pipe(takeUntil(this._destroy$)).subscribe(() => {
125-
document.addEventListener('touchstart', this.onDocumentTouchStart, { passive: true });
127+
this._document.addEventListener('touchstart', this.onDocumentTouchStart, { passive: true });
126128
});
127129
this.overlayService.closed.pipe(takeUntil(this._destroy$)).subscribe(() => {
128-
document.removeEventListener('touchstart', this.onDocumentTouchStart);
130+
this._document.removeEventListener('touchstart', this.onDocumentTouchStart);
129131
});
130132
}
131133

132134
/** @hidden */
133135
public override ngOnDestroy() {
134136
super.ngOnDestroy();
135137

136-
document.removeEventListener('touchstart', this.onDocumentTouchStart);
138+
this._document.removeEventListener('touchstart', this.onDocumentTouchStart);
137139
this._destroy$.next(true);
138140
this._destroy$.complete();
139141
}

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-public-row.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { IgxSummaryResult } from './summaries/grid-summary';
66
import { ITreeGridRecord } from './tree-grid/tree-grid.interfaces';
77
import { mergeWith } from 'lodash-es';
88
import { CellType, GridServiceType, GridType, IGridValidationState, RowType, ValidationStatus } from './common/grid.interface';
9+
import { IgxPivotGridComponent } from './pivot-grid/public_api';
10+
import { PivotUtil } from './pivot-grid/pivot-util';
911

1012
abstract class BaseRow implements RowType {
1113
public index: number;
@@ -791,3 +793,71 @@ export class IgxSummaryRow implements RowType {
791793
return row;
792794
}
793795
}
796+
797+
export class IgxPivotGridRow implements RowType {
798+
799+
/** The index of the row within the grid */
800+
public index: number;
801+
802+
/**
803+
* The grid that contains the row.
804+
*/
805+
public grid: IgxPivotGridComponent;
806+
private _data?: any;
807+
808+
constructor(grid: IgxPivotGridComponent, index: number, data?: any) {
809+
this.grid = grid;
810+
this.index = index;
811+
this._data = data && data.addRow && data.recordRef ? data.recordRef : data;
812+
}
813+
814+
/**
815+
* The data passed to the row component.
816+
*/
817+
public get data(): any {
818+
return this._data ?? this.grid.dataView[this.index];
819+
}
820+
821+
/**
822+
* Returns the view index calculated per the grid page.
823+
*/
824+
public get viewIndex(): number {
825+
return this.index + this.grid.page * this.grid.perPage;
826+
}
827+
828+
/**
829+
* Gets the row key.
830+
* A row in the grid is identified either by:
831+
* - primaryKey data value,
832+
* - the whole rowData, if the primaryKey is omitted.
833+
*
834+
* ```typescript
835+
* let rowKey = row.key;
836+
* ```
837+
*/
838+
public get key(): any {
839+
const dimension = this.grid.visibleRowDimensions[this.grid.visibleRowDimensions.length - 1];
840+
const recordKey = PivotUtil.getRecordKey(this.data, dimension);
841+
return recordKey ? recordKey : null;
842+
}
843+
844+
/**
845+
* Gets whether the row is selected.
846+
* Default value is `false`.
847+
* ```typescript
848+
* row.selected = true;
849+
* ```
850+
*/
851+
public get selected(): boolean {
852+
return this.grid.selectionService.isRowSelected(this.key);
853+
}
854+
855+
public set selected(val: boolean) {
856+
if (val) {
857+
this.grid.selectionService.selectRowsWithNoEvent([this.key]);
858+
} else {
859+
this.grid.selectionService.deselectRowsWithNoEvent([this.key]);
860+
}
861+
this.grid.cdr.markForCheck();
862+
}
863+
}

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

0 commit comments

Comments
 (0)