Skip to content

Commit 5731ba6

Browse files
MKirovaMKirova
authored andcommitted
Merge branch 'mkirova/row-pinning-base' of https://github.com/IgniteUI/igniteui-angular.git
2 parents cd2d2b9 + 31e50ea commit 5731ba6

21 files changed

+1272
-1310
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ All notable changes for each version of this project will be documented in this
122122
</igx-grid>
123123
```
124124
- `IgxSlider`:
125+
- **Breaking Change** - `isContinuous` - input has been deleted. The option is not supported anymore.
125126
- `primaryTicks` input was added. Which sets the number of primary ticks
126127
- `secondaryTicks` input was added. Which sets the number of secondary ticks.
127128
- `showTicks` input was added. Which show/hide all slider ticks and tick labels.
@@ -130,7 +131,6 @@ All notable changes for each version of this project will be documented in this
130131
- `ticksOrientation` input was added. Allows to change ticks orientation to top|bottom|mirror.
131132
- `tickLabelsOrientation` input was added. Allows you to change the rotation of all tick labels from horizontal to vertical(toptobottom, bottomtotop).
132133
- `igxSliderTickLabel` directive has been introduced. Allows you to set a custom template for all tick labels.
133-
- `isContinuous` - input has been deleted. The option is not supported anymore.
134134
- `onValueChanged` - new output has been exposed. This event is emitted at the end of every slide interaction.
135135

136136
- `IgxCarousel`:

projects/igniteui-angular/src/lib/core/utils.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,14 @@ export const enum KEYCODES {
139139
RIGHT_ARROW = 39,
140140
DOWN_ARROW = 40,
141141
F2 = 113,
142-
TAB = 9
142+
TAB = 9,
143+
CTRL = 17,
144+
Z = 90,
145+
Y = 89,
146+
X = 88,
147+
BACKSPACE = 8,
148+
DELETE = 46,
149+
INPUT_METHOD = 229
143150
}
144151

145152
/**

projects/igniteui-angular/src/lib/date-picker/date-picker.component.spec.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component, ViewChild, ElementRef } from '@angular/core';
22
import { async, fakeAsync, TestBed, tick, flush, ComponentFixture } from '@angular/core/testing';
3-
import { FormsModule, FormGroup, FormBuilder, FormControl, ReactiveFormsModule} from '@angular/forms';
3+
import { FormsModule, FormGroup, FormBuilder, FormControl, ReactiveFormsModule } from '@angular/forms';
44
import { By } from '@angular/platform-browser';
55
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
66
import { IgxDatePickerComponent, IgxDatePickerModule } from './date-picker.component';
@@ -206,7 +206,7 @@ describe('IgxDatePicker', () => {
206206
expect(input).toEqual(document.activeElement);
207207
}));
208208

209-
it('When a modal datepicker is closed via outside click, the focus should remain on the input',
209+
it('When a modal datepicker is closed via outside click, the focus should remain on the input',
210210
fakeAsync(() => {
211211
const datePickerDom = fixture.debugElement.query(By.css('igx-date-picker'));
212212
let overlayToggle = document.getElementsByClassName('igx-overlay__wrapper--modal');
@@ -230,7 +230,7 @@ describe('IgxDatePicker', () => {
230230
expect(input).toEqual(document.activeElement);
231231
}));
232232

233-
it('When datepicker is closed upon selecting a date, the focus should remain on the input',
233+
it('When datepicker is closed upon selecting a date, the focus should remain on the input',
234234
fakeAsync(() => {
235235
const datePickerDom = fixture.debugElement.query(By.css('igx-date-picker'));
236236
let overlayToggle = document.getElementsByClassName('igx-overlay__wrapper--modal');
@@ -939,7 +939,6 @@ describe('IgxDatePicker', () => {
939939

940940
// initial input value is 20-10-11 / dd-MM-yy
941941
// focus the day part, position the caret at the beginning
942-
input.nativeElement.focus();
943942
input.nativeElement.setSelectionRange(0, 0);
944943

945944
// press arrow up
@@ -984,7 +983,6 @@ describe('IgxDatePicker', () => {
984983

985984
// initial input value is 20-10-11 / dd-MM-yy
986985
// focus the day part, position the caret at the beginning
987-
input.nativeElement.focus();
988986
input.nativeElement.setSelectionRange(0, 0);
989987

990988
// press arrow down
@@ -1036,7 +1034,6 @@ describe('IgxDatePicker', () => {
10361034

10371035
// initial input value is 20-10-11 / dd-MM-yy
10381036
// focus the day part, position the caret at the beginning
1039-
input.nativeElement.focus();
10401037
input.nativeElement.setSelectionRange(0, 0);
10411038

10421039
// up
@@ -1149,7 +1146,8 @@ describe('IgxDatePicker', () => {
11491146
expect(input).toBeDefined();
11501147
datePicker.isSpinLoop = false;
11511148

1152-
input.nativeElement.focus();
1149+
input.triggerEventHandler('focus', {});
1150+
fixture.detectChanges(); // bound transformedDate assign
11531151
UIInteractions.sendInput(input, '31-03-19');
11541152
expect(input.nativeElement.value).toBe('31-03-19');
11551153

projects/igniteui-angular/src/lib/date-picker/date-picker.pipes.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,18 @@ export class DatePickerDisplayValuePipe implements PipeTransform {
3131
export class DatePickerInputValuePipe implements PipeTransform {
3232
constructor(@Inject(IGX_DATE_PICKER_COMPONENT) private _datePicker: IDatePicker) { }
3333
transform(value: any, args?: any): any {
34+
/**
35+
* TODO(D.P.): This plugs into the mask, but constantly received display strings it can't handle at all
36+
* Those are almost immediately overridden by the pickers onFocus handling anyway; Refactor ASAP
37+
*/
3438
if (this._datePicker.invalidDate !== '') {
3539
return this._datePicker.invalidDate;
3640
} else {
3741
if (this._datePicker.value === null || this._datePicker.value === undefined) {
3842
return DatePickerUtil.maskToPromptChars(this._datePicker.inputMask);
3943
} else {
40-
return DatePickerUtil.addPromptCharsEditMode(this._datePicker.dateFormatParts, this._datePicker.value, value);
44+
return (this._datePicker as any)._getEditorDate(this._datePicker.value);
45+
// return DatePickerUtil.addPromptCharsEditMode(this._datePicker.dateFormatParts, this._datePicker.value, value);
4146
}
4247
}
4348
}

projects/igniteui-angular/src/lib/directives/autocomplete/autocomplete.directive.spec.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,13 @@ describe('IgxAutocomplete', () => {
682682
expect(dropDownAny.scrollContainer.getBoundingClientRect().width)
683683
.toEqual(group.element.nativeElement.getBoundingClientRect().width);
684684
});
685+
it('Should apply width to dropdown list if set', () => {
686+
UIInteractions.sendInput(input, 's', fixture);
687+
fixture.componentInstance.ddWidth = '600px';
688+
fixture.detectChanges();
689+
const dropDownAny = dropDown as any;
690+
expect(dropDownAny.scrollContainer.getBoundingClientRect().width).toEqual(600);
691+
});
685692
it('Should render aria attributes properly', fakeAsync(() => {
686693
expect(input.nativeElement.attributes['autocomplete'].value).toEqual('off');
687694
expect(input.nativeElement.attributes['role'].value).toEqual('combobox');
@@ -853,7 +860,7 @@ describe('IgxAutocomplete', () => {
853860
<label igxLabel for="towns">Towns</label>
854861
<igx-suffix igxRipple><igx-icon fontSet="material">clear</igx-icon> </igx-suffix>
855862
</igx-input-group>
856-
<igx-drop-down #townsPanel>
863+
<igx-drop-down #townsPanel [width]="ddWidth">
857864
<igx-drop-down-item *ngFor="let town of towns | startsWith:townSelected" [value]="town">
858865
{{town}}
859866
</igx-drop-down-item>
@@ -866,6 +873,7 @@ class AutocompleteComponent {
866873
@ViewChild(IgxDropDownComponent, { static: true }) public dropDown: IgxDropDownComponent;
867874
townSelected;
868875
public towns;
876+
public ddWidth = null;
869877
settings: AutocompleteOverlaySettings = null;
870878
onItemSelected(args) { }
871879

projects/igniteui-angular/src/lib/directives/autocomplete/autocomplete.directive.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,8 @@ export class IgxAutocompleteDirective extends IgxDropDownItemNavigationDirective
277277
if (this.disabled || !this.collapsed) {
278278
return;
279279
}
280-
this.target.width = this.parentElement.clientWidth + 'px';
280+
// if no drop-down width is set, the drop-down will be as wide as the autocomplete input;
281+
this.target.width = this.target.width || (this.parentElement.clientWidth + 'px');
281282
this.target.open(this.settings);
282283
this.target.onSelection.pipe(takeUntil(this.dropDownOpened$)).subscribe(this.select);
283284
this.target.onOpened.pipe(first()).subscribe(this.highlightFirstItem);

0 commit comments

Comments
 (0)