Skip to content

Commit 4dcc5b2

Browse files
committed
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular into feature/align-tooltip
2 parents 49a2445 + d0361ce commit 4dcc5b2

File tree

54 files changed

+392
-276
lines changed

Some content is hidden

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

54 files changed

+392
-276
lines changed

CHANGELOG.md

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
## 20.0.0
5+
## 20.1.0
66
### General
77
- `IgxTooltipTarget`
88
- **Behavioral Changes**
@@ -11,10 +11,18 @@ All notable changes for each version of this project will be documented in this
1111
- The `showTooltip` and `hideTooltip` methods do not take `showDelay`/`hideDelay` into account.
1212

1313
### New Features
14+
15+
- `IgxOverlay`
16+
- Position Settings now accept a new optional `placement` input property of type `Placement`. Controls where to place the element relative to the target element. Supported values are `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, `bottom-end`, `right`, `right-start`, `right-end`, `left`, `left-start`, `left-end`.
17+
18+
_Note:_ `horizontalDirection`, `horizontalStartPoint`, `verticalDirection`, and `verticalStartPoint` has priority.
19+
20+
- Position Settings now accept a new optional `offset` input property of type `number`. Used to set the offset of the element from the target in pixels when shown in connected, elastic, or auto position strategy.
21+
1422
- `IgxTooltip`
1523
- The tooltip now remains open while interacting with it.
1624
- `IgxTooltipTarget`
17-
- Introduced a new `hasArrow` input property. Controls whether to display an arrow indicator for the tooltip. Defaults to `false`.
25+
- Introduced a new `positionSettings` input property. Controls the position and animation settings used by the tooltip.
1826
- Introduced a new `sticky` input property. When set to `true`, the tooltip renders a default close icon `x`. The tooltip remains visible until the user closes it via the close icon `x` or `Esc` key. Defaults to `false`.
1927
- Introduced a new `closeButtonTemplate` input property that allows templating the default close icon `x`.
2028
```html
@@ -26,16 +34,85 @@ All notable changes for each version of this project will be documented in this
2634
</ng-template>
2735
```
2836

29-
- Introduced a new `placement` input property of type `TooltipPlacement`. Controls where to place the tooltip relative to the target element. Default value is `bottom`. Supported values are `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, `bottom-end`, `right`, `right-start`, `right-end`, `left`, `left-start`, `left-end`.
37+
- Introduced a new `hasArrow` input property. Controls whether to display an arrow indicator for the tooltip. Defaults to `false`.
3038

31-
_Note:_ Positioning the arrow is based on the `placement` property. If `hasArrow` is set to `true`, changing the `placement` property will change the arrow position as well.
39+
_Note:_ The arrow's position takes `positionSettings.placement` property into account. If `hasArrow` is set to `true`, changing the `placement` property will change the arrow position as well.
3240
```html
33-
<igx-icon [igxTooltipTarget]="tooltipRef" [placement]="'top-start'">info</igx-icon>
41+
<igx-icon [igxTooltipTarget]="tooltipRef" [hasArrow]="true" [positionSettings]="settings">info</igx-icon>
3442
<span #tooltipRef="tooltip" igxTooltip>Hello there, I am a tooltip!</span>
3543
```
36-
- Introduced a new `offset` input property. Controls the offset of the tooltip from the target in pixels. Default value is 6.
44+
```ts
45+
public settings: PositionSettings = {
46+
placement: Placement.TopStart
47+
}
48+
```
3749

