Skip to content

Commit ae49d35

Browse files
authored
Merge branch 'master' into vslavov/tree-POC
2 parents 73223ad + d1d1cd2 commit ae49d35

File tree

76 files changed

+2686
-451
lines changed

Some content is hidden

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

76 files changed

+2686
-451
lines changed

CHANGELOG.md

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,28 @@ All notable changes for each version of this project will be documented in this
88
- The `igx-drop-down-item` now allows for `igxPrefix`, `igxSuffix` and `igx-divider` directives to be passed as `ng-content` and they will be renderer accordingly in the item's content.
99
- `IgxGrid`
1010
- Added support for exporting grouped data.
11+
- `IgxTreeGrid`
12+
- Added `multipleCascade` row selection mode. In this mode, selecting a record results in the selection of all its children recursively. When only some children are selected, their parent's checkbox is in an indeterminate state.
13+
14+
15+
```html
16+
<igx-tree-grid [rowSelection]="'multipleCascade'">
17+
</igx-tree-grid>
18+
```
1119
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
1220
- Support for `currency` type columns is added in the grid.
21+
- Support for `percent` type columns is added in the grid.
1322
- Added support for filtering based on the formatted cell values using the `FormattedValuesFilteringStrategy` for `IgxGrid`/`IgxHierarchicalGrid` and `TreeGridFormattedValuesFilteringStrategy` for `IgxTreeGrid`.
1423
- `IgxPaginator`
1524
- `paging` and `pagingDone` events are now emitted.
16-
- `IgxInput` now supports `type="file"` and its styling upon all themes.
25+
- `IgxInput` now supports `type="file"` and its styling upon all themes.
1726
_Note: validation of file type input is not yet supported._
27+
- `igxSplitter` now has the following additional outputs:
28+
- `resizeStart` - Emits when pane resizing starts.
29+
- `resizing`- Emits while panes are being resized.
30+
- `resizeEnd` - Emits when pane resizing ends.
31+
32+
All emit with the two panes affected by the resize operation as arguments.
1833

