igniteui-angular 22.1.0-beta.5 → 22.1.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/igniteui-angular-button-group.mjs +2 -2
- package/fesm2022/igniteui-angular-button-group.mjs.map +1 -1
- package/fesm2022/igniteui-angular-directives.mjs +6 -1
- package/fesm2022/igniteui-angular-directives.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-core.mjs +18 -6
- package/fesm2022/igniteui-angular-grids-core.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs +1 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs.map +1 -1
- package/lib/grids/core/src/filtering/excel-style/themes/_derived.scss +3 -2
- package/migrations/update-22_1_0_import-migration/index.js +88 -60
- package/migrations/update-22_1_0_import-migration/index.spec.js +57 -1
- package/package.json +1 -1
- package/styles/igniteui-angular-dark.css +1 -1
- package/styles/igniteui-angular.css +1 -1
- package/styles/igniteui-bootstrap-dark.css +1 -1
- package/styles/igniteui-bootstrap-light.css +1 -1
- package/styles/igniteui-dark-green.css +1 -1
- package/styles/igniteui-fluent-dark-excel.css +1 -1
- package/styles/igniteui-fluent-dark-word.css +1 -1
- package/styles/igniteui-fluent-dark.css +1 -1
- package/styles/igniteui-fluent-light-excel.css +1 -1
- package/styles/igniteui-fluent-light-word.css +1 -1
- package/styles/igniteui-fluent-light.css +1 -1
- package/styles/igniteui-indigo-dark.css +1 -1
- package/styles/igniteui-indigo-light.css +1 -1
- package/styles/maps/igniteui-angular-dark.css.map +1 -1
- package/styles/maps/igniteui-angular.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-dark.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-light.css.map +1 -1
- package/styles/maps/igniteui-dark-green.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-light.css.map +1 -1
- package/styles/maps/igniteui-indigo-dark.css.map +1 -1
- package/styles/maps/igniteui-indigo-light.css.map +1 -1
- package/types/igniteui-angular-directives.d.ts +1 -1
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
var(--ig-btn-group-selected-bg, #{color($color: 'gray', $variant: 100)}),
|
|
40
40
|
),
|
|
41
41
|
$item-hover-background: var(--item-selected-background),
|
|
42
|
-
$item-hover-text-color: var(--_excel-filtering-foreground, #{color($color: 'gray', $variant: 700)}),
|
|
43
42
|
$item-active-border-color: transparent,
|
|
44
43
|
$item-selected-text-color: var(--_excel-filtering-accent-color, #{if(
|
|
45
44
|
$theme == 'indigo',
|
|
@@ -110,10 +109,12 @@
|
|
|
110
109
|
);
|
|
111
110
|
|
|
112
111
|
@if $theme == 'material' {
|
|
112
|
+
--_excel-filtering-secondary-background: #{dynamic-shade(var(--secondary-background, var(--ig-excel-filtering-secondary-background)), $lightness: 95, $offset: 3)};
|
|
113
|
+
|
|
113
114
|
@include tokens(
|
|
114
115
|
input-group-theme(
|
|
115
116
|
$schema: $schema,
|
|
116
|
-
$box-background: var(--_excel-filtering-background),
|
|
117
|
+
$box-background: dynamic-shade(var(--_excel-filtering-background), $lightness: 95, $offset: 3),
|
|
117
118
|
$idle-bottom-line-color: var(--_excel-filtering-accent-color),
|
|
118
119
|
$idle-text-color: var(--_excel-filtering-foreground),
|
|
119
120
|
$placeholder-color: color-mix(in srgb, var(--_excel-filtering-foreground) 80%, var(--_excel-filtering-background)),
|
|
@@ -81,75 +81,103 @@ function resolveEntryPoint(importPath) {
|
|
|
81
81
|
}
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
84
|
+
/** Sorts specifiers alphabetically by their imported symbol name. */
|
|
85
|
+
const sortByName = (a, b) => a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
86
|
+
/** Collects Ignite UI named imports from the file, in source order. */
|
|
87
|
+
function collectIgImports(sourceFile) {
|
|
88
|
+
const imports = [];
|
|
89
|
+
const visit = (node) => {
|
|
90
|
+
if (ts.isImportDeclaration(node) && (0, tsUtils_1.igNamedImportFilter)(node)) {
|
|
91
|
+
const resolved = resolveEntryPoint(node.moduleSpecifier.text);
|
|
92
|
+
if (resolved) {
|
|
93
|
+
const namedBindings = node.importClause.namedBindings;
|
|
94
|
+
const specifiers = namedBindings.elements.map(element => {
|
|
95
|
+
var _a;
|
|
96
|
+
const name = element.name.text;
|
|
97
|
+
const alias = (_a = element.propertyName) === null || _a === void 0 ? void 0 : _a.text;
|
|
98
|
+
const importName = alias || name;
|
|
99
|
+
const typePrefix = element.isTypeOnly ? 'type ' : '';
|
|
100
|
+
const specifier = alias ? `${importName} as ${name}` : importName;
|
|
101
|
+
return { key: importName, text: `${typePrefix}${specifier}` };
|
|
102
|
+
});
|
|
103
|
+
imports.push({
|
|
104
|
+
node,
|
|
105
|
+
basePackage: resolved.basePackage,
|
|
106
|
+
entry: resolved.entry,
|
|
107
|
+
isTypeOnly: node.importClause.phaseModifier === ts.SyntaxKind.TypeKeyword,
|
|
108
|
+
specifiers
|
|
109
|
+
});
|
|
109
110
|
}
|
|
110
|
-
entryPointGroups.get(move.to).push(fullImport);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
// Keep in the original entry point
|
|
114
|
-
remaining.push(fullImport);
|
|
115
111
|
}
|
|
116
|
-
|
|
117
|
-
// If nothing changed, return null
|
|
118
|
-
if (entryPointGroups.size === 0) {
|
|
119
|
-
return null;
|
|
120
|
-
}
|
|
121
|
-
// Generate new import statements
|
|
122
|
-
const newImports = [];
|
|
123
|
-
// Add remaining imports for the original entry point first
|
|
124
|
-
if (remaining.length > 0) {
|
|
125
|
-
const sortedImports = remaining.sort();
|
|
126
|
-
newImports.push(`import { ${sortedImports.join(', ')} } from '${importPath}';`);
|
|
127
|
-
}
|
|
128
|
-
// Add moved imports
|
|
129
|
-
for (const [entryPoint, imports] of entryPointGroups) {
|
|
130
|
-
const sortedImports = imports.sort();
|
|
131
|
-
newImports.push(`import { ${sortedImports.join(', ')} } from '${source.basePackage}/${entryPoint}';`);
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
start: node.getStart(sourceFile),
|
|
135
|
-
end: node.getEnd(),
|
|
136
|
-
replacement: newImports.join('\n')
|
|
112
|
+
ts.forEachChild(node, visit);
|
|
137
113
|
};
|
|
114
|
+
visit(sourceFile);
|
|
115
|
+
return imports;
|
|
138
116
|
}
|
|
139
117
|
function migrateFile(filePath, content) {
|
|
140
118
|
const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
119
|
+
const imports = collectIgImports(sourceFile);
|
|
120
|
+
// The full module path a specifier ends up in, or null if it stays where it is.
|
|
121
|
+
const movedTo = (imp, spec) => {
|
|
122
|
+
const move = EXPORT_MOVES.get(spec.key);
|
|
123
|
+
return move && move.from === imp.entry ? `${imp.basePackage}/${move.to}` : null;
|
|
124
|
+
};
|
|
125
|
+
// A stable key per output import: its `type` modifier plus module path.
|
|
126
|
+
const importKey = (path, isTypeOnly) => `${isTypeOnly ? 'type ' : ''}${path}`;
|
|
127
|
+
// Imports (module path + type modifier) that gain a moved specifier.
|
|
128
|
+
const mergeTargets = new Set();
|
|
129
|
+
for (const imp of imports) {
|
|
130
|
+
for (const spec of imp.specifiers) {
|
|
131
|
+
const to = movedTo(imp, spec);
|
|
132
|
+
if (to) {
|
|
133
|
+
mergeTargets.add(importKey(to, imp.isTypeOnly));
|
|
147
134
|
}
|
|
148
135
|
}
|
|
149
|
-
ts.forEachChild(node, visit);
|
|
150
136
|
}
|
|
151
|
-
|
|
152
|
-
|
|
137
|
+
// Nothing moves in this file.
|
|
138
|
+
if (mergeTargets.size === 0) {
|
|
139
|
+
return content;
|
|
140
|
+
}
|
|
141
|
+
// Rewrite imports that lose a specifier (sources) or receive one (merge targets).
|
|
142
|
+
const participating = imports.filter(imp => imp.specifiers.some(spec => movedTo(imp, spec)) ||
|
|
143
|
+
mergeTargets.has(importKey(`${imp.basePackage}/${imp.entry}`, imp.isTypeOnly)));
|
|
144
|
+
// Collect the surviving specifiers per output import, retained ones before moved ones.
|
|
145
|
+
const groups = new Map();
|
|
146
|
+
const add = (path, isTypeOnly, spec) => {
|
|
147
|
+
var _a;
|
|
148
|
+
const key = importKey(path, isTypeOnly);
|
|
149
|
+
((_a = groups.get(key)) !== null && _a !== void 0 ? _a : groups.set(key, { path, isTypeOnly, specifiers: [] }).get(key)).specifiers.push(spec);
|
|
150
|
+
};
|
|
151
|
+
for (const imp of participating) {
|
|
152
|
+
const from = `${imp.basePackage}/${imp.entry}`;
|
|
153
|
+
for (const spec of imp.specifiers) {
|
|
154
|
+
if (!movedTo(imp, spec)) {
|
|
155
|
+
add(from, imp.isTypeOnly, spec);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
for (const spec of imp.specifiers) {
|
|
159
|
+
const to = movedTo(imp, spec);
|
|
160
|
+
if (to) {
|
|
161
|
+
add(to, imp.isTypeOnly, spec);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
const newImports = [...groups.values()].map(group => {
|
|
166
|
+
const typeModifier = group.isTypeOnly ? 'type ' : '';
|
|
167
|
+
const specifiers = group.specifiers.sort(sortByName).map(s => s.text).join(', ');
|
|
168
|
+
return `import ${typeModifier}{ ${specifiers} } from '${group.path}';`;
|
|
169
|
+
});
|
|
170
|
+
// Replace the first participating declaration with the merged imports; drop the rest.
|
|
171
|
+
const anchor = participating[0];
|
|
172
|
+
const changes = [
|
|
173
|
+
{ start: anchor.node.getStart(sourceFile), end: anchor.node.getEnd(), replacement: newImports.join('\n') },
|
|
174
|
+
...participating.slice(1).map(imp => ({
|
|
175
|
+
start: imp.node.getFullStart(),
|
|
176
|
+
end: imp.node.getEnd(),
|
|
177
|
+
replacement: ''
|
|
178
|
+
}))
|
|
179
|
+
];
|
|
180
|
+
// Apply changes in reverse order to maintain positions.
|
|
153
181
|
changes.sort((a, b) => b.start - a.start);
|
|
154
182
|
let result = content;
|
|
155
183
|
for (const change of changes) {
|
|
@@ -52,7 +52,7 @@ describe(`Update to ${version}`, () => {
|
|
|
52
52
|
beforeEach(() => {
|
|
53
53
|
appTree = (0, setup_spec_1.setupTestTree)();
|
|
54
54
|
});
|
|
55
|
-
const migrationName = 'migration-
|
|
55
|
+
const migrationName = 'migration-59';
|
|
56
56
|
const filePath = '/testSrc/appPrefix/component/test.component.ts';
|
|
57
57
|
it('should move a single IgxSummaryOperand import from grids/core to core', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
58
58
|
appTree.create(filePath, `import { IgxSummaryOperand } from 'igniteui-angular/grids/core';`);
|
|
@@ -116,6 +116,46 @@ describe(`Update to ${version}`, () => {
|
|
|
116
116
|
expect(tree.readContent(filePath))
|
|
117
117
|
.toEqual(`import { IGroupingDoneEventArgs } from 'igniteui-angular/grids/core';`);
|
|
118
118
|
}));
|
|
119
|
+
it('should move IGroupingDoneEventArgs from grids/grid to grids/core as type import', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
120
|
+
appTree.create(filePath, `import type { IGroupingDoneEventArgs } from 'igniteui-angular/grids/grid';`);
|
|
121
|
+
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
122
|
+
expect(tree.readContent(filePath))
|
|
123
|
+
.toEqual(`import type { IGroupingDoneEventArgs } from 'igniteui-angular/grids/core';`);
|
|
124
|
+
}));
|
|
125
|
+
it('should preserve the type modifier when moving summary operands from grids/core to core', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
+
appTree.create(filePath, `import type { IgxSummaryOperand } from 'igniteui-angular/grids/core';`);
|
|
127
|
+
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
128
|
+
expect(tree.readContent(filePath))
|
|
129
|
+
.toEqual(`import type { IgxSummaryOperand } from 'igniteui-angular/core';`);
|
|
130
|
+
}));
|
|
131
|
+
it('should preserve a per-specifier inline type modifier when moving an export', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
132
|
+
appTree.create(filePath, `import { type IGroupingDoneEventArgs, IgxGridComponent } from 'igniteui-angular/grids/grid';`);
|
|
133
|
+
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
134
|
+
expect(tree.readContent(filePath))
|
|
135
|
+
.toEqual(`import { IgxGridComponent } from 'igniteui-angular/grids/grid';\n` +
|
|
136
|
+
`import { type IGroupingDoneEventArgs } from 'igniteui-angular/grids/core';`);
|
|
137
|
+
}));
|
|
138
|
+
it('should migrate multiple separate import declarations in the same file', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
139
|
+
appTree.create(filePath, `import { IgxSummaryOperand } from 'igniteui-angular/grids/core';\n` +
|
|
140
|
+
`import { IGroupingDoneEventArgs } from 'igniteui-angular/grids/grid';`);
|
|
141
|
+
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
142
|
+
expect(tree.readContent(filePath))
|
|
143
|
+
.toEqual(`import { IgxSummaryOperand } from 'igniteui-angular/core';\n` +
|
|
144
|
+
`import { IGroupingDoneEventArgs } from 'igniteui-angular/grids/core';`);
|
|
145
|
+
}));
|
|
146
|
+
it('should migrate multiple import type declarations in the same file', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
147
|
+
appTree.create(filePath, `import type { IMultiRowLayoutNode, ISelectionNode } from 'igniteui-angular/grids/core';`);
|
|
148
|
+
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
149
|
+
expect(tree.readContent(filePath))
|
|
150
|
+
.toEqual(`import type { IMultiRowLayoutNode, ISelectionNode } from 'igniteui-angular/core';`);
|
|
151
|
+
}));
|
|
152
|
+
it('should merge migrated import type declarations', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
153
|
+
appTree.create(filePath, `import { IgxSummaryResult } from 'igniteui-angular/core';\n` +
|
|
154
|
+
`import { IgxNumberSummaryOperand, IgxSummaryOperand } from 'igniteui-angular/grids/core';`);
|
|
155
|
+
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
156
|
+
expect(tree.readContent(filePath))
|
|
157
|
+
.toEqual(`import { IgxNumberSummaryOperand, IgxSummaryOperand, IgxSummaryResult } from 'igniteui-angular/core';`);
|
|
158
|
+
}));
|
|
119
159
|
it('should split IGroupingDoneEventArgs out of grids/grid, keeping other exports', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
120
160
|
appTree.create(filePath, `import { IgxGridComponent, IGroupingDoneEventArgs } from 'igniteui-angular/grids/grid';`);
|
|
121
161
|
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
@@ -129,4 +169,20 @@ describe(`Update to ${version}`, () => {
|
|
|
129
169
|
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
130
170
|
expect(tree.readContent(filePath)).toEqual(content);
|
|
131
171
|
}));
|
|
172
|
+
it('should merge into an existing core import while leaving unrelated imports untouched', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
173
|
+
appTree.create(filePath, `import { Component, OnInit, ViewChild } from '@angular/core';\n` +
|
|
174
|
+
`import { IgxHierarchicalGridComponent, IgxRowIslandComponent } from 'igniteui-angular/grids/hierarchical-grid';\n` +
|
|
175
|
+
`import { IgxCellTemplateDirective, IgxColumnComponent, IgxNumberSummaryOperand, IgxSummaryOperand } from 'igniteui-angular/grids/core';\n` +
|
|
176
|
+
`import { IgxSummaryResult } from 'igniteui-angular/core';\n` +
|
|
177
|
+
`import { SINGERS } from '../../data/singersData';\n` +
|
|
178
|
+
`import { IgxPreventDocumentScrollDirective } from '../../directives/prevent-scroll.directive';`);
|
|
179
|
+
const tree = yield schematicRunner.runSchematic(migrationName, {}, appTree);
|
|
180
|
+
expect(tree.readContent(filePath))
|
|
181
|
+
.toEqual(`import { Component, OnInit, ViewChild } from '@angular/core';\n` +
|
|
182
|
+
`import { IgxHierarchicalGridComponent, IgxRowIslandComponent } from 'igniteui-angular/grids/hierarchical-grid';\n` +
|
|
183
|
+
`import { IgxCellTemplateDirective, IgxColumnComponent } from 'igniteui-angular/grids/core';\n` +
|
|
184
|
+
`import { IgxNumberSummaryOperand, IgxSummaryOperand, IgxSummaryResult } from 'igniteui-angular/core';\n` +
|
|
185
|
+
`import { SINGERS } from '../../data/singersData';\n` +
|
|
186
|
+
`import { IgxPreventDocumentScrollDirective } from '../../directives/prevent-scroll.directive';`);
|
|
187
|
+
}));
|
|
132
188
|
});
|
package/package.json
CHANGED