Skip to content

Commit 2a0c2a1

Browse files
authored
Merge branch 'master' into angular-11
2 parents aef384d + 074d9ea commit 2a0c2a1

34 files changed

+1419
-209
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Ignite UI for Angular Change Log
22

33
All notable changes for each version of this project will be documented in this file.
4+
## 11.0.0
5+
6+
### General
7+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
8+
- Added a new directive for re-templating the Excel style filtering header icon - `IgxExcelStyleHeaderIconDirective`.
9+
410
## 10.2.0
511

612
### General

projects/igniteui-angular/src/lib/calendar/calendar-base.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,16 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
156156
*/
157157
public set value(value: Date | Date[]) {
158158
if (!value || !!value && (value as Date[]).length === 0) {
159+
this.selectedDatesWithoutFocus = new Date();
159160
return;
160161
}
161-
162+
if (!this.selectedDatesWithoutFocus) {
163+
const valueDate = value[0] ? Math.min.apply(null, value) : value;
164+
const date = this.getDateOnly(new Date(valueDate)).setDate(1);
165+
this.viewDate = new Date(date);
166+
}
162167
this.selectDate(value);
168+
this.selectedDatesWithoutFocus = value;
163169
}
164170

165171
/**
@@ -175,6 +181,9 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
175181
* Sets the date that will be presented in the default view when the component renders.
176182
*/
177183
public set viewDate(value: Date) {
184+
if (this._viewDate) {
185+
this.selectedDatesWithoutFocus = value;
186+
}
178187
const date = this.getDateOnly(value).setDate(1);
179188
this._viewDate = new Date(date);
180189
}
@@ -380,6 +389,11 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
380389
*/
381390
public selectedDates;
382391

