Skip to content

Commit d2458cd

Browse files
authored
Merge branch '19.2.x' into ttonev/fix-14970-master
2 parents 24eb27e + 5f255b2 commit d2458cd

File tree

75 files changed

+3450
-340
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+3450
-340
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ name: "CodeQL"
1313

1414
on:
1515
push:
16-
branches: [ master, 19.1.x, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
16+
branches: [ master, 19.2.x, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
1717
pull_request:
1818
# The branches below must be a subset of the branches above
19-
branches: [ master, 19.1.x, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
19+
branches: [ master, 19.2.x, 18.2.x, 17.2.x, 16.1.x, 15.1.x ]
2020
schedule:
2121
- cron: '33 4 * * 4'
2222

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@ All notable changes for each version of this project will be documented in this
1111
- **Deprecation** - `tabIndex` has been deprecated and will be removed in a future version.
1212
- `IgxGrid`, `IgxHierarchicalGrid`, `IgxTreeGrid`
1313
- A column's `minWidth` and `maxWidth` constrain the user-specified `width` so that it cannot go outside their bounds.
14+
- In SSR mode grid with height 100% or with no height will render on the server with % size and with no data. The grid will show either the empty grid template or the loading indicator (if isLoading is true).
15+
- In SSR mode grid with width 100% or with no width will render on the server with % size and with all columns.
16+
- The `pagingMode` property can now be set as simple strings `'local'` and `'remote'` and does not require importing the `GridPagingMode` enum.
17+
- `IgxHierarchicalGrid`
18+
- Introduced a new advanced filtering capability that enables top-level records to be dynamically refined based on the attributes or data of their associated child records.
19+
- Added a new `schema` input property that can be used to pass collection of `EntityType` objects. This property is required for remote data scenarios.
20+
- `IgxQueryBuilderComponent`, `IgxAdvancedFilteringDialogComponent`
21+
- Added support for entities with hierarchical structure.
22+
- `EntityType`
23+
- A new optional property called `childEntities` has been introduced that can be used to create nested entities.
1424

1525
## 19.1.1
1626
### New Features
@@ -28,7 +38,7 @@ All notable changes for each version of this project will be documented in this
2838
- Introduced a new `expanded` input property, enabling dynamic control over the banner's state. The banner can now be programmatically set to expanded (visible) or collapsed (hidden) both initially and at runtime. Animations will trigger during runtime updates — the **open animation** plays when `expanded` is set to `true`, and the **close animation** plays when set to `false`. However, no animations will trigger when the property is set initially.
2939
- The banner's event lifecycle (`opening`, `opened`, `closing`, `closed`) only triggers through **user interactions** (e.g., clicking to open/close). Programmatic updates using the `expanded` property will not fire any events.
3040
- If the `expanded` property changes during an ongoing animation, the current animation will **stop** and the opposite animation will begin from the **point where the previous animation left off**. For instance, if the open animation (10 seconds) is interrupted at 6 seconds and `expanded` is set to `false`, the close animation (5 seconds) will start from its 3rd second.
31-
- `IgxQueryBuilder` has new design that comes with updated appearance and new functionality
41+
- `IgxQueryBuilder` has a new design that comes with an updated appearance and new functionality
3242
- `IgxQueryBuilderComponent`
3343
- Introduced the ability to create nested queries by specifying IN/NOT IN operators.
3444
- Introduced the ability to reposition condition chips by dragging or using `Arrow Up/Down`.

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"@types/source-map": "0.5.2",
7575
"express": "^4.21.1",
7676
"fflate": "^0.8.1",
77-
"igniteui-theming": "^17.0.0",
77+
"igniteui-theming": "^17.2.0",
7878
"igniteui-trial-watermark": "^3.0.2",
7979
"lodash-es": "^4.17.21",
8080
"rxjs": "^7.8.2",

projects/igniteui-angular-elements/src/analyzer/elements.config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ import {
77
} from "../../../igniteui-angular/src/public_api";
88
import { IgxPaginatorComponent } from "../../../igniteui-angular/src/lib/paginator/paginator.component";
99
import { IgxPaginatorToken } from "../../../igniteui-angular/src/lib/paginator/token";
10-
import { IgxActionStripComponent } from "../../../igniteui-angular/src/lib/action-strip/action-strip.component";
11-
import { IgxActionStripToken } from "../../../igniteui-angular/src/lib/action-strip/token";
12-
import { IgxGridEditingActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component";
13-
import { IgxGridActionsBaseDirective } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive";
14-
import { IgxGridPinningActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component";
15-
import { IgxColumnComponent } from "../../../igniteui-angular/src/lib/grids/columns/column.component";
16-
import { IgxColumnGroupComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-group.component";
17-
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
1810
import { IgxGridToolbarTitleComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/common";
1911
import { IgxGridToolbarActionsComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/common";
2012
import { IgxGridToolbarAdvancedFilteringComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-advanced-filtering.component";
2113
import { IgxGridToolbarComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar.component";
2214
import { IgxToolbarToken } from "../../../igniteui-angular/src/lib/grids/toolbar/token";
15+
import { IgxColumnComponent } from "../../../igniteui-angular/src/lib/grids/columns/column.component";
16+
import { IgxColumnGroupComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-group.component";
2317
import { IgxRowIslandComponent } from "../../../igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component";
18+
import { IgxActionStripComponent } from "../../../igniteui-angular/src/lib/action-strip/action-strip.component";
19+
import { IgxActionStripToken } from "../../../igniteui-angular/src/lib/action-strip/token";
20+
import { IgxGridEditingActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component";
21+
import { IgxGridActionsBaseDirective } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive";
22+
import { IgxGridPinningActionsComponent } from "../../../igniteui-angular/src/lib/action-strip/grid-actions/grid-pinning-actions.component";
23+
import { IgxColumnLayoutComponent } from "../../../igniteui-angular/src/lib/grids/columns/column-layout.component";
2424
import { IgxGridToolbarExporterComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-exporter.component";
2525
import { IgxGridToolbarHidingComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-hiding.component";
2626
import { IgxGridToolbarPinningComponent } from "../../../igniteui-angular/src/lib/grids/toolbar/grid-toolbar-pinning.component";

projects/igniteui-angular-elements/src/app/custom-strategy.spec.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
2+
import { html } from 'lit-html';
23
import { firstValueFrom, fromEvent, skip, timer } from 'rxjs';
34
import { ComponentRefKey, IgcNgElement } from './custom-strategy';
45
import hgridData from '../assets/data/projects-hgrid.js';
@@ -52,6 +53,43 @@ describe('Elements: ', () => {
5253
const columnComponent = (await columnEl.ngElementStrategy[ComponentRefKey]).instance as IgxColumnComponent;
5354
expect(gridComponent.columnList.toArray()).toContain(columnComponent);
5455
});
56+
57+
it(`should keep IgcNgElement instance in template of another IgcNgElement #15678`, async () => {
58+
const gridEl = document.createElement("igc-grid");
59+
testContainer.appendChild(gridEl);
60+
const columnEl = document.createElement("igc-column") as IgcNgElement;
61+
gridEl.appendChild(columnEl);
62+
gridEl.primaryKey = 'id';
63+
gridEl.data = [{ id: '1' }];
64+
(gridEl as any).detailTemplate = (ctx) => {
65+
return html`<div>
66+
<igc-grid id="child${ctx.implicit.id}"></igc-grid>
67+
</div>`;
68+
}
69+
70+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
71+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 2));
72+
73+
// sigh (。﹏。*)
74+
(gridEl as any).toggleRow('1');
75+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 2));
76+
77+
let detailGrid = document.querySelector<IgcNgElement>('#child1');
78+
expect(detailGrid).toBeDefined();
79+
let detailGridComponent = (await detailGrid?.ngElementStrategy[ComponentRefKey])?.instance as IgxGridComponent;
80+
expect(detailGridComponent).toBeDefined();
81+
82+
// close and re-expand row detail:
83+
(gridEl as any).toggleRow('1');
84+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 2));
85+
(gridEl as any).toggleRow('1');
86+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 2));
87+
88+
detailGrid = document.querySelector<IgcNgElement>('#child1');
89+
expect(detailGrid).toBeDefined();
90+
detailGridComponent = (await detailGrid?.ngElementStrategy[ComponentRefKey])?.instance as IgxGridComponent;
91+
expect(detailGridComponent).toBeDefined("Detail child grid was destroyed on re-expand");
92+
});
5593
});
5694

5795
describe('Grid integration scenarios.', () => {

projects/igniteui-angular-elements/src/app/custom-strategy.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { ApplicationRef, ChangeDetectorRef, ComponentFactory, ComponentRef, Injector, OnChanges, QueryList, Type, ViewContainerRef, reflectComponentType } from '@angular/core';
1+
import { ApplicationRef, ChangeDetectorRef, ComponentFactory, ComponentRef, DestroyRef, Injector, OnChanges, QueryList, Type, ViewContainerRef, reflectComponentType } from '@angular/core';
2+
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
23
import { NgElement } from '@angular/elements';
34
import { fromEvent } from 'rxjs';
45
import { takeUntil } from 'rxjs/operators';
@@ -48,6 +49,14 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy {
4849
return this._templateWrapper;
4950
}
5051

52+
private _configSelectors: string;
53+
public get configSelectors(): string {
54+
if (!this._configSelectors) {
55+
this._configSelectors = this.config.map(x => x.selector).join(',');
56+
}
57+
return this._configSelectors;
58+
}
59+
5160
constructor(private _componentFactory: ComponentFactory<any>, private _injector: Injector, private config: ComponentConfig[]) {
5261
super(_componentFactory, _injector);
5362
}
@@ -233,6 +242,14 @@ class IgxCustomNgElementStrategy extends ComponentNgElementStrategy {
233242
}
234243
value = this.templateWrapper.addTemplate(value);
235244
// TODO: discard oldValue
245+
246+
// check template for any angular-element components
247+
this.templateWrapper.templateRendered.pipe(takeUntilDestroyed(componentRef.injector.get(DestroyRef))).subscribe((element) => {
248+
element.querySelectorAll<IgcNgElement>(this.configSelectors)?.forEach((c) => {
249+
// tie to angularParent lifecycle for cached scenarios like detailTemplate:
250+
c.ngElementStrategy.angularParent = componentRef;
251+
});
252+
});
236253
}
237254
if (componentRef && componentConfig?.boolProps?.includes(property)) {
238255
// bool coerce:

projects/igniteui-angular-elements/src/app/wrapper/wrapper.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ChangeDetectorRef, Component, QueryList, TemplateRef, ViewChildren } from '@angular/core';
2+
import { Subject } from 'rxjs';
23
import { TemplateRefWrapper } from './template-ref-wrapper';
34

45
import { render, TemplateResult } from 'lit-html';
@@ -14,6 +15,7 @@ type TemplateFunction = (arg: any) => TemplateResult;
1415
export class TemplateWrapperComponent {
1516

1617
public templateFunctions: TemplateFunction[] = [];
18+
public templateRendered = new Subject<HTMLElement>();
1719

1820
/**
1921
* All template refs
@@ -27,6 +29,7 @@ export class TemplateWrapperComponent {
2729

2830
public litRender(container: HTMLElement, templateFunc: (arg: any) => TemplateResult, arg: any) {
2931
render(templateFunc(arg), container);
32+
this.templateRendered.next(container);
3033
}
3134

3235
public addTemplate(templateFunc: TemplateFunction): TemplateRef<any> {

projects/igniteui-angular-elements/src/index.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ <h3 class="ig-typography__h6">Flat Grid (MRL column layout)</h3>
195195
<igc-combo ${ref(focusCallback)} style="width:100%; height:100%" .data=${northwindProducts} value-key="ProductName" @igcChange=${(e) => ctx.cell.editValue = e.detail.newValue} single-select>
196196
</igc-combo>
197197
`;
198-
grid1.detailTemplate = (ctx) => html`<div><span class="categoryStyle">Stock: ${ctx.implicit.InStock}</span></div>`;
198+
grid1.detailTemplate = (ctx) => {
199+
return html`<div>
200+
<igc-grid auto-generate="true"></igc-grid>
201+
</div>`;
202+
}
199203

200204
grid2.querySelector('igc-column[field="ProductName"]').inlineEditorTemplate = (ctx) =>
201205
html`

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

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -708,47 +708,4 @@ export class CsvExportComponent {
708708
)
709709
).toEqual(expectedContent);
710710
});
711-
712-
it('should update GridPagingMode enum from lowerCase to TitleCase', async () => {
713-
appTree.create(
714-
'/testSrc/appPrefix/component/paging-test.component.ts',
715-
`import { Component } from '@angular/core';
716-
import { GridPagingMode } from "igniteui-angular";
717-
718-
@Component({
719-
selector: "app-paging-test",
720-
styleUrls: ["./paging-test.component.scss"],
721-
templateUrl: "./paging-test.component.html"
722-
})
723-
export class PagingComponent {
724-
public pagingLocal: GridPagingMode = GridPagingMode.local;
725-
public pagingRemote: GridPagingMode = GridPagingMode.remote;
726-
constructor(){}
727-
}
728-
`);
729-
730-
const tree = await runner
731-
.runSchematic('migration-19', {}, appTree);
732-
733-
const expectedContent =
734-
`import { Component } from '@angular/core';
735-
import { GridPagingMode } from "igniteui-angular";
736-
737-
@Component({
738-
selector: "app-paging-test",
739-
styleUrls: ["./paging-test.component.scss"],
740-
templateUrl: "./paging-test.component.html"
741-
})
742-
export class PagingComponent {
743-
public pagingLocal: GridPagingMode = GridPagingMode.Local;
744-
public pagingRemote: GridPagingMode = GridPagingMode.Remote;
745-
constructor(){}
746-
}
747-
`;
748-
expect(
749-
tree.readContent(
750-
'/testSrc/appPrefix/component/paging-test.component.ts'
751-
)
752-
).toEqual(expectedContent);
753-
});
754711
});

0 commit comments

Comments
 (0)