Skip to content

Commit f9dd381

Browse files
committed
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular into ddincheva/rowStyling
2 parents 8f4a6ed + 198f77b commit f9dd381

File tree

24 files changed

+194
-74
lines changed

24 files changed

+194
-74
lines changed

CHANGELOG.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

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

5+
## 12.1.2
6+
- `igxGrid`
7+
- The column formatter callback signature now accepts the row data as an additional argument:
8+
```typescript formatter(value: any, rowData?: any)```
9+
The `rowData` argument may be `undefined` in remote scenarios/applying the callback on filtering labels
10+
so make sure to check its availability.
11+
512
## 12.1.0
613

714
### New Features
@@ -32,7 +39,7 @@ All notable changes for each version of this project will be documented in this
3239
```
3340
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
3441
- Added `batchEditing` - an `Input` property for controlling what type of transaction service is provided for the grid.
35-
Setting `<igx-grid [batchEditing]="true">` is the same as providing `[{ provide: IgxGridTransaction, useClass: IgxTransactionService }]`.
42+
Setting `<igx-grid [batchEditing]="true">` is the same as providing `[{ provide: IgxGridTransaction, useClass: IgxTransactionService }]`.
3643
- **Deprecation** - Providing a transaction service for the grid via `providers: [IgxTransactionService]` is now deprecated and will be removed in a future patch.
3744
Instead, use the new `batchEditing` property to control the grid's Transactions.
3845

@@ -46,14 +53,14 @@ All notable changes for each version of this project will be documented in this
4653
- `IgxGridCellComponent`, `IgxTreeGridCellComponent`, `IgxHierarchicalGridCellComponent` are no longer exposed in the public API. Instead, a new class `IgxGridCell` replaces all of these. It is a facade class which exposes only the public API of the above mentioned. Automatic migration will change these imports with `CellType`, which is the interface implemented by `IgxGridCell`
4754
- **Behavioral changes**
4855
- `getCellByKey`, `getCellByColumn`, `getCellByColumnVisibleIndex`, `row.cells`, `column.cells`, `grid.selectedCells` now return an `IgxGridCell` the `CellType` interface.
49-
- `cell` in `IGridCellEventArgs` is now `CellType`. `IGridCellEventArgs` are emitetd in `cellClick`, `selected`, `contextMenu` and `doubleClick` events.
56+
- `cell` in `IGridCellEventArgs` is now `CellType`. `IGridCellEventArgs` are emitetd in `cellClick`, `selected`, `contextMenu` and `doubleClick` events.
5057
- `let-cell` property in cell template is now `CellType`.
5158
- `getCellByColumnVisibleIndex` is now deprecated and will be removed in next major version. Use `getCellByKey`, `getCellByColumn` instead.
5259

5360
- `Transactions`
5461
- Added `IgxFlatTransactionFactory` - the singleton service instantiates a new `TransactionService<Transaction, State>` given a `transaction type`.
5562
- Added `IgxHierarchicalTransactionFactory` - the singleton service instantiates a new `HierarchicalTransactionService<HierarchicalTransaction, HierarchicalState>` given a `transaction type`.
56-
63+
5764
- `Toolbar Actions`
5865
- Exposed a new input property `overlaySettings` for all column actions (`hiding` | `pinning` | `advanced filtering` | `exporter`). Example below:
5966

projects/igniteui-angular/migrations/common/UpdateChanges.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ export class UpdateChanges {
196196
this.valueTransforms.set(functionName, callback);
197197
}
198198

199-
public getDefaultLanguageService(entryPath: string): tss.LanguageService | undefined {
199+
/** Path must be absolute. If calling externally, use this.getAbsolutePath */
200+
protected getDefaultLanguageService(entryPath: string): tss.LanguageService | undefined {
200201
const project = this.getDefaultProjectForFile(entryPath);
201202
return project.getLanguageService();
202203
}

projects/igniteui-angular/migrations/common/tsUtils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ const getTypeDefinitions = (langServ: tss.LanguageService, entryPath: string, po
247247
* Get type information about a TypeScript identifier
248248
*
249249
* @param langServ TypeScript/Angular LanguageService
250-
* @param entryPath path to file
250+
* @param entryPath path to file (absolute)
251251
* @param position Index of identifier
252252
*/
253253
export const getTypeDefinitionAtPosition =

projects/igniteui-angular/migrations/update-11_1_0/changes/members.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,20 @@
363363
"definedIn": [
364364
"IgxTooltipTargetDirective"
365365
]
366+
},
367+
{
368+
"member": "remote",
369+
"replaceWith": "Remote",
370+
"definedIn": [
371+
"GridPagingMode"
372+
]
373+
},
374+
{
375+
"member": "local",
376+
"replaceWith": "Local",
377+
"definedIn": [
378+
"GridPagingMode"
379+
]
366380
}
367381
]
368382
}

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -749,4 +749,49 @@ export class CsvExportComponent {
749749
)
750750
).toEqual(expectedContent);
751751
});
752+
753+
it('should update GridPagingMode enum from lowerCase to TitleCase', async () => {
754+
pending('set up tests for migrations through lang service');
755+
appTree.create(
756+
'/testSrc/appPrefix/component/paging-test.component.ts',
757+
`import { Component } from '@angular/core';
758+
import { GridPagingMode } from "igniteui-angular";
759+
760+
@Component({
761+
selector: "app-paging-test",
762+
styleUrls: ["./paging-test.component.scss"],
763+
templateUrl: "./paging-test.component.html"
764+
})
765+
export class PagingComponent {
766+
public pagingLocal: GridPagingMode = GridPagingMode.Local;
767+
public pagingRemote: GridPagingMode = GridPagingMode.Remote;
768+
constructor(){}
769+
}
770+
`);
771+
772+
const tree = await runner
773+
.runSchematicAsync('migration-19', {}, appTree)
774+
.toPromise();
775+
776+
const expectedContent =
777+
`import { Component } from '@angular/core';
778+
import { GridPagingMode } from "igniteui-angular";
779+
780+
@Component({
781+
selector: "app-paging-test",
782+
styleUrls: ["./paging-test.component.scss"],
783+
templateUrl: "./paging-test.component.html"
784+
})
785+
export class PagingComponent {
786+
public pagingLocal: GridPagingMode = GridPagingMode.local;
787+
public pagingRemote: GridPagingMode = GridPagingMode.remote;
788+
constructor(){}
789+
}
790+
`;
791+
expect(
792+
tree.readContent(
793+
'/testSrc/appPrefix/component/paging-test.component.ts'
794+
)
795+
).toEqual(expectedContent);
796+
});
752797
});
Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Rule, SchematicContext, Tree } from '@angular-devkit/schematics';
2-
import { findMatches, replaceMatch } from '../common/tsUtils';
32
import { UpdateChanges } from '../common/UpdateChanges';
43

54
const version = '11.1.0';
@@ -8,28 +7,5 @@ export default (): Rule => (host: Tree, context: SchematicContext) => {
87
context.logger.info(`Applying migration for Ignite UI for Angular to version ${version}`);
98

109
const update = new UpdateChanges(__dirname, host, context);
11-
const tsFiles = update.tsFiles;
12-
const targetEnum = 'GridPagingMode';
13-
const changes = [
14-
{ member: 'remote', replaceWith: 'Remote', definedIn: [targetEnum] },
15-
{ member: 'local', replaceWith: 'Local', definedIn: [targetEnum] }
16-
];
1710
update.applyChanges();
18-
for (const entryPath of tsFiles) {
19-
const ls = update.getDefaultLanguageService(entryPath);
20-
let content = host.read(entryPath).toString();
21-
for (const change of changes) {
22-
const matches = findMatches(content, change.member);
23-
for (const position of matches) {
24-
const definition = ls.getDefinitionAndBoundSpan(entryPath, position - 1)?.definitions[0];
25-
if (definition
26-
&& definition.kind === 'enum'
27-
&& definition.name === targetEnum
28-
&& definition.fileName.includes('igniteui-angular')) {
29-
content = replaceMatch(content, change.member, change.replaceWith, position);
30-
host.overwrite(entryPath, content);
31-
}
32-
}
33-
}
34-
}
3511
};

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,16 @@
14411441
padding-top: 0 !important;
14421442
}
14431443

1444+
.igx-input-group__bundle {
1445+
border: none !important;
1446+
}
1447+
1448+
igx-prefix,
1449+
igx-suffix {
1450+
padding-top: 0 !important;
1451+
padding-bottom: 0 !important;
1452+
}
1453+
14441454
igx-date-range-picker {
14451455
height: 100%;
14461456
}

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,18 @@ describe('IgxDateRangePicker', () => {
758758

759759
disabled$.complete();
760760
}));
761+
762+
it('should update the calendar while it\'s open and the value has been updated', fakeAsync(() => {
763+
dateRange.open();
764+
tick();
765+
fixture.detectChanges();
766+
767+
const range = { start: new Date(), end: new Date(new Date().setDate(new Date().getDate() + 1)) };
768+
dateRange.value = range;
769+
fixture.detectChanges();
770+
771+
expect((dateRange as any).calendar.selectedDates.length).toBeGreaterThan(0);
772+
}));
761773
});
762774

763775
describe('Two Inputs', () => {
@@ -1170,6 +1182,18 @@ describe('IgxDateRangePicker', () => {
11701182
disabled$.complete();
11711183
}));
11721184

1185+
it('should update the calendar while it\'s open and the value has been updated', fakeAsync(() => {
1186+
dateRange.open();
1187+
tick();
1188+
fixture.detectChanges();
1189+
1190+
const range = { start: new Date(), end: new Date(new Date().setDate(new Date().getDate() + 1)) };
1191+
dateRange.value = range;
1192+
fixture.detectChanges();
1193+
1194+
expect((dateRange as any).calendar.selectedDates.length).toBeGreaterThan(0);
1195+
}));
1196+
11731197
describe('Data binding', () => {
11741198
it('should properly update component value with ngModel bound to projected inputs - #7353', fakeAsync(() => {
11751199
fixture = TestBed.createComponent(DateRangeTwoInputsNgModelTestComponent);

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
767767
private updateValue(value: DateRange) {
768768
this._value = value ? value : null;
769769
this.updateInputs();
770+
this.updateCalendar();
770771
}
771772

772773
private updateValidityOnBlur() {
@@ -847,6 +848,9 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
847848
}
848849

849850
private updateCalendar(): void {
851+
if (!this.calendar) {
852+
return;
853+
}
850854
this.calendar.disabledDates = [];
851855
const minValue = this.parseMinValue(this.minValue);
852856
if (minValue) {

projects/igniteui-angular/src/lib/directives/radio/radio-group.directive.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { IgxRippleModule } from '../ripple/ripple.directive';
1616
import { takeUntil } from 'rxjs/operators';
1717
import { noop, Subject } from 'rxjs';
1818
import { mkenum } from '../../core/utils';
19+
import { DeprecateProperty } from '../../core/deprecateDecorators';
1920

2021
/**
2122
* Determines the Radio Group alignment
@@ -24,7 +25,7 @@ export const RadioGroupAlignment = mkenum({
2425
horizontal: 'horizontal',
2526
vertical: 'vertical'
2627
});
27-
export type RadioGroupAlignment = (typeof RadioGroupAlignment)[keyof typeof RadioGroupAlignment];
28+
export type RadioGroupAlignment = typeof RadioGroupAlignment[keyof typeof RadioGroupAlignment];
2829

2930
let nextId = 0;
3031

@@ -123,30 +124,35 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
123124
return this._required;
124125
}
125126
public set required(value: boolean) {
126-
this._required = (value as any === '') || value;
127+
this._required = (value as any) === '' || value;
127128
this._setRadioButtonsRequired();
128129
}
129130

130131
/**
131132
* An @Input property that allows you to disable the radio group. By default it's false.
132133
*
134+
* @deprecated in version 12.2.0
135+
*
133136
* @example
134137
* ```html
135-
* <igx-radio-group [disabled]="true"></igx-radio-group>
138+
* <igx-radio-group disabled></igx-radio-group>
136139
* ```
137140
*/
141+
@DeprecateProperty('`disabled` is deprecated.')
138142
@Input()
139143
public get disabled(): boolean {
140144
return this._disabled;
141145
}
142146
public set disabled(value: boolean) {
143-
this._disabled = (value as any === '') || value;
147+
this._disabled = (value as any) === '' || value;
144148
this.setDisabledState(value);
145149
}
146150

147151
/**
148152
* Sets/gets the position of the `label` in the child radio buttons.
149153
*
154+
* @deprecated in version 12.2.0
155+
*
150156
* @remarks
151157
* If not set, `labelPosition` will have value `"after"`.
152158
*
@@ -155,6 +161,7 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
155161
* <igx-radio-group labelPosition = "before"></igx-radio-group>
156162
* ```
157163
*/
164+
@DeprecateProperty('`labelPosition` is deprecated.')
158165
@Input()
159166
public get labelPosition(): RadioLabelPosition | string {
160167
return this._labelPosition;
@@ -340,10 +347,10 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
340347
* @hidden
341348
* @internal
342349
*/
343-
public setDisabledState(isDisabled: boolean) {
350+
public setDisabledState(isDisabled: boolean) {
344351
if (this.radioButtons) {
345352
this.radioButtons.forEach((button) => {
346-
button.disabled = isDisabled;
353+
button.setDisabledState(isDisabled);
347354
});
348355
}
349356
}
@@ -396,7 +403,7 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
396403
* @internal
397404
*/
398405
private _selectedRadioButtonChanged(args: IChangeRadioEventArgs) {
399-
this.radioButtons.forEach(button => {
406+
this.radioButtons.forEach((button) => {
400407
button.checked = button.id === args.radio.id;
401408
});
402409

@@ -487,4 +494,4 @@ export class IgxRadioGroupDirective implements AfterContentInit, ControlValueAcc
487494
exports: [IgxRadioGroupDirective, IgxRadioComponent],
488495
imports: [IgxRippleModule]
489496
})
490-
export class IgxRadioModule { }
497+
export class IgxRadioModule {}

0 commit comments

Comments
 (0)