38-
_Note:_ If a custom `positionStrategy` is used, the `placement` and `offset` properties (if set) will not be taken into account and the arrow (if enabled) will not be displayed.
50+
_Note:_ The tooltip uses the `TooltipPositionStrategy` to position the tooltip and arrow element. If a custom position strategy is used (`overlaySettings.positionStrategy`) and `hasArrow` is set to `true`, the custom strategy should implement the `ITooltipPositionStrategy` interface that exposes the `positionArrow(arrow: HTMLElement, arrowFit: ArrowFit)` method. Otherwise, the arrow will not be displayed.
51+
52+
_Note:_ The arrow element is positioned based on the `positionSettings.placement` property. If `horizontalDirection`, `horizontalStartPoint`, `verticalDirection`, and `verticalStartPoint` are used and the direction and starting point do not correspond to any of the predefined placement values, the arrow is positioned based on `Placement.Bottom` (top middle side of the tooltip).
53+
54+
The arrow can be positioned via a custom position strategy that implements the `positionArrow(arrow: HTMLElement, arrowFit: ArrowFit)` method.
55+
56+
For example:
57+
58+
```ts
59+
export class CustomStrategy extends ConnectedPositioningStrategy implements ITooltipPositionStrategy {
60+
constructor(settings?: PositionSettings) {
61+
super(settings);
62+
}
63+
64+
public positionArrow(arrow: HTMLElement, arrowFit: ArrowFit): void {
65+
Object.assign(arrow.style, {
66+
left: '-0.25rem',
67+
transform: 'rotate(-45deg)',
68+
[arrowFit.direction]: '-0.25rem',
69+
});
70+
}
71+
}
72+
73+
public overlaySettings: OverlaySettings = {
74+
positionStrategy: new CustomStrategy({
75+
offset: 4,
76+
horizontalDirection: HorizontalAlignment.Right,
77+
horizontalStartPoint: HorizontalAlignment.Right,
78+
verticalDirection: VerticalAlignment.Bottom,
79+
verticalStartPoint: VerticalAlignment.Bottom,
80+
})
81+
};
82+
```
83+
84+
```html
85+
<igx-icon [igxTooltipTarget]="tooltipRef" [hasArrow]="true" [overlaySettings]="overlaySettings">info</igx-icon>
86+
<span #tooltipRef="tooltip" igxTooltip>Hello there, I am a tooltip!</span>
87+
```
88+
89+
## 20.0.0
90+
91+
### General
92+
- **Angular 20 Compatibility** - Ignite UI for Angular now plays nice with Angular 20! Upgrade your apps and enjoy the latest features.
93+
- `IgxActionStrip`
94+
- **Behavioral Changes** - When using the Action Strip standalone, outside of Grid, scenarios the component is no longer initially visible and the `hidden` property now defaults to `true`.
95+
- `IgxChip`
96+
- **Behavioral Change** The `variant` is now strictly typed with the union of supported options and no longer accepts invalid values for the default state, provide no value (nullish) instead is needed.
97+
98+
### New Features
99+
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`, `IgxPivotGrid`
100+
- Added a new `igxGridEmpty` template directive that allows assigning the `emptyGridTemplate` declaratively, without the need to get and assign reference, like other grid templates like:
101+
```html
102+
<igx-grid>
103+
<ng-template igxGridEmpty>
104+
<!-- content to show when the grid is empty -->
105+
</ng-template>
106+
</igx-grid>
107+
```
108+
- Added a new `igxGridLoading` template directive that allows assigning the `loadingGridTemplate` declaratively, without the need to get and assign reference, like other grid templates like:
109+
```html
110+
<igx-grid>
111+
<ng-template igxGridLoading>
112+
<!-- content to show when the grid is loading -->
113+
</ng-template>
114+
</igx-grid>
115+
```
39116

40117
## 19.2.0
41118

angular.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@
323323
],
324324
"outputHashing": "none",
325325
"optimization": true,
326-
"externalDependencies": ["lit-html"]
326+
"externalDependencies": ["lit"]
327327
},
328328
"development": {
329329
"optimization": false,

package-lock.json

Lines changed: 17 additions & 103 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
@@ -75,7 +75,7 @@
7575
"express": "^5.1.0",
7676
"fflate": "^0.8.1",
7777
"igniteui-theming": "^18.0.1",
78-
"igniteui-trial-watermark": "^3.0.2",
78+
"igniteui-trial-watermark": "^3.1.0",
7979
"lodash-es": "^4.17.21",
8080
"rxjs": "^7.8.2",
8181
"tslib": "^2.3.0",

projects/igniteui-angular-elements/esbuild.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const config = {
88
minify: false, // temporary disabled due to Webpack issues https://github.com/webpack/webpack/issues/16262
99
outfile: `${ROOT}/elements.js`,
1010
format: 'esm',
11-
external: ['lit-html'],
11+
external: ['lit'],
1212
target: 'es2022',
1313
metafile: true,
1414
treeShaking: true

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

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IgxColumnComponent, IgxGridComponent, IgxHierarchicalGridComponent } from 'igniteui-angular';
2-
import { html } from 'lit-html';
2+
import { html } from 'lit';
33
import { firstValueFrom, fromEvent, skip, timer } from 'rxjs';
44
import { ComponentRefKey, IgcNgElement } from './custom-strategy';
55
import hgridData from '../assets/data/projects-hgrid.js';
@@ -11,6 +11,7 @@ import {
1111
IgcColumnComponent,
1212
IgcPaginatorComponent,
1313
IgcGridStateComponent,
14+
IgcColumnLayoutComponent,
1415
} from './components';
1516
import { defineComponents } from '../utils/register';
1617

@@ -23,6 +24,7 @@ describe('Elements: ', () => {
2324
IgcHierarchicalGridComponent,
2425
IgcPivotGridComponent,
2526
IgcColumnComponent,
27+
IgcColumnLayoutComponent,
2628
IgcPaginatorComponent,
2729
IgcGridStateComponent,
2830
);
@@ -181,5 +183,52 @@ describe('Elements: ', () => {
181183
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 2));
182184
expect(() => stateComponent.getStateAsString()).not.toThrow();
183185
});
186+
187+
it(`should allow manipulating projected columns through the DOM`, async () => {
188+
const innerHtml = `
189+
<igc-grid id="testGrid" primary-key="ProductID">
190+
<igc-column-layout header="Product ID">
191+
<igc-column row-start="1" col-start="1" row-end="3" field="ProductID" header="Product ID" width="25%"></igc-column>
192+
</igc-column-layout>
193+
<igc-column-layout header="Product Details">
194+
<igc-column row-start="1" col-start="1" col-end="3" field="ProductName" header="Product Name"></igc-column>
195+
<igc-column row-start="2" col-start="1" col-end="2" field="CategoryName" header="Category Name" groupable="true"></igc-column>
196+
<igc-column row-start="2" col-start="2" col-end="3" field="ImageUrl"></igc-column>
197+
</igc-column-layout>
198+
<igc-column-layout header="Product Stock">
199+
<igc-column row-start="1" col-start="1" col-end="3" field="InStock" header="In Stock" width="25%"></igc-column>
200+
</igc-column-layout>
201+
</igc-grid>`;
202+
testContainer.innerHTML = innerHtml;
203+
204+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
205+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
206+
207+
const grid = document.querySelector<IgcNgElement & InstanceType<typeof IgcGridComponent>>('#testGrid');
208+
const thirdGroup = document.querySelector<IgcNgElement>('igc-column-layout[header="Product Stock"]');
209+
const secondGroup = document.querySelector<IgcNgElement>('igc-column-layout[header="Product Details"]');
210+
211+
expect(grid.columns.length).toEqual(8);
212+
expect(grid.getColumnByName('ProductID')).toBeTruthy();
213+
expect(grid.getColumnByVisibleIndex(1).field).toEqual('ProductName');
214+
215+
grid.removeChild(secondGroup);
216+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
217+
218+
expect(grid.columns.length).toEqual(4);
219+
expect(grid.getColumnByName('ProductID')).toBeTruthy();
220+
expect(grid.getColumnByVisibleIndex(1).field).toEqual('InStock');
221+
222+
// TODO: secondGroup can't be re-used
223+
const newGroup = document.createElement('igc-column-layout');
224+
const newColumn = document.createElement('igc-column');
225+
newColumn.setAttribute('field', 'ProductName');
226+
newGroup.appendChild(newColumn);
227+
grid.insertBefore(newGroup, thirdGroup);
228+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
229+
230+
expect(grid.columns.length).toEqual(6);
231+
expect(grid.getColumnByVisibleIndex(1).field).toEqual('ProductName');
232+
});
184233
});
185234
});

0 commit comments

Comments
 (0)