392+
/**
393+
* @hidden
394+
*/
395+
private selectedDatesWithoutFocus;
396+
383397
/**
384398
* @hidden
385399
*/

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

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,8 @@ describe('IgxCalendar - ', () => {
174174
configureTestSuite();
175175
beforeAll(waitForAsync(() => {
176176
TestBed.configureTestingModule({
177-
declarations: [IgxCalendarSampleComponent, IgxCalendarRangeComponent, IgxCalendarDisabledSpecialDatesComponent],
177+
declarations: [IgxCalendarSampleComponent, IgxCalendarRangeComponent, IgxCalendarDisabledSpecialDatesComponent,
178+
IgxCalendarValueComponent],
178179
imports: [IgxCalendarModule, FormsModule, NoopAnimationsModule]
179180
}).compileComponents();
180181
}));
@@ -291,6 +292,27 @@ describe('IgxCalendar - ', () => {
291292
expect(bodyMonth.nativeElement.textContent.trim()).toMatch('8');
292293
});
293294

295+
it('Should show right month when value is set', () => {
296+
fixture = TestBed.createComponent(IgxCalendarValueComponent);
297+
fixture.detectChanges();
298+
calendar = fixture.componentInstance.calendar;
299+
300+
expect(calendar.weekStart).toEqual(WEEKDAYS.SUNDAY);
301+
expect(calendar.selection).toEqual('single');
302+
expect(calendar.viewDate.getMonth()).toEqual(calendar.value.getMonth());
303+
304+
const date = new Date(2020, 8, 28);
305+
calendar.viewDate = date;
306+
fixture.detectChanges();
307+
308+
expect(calendar.viewDate.getMonth()).toEqual(date.getMonth());
309+
310+
calendar.value = new Date(2020, 9, 15);
311+
fixture.detectChanges();
312+
313+
expect(calendar.viewDate.getMonth()).toEqual(date.getMonth());
314+
});
315+
294316
it('Should properly set locale', () => {
295317
fixture.componentInstance.viewDate = new Date(2018, 8, 17);
296318
fixture.componentInstance.model = new Date();
@@ -1998,6 +2020,16 @@ export class IgxCalendarDisabledSpecialDatesComponent {
19982020
@ViewChild(IgxCalendarComponent, { static: true }) public calendar: IgxCalendarComponent;
19992021
}
20002022

2023+
@Component({
2024+
template: `
2025+
<igx-calendar [value]="value"></igx-calendar>
2026+
`
2027+
})
2028+
export class IgxCalendarValueComponent {
2029+
public value = new Date(2020, 7, 13);
2030+
@ViewChild(IgxCalendarComponent, { static: true }) public calendar: IgxCalendarComponent;
2031+
}
2032+
20012033
class DateTester {
20022034
// tests whether a date is disabled or not
20032035
static testDatesAvailability(dates: IgxDayItemComponent[], disabled: boolean) {

projects/igniteui-angular/src/lib/core/i18n/grid-resources.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export interface IGridResourceStrings {
22
igx_grid_groupByArea_message?: string;
3+
igx_grid_groupByArea_select_message?: string;
4+
igx_grid_groupByArea_deselect_message?: string;
35
igx_grid_emptyFilteredGrid_message?: string;
46
igx_grid_emptyGrid_message?: string;
57
igx_grid_filter?: string;
@@ -113,6 +115,8 @@ export interface IGridResourceStrings {
113115

114116
export const GridResourceStringsEN: IGridResourceStrings = {
115117
igx_grid_groupByArea_message: 'Drag a column header and drop it here to group by that column.',
118+
igx_grid_groupByArea_select_message: 'Select all rows in the group with field name {0} and value {1}.',
119+
igx_grid_groupByArea_deselect_message: 'Deselect all rows in the group with field name {0} and value {1}.',
116120
igx_grid_emptyFilteredGrid_message: 'No records found.',
117121
igx_grid_emptyGrid_message: 'Grid has no data.',
118122
igx_grid_filter: 'Filter',

projects/igniteui-angular/src/lib/core/styles/components/_common/_igx-display-container.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
width: 100%;
55
overflow: hidden;
66
flex-shrink: 0;
7+
order: 3;
78
}
89

910
%display-container--inactive {

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,18 @@
3737
}
3838

3939
%grid-excel-icon {
40+
display: flex;
4041
cursor: pointer;
4142

42-
&.igx-icon {
43+
igx-icon {
4344
width: rem(15px);
4445
height: rem(15px);
4546
font-size: rem(15px);
4647
}
4748
}
4849

4950
%grid-excel-icon--filtered {
50-
&.igx-icon {
51+
igx-icon {
5152
color: if(
5253
$variant == 'indigo-design',
5354
igx-color($palette, 'warn', 500),

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-component.scss

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -647,10 +647,6 @@
647647
@extend %igx-grid__hierarchical-expander--push !optional;
648648
}
649649

650-
@include e(hierarchical-expander, $m: no-border) {
651-
@extend %igx-grid__hierarchical-expander--no-border !optional;
652-
}
653-
654650
@include e(hierarchical-indent, $m: scroll) {
655651
@extend %igx-grid__hierarchical-indent--scroll !optional;
656652
}
@@ -663,6 +659,7 @@
663659
@include e(row-indentation, $m: level-#{$i}) {
664660
@extend %igx-grid__row-indentation--level-#{$i} !optional;
665661
}
662+
666663
@include e(group-row, $m: padding-level-#{$i}) {
667664
@extend %igx-grid__group-row--padding-level-#{$i} !optional;
668665
}
@@ -771,8 +768,9 @@
771768
@include e(row-indentation, $m: level-#{$i}) {
772769
@extend %igx-grid__row-indentation-cosy--level-#{$i} !optional;
773770
}
771+
774772
@include e(group-row, $m: padding-level-#{$i}) {
775-
@extend %igx-grid__group-row--padding-cosy-level-#{$i} !optional;
773+
@extend %igx-grid__group-row-cosy--padding-level-#{$i} !optional;
776774
}
777775
}
778776

@@ -883,6 +881,7 @@
883881
@include e(row-indentation, $m: level-#{$i}) {
884882
@extend %igx-grid__row-indentation-compact--level-#{$i} !optional;
885883
}
884+
886885
@include e(group-row, $m: padding-level-#{$i}) {
887886
@extend %igx-grid__group-row-compact--padding-level-#{$i} !optional;
888887
}

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

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,12 +1043,13 @@
10431043
align-items: center;
10441044
justify-content: center;
10451045
padding: map-get($grid-cell-padding, 'comfortable');
1046-
padding-#{$right}: 0;
1046+
flex: 1 0 auto;
10471047
// Fix for IE 11
10481048
min-width: calc(#{$drag-icon-size} + #{$cell-padding-comfortable});
10491049
background: inherit;
10501050
z-index: 4;
10511051
cursor: move;
1052+
order: -1;
10521053

10531054
%igx-icon-display {
10541055
width: $drag-icon-size;
@@ -1057,29 +1058,22 @@
10571058
}
10581059
}
10591060

1060-
%igx-grid__drag-indicator--cosy{
1061+
%igx-grid__drag-indicator--cosy {
10611062
padding: map-get($grid-cell-padding, 'cosy');
10621063
// Fix for IE 11
10631064
min-width: calc(#{$drag-icon-size} + #{$cell-padding-cosy});
1064-
padding-#{$right}: 0;
10651065
}
10661066

10671067
%igx-grid__drag-indicator--compact {
10681068
padding: map-get($grid-cell-padding, 'compact');
10691069
// Fix for IE 11
10701070
min-width: calc(#{$drag-icon-size} + #{$cell-padding-compact});
1071-
padding-#{$right}: 0;
10721071
}
10731072

10741073
%igx-grid__drag-indicator--header {
10751074
border-#{$right}: $grid-header-border;
10761075
}
10771076

1078-
%igx-grid__hierarchical-expander + %igx-grid__drag-indicator {
1079-
padding-#{$left}: 0;
1080-
min-width: $drag-icon-size;
1081-
}
1082-
10831077
%igx-grid__drag-indicator--off {
10841078
color: --var($theme, 'row-drag-color');
10851079
}
@@ -1945,6 +1939,11 @@
19451939
outline-style: none;
19461940
border-bottom: 1px solid --var($theme, 'row-border-color');
19471941
min-height: map-get($grid-header-height, 'comfortable');
1942+
1943+
%igx-grid__drag-indicator {
1944+
cursor: default;
1945+
flex-grow: 0;
1946+
}
19481947
}
19491948

19501949
%igx-grid__group-row--active {
@@ -1955,6 +1954,13 @@
19551954
color: --var($theme, 'expand-icon-color');
19561955
}
19571956

1957+
%igx-grid__drag-indicator {
1958+
border: 1px solid --var($theme, 'cell-active-border-color');
1959+
border-left-width: 0;
1960+
border-right-width: 0;
1961+
box-shadow: inset 1px 0 0 0 --var($theme, 'cell-active-border-color');
1962+
}
1963+
19581964
&:hover {
19591965
background: --var($theme, 'group-row-selected-background');
19601966
}
@@ -2061,15 +2067,15 @@
20612067
}
20622068

20632069
%igx-grid__row-indentation {
2064-
background: transparent;
2065-
z-index: 1;
2070+
position: relative;
20662071
display: flex;
20672072
justify-content: center;
20682073
align-items: center;
2069-
position: relative;
20702074
padding-#{$left}: map-get($grid-grouping-indicator-padding, 'comfortable');
20712075
padding-#{$right}: map-get($grid-grouping-indicator-padding, 'comfortable');
2072-
border-#{$right}: 1px solid transparent;
2076+
border-#{$right}: 1px solid --var($theme, 'header-border-color');
2077+
background: inherit;
2078+
z-index: 1;
20732079

20742080
&::after {
20752081
content: '';
@@ -2202,8 +2208,8 @@
22022208
align-items: center;
22032209
z-index: 1;
22042210
cursor: pointer;
2205-
padding-#{$left}: map-get($grid-grouping-indicator-padding, 'comfortable');
22062211
padding-#{$right}: $grouping-padding-right;
2212+
margin-#{$left}: #{map-get($grid-grouping-indicator-padding, 'comfortable')};
22072213
min-height: map-get($grid-header-height, 'comfortable');
22082214

22092215
igx-icon {
@@ -2226,13 +2232,13 @@
22262232
}
22272233

22282234
%igx-grid__grouping-indicator--cosy {
2229-
padding-#{$left}: map-get($grid-grouping-indicator-padding, 'cosy');
22302235
min-height: map-get($grid-header-height, 'cosy');
2236+
margin-#{$left}: #{map-get($grid-grouping-indicator-padding, 'cosy')};
22312237
}
22322238

22332239
%igx-grid__grouping-indicator--compact {
2234-
padding-#{$left}: map-get($grid-grouping-indicator-padding, 'compact');
22352240
min-height: map-get($grid-header-height, 'compact');
2241+
margin-#{$left}: #{map-get($grid-grouping-indicator-padding, 'compact')};
22362242
}
22372243

22382244
%igx-grid__header-indentation {
@@ -2284,32 +2290,34 @@
22842290
}
22852291

22862292
@for $i from 1 through 10 {
2287-
// COMFORTABLE
22882293
%igx-grid__row-indentation--level-#{$i} {
2289-
background: inherit;
22902294
padding-#{$left}: calc(#{$i*map-get($grid-grouping-indicator-padding, 'comfortable')} + #{$indicator-icon-width});
22912295
}
22922296

22932297
%igx-grid__group-row--padding-level-#{$i} {
2294-
padding-#{$left}: #{$i*map-get($grid-grouping-indicator-padding, 'comfortable')};
2298+
%igx-grid__grouping-indicator {
2299+
padding-#{$left}: #{$i*map-get($grid-grouping-indicator-padding, 'comfortable')};
2300+
}
22952301
}
22962302

2297-
// COSY
22982303
%igx-grid__row-indentation-cosy--level-#{$i} {
22992304
padding-#{$left}: calc(#{$i*map-get($grid-grouping-indicator-padding, 'cosy')} + #{$indicator-icon-width});
23002305
}
23012306

23022307
%igx-grid__group-row-cosy--padding-level-#{$i} {
2303-
padding-#{$left}: #{$i*map-get($grid-grouping-indicator-padding, 'cosy')};
2308+
%igx-grid__grouping-indicator {
2309+
padding-#{$left}: #{$i*map-get($grid-grouping-indicator-padding, 'cosy')};
2310+
}
23042311
}
23052312

2306-
// COMPACT
23072313
%igx-grid__row-indentation-compact--level-#{$i} {
23082314
padding-#{$left}: calc(#{$i*map-get($grid-grouping-indicator-padding, 'compact')} + #{$indicator-icon-width});
23092315
}
23102316

23112317
%igx-grid__group-row-compact--padding-level-#{$i} {
2312-
padding-#{$left}: #{$i*map-get($grid-grouping-indicator-padding, 'compact')};
2318+
%igx-grid__grouping-indicator {
2319+
padding-#{$left}: #{$i*map-get($grid-grouping-indicator-padding, 'compact')};
2320+
}
23132321
}
23142322
}
23152323

@@ -2629,7 +2637,8 @@
26292637
cursor: pointer;
26302638
z-index: 3;
26312639
color: --var($theme, 'expand-icon-color');
2632-
border-#{$right}: 1px solid transparent;
2640+
border-#{$right}: 1px solid --var($theme, 'header-border-color');
2641+
order: 2;
26332642

26342643
&:focus {
26352644
outline: none;
@@ -2703,7 +2712,6 @@
27032712
}
27042713
}
27052714

2706-
%igx-grid__hierarchical-expander--no-border,
27072715
%igx-grid__header-indentation--no-border {
27082716
border-#{$right}: 1px solid transparent;
27092717
}

projects/igniteui-angular/src/lib/grids/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,8 @@ Here is a list of all public methods exposed by **igx-grid**:
311311
|`isExpandedGroup(group: IGroupByRecord )`| Returns if a group is expanded or not.
312312
|`toggleGroup(group: IGroupByRecord)`| Toggles the expansion state of a group.
313313
|`toggleAllGroupRows()`| Toggles the expansion state of all group rows recursively.
314+
|`selectAllRowsInGroup(group: IGroupByRecord, clearPrevSelection?: boolean)`| Select all rows within a group.
315+
|`deselectAllRowsInGroup(group: IGroupByRecord)`| Deselect all rows within a group.
314316
|`openAdvancedFilteringDialog()`| Opens the advanced filtering dialog.
315317
|`closeAdvancedFilteringDialog(applyChanges: boolean)`| Closes the advanced filtering dialog.
316318

0 commit comments

Comments
 (0)