Skip to content

Commit 8b47d69

Browse files
authored
Merge branch '9.1.x' into ibarakov/fix-5280-9.1.x
2 parents 9a6a40c + fece0c2 commit 8b47d69

37 files changed

+413
-277
lines changed

.hooks/scripts/templates/default.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var defaults = {
1111
otherLine: 80,
1212
},
1313
issuePattern: '(#)[0-9]+',
14-
typesWithMandatoryIssue: [ 'feat', 'fix', 'test' ],
14+
typesWithMandatoryIssue: [],
1515
guidelinesUrl: 'https://bit.ly/angular-guidelines',
1616
types: [
1717
'feat', 'fix', 'docs', 'style', 'refactor', 'perf', 'test', 'chore', 'build', 'ci', 'revert'
@@ -20,4 +20,4 @@ var defaults = {
2020
oldMessagePath: path.join('.git', 'COMMIT_EDITMSG_OLD')
2121
}
2222

23-
module.exports = defaults;
23+
module.exports = defaults;

.hooks/scripts/utils/issue-validator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ var matchType = require('../common').matchType,
66
module.exports = (lines, options, errors) => {
77
var ticket = new RegExp(options.issuePattern);
88
var whetherIssueIsMandatory = false,
9-
wheterMatchAnyIssueRef = false;
9+
wheterMatchAnyIssueRef = false;
10+
1011

11-
1212
if (matchType(options.typesWithMandatoryIssue, lines[0])) {
1313
whetherIssueIsMandatory = true;
1414
}
@@ -27,7 +27,7 @@ module.exports = (lines, options, errors) => {
2727

2828
if (whetherIssueIsMandatory && !wheterMatchAnyIssueRef) {
2929
errors.push(errorFactory(
30-
`The issue reference for (${options.typesWithMandatoryIssue.join(', ')}) types is mandatory!\n`,
30+
`The issue reference for (${options.typesWithMandatoryIssue.join(', ')}) types is mandatory!\n`,
3131
"Please add at least one related issue. E.g: Closes #31, Closes #45"));
3232
}
33-
}
33+
}

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ All notable changes for each version of this project will be documented in this
1313
### General
1414
- `IgxHierarchicalGrid`
1515
- `onGridInitialized` - New output has been exposed. Emitted after a grid is being initialized for the corresponding row island.
16-
16+
- **Behavioral Change** - When moving a column `DropPosition.None` is now acting like `DropPosition.AfterDropTarget`.
1717
## 9.1.0
1818

1919
### General

projects/igniteui-angular/src/lib/core/styles/components/grid/_excel-filtering-theme.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@
108108

109109
%grid-excel-sort {
110110
display: block;
111-
padding: rem(8px) rem(16px);
111+
padding-top: rem(8px);
112+
padding-bottom: rem(8px);
112113

113114
header {
114115
color: igx-color($palette, 'grays', 700);
@@ -245,7 +246,8 @@
245246
}
246247

247248
%grid-excel-sort {
248-
padding: rem(8px);
249+
padding-top: rem(8px);
250+
padding-bottom: rem(8px);
249251
}
250252

251253
%grid-excel-actions {
@@ -277,7 +279,8 @@
277279
}
278280

279281
%grid-excel-sort {
280-
padding: rem(4px);
282+
padding-top: rem(4px);
283+
padding-bottom: rem(4px);
281284

282285
@extend %grid-excel-action--compact;
283286

@@ -384,7 +387,7 @@
384387
align-items: center;
385388
padding: 0 rem(16px);
386389

387-
igx-input-group {
390+
igx-select {
388391
flex-grow: 1;
389392
flex-basis: 40%;
390393
margin: rem(16px) 0;

projects/igniteui-angular/src/lib/date-picker/date-picker.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
<input
2525
class="igx-date-picker__input-date"
2626
igxInput
27-
[igxTextSelection]="true"
2827
type="text"
2928
[value]="transformedDate"
3029
[igxMask]="inputMask"
3130
[placeholder]="mask"
31+
[igxTextSelection]="true"
3232
[disabled]="disabled"
3333
[displayValuePipe]="displayValuePipe"
3434
[focusedValuePipe]="inputValuePipe"

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,22 @@ describe('IgxDatePicker', () => {
132132
expect(inputGroup.nativeElement.classList.contains('igx-input-group--disabled')).toBeTruthy();
133133
});
134134

135+
it('should not be able to toggle & clear when disabled', () => {
136+
const date = new Date();
137+
datePicker.value = date;
138+
datePicker.disabled = true;
139+
fixture.detectChanges();
140+
expect(datePicker.collapsed).toBeTruthy();
141+
142+
datePicker.openDialog();
143+
fixture.detectChanges();
144+
expect(datePicker.collapsed).toBeTruthy();
145+
146+
datePicker.clear();
147+
fixture.detectChanges();
148+
expect(datePicker.value).toEqual(date);
149+
});
150+
135151
it('When labelVisability is set to false the label should not be visible', () => {
136152
let label = fixture.debugElement.query(By.directive(IgxLabelDirective));
137153

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

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import { IgxInputGroupModule, IgxInputDirective, IgxInputGroupComponent, IgxInpu
3434
import { Subject, fromEvent, animationFrameScheduler, interval, Subscription } from 'rxjs';
3535
import { filter, takeUntil, throttle } from 'rxjs/operators';
3636
import { IgxOverlayOutletDirective } from '../directives/toggle/toggle.directive';
37-
import { IgxTextSelectionModule} from '../directives/text-selection/text-selection.directive';
37+
import { IgxTextSelectionModule } from '../directives/text-selection/text-selection.directive';
3838
import {
3939
OverlaySettings,
4040
IgxOverlayService,
@@ -144,7 +144,7 @@ const noop = () => { };
144144
`]
145145
})
146146
export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor,
147-
EditorProvider, OnInit, AfterViewInit, OnDestroy, AfterViewChecked {
147+
EditorProvider, OnInit, AfterViewInit, OnDestroy, AfterViewChecked {
148148
/**
149149
* Gets/Sets the `IgxDatePickerComponent` label.
150150
* @remarks
@@ -914,10 +914,10 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
914914
* @param date passed date that has to be set to the calendar.
915915
*/
916916
public selectDate(date: Date): void {
917-
const oldValue = this.value;
917+
const oldValue = this.value;
918918
this.value = date;
919919

920-
this.emitValueChangeEvent(oldValue, this.value );
920+
this.emitValueChangeEvent(oldValue, this.value);
921921
this.onSelection.emit(date);
922922
}
923923

@@ -929,9 +929,9 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
929929
* ```
930930
*/
931931
public deselectDate(): void {
932-
const oldValue = this.value;
932+
const oldValue = this.value;
933933
this.value = null;
934-
this.emitValueChangeEvent(oldValue, this.value );
934+
this.emitValueChangeEvent(oldValue, this.value);
935935
if (this.calendar) {
936936
this.calendar.deselectDate();
937937
}
@@ -946,7 +946,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
946946
* ```
947947
*/
948948
public openDialog(): void {
949-
if (!this.collapsed) {
949+
if (!this.collapsed || this.disabled) {
950950
return;
951951
}
952952

@@ -987,10 +987,12 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
987987
* @hidden @internal
988988
*/
989989
public clear(): void {
990-
this.isEmpty = true;
991-
this.invalidDate = '';
992-
this.deselectDate();
993-
this._setCursorPosition(0);
990+
if (!this.disabled) {
991+
this.isEmpty = true;
992+
this.invalidDate = '';
993+
this.deselectDate();
994+
this._setCursorPosition(0);
995+
}
994996
}
995997

996998
/**
@@ -1008,10 +1010,10 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
10081010
date.setSeconds(this.value.getSeconds());
10091011
date.setMilliseconds(this.value.getMilliseconds());
10101012
}
1011-
const oldValue = this.value;
1013+
const oldValue = this.value;
10121014
this.value = date;
10131015

1014-
this.emitValueChangeEvent(oldValue, this.value );
1016+
this.emitValueChangeEvent(oldValue, this.value);
10151017
this.calendar.viewDate = date;
10161018
this.closeCalendar();
10171019
this.onSelection.emit(date);
@@ -1141,11 +1143,11 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
11411143

11421144
if (this.disabledDates === null
11431145
|| (this.disabledDates !== null && !isDateInRanges(newValue, this.disabledDates))) {
1144-
const oldValue = this.value;
1145-
this.value = newValue;
1146+
const oldValue = this.value;
1147+
this.value = newValue;
11461148

1147-
this.emitValueChangeEvent(oldValue, this.value );
1148-
this.invalidDate = '';
1149+
this.emitValueChangeEvent(oldValue, this.value);
1150+
this.invalidDate = '';
11491151
} else {
11501152
const args: IDatePickerDisabledDateEventArgs = {
11511153
datePicker: this,

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,34 @@ describe('IgxDateRangePicker', () => {
586586
fixture.detectChanges();
587587
verifyDateRange();
588588
});
589+
590+
it('should select a range from the calendar only when the two inputs are filled in', fakeAsync(() => {
591+
fixture.componentInstance.mode = InteractionMode.DropDown;
592+
fixture.detectChanges();
593+
594+
startInput.triggerEventHandler('focus', {});
595+
fixture.detectChanges();
596+
UIInteractions.simulateTyping('11/10/2015', startInput);
597+
598+
fixture.componentInstance.dateRange.open();
599+
tick();
600+
fixture.detectChanges();
601+
expect(fixture.componentInstance.dateRange.calendar.selectedDates.length).toBe(0);
602+
603+
UIInteractions.triggerEventHandlerKeyDown('Escape', calendar);
604+
tick();
605+
fixture.detectChanges();
606+
607+
endInput.triggerEventHandler('focus', {});
608+
fixture.detectChanges();
609+
UIInteractions.simulateTyping('11/16/2015', endInput);
610+
fixture.detectChanges();
611+
612+
fixture.componentInstance.dateRange.open();
613+
tick();
614+
fixture.detectChanges();
615+
expect(fixture.componentInstance.dateRange.calendar.selectedDates.length).toBe(7);
616+
}));
589617
});
590618

591619
describe('Keyboard navigation', () => {

0 commit comments

Comments
 (0)