Skip to content

Commit e3c4b39

Browse files
authored
Merge branch 'master' into puppeteer
2 parents 8222819 + dc62940 commit e3c4b39

File tree

71 files changed

+4687
-2652
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+4687
-2652
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes for each version of this project will be documented in this file.
44

5+
## 15.1.1
6+
- **Breaking Changes** - ` $label-floated-background` and `$label-floated-disabled-background` properties of `IgxInputGroupComponent` theme has been removed.
7+
- `IgxInputGroupComponent` The input group has been refactored so that the floating label for the input of `type="border"` does not require a background to match the surface background under the input field. Also, suffixes and prefixes are refactored to take the full height of the input which makes it easy to add background to them.
8+
-
9+
- **Breaking Changes** - `$size` property of `scrollbar-theme` theme has been renamed to `$scrollbar-size`.
10+
511
## 15.1.0
612

713
### New Features
@@ -24,14 +30,16 @@ All notable changes for each version of this project will be documented in this
2430
- **Behavioral Change** - When selected row is deleted from the grid component `rowSelectionChanging` event will no longer be emitted.
2531
- `IgxCarousel`
2632
- **Breaking Change** The `onSlideChanged`, `onSlideAdded`, `onSlideRemoved`, `onCarouselPaused` and `onCarouselPlaying` outputs have been renamed to `slideChanged`, `slideAdded`, `slideRemoved`, `carouselPaused` and `carouselPlaying` to not violate the no on-prefixed outputs convention. Automatic migrations are available and will be applied on `ng update`.
27-
- `IgxRadio`, `IgxRadioGroup`
33+
- `IgxRadio`, `IgxRadioGroup`, `IgxCheckbox`, `IgxSwitch`
2834
- Added component validation along with styles for invalid state
2935
- `igxMask` directive
3036
- Added the capability to escape mask pattern literals.
3137
- `IgxBadge`
3238
- Added `shape` property that controls the shape of the badge and can be either `square` or `rounded`. The default shape of the badge is rounded.
3339
- `IgxAvatar`
3440
- **Breaking Change** The `roundShape` property has been deprecated and will be removed in a future version. Users can control the shape of the avatar by the newly added `shape` attribute that can be `square`, `rounded` or `circle`. The default shape of the avatar is `square`.
41+
- `IgxOverlayService`
42+
- `attach` method overload accepting `ComponentFactoryResolver` (trough `NgModuleRef`-like object) is now deprecated in line with API deprecated in Angular 13. New overload is added accepting `ViewComponentRef` that should be used instead.
3543

3644

3745
## 15.0.1
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"$schema": "../../common/schema/theme-changes.schema.json",
3+
"changes": [
4+
{
5+
"name": "$size",
6+
"replaceWith": "$scrollbar-size",
7+
"owner": "scrollbar-theme",
8+
"type":"property"
9+
},
10+
{
11+
"name": "$label-floated-background",
12+
"remove": true,
13+
"owner": "input-group-theme",
14+
"type":"property"
15+
},
16+
{
17+
"name": "$label-floated-disabled-background",
18+
"remove": true,
19+
"owner": "input-group-theme",
20+
"type":"property"
21+
}
22+
]
23+
}

