Skip to content

Commit f44e44e

Browse files
authored
Merge branch 'master' into skrastev/fix-9158
2 parents ac1d77f + e2eafda commit f44e44e

File tree

7 files changed

+57
-28
lines changed

7 files changed

+57
-28
lines changed

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

+17-1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ describe('UpdateChanges', () => {
6565
'test2.component.html',
6666
'<igx-remove attr></igx-remove><igx-component>'
6767
);
68+
appTree.create(
69+
'test3.component.html',
70+
'<igx-remove-me-not attr></igx-remove-me-not> <igx-component> <igx-component-child></igx-component-child> </igx-component>'
71+
);
6872

6973
const update = new UnitUpdateChanges(__dirname, appTree);
7074
expect(fs.existsSync).toHaveBeenCalledWith(jsonPath);
@@ -74,6 +78,9 @@ describe('UpdateChanges', () => {
7478
update.applyChanges();
7579
expect(appTree.readContent('test.component.html')).toEqual('<igx-replaced> <content> </igx-replaced> ');
7680
expect(appTree.readContent('test2.component.html')).toEqual('<igx-replaced>');
81+
expect(appTree.readContent('test3.component.html')).toEqual(
82+
'<igx-remove-me-not attr></igx-remove-me-not> <igx-replaced> <igx-component-child></igx-component-child> </igx-replaced>'
83+
);
7784
done();
7885
});
7986

@@ -175,7 +182,7 @@ describe('UpdateChanges', () => {
175182
});
176183
spyOn<any>(fs, 'readFileSync').and.callFake(() => JSON.stringify(inputJson));
177184

178-
const fileContent = `<one [replaceMe]="a"> <comp\r\ntag [replaceMe]="dwdw" [oldProp]=''> </other> <another oldProp="b" />`;
185+
let fileContent = `<one [replaceMe]="a"> <comp\r\ntag [replaceMe]="dwdw" [oldProp]=''> </other> <another oldProp="b" />`;
179186
appTree.create('test.component.html', fileContent);
180187

181188
const update = new UnitUpdateChanges(__dirname, appTree);
@@ -213,6 +220,15 @@ describe('UpdateChanges', () => {
213220
update4.applyChanges();
214221
expect(appTree.readContent('test.component.html')).toEqual(
215222
`<comp\r\ntag [oldProp]="g" [replaced]="NOT.replaceMe" ><another [otherProp]="oldProp" /></comp>`);
223+
224+
225+
fileContent = `<span [bait]="replaceMe"><ng-container ngProjectAs="comp"> sike! </ng-container></span>`;
226+
appTree.overwrite('test.component.html', fileContent);
227+
update4.applyChanges();
228+
expect(appTree.readContent('test.component.html')).toEqual(
229+
`<span [bait]="replaceMe"><ng-container ngProjectAs="comp"> sike! </ng-container></span>`
230+
);
231+
216232
done();
217233
});
218234

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ export class UpdateChanges {
198198
regSource = String.raw`\<${change.selector}[\s\S]*?\<\/${change.selector}\>`;
199199
replace = '';
200200
} else {
201-
regSource = String.raw`\<(\/?)${change.selector}`;
201+
regSource = String.raw`\<(\/?)${change.selector}(?=[\s\>])`;
202202
replace = `<$1${change.replaceWith}`;
203203
}
204204
break;
@@ -276,6 +276,9 @@ export class UpdateChanges {
276276
}
277277

278278
const matches = fileContent.match(new RegExp(searchPattern, 'g'));
279+
if (!matches) {
280+
continue;
281+
}
279282

280283
for (const match of matches) {
281284
let replaceStatement = replace;

projects/igniteui-angular/src/lib/core/styles/base/utilities/_mixins.scss

+6-4
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,16 @@
161161
///
162162
@mixin igx-palette-vars($palette, $contrast: true) {
163163
$scope: if(is-root(), ':root', '&');
164-
$theme: map-get(map-get($palette, '_meta'), 'variant');
164+
$_meta: map-get($palette, '_meta');
165+
$theme: if($_meta, map-get($_meta, 'variant'), null);
165166

166167
#{$scope} {
167168
@each $name, $color in $palette {
168169
@each $variant, $value in $color {
169-
$valid: not(str-index(#{$variant}, 'contrast')) and not(str-index(#{$variant}, 'variant'));
170+
$_valid-base: type-of(map-get($color, 500)) == 'color' and $theme;
171+
$_valid-variant: not(str-index(#{$variant}, 'contrast')) and not(str-index(#{$variant}, 'variant')) and $theme;
170172

171-
@if($variant == 500) {
173+
@if $_valid-base and $variant == 500 {
172174
--igx-#{$name}-h: #{round(hue($value))};
173175
--igx-#{$name}-s: #{round(saturation($value))};
174176
--igx-#{$name}-l: #{round(lightness($value))};
@@ -180,7 +182,7 @@
180182
}
181183
}
182184

183-
@if $valid {
185+
@if $_valid-base and $_valid-variant {
184186
--igx-#{$name}-#{$variant}: #{_gen-hsla-color($name, $variant, $theme)};
185187
} @else if $name != '_meta' {
186188
--igx-#{$name}-#{$variant}: #{$value};

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -3255,7 +3255,8 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
32553255
((event.target === this.tbody.nativeElement && this.navigation.activeNode.row >= 0 &&
32563256
this.navigation.activeNode.row < this.dataView.length)
32573257
|| (event.target === this.theadRow.nativeElement && this.navigation.activeNode.row === -1)
3258-
|| (event.target === this.tfoot.nativeElement && this.navigation.activeNode.row === this.dataView.length)) &&
3258+
|| (event.target === this.tfoot.nativeElement.children[0] &&
3259+
this.navigation.activeNode.row === this.dataView.length)) &&
32593260
!(this.rowEditable && this.crudService.rowEditingBlocked && this.crudService.rowInEditMode)) {
32603261
this.navigation.lastActiveNode = this.navigation.activeNode;
32613262
this.navigation.activeNode = {} as IActiveNode;

projects/igniteui-angular/src/lib/grids/grid-navigation.service.ts

+1
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,7 @@ export class IgxGridNavigationService {
529529
this.grid.getNextCell(this.activeNode.row, this.activeNode.column, col => col.editable);
530530
if (!this.grid.crudService.rowInEditMode && this.isActiveNode(next.rowIndex, next.visibleColumnIndex)) {
531531
this.grid.crudService.endEdit(true, event);
532+
this.grid.tbody.nativeElement.focus();
532533
return;
533534
}
534535
event.preventDefault();

src/styles/_demo-theme.scss

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ body {
99
color: $igx-foreground-color;
1010
}
1111

12+
:root {
13+
--some-dynamic-color: hsl(#{random(360)}, 100%, 50%);
14+
}
15+
1216
@include igx-core($direction: $direction);
1317
@include igx-typography($font-family: $typeface, $type-scale: $type-scale);
1418
@include igx-theme($palette: $palette, $schema: $schema, $legacy-support: $legacy-support);

src/styles/_variables.scss

+23-21
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,26 @@ $handmade-palette: (
7373
'A700-contrast': white
7474
),
7575
grays: (
76-
50: rgba(0, 0, 0, .02),
77-
'50-contrast': black,
78-
100: rgba(0, 0, 0, .04),
79-
'100-contrast': black,
80-
200: rgba(0, 0, 0, .08),
81-
'200-contrast': black,
82-
300: rgba(0, 0, 0, .12),
83-
'300-contrast': black,
84-
400: rgba(0, 0, 0, .26),
85-
'400-contrast': black,
86-
500: rgba(0, 0, 0, .38),
76+
50: rgba(255, 255, 255, .02),
77+
'50-contrast': white,
78+
100: rgba(255, 255, 255, .04),
79+
'100-contrast': white,
80+
200: rgba(255, 255, 255, .08),
81+
'200-contrast': white,
82+
300: rgba(255, 255, 255, .12),
83+
'300-contrast': white,
84+
400: rgba(255, 255, 255, .26),
85+
'400-contrast': white,
86+
500: rgba(255, 255, 255, .38),
8787
'500-contrast': black,
88-
600: rgba(0, 0, 0, .54),
89-
'600-contrast': white,
90-
700: rgba(0, 0, 0, .62),
91-
'700-contrast': white,
92-
800: rgba(0, 0, 0, .74),
93-
'800-contrast': white,
94-
900: rgba(0, 0, 0, .87),
95-
'900-contrast': white
88+
600: rgba(255, 255, 255, .54),
89+
'600-contrast': black,
90+
700: rgba(255, 255, 255, .62),
91+
'700-contrast': black,
92+
800: rgba(255, 255, 255, .74),
93+
'800-contrast': black,
94+
900: rgba(255, 255, 255, .87),
95+
'900-contrast': black
9696
),
9797
info: (
9898
500: #1377d5,
@@ -111,7 +111,9 @@ $handmade-palette: (
111111
'500-contrast': black
112112
),
113113
surface: (
114-
500: #fff,
115-
'500-contrast': black
114+
500: #222,
115+
'500-contrast': white
116116
)
117117
);
118+
119+
// $palette: $handmade-palette;

0 commit comments

Comments
 (0)