Skip to content

Commit 4ce66eb

Browse files
committed
Merge branch '12.1.x' of https://github.com/IgniteUI/igniteui-angular into PMiteva/fix-9717-12.1.x
2 parents d8da792 + 6964133 commit 4ce66eb

File tree

8 files changed

+92
-19
lines changed

8 files changed

+92
-19
lines changed

angular.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@
5959
"namedChunks": false,
6060
"extractLicenses": true,
6161
"vendorChunk": false,
62-
"buildOptimizer": true
62+
"buildOptimizer": true,
63+
"aot": true
6364
},
6465
"hmr": {
6566
"budgets": [

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

Lines changed: 36 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface BoundPropertyObject {
3232

3333
/* eslint-disable arrow-parens */
3434
export class UpdateChanges {
35+
protected tsconfigPath = TSCONFIG_PATH;
3536
protected _projectService: tss.server.ProjectService;
3637
public get projectService(): tss.server.ProjectService {
3738
if (!this._projectService) {
@@ -181,7 +182,7 @@ export class UpdateChanges {
181182

182183
// if tsconfig.json was patched, restore it
183184
if (this._initialTsConfig !== '') {
184-
this.host.overwrite(TSCONFIG_PATH, this._initialTsConfig);
185+
this.host.overwrite(this.tsconfigPath, this._initialTsConfig);
185186
}
186187

187188
}
@@ -479,23 +480,24 @@ export class UpdateChanges {
479480
}
480481

481482
private patchTsConfig(): void {
482-
if (this.serverHost.fileExists(TSCONFIG_PATH)) {
483+
this.ensureTsConfigPath();
484+
if (this.serverHost.fileExists(this.tsconfigPath)) {
483485
let originalContent = '';
484486
try {
485-
originalContent = this.serverHost.readFile(TSCONFIG_PATH);
487+
originalContent = this.serverHost.readFile(this.tsconfigPath);
486488
} catch {
487489
this.context?.logger
488-
.warn(`Could not read ${TSCONFIG_PATH}. Some Angular Ivy features might be unavailable during migrations.`);
490+
.warn(`Could not read ${this.tsconfigPath}. Some Angular Ivy features might be unavailable during migrations.`);
489491
return;
490492
}
491493
let content;
492494
// use ts parser as it handles jsonc-style files w/ comments
493-
const result = ts.parseConfigFileTextToJson(TSCONFIG_PATH, originalContent);
495+
const result = ts.parseConfigFileTextToJson(this.tsconfigPath, originalContent);
494496
if (!result.error) {
495497
content = result.config;
496498
} else {
497499
this.context?.logger
498-
.warn(`Could not parse ${TSCONFIG_PATH}. Angular Ivy language service might be unavailable during migrations.`);
500+
.warn(`Could not parse ${this.tsconfigPath}. Angular Ivy language service might be unavailable during migrations.`);
499501
this.context?.logger
500502
.warn(`Error:\n${result.error}`);
501503
return;
@@ -505,15 +507,41 @@ export class UpdateChanges {
505507
}
506508
if (!content.angularCompilerOptions.strictTemplates) {
507509
this.context?.logger
508-
.info(`Adding 'angularCompilerOptions.strictTemplates' to ${TSCONFIG_PATH} for migration run.`);
510+
.info(`Adding 'angularCompilerOptions.strictTemplates' to ${this.tsconfigPath} for migration run.`);
509511
content.angularCompilerOptions.strictTemplates = true;
510-
this.host.overwrite(TSCONFIG_PATH, JSON.stringify(content));
512+
this.host.overwrite(this.tsconfigPath, JSON.stringify(content));
511513
// store initial state and restore it once migrations are finished
512514
this._initialTsConfig = originalContent;
513515
}
514516
}
515517
};
516518

519+
private ensureTsConfigPath(): void {
520+
if (this.host.exists(this.tsconfigPath)) {
521+
return;
522+
}
523+
524+
// attempt to find a main tsconfig from workspace:
525+
const wsProject = this.workspace.projects[this.workspace.defaultProject] || this.workspace.projects[0];
526+
// technically could be per-project, but assuming there's at least one main tsconfig for IDE support
527+
const projectConfig = wsProject.architect?.build?.options['tsConfig'];
528+
529+
if (!projectConfig || !this.host.exists(projectConfig)) {
530+
return;
531+
}
532+
if (path.posix.basename(projectConfig) === TSCONFIG_PATH) {
533+
// not project specific extended tsconfig, use directly
534+
this.tsconfigPath = projectConfig;
535+
return;
536+
}
537+
538+
// look for base config through extends property
539+
const result = ts.parseConfigFileTextToJson(projectConfig, this.serverHost.readFile(projectConfig));
540+
if (!result.error && result.config.extends) {
541+
this.tsconfigPath = path.posix.join(path.posix.dirname(projectConfig), result.config.extends);
542+
}
543+
};
544+
517545
private loadConfig(configJson: string) {
518546
const filePath = path.join(this.rootPath, 'changes', configJson);
519547
if (fs.existsSync(filePath)) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ export class IgxYearsViewComponent implements ControlValueAccessor {
192192
*
193193
* @hidden
194194
*/
195-
public get decade(): number[] {
196-
const result = [];
195+
public get decade() {
196+
const result: Date[] = [];
197197
const start = this.date.getFullYear() - 3;
198198
const end = this.date.getFullYear() + 4;
199199

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ export type IgxButtonType = typeof IgxButtonType[keyof typeof IgxButtonType];
5252
})
5353
export class IgxButtonDirective extends DisplayDensityBase {
5454
private static ngAcceptInputType_type: IgxButtonType | '';
55+
private static ngAcceptInputType_disabled: boolean | '';
5556

5657
/**
5758
* Called when the button is clicked.

projects/igniteui-angular/src/lib/grids/grid-base.directive.ts

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5568,7 +5568,10 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
55685568
public copyHandler(event) {
55695569
const selectedColumns = this.gridAPI.grid.selectedColumns();
55705570
const columnData = this.getSelectedColumnsData(this.clipboardOptions.copyFormatters, this.clipboardOptions.copyHeaders);
5571-
const selectedData = this.getSelectedData(this.clipboardOptions.copyFormatters, this.clipboardOptions.copyHeaders);
5571+
let selectedData;
5572+
if (event.type === 'copy'){
5573+
selectedData = this.getSelectedData(this.clipboardOptions.copyFormatters, this.clipboardOptions.copyHeaders);
5574+
};
55725575

55735576
let data = [];
55745577
let result;
@@ -6687,12 +6690,52 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
66876690
let record = {};
66886691
let selectedData = [];
66896692
let keys = [];
6693+
const selectionCollection = new Map();
66906694
const keysAndData = [];
66916695
const activeEl = this.selectionService.activeElement;
6696+
6697+
if (this.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid') {
6698+
const expansionRowIndexes = Array.from(this.expansionStates.keys());
6699+
if (this.selectionService.selection.size > 0) {
6700+
if (expansionRowIndexes.length > 0) {
6701+
for (const [key, value] of this.selectionService.selection.entries()) {
6702+
let updatedKey = key;
6703+
expansionRowIndexes.forEach(row => {
6704+
let rowIndex;
6705+
if (row.ID) {
6706+
rowIndex = Number(row.ID);
6707+
}else {
6708+
rowIndex = Number(row);
6709+
}
6710+
6711+
if (updatedKey > Number(rowIndex)) {
6712+
updatedKey--;
6713+
}
6714+
});
6715+
selectionCollection.set(updatedKey, value);
6716+
}
6717+
}
6718+
} else if (activeEl) {
6719+
if (expansionRowIndexes.length > 0) {
6720+
expansionRowIndexes.forEach(row => {
6721+
if (activeEl.row > Number(row)) {
6722+
activeEl.row--;
6723+
}
6724+
});
6725+
}
6726+
}
6727+
}
6728+
66926729
const totalItems = (this as any).totalItemCount ?? 0;
66936730
const isRemote = totalItems && totalItems > this.dataView.length;
6694-
const selectionMap = isRemote ? Array.from(this.selectionService.selection) :
6731+
let selectionMap;
6732+
if (this.nativeElement.tagName.toLowerCase() === 'igx-hierarchical-grid' && selectionCollection.size > 0) {
6733+
selectionMap = isRemote ? Array.from(selectionCollection) :
6734+
Array.from(selectionCollection).filter((tuple) => tuple[0] < source.length);
6735+
}else {
6736+
selectionMap = isRemote ? Array.from(this.selectionService.selection) :
66956737
Array.from(this.selectionService.selection).filter((tuple) => tuple[0] < source.length);
6738+
}
66966739

66976740
if (this.cellSelection === GridSelectionMode.single && activeEl) {
66986741
selectionMap.push([activeEl.row, new Set<number>().add(activeEl.column)]);

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<igx-snackbar #addRowSnackbar [outlet]="igxBodyOverlayOutlet" [actionText]="resourceStrings.igx_grid_snackbar_addrow_actiontext" [displayTime]='snackbarDisplayTime'>{{resourceStrings.igx_grid_snackbar_addrow_label}}</igx-snackbar>
112112
</div>
113113

114-
<div igxOverlayOutlet #igxBodyOverlayOutlet></div>
114+
<div igxOverlayOutlet #igxBodyOverlayOutlet="overlay-outlet"></div>
115115
</div>
116116

117117
<div class="igx-grid__tfoot" role="rowgroup" [style.height.px]='summariesHeight' #tfoot>

src/app/grid-cell-api/grid-cell-api.sample.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
</div>
3030
<div class="grid-wrapper">
31-
<igx-grid #grid [rowDraggable]="true" (rowDragStart)="onRowDragStart($event)" (onRowDragEnd)="onRowDragEnd($event)" [data]="data" [cellSelection]="true" [rowEditable]="true" [allowFiltering]='true' [primaryKey]='"ID"' [paging]="true" [columnSelection]="'single'"
31+
<igx-grid #grid [rowDraggable]="true" [data]="data" [cellSelection]="'multiple'" [rowEditable]="true" [allowFiltering]='true' [primaryKey]='"ID"' [paging]="true" [columnSelection]="'single'"
3232
[width]="'800px'" [height]="'600px'" [rowSelection]="'multiple'">
3333
<igx-paginator>
3434
</igx-paginator>
@@ -138,7 +138,7 @@
138138
<button (click)="setEditMode(treeGridHier, tHIndex, tHGridLogger)">Set editMode</button>
139139
</div>
140140
<div style="margin-right: 5px; text-align: start">
141-
<button (click)="logState(treeGridHier, tHIndex, tHGridLogger, tHGridLogger)">Log state By Index</button>
141+
<button (click)="logState(treeGridHier, tHIndex, tHGridLogger)">Log state By Index</button>
142142
</div>
143143
<div style="margin-right: 5px; text-align: start">
144144
<button (click)="logStateByKey(treeGridHier, tHCellKey, tHcolumnField, tHGridLogger)">Log state by key</button>
@@ -300,4 +300,4 @@
300300
</button>
301301
</div>
302302
</div>
303-
</div>
303+
</div>

src/app/snackbar/snackbar.sample.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ <h4 class="sample-title">Snackbar w/ action button</h4>
1717
[ariaLive]="'assertive'"
1818
(clicked)="undoColorChange(snackbar)"
1919
[outlet]="outlet"
20-
(animationStarted)="onAnimationStarted($event)"
21-
(animationDone)="onAnimationDone($event)"
20+
(animationStarted)="onAnimationStarted()"
21+
(animationDone)="onAnimationDone()"
2222
>
2323
</igx-snackbar>
2424
</div>

0 commit comments

Comments
 (0)