projects/igniteui-angular/migrations/update-15_1_0/index.spec.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,34 @@ describe(`Update to ${version}`, () => {
138138
`
139139
);
140140
});
141+
142+
it('should rename the $size property to the $scrollbar-size', async () => {
143+
appTree.create(
144+
`/testSrc/appPrefix/component/test.component.scss`,
145+
`$custom-scrollbar: scrollbar-theme($size: 10px);`
146+
);
147+
148+
const tree = await schematicRunner
149+
.runSchematicAsync(migrationName, {}, appTree)
150+
.toPromise();
151+
152+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.scss')).toEqual(
153+
`$custom-scrollbar: scrollbar-theme($scrollbar-size: 10px);`
154+
);
155+
});
156+
157+
it('should remove the $label-floated-background amd $label-floated-disabled-background properties from the input-group-theme', async () => {
158+
appTree.create(
159+
`/testSrc/appPrefix/component/test.component.scss`,
160+
`$custom-input: input-group-theme($label-floated-background: transparent, $label-floated-disabled-background: transparent);`
161+
);
162+
163+
const tree = await schematicRunner
164+
.runSchematicAsync(migrationName, {}, appTree)
165+
.toPromise();
166+
167+
expect(tree.readContent('/testSrc/appPrefix/component/test.component.scss')).toEqual(
168+
`$custom-input: input-group-theme();`
169+
);
170+
});
141171
});

projects/igniteui-angular/src/lib/calendar/calendar-multi-view.component.spec.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,9 @@ describe('Multi-View Calendar - ', () => {
13171317
overlay = document.querySelector(HelperTestFunctions.OVERLAY_CSSCLASS);
13181318
HelperTestFunctions.verifyMonthsViewNumber(overlay, 2);
13191319
HelperTestFunctions.verifyCalendarSubHeaders(overlay, [new Date('2019-09-16'), new Date('2019-10-16')]);
1320+
1321+
// clean up test
1322+
tick(350);
13201323
}));
13211324

13221325
it('Verify setting hideOutsideDays and monthsViewNumber from datepicker', fakeAsync(() => {
@@ -1349,8 +1352,10 @@ describe('Multi-View Calendar - ', () => {
13491352
expect(HelperTestFunctions.getHiddenDays(overlay, 0).length).toBe(0);
13501353
expect(HelperTestFunctions.getHiddenDays(overlay, 1).length).toBe(0);
13511354
expect(HelperTestFunctions.getHiddenDays(overlay, 2).length).toBe(0);
1352-
}));
13531355

1356+
// clean up test
1357+
tick(350);
1358+
}));
13541359
});
13551360
});
13561361

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

Lines changed: 64 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import {
2+
AfterContentChecked,
3+
AfterViewChecked,
24
AfterViewInit,
35
ChangeDetectorRef,
46
ContentChild,
7+
ContentChildren,
58
Directive,
69
DoCheck,
710
ElementRef,
@@ -16,6 +19,7 @@ import {
1619
OnInit,
1720
Optional,
1821
Output,
22+
QueryList,
1923
TemplateRef,
2024
ViewChild
2125
} from '@angular/core';
@@ -30,7 +34,7 @@ import { SortingDirection } from '../data-operations/sorting-strategy';
3034
import { IForOfState, IgxForOfDirective } from '../directives/for-of/for_of.directive';
3135
import { IgxIconService } from '../icon/public_api';
3236
import { IgxInputGroupType, IGX_INPUT_GROUP_TYPE } from '../input-group/inputGroupType';
33-
import { IgxInputDirective, IgxInputGroupComponent, IgxInputState, IgxLabelDirective } from '../input-group/public_api';
37+
import { IgxInputDirective, IgxInputGroupComponent, IgxInputState, IgxLabelDirective, IgxPrefixDirective, IgxSuffixDirective } from '../input-group/public_api';
3438
import { AbsoluteScrollStrategy, AutoPositionStrategy, OverlaySettings } from '../services/public_api';
3539
import { IgxComboDropDownComponent } from './combo-dropdown.component';
3640
import { IgxComboAPIService } from './combo.api';
@@ -124,8 +128,8 @@ export interface IComboFilteringOptions {
124128
}
125129

126130
@Directive()
127-
export abstract class IgxComboBaseDirective extends DisplayDensityBase implements IgxComboBase, OnInit, DoCheck,
128-
AfterViewInit, OnDestroy, ControlValueAccessor {
131+
export abstract class IgxComboBaseDirective extends DisplayDensityBase implements IgxComboBase, AfterViewChecked, OnInit, DoCheck,
132+
AfterViewInit, AfterContentChecked, OnDestroy, ControlValueAccessor {
129133
/**
130134
* Defines whether the caseSensitive icon should be shown in the search input
131135
*
@@ -752,6 +756,12 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
752756
@ViewChild('complex', { read: TemplateRef, static: true })
753757
protected complexTemplate: TemplateRef<any>;
754758

759+
@ContentChildren(IgxPrefixDirective, { descendants: true })
760+
protected prefixes: QueryList<IgxPrefixDirective>;
761+
762+
@ContentChildren(IgxSuffixDirective, { descendants: true })
763+
protected suffixes: QueryList<IgxSuffixDirective>;
764+
755765
/** @hidden @internal */
756766
public get searchValue(): string {
757767
return this._searchValue;
@@ -950,24 +960,39 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
950960
super(_displayDensityOptions);
951961
}
952962

953-
/** @hidden @internal */
954-
public ngOnInit() {
955-
this.ngControl = this._injector.get<NgControl>(NgControl, null);
956-
const targetElement = this.elementRef.nativeElement;
963+
public ngAfterViewChecked() {
964+
const targetElement = this.inputGroup.element.nativeElement.querySelector('.igx-input-group__bundle') as HTMLElement;
965+
957966
this._overlaySettings = {
958967
target: targetElement,
959968
scrollStrategy: new AbsoluteScrollStrategy(),
960969
positionStrategy: new AutoPositionStrategy(),
961970
modal: false,
962971
closeOnOutsideClick: true,
963-
excludeFromOutsideClick: [targetElement as HTMLElement]
972+
excludeFromOutsideClick: [targetElement]
964973
};
974+
}
975+
976+
/** @hidden @internal */
977+
public ngAfterContentChecked(): void {
978+
if (this.inputGroup && this.prefixes?.length > 0) {
979+
this.inputGroup.prefixes = this.prefixes;
980+
}
981+
982+
if (this.inputGroup && this.suffixes?.length > 0) {
983+
this.inputGroup.suffixes = this.suffixes;
984+
}
985+
}
986+
987+
/** @hidden @internal */
988+
public ngOnInit() {
989+
this.ngControl = this._injector.get<NgControl>(NgControl, null);
965990
this.selectionService.set(this.id, new Set());
966991
this._iconService.addSvgIconFromText(caseSensitive.name, caseSensitive.value, 'imx-icons');
967992
}
968993

969994
/** @hidden @internal */
970-
public ngAfterViewInit() {
995+
public ngAfterViewInit(): void {
971996
this.filteredData = [...this.data];
972997

973998
if (this.ngControl) {
@@ -982,14 +1007,14 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
9821007
}
9831008

9841009
/** @hidden @internal */
985-
public ngDoCheck() {
1010+
public ngDoCheck(): void {
9861011
if (this.data?.length && this.selection.length && !this._value) {
9871012
this._value = this.createDisplayText(this.selection, []);
9881013
}
9891014
}
9901015

9911016
/** @hidden @internal */
992-
public ngOnDestroy() {
1017+
public ngOnDestroy(): void {
9931018
this.destroy$.next();
9941019
this.destroy$.complete();
9951020
this.comboAPI.clear();
@@ -1005,6 +1030,10 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
10051030
* ```
10061031
*/
10071032
public toggle(): void {
1033+
if (this.collapsed && this._value.length !== 0) {
1034+
this.filterValue = '';
1035+
this.cdr.detectChanges();
1036+
}
10081037
const overlaySettings = Object.assign({}, this._overlaySettings, this.overlaySettings);
10091038
this.dropdown.toggle(overlaySettings);
10101039
if (!this.collapsed){
@@ -1021,6 +1050,10 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
10211050
* ```
10221051
*/
10231052
public open(): void {
1053+
if (this.collapsed && this._value.length !== 0) {
1054+
this.filterValue = '';
1055+
this.cdr.detectChanges();
1056+
}
10241057
const overlaySettings = Object.assign({}, this._overlaySettings, this.overlaySettings);
10251058
this.dropdown.open(overlaySettings);
10261059
this.setActiveDescendant();
@@ -1068,6 +1101,26 @@ export abstract class IgxComboBaseDirective extends DisplayDensityBase implement
10681101
return this.selectionService.is_item_selected(this.id, item);
10691102
}
10701103

1104+
/** @hidden @internal */
1105+
public get toggleIcon(): string {
1106+
if (this.inputGroup.theme === 'material') {
1107+
return this.dropdown.collapsed
1108+
? 'expand_more'
1109+
: 'expand_less';
1110+
}
1111+
1112+
return this.dropdown.collapsed
1113+
? 'arrow_drop_down'
1114+
: 'arrow_drop_up';
1115+
}
1116+
1117+
/** @hidden @internal */
1118+
public get clearIcon(): string {
1119+
return this.inputGroup.theme === 'material'
1120+
? 'cancel'
1121+
: 'clear';
1122+
}
1123+
10711124
/** @hidden @internal */
10721125
public addItemToCollection() {
10731126
if (!this.searchValue) {

projects/igniteui-angular/src/lib/combo/combo.component.html

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,35 @@
2323
<ng-container *ngTemplateOutlet="clearIconTemplate"></ng-container>
2424
</ng-container>
2525
<igx-icon *ngIf="!clearIconTemplate">
26-
clear
26+
{{ clearIcon }}
2727
</igx-icon>
2828
</igx-suffix>
2929
<igx-suffix class="igx-combo__toggle-button">
3030
<ng-container *ngIf="toggleIconTemplate">
3131
<ng-container *ngTemplateOutlet="toggleIconTemplate; context: {$implicit: this.collapsed}"></ng-container>
3232
</ng-container>
3333
<igx-icon *ngIf="!toggleIconTemplate">
34-
{{ dropdown.collapsed ? 'arrow_drop_down' : 'arrow_drop_up'}}
34+
{{ toggleIcon }}
3535
</igx-icon>
3636
</igx-suffix>
3737
</igx-input-group>
3838
<igx-combo-drop-down #igxComboDropDown class="igx-combo__drop-down" [displayDensity]="displayDensity"
3939
[labelledBy]="this.ariaLabelledBy || this.label?.id || this.placeholder || ''"
4040
[width]="itemsWidth || '100%'" (opening)="handleOpening($event)" (closing)="handleClosing($event)"
4141
(opened)="handleOpened()" (closed)="handleClosed()">
42-
<igx-input-group *ngIf="displaySearchInput" [displayDensity]="displayDensity" theme="material" class="igx-combo__search">
43-
<input class="igx-combo-input" igxInput #searchInput name="searchInput" autocomplete="off" type="text"
44-
[(ngModel)]="searchValue" (ngModelChange)="handleInputChange($event)" (keyup)="handleKeyUp($event)"
45-
(keydown)="handleKeyDown($event)" (focus)="dropdown.onBlur($event)" [attr.placeholder]="searchPlaceholder"
46-
aria-autocomplete="list" role="searchbox" aria-label="search"/>
47-
<igx-suffix *ngIf="showSearchCaseIcon">
48-
<igx-icon family="imx-icons" name="case-sensitive" [active]="filteringOptions.caseSensitive"
49-
(click)="toggleCaseSensitive()">
50-
</igx-icon>
51-
</igx-suffix>
52-
</igx-input-group>
42+
<div class="igx-combo__search">
43+
<igx-input-group *ngIf="displaySearchInput" [displayDensity]="displayDensity" theme="material" >
44+
<input igxInput #searchInput name="searchInput" autocomplete="off" type="text"
45+
[(ngModel)]="searchValue" (ngModelChange)="handleInputChange($event)" (keyup)="handleKeyUp($event)"
46+
(keydown)="handleKeyDown($event)" (focus)="dropdown.onBlur($event)" [attr.placeholder]="searchPlaceholder"
47+
aria-autocomplete="list" role="searchbox" aria-label="search"/>
48+
<igx-suffix *ngIf="showSearchCaseIcon" (click)="toggleCaseSensitive()">
49+
<span [ngClass]="filteringOptions.caseSensitive? 'igx-combo__case-icon--active' : 'igx-combo__case-icon'">
50+
<igx-icon family="imx-icons" name="case-sensitive" [active]="filteringOptions.caseSensitive"></igx-icon>
51+
</span>
52+
</igx-suffix>
53+
</igx-input-group>
54+
</div>
5355
<ng-container *ngTemplateOutlet="headerTemplate">
5456
</ng-container>
5557
<div #dropdownItemContainer class="igx-combo__content" [style.overflow]="'hidden'"

0 commit comments

Comments
 (0)