1934
### General
2035
- **Breaking Change** - Many outputs are renamed with the introduction of new rules in Ignite UI for Angular's naming convention. Please, ensure that when you update to 11.1 you do so through
@@ -30,22 +45,27 @@ All notable changes for each version of this project will be documented in this
3045
- `IgxDialog`
3146
- The dialog content has been moved inside the dialog window container in the template. This means that if you have added something in-between the opening and closing tags of the dialog, you may have to adjust its styling a bit since that content is now rendered inside a container that has padding on it.
3247
- `IgxCalendar`
48+
- **Breaking Change**
3349
- A new string enumeration `IgxCalendarView` is exported. Either the new one or the current `CalendarView` can be used. `CalendarView` will be deprecated in a future release.
3450
- `onSelection` is now `selected`
3551
- `onViewChanging` is now `viewChanging`
3652
- `onDateSelection` is now `dateSelection`
3753
- `onYearSelection` is now `yearSelection`
3854
- `onMonthSelection` is now `monthSelection`
3955
- `IgxYearsViewComponent`
56+
- **Breaking Change**
4057
- `onSelection` is now `selected`
4158
- `onYearSelection` is now `yearSelection`
4259
- `IgxDaysViewComponent`
60+
- **Breaking Change**
4361
- `onDateSelection` is now `dateSelection`
4462
- `onViewChanging` is now `viewChanging`
4563
- `IgxMonthsViewComponent`
64+
- **Breaking Change**
4665
- `onSelection` is now `selected`
4766
- `onMonthSelection` is now `monthSelection`
4867
- `IgxMonthPickerComponent`
68+
- **Breaking Change**
4969
- `onSelection` is now `selected`
5070
- `IgxRadioGroup`
5171
- Added new property `alignment` that determines the radio group alignment. Available options are `horizontal` (default) and `vertical`.
@@ -93,7 +113,27 @@ All notable changes for each version of this project will be documented in this
93113
- `page`, `perPage`, `paginate`, `nextPage`, `previousPage` and `totalPages` in the grids are deprecated and will be removed. Use the corresponding `IgxPaginator` outputs/inputs. When using an external paginator, take care to provide the corresponding slice of data. See [`Paging with Custom Template`](https://www.infragistics.com/products/ignite-ui-angular/angular/components/grid/paging#remote-paging-with-custom-template)
94114
- IgxButton
95115
- IgxIcon(s) placed in a button now include margin if there are one or more sibling elements to give them some breathing room. The amount of margin applied depends on the display density of the button.
96-
116+
- `IgxListComponent`
117+
- **Breaking Change** - The following outputs are renamed:
118+
- `onLeftPan` to `leftPan`
119+
- `onRightPan` to `rightPan`
120+
- `onPanStateChange` to `panStateChange`
121+
- `onItemClicked` to `itemClicked`
122+
- `IgxNavbarComponent`
123+
- **Breaking Change** - The `onAction` output is renamed to `action`.
124+
- `IgxTabsComponent`
125+
- **Breaking Change** - The following outputs are renamed:
126+
- `onTabItemSelected` to `tabItemSelected`
127+
- `onTabItemDeselected` to `tabItemDeselected`
128+
- `IgxTooltipTargetDirective`
129+
- **Breaking Change** - The following outputs are renamed:
130+
- `onTooltipShow` to `tooltipShow`
131+
- `onTooltipHide` to `tooltipHide`
132+
- `IgxBaseExporter`, `IgxExcelExporterService`, `IgxCsvExporterService`
133+
- **Breaking Change** - The following outputs are renamed:
134+
- `onColumnExport` to `columnExporting`
135+
- `onRowExport` to `rowExporting`
136+
- `onExportEnded` to `exportEnded`
97137
98138
## 11.0.4
99139

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Tree } from '@angular-devkit/schematics';
22
import * as ts from 'typescript/lib/tsserverlibrary';
3-
import { CUSTOM_TS_PLUGIN_NAME } from './tsUtils';
3+
import { CUSTOM_TS_PLUGIN_NAME, CUSTOM_TS_PLUGIN_PATH } from './tsUtils';
44

55
export class ServerHost implements ts.server.ServerHost {
66
readonly args: string[];
@@ -75,6 +75,7 @@ export class ServerHost implements ts.server.ServerHost {
7575
try {
7676
const paths = [initialPath];
7777
if (moduleName === CUSTOM_TS_PLUGIN_NAME) {
78+
moduleName = CUSTOM_TS_PLUGIN_PATH;
7879
paths.push(__dirname);
7980
}
8081
const modulePath = require.resolve(moduleName, { paths });

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import {
99
SelectorChanges, ThemePropertyChanges, ImportsChanges, MemberChanges
1010
} from './schema';
1111
import {
12-
getLanguageService, getRenamePositions, findMatches,
13-
replaceMatch, createProjectService, isMemberIgniteUI, NG_LANG_SERVICE_PACKAGE_NAME
12+
getLanguageService, getRenamePositions, findMatches, replaceMatch,
13+
createProjectService, isMemberIgniteUI, NG_LANG_SERVICE_PACKAGE_NAME, NG_CORE_PACKAGE_NAME
1414
} from './tsUtils';
1515
import {
1616
getProjectPaths, getWorkspace, getProjects, escapeRegExp,
17-
getPackageManager, canResolvePackage, tryInstallPackage, tryUninstallPackage
17+
getPackageManager, canResolvePackage, tryInstallPackage, tryUninstallPackage, getPackageVersion
1818
} from './util';
1919
import { ServerHost } from './ServerHost';
2020

@@ -30,7 +30,14 @@ export interface BoundPropertyObject {
3030

3131
/* eslint-disable arrow-parens */
3232
export class UpdateChanges {
33-
protected projectService: tss.server.ProjectService;
33+
protected _projectService: tss.server.ProjectService;
34+
public get projectService(): tss.server.ProjectService {
35+
if (!this._projectService) {
36+
this._projectService = createProjectService(this.serverHost);
37+
}
38+
return this._projectService;
39+
}
40+
3441
protected serverHost: ServerHost;
3542
protected workspace: WorkspaceSchema;
3643
protected sourcePaths: string[];
@@ -119,7 +126,6 @@ export class UpdateChanges {
119126
this.importsChanges = this.loadConfig('imports.json');
120127
this.membersChanges = this.loadConfig('members.json');
121128
this.serverHost = new ServerHost(this.host);
122-
this.projectService = createProjectService(this.serverHost);
123129
}
124130

125131
/** Apply configured changes to the Host Tree */
@@ -128,7 +134,13 @@ export class UpdateChanges {
128134
&& !canResolvePackage(NG_LANG_SERVICE_PACKAGE_NAME);
129135
if (shouldInstallPkg) {
130136
this.context.logger.info(`Installing temporary migration dependencies via ${this.packageManager}.`);
131-
tryInstallPackage(this.context, this.packageManager, NG_LANG_SERVICE_PACKAGE_NAME);
137+
// try and get an appropriate version of the package to install
138+
let targetVersion = getPackageVersion(NG_CORE_PACKAGE_NAME) || 'latest';
139+
if (targetVersion.startsWith('11')) {
140+
// TODO: Temporary restrict 11 LS version, till update for new module loading
141+
targetVersion = '11.0.0';
142+
}
143+
tryInstallPackage(this.context, this.packageManager, `${NG_LANG_SERVICE_PACKAGE_NAME}@${targetVersion}`);
132144
}
133145

134146
this.updateTemplateFiles();

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import { TSLanguageService } from './tsPlugin/TSLanguageService';
99

1010
export const IG_PACKAGE_NAME = 'igniteui-angular';
1111
export const NG_LANG_SERVICE_PACKAGE_NAME = '@angular/language-service';
12-
export const CUSTOM_TS_PLUGIN_NAME = './tsPlugin';
12+
export const NG_CORE_PACKAGE_NAME = '@angular/core';
13+
export const CUSTOM_TS_PLUGIN_PATH = './tsPlugin';
14+
export const CUSTOM_TS_PLUGIN_NAME = 'igx-ts-plugin';
1315

1416
/** Returns a source file */
1517
// export function getFileSource(sourceText: string): ts.SourceFile {
@@ -224,14 +226,14 @@ export const createProjectService = (serverHost: tss.server.ServerHost): tss.ser
224226
* Attempts to get type definitions using the TypeScript Language Service.
225227
* Can fall back to a cached version of the TSLS.
226228
*/
227-
const getTypeDefinitions = (langServ: tss.LanguageService, entryPath: string, definition: tss.DefinitionInfo): any =>
229+
const getTypeDefinitions = (langServ: tss.LanguageService, entryPath: string, position: number): any =>
228230
/*
229231
getTypeScriptLanguageService is attached by us to the Typescript Language Service
230232
via a custom made plugin, it's sole purpose is to cache the language service and return it
231233
before any other plugins modify it
232234
*/
233-
langServ.getTypeDefinitionAtPosition(entryPath, definition.textSpan.start)
234-
|| (langServ as TSLanguageService).getTypeScriptLanguageService().getTypeDefinitionAtPosition(entryPath, definition.textSpan.start);
235+
langServ.getTypeDefinitionAtPosition(entryPath, position)
236+
|| (langServ as TSLanguageService).getTypeScriptLanguageService().getTypeDefinitionAtPosition(entryPath, position);
235237

236238
/**
237239
* Get type information about a TypeScript identifier
@@ -251,7 +253,7 @@ export const getTypeDefinitionAtPosition =
251253
if (definition.kind.toString() === 'reference') {
252254
return langServ.getDefinitionAndBoundSpan(entryPath, definition.textSpan.start).definitions[0];
253255
}
254-
let typeDefs = getTypeDefinitions(langServ, entryPath, definition);
256+
let typeDefs = getTypeDefinitions(langServ, entryPath, definition.textSpan.start);
255257
// if there are no type definitions found, the identifier is a ts property, referred in an internal/external template
256258
// or is a reference in a decorator
257259
if (!typeDefs) {
@@ -288,7 +290,7 @@ export const getTypeDefinitionAtPosition =
288290
return null;
289291
}
290292

291-
typeDefs = langServ.getTypeDefinitionAtPosition(definition.fileName, member.name.getStart() + 1);
293+
typeDefs = getTypeDefinitions(langServ, definition.fileName, member.name.getStart() + 1);
292294
}
293295
if (typeDefs?.length) {
294296
return typeDefs[0];

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

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,26 @@ export const getPackageManager = (host: Tree) => {
7878
};
7979

8080
export const canResolvePackage = (pkg: string): boolean => {
81-
let modulePath;
8281
try {
83-
modulePath = require.resolve(pkg);
84-
} finally {
85-
// eslint-disable-next-line no-unsafe-finally
86-
return !!modulePath;
82+
// attempt resolve in child process to keep result out of package.json cache
83+
// otherwise resolve will not read the json again (after install) and won't load the main correctly
84+
// https://stackoverflow.com/questions/59865584/how-to-invalidate-cached-require-resolve-results
85+
execSync(`node -e "require.resolve('${pkg}');"`, { stdio: 'ignore' });
86+
return true;
87+
} catch {
88+
return false;
8789
}
8890
};
8991

92+
export const getPackageVersion = (pkg: string): string => {
93+
let version = null;
94+
try {
95+
version = require(path.posix.join(pkg, 'package.json'))?.version;
96+
} catch {}
97+
98+
return version;
99+
};
100+
90101
export const tryInstallPackage = (context: SchematicContext, packageManager: string, pkg: string) => {
91102
try {
92103
context.logger.debug(`Installing ${pkg} via ${packageManager}.`);

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

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,87 @@
282282
"definedIn": [
283283
"IgxMonthsViewComponent"
284284
]
285+
},
286+
{
287+
"member": "onRowExport",
288+
"replaceWith": "rowExporting",
289+
"definedIn": [
290+
"IgxExcelExporterService",
291+
"IgxCsvExporterService",
292+
"IgxBaseExporter"
293+
]
294+
},
295+
{
296+
"member": "onColumnExport",
297+
"replaceWith": "columnExporting",
298+
"definedIn": [
299+
"IgxExcelExporterService",
300+
"IgxCsvExporterService",
301+
"IgxBaseExporter"
302+
]
303+
},
304+
{
305+
"member": "onAction",
306+
"replaceWith": "action",
307+
"definedIn": [
308+
"IgxNavbarComponent"
309+
]
310+
},
311+
{
312+
"member": "onLeftPan",
313+
"replaceWith": "leftPan",
314+
"definedIn": [
315+
"IgxListComponent"
316+
]
317+
},
318+
{
319+
"member": "onRightPan",
320+
"replaceWith": "rightPan",
321+
"definedIn": [
322+
"IgxListComponent"
323+
]
324+
},
325+
{
326+
"member": "onPanStateChange",
327+
"replaceWith": "panStateChange",
328+
"definedIn": [
329+
"IgxListComponent"
330+
]
331+
},
332+
{
333+
"member": "onItemClicked",
334+
"replaceWith": "itemClicked",
335+
"definedIn": [
336+
"IgxListComponent"
337+
]
338+
},
339+
{
340+
"member": "onTabItemSelected",
341+
"replaceWith": "tabItemSelected",
342+
"definedIn": [
343+
"IgxTabsComponent"
344+
]
345+
},
346+
{
347+
"member": "onTabItemDeselected",
348+
"replaceWith": "tabItemDeselected",
349+
"definedIn": [
350+
"IgxTabsComponent"
351+
]
352+
},
353+
{
354+
"member": "onTooltipShow",
355+
"replaceWith": "tooltipShow",
356+
"definedIn": [
357+
"IgxTooltipTargetDirective"
358+
]
359+
},
360+
{
361+
"member": "onTooltipHide",
362+
"replaceWith": "tooltipHide",
363+
"definedIn": [
364+
"IgxTooltipTargetDirective"
365+
]
285366
}
286367
]
287368
}

0 commit comments

Comments
 (0)