Skip to content

Commit 2de7ac7

Browse files
authored
Merge branch 'master' into mdragnev/quickfilter-improvements
2 parents f5e7441 + 65f311c commit 2de7ac7

File tree

23 files changed

+291
-107
lines changed

23 files changed

+291
-107
lines changed

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

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
IgcPaginatorComponent,
1313
IgcGridStateComponent,
1414
IgcColumnLayoutComponent,
15+
IgcActionStripComponent,
16+
IgcGridEditingActionsComponent,
1517
} from './components';
1618
import { defineComponents } from '../utils/register';
1719

@@ -27,6 +29,8 @@ describe('Elements: ', () => {
2729
IgcColumnLayoutComponent,
2830
IgcPaginatorComponent,
2931
IgcGridStateComponent,
32+
IgcActionStripComponent,
33+
IgcGridEditingActionsComponent
3034
);
3135
});
3236

@@ -230,5 +234,66 @@ describe('Elements: ', () => {
230234
expect(grid.columns.length).toEqual(6);
231235
expect(grid.getColumnByVisibleIndex(1).field).toEqual('ProductName');
232236
});
237+
238+
it('should not destroy action strip when row it is shown in is destroyed or cached.', async() => {
239+
const innerHtml = `
240+
<igc-grid id="testGrid" auto-generate>
241+
<igc-action-strip id="testStrip">
242+
<igc-grid-editing-actions add-row="true"></igc-grid-editing-actions>
243+
</igc-action-strip>
244+
</igc-grid>`;
245+
testContainer.innerHTML = innerHtml;
246+
247+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
248+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
249+
250+
const grid = document.querySelector<IgcNgElement & InstanceType<typeof IgcGridComponent>>('#testGrid');
251+
const actionStrip = document.querySelector<IgcNgElement & InstanceType<typeof IgcActionStripComponent>>('#testStrip');
252+
grid.data = SampleTestData.foodProductData();
253+
254+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
255+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
256+
257+
let row = grid.dataRowList.toArray()[0];
258+
actionStrip.show(row);
259+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
260+
261+
expect(actionStrip.hidden).toBeFalse();
262+
263+
grid.data = [];
264+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
265+
266+
// row destroyed
267+
expect((row.cdr as any).destroyed).toBeTrue();
268+
// action strip still in DOM, only hidden.
269+
expect(actionStrip.hidden).toBeTrue();
270+
expect(actionStrip.isConnected).toBeTrue();
271+
272+
grid.data = SampleTestData.foodProductData();
273+
grid.groupBy({ fieldName: 'InStock', dir: 1, ignoreCase: false });
274+
275+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
276+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
277+
278+
row = grid.dataRowList.toArray()[0];
279+
actionStrip.show(row);
280+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
281+
282+
expect(actionStrip.hidden).toBeFalse();
283+
284+
// collapse all data rows, leave only groups
285+
grid.toggleAllGroupRows();
286+
287+
// TODO: Better way to wait - potentially expose the queue or observable for update on the strategy
288+
await firstValueFrom(timer(10 /* SCHEDULE_DELAY */ * 3));
289+
290+
// row not destroyed, but also not in dom anymore
291+
expect((row.cdr as any).destroyed).toBeFalse();
292+
expect(row.element.nativeElement.isConnected).toBe(false);
293+
294+
// action strip still in DOM, only hidden.
295+
expect(actionStrip.hidden).toBeTrue();
296+
expect(actionStrip.isConnected).toBeTrue();
297+
});
233298
});
234299
});

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.spec.ts

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { IgxGridPinningActionsComponent } from './grid-pinning-actions.component
1515
import { IgxActionStripComponent } from '../action-strip.component';
1616
import { IRowDataCancelableEventArgs, IgxColumnComponent } from '../../grids/public_api';
1717
import { SampleTestData } from '../../test-utils/sample-test-data.spec';
18+
import { SortingDirection } from '../../data-operations/sorting-strategy';
1819

1920
describe('igxGridEditingActions #grid ', () => {
2021
let fixture;
@@ -274,6 +275,59 @@ describe('igxGridEditingActions #grid ', () => {
274275

275276
expect(actionStrip.hidden).toBeTrue();
276277
});
278+
279+
it('should auto-hide on delete action click.', () => {
280+
const row = grid.rowList.toArray()[0];
281+
actionStrip.show(row);
282+
fixture.detectChanges();
283+
284+
expect(actionStrip.hidden).toBeFalse();
285+
286+
const deleteIcon = fixture.debugElement.queryAll(By.css(`igx-grid-editing-actions igx-icon`))[1];
287+
expect(deleteIcon.nativeElement.innerText).toBe('delete');
288+
deleteIcon.parent.triggerEventHandler('click', new Event('click'));
289+
fixture.detectChanges();
290+
291+
expect(actionStrip.hidden).toBeTrue();
292+
293+
});
294+
295+
it('should auto-hide if context row is destroyed.', () => {
296+
const row = grid.rowList.toArray()[0];
297+
actionStrip.show(row);
298+
fixture.detectChanges();
299+
300+
expect(actionStrip.hidden).toBeFalse();
301+
302+
// bind to no data, which removes all rows.
303+
grid.data = [];
304+
grid.cdr.detectChanges();
305+
306+
expect((row.cdr as any).destroyed).toBeTrue();
307+
expect(actionStrip.hidden).toBeTrue();
308+
});
309+
310+
it('should auto-hide if context row is cached.', () => {
311+
// create group rows
312+
grid.groupBy({ fieldName: 'ContactTitle', dir: SortingDirection.Desc, ignoreCase: false });
313+
fixture.detectChanges();
314+
315+
// show for first data row
316+
const row = grid.dataRowList.toArray()[0];
317+
actionStrip.show(row);
318+
fixture.detectChanges();
319+
320+
// collapse all groups to cache data rows
321+
grid.toggleAllGroupRows();
322+
fixture.detectChanges();
323+
324+
// not destroyed, but not in DOM anymore
325+
expect((row.cdr as any).destroyed).toBeFalse();
326+
expect(row.element.nativeElement.isConnected).toBe(false);
327+
328+
// action strip should be hidden
329+
expect(actionStrip.hidden).toBeTrue();
330+
});
277331
});
278332

279333
describe('auto show/hide in HierarchicalGrid', () => {

projects/igniteui-angular/src/lib/core/styles/components/carousel/_carousel-theme.scss

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@
247247
background: var-get($theme, 'indicator-dot-color');
248248

249249
@if $variant != 'indigo' {
250-
@include animation('scale-out-center' .15s $ease-out-quad forwards);
251250
inset: rem(1px);
252251
} @else {
253252
width: rem(8px);
@@ -261,11 +260,11 @@
261260
&:hover {
262261
border-color: var-get($theme, 'indicator-active-border-color');
263262

264-
@if $variant == 'indigo' {
265-
&::after {
266-
background: var-get($theme, 'indicator-hover-dot-color');
267-
}
263+
&::after {
264+
background: var-get($theme, 'indicator-hover-dot-color');
265+
}
268266

267+
@if $variant == 'indigo' {
269268
&::before {
270269
position: absolute;
271270
content: '';
@@ -290,7 +289,7 @@
290289
content: '';
291290
width: inherit;
292291
height: inherit;
293-
border: rem(2px) solid var-get($theme, 'indicator-active-dot-color');
292+
border: rem(2px) solid var-get($theme, 'indicator-active-border-color');
294293
inset-inline-start: 0;
295294
top: 0;
296295
border-radius: border-radius(50%);
@@ -304,12 +303,14 @@
304303
}
305304
}
306305

307-
@if $variant == 'indigo' {
308-
&:hover {
309-
&::after {
310-
background: var-get($theme, 'indicator-active-hover-dot-color');
311-
}
306+
&:hover {
307+
border-color: var-get($theme, 'indicator-active-hover-dot-color');
312308

309+
&::after {
310+
background: var-get($theme, 'indicator-active-hover-dot-color');
311+
}
312+
313+
@if $variant == 'indigo' {
313314
&::before {
314315
border-color: var-get($theme, 'indicator-active-hover-dot-color');
315316
}

projects/igniteui-angular/src/lib/core/styles/components/checkbox/_checkbox-theme.scss

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* stylelint-disable max-nesting-depth */
12
@use 'sass:map';
23
@use 'sass:math';
34
@use '../../base' as *;
@@ -49,13 +50,6 @@
4950
'indigo': rem(8px),
5051
), $variant);
5152

52-
$mark-stroke: map.get((
53-
'material': 3,
54-
'fluent': 1,
55-
'bootstrap': 3,
56-
'indigo': 3,
57-
), $variant);
58-
5953
$mark-offset: map.get((
6054
'material': 0,
6155
'fluent': -1px,
@@ -64,7 +58,7 @@
6458
), $variant);
6559

6660
$mark-length: 24;
67-
$mark-x-factor: math.div($mark-stroke, $mark-length);
61+
$mark-x-factor: calc(#{var-get($theme, 'tick-width')} / $mark-length);
6862

6963
$ripple-size: rem(40px);
7064
$ripple-radius: math.div($ripple-size, 2);
@@ -205,7 +199,7 @@
205199
inset: 0;
206200
stroke: var-get($theme, 'tick-color');
207201
stroke-linecap: square;
208-
stroke-width: $mark-stroke;
202+
stroke-width: var-get($theme, 'tick-width');
209203
stroke-dasharray: $mark-length;
210204
stroke-dashoffset: $mark-length;
211205
fill: none;
@@ -366,7 +360,7 @@
366360
%cbx-composite-mark--in {
367361
stroke-dashoffset: 41; /* length of path - adjacent line length */
368362
opacity: 1;
369-
transform: rotate(45deg) translateX(-#{$mark-x-factor}em);
363+
transform: rotate(45deg) translateX(calc(#{$mark-x-factor} * -1em));
370364
}
371365

372366
%cbx-composite-mark--fluent {

projects/igniteui-angular/src/lib/core/styles/components/combo/_combo-theme.scss

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
'material': pad-inline(rem(4px), rem(8px), rem(16px)),
1414
'fluent': pad-inline(rem(2px), rem(4px), rem(8px)),
1515
'bootstrap': pad-inline(rem(4px), rem(8px), rem(16px)),
16-
'indigo': pad-inline(rem(12px))
16+
'indigo': pad-inline(rem(8px), rem(12px), rem(12px))
1717
), $variant);
1818

1919
$search-input-block-padding: map.get((
@@ -73,6 +73,16 @@
7373
igx-input-group {
7474
--theme: #{if($variant == 'indigo', 'indigo', 'material')};
7575
--ig-size: #{if($variant == 'indigo', 2, 1)};
76+
77+
@if $variant == 'bootstrap' or $variant == 'indigo' {
78+
input {
79+
height: rem(28px);
80+
}
81+
} @else if $variant == 'fluent' {
82+
input {
83+
height: rem(32px);
84+
}
85+
}
7686
}
7787
}
7888

@@ -151,6 +161,18 @@
151161
%igx-combo__search {
152162
--igx-input-group-input-suffix-background: transparent;
153163
--igx-input-group-input-suffix-background--focused: transparent;
164+
165+
.igx-input-group__bundle::after {
166+
border-block-end-color: var(--border-color);
167+
}
168+
169+
.igx-input-group__bundle:hover::after {
170+
border-block-end-color: #{if($variant == 'fluent', var(--hover-border-color), var(--border-color))};;
171+
}
172+
173+
.igx-input-group--focused .igx-input-group__bundle::after {
174+
border-block-end-color: var(--focused-bottom-line-color);
175+
}
154176
}
155177
}
156178

projects/igniteui-angular/src/lib/core/styles/components/date-range-picker/_date-range-picker-theme.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@
2323
}
2424
}
2525

26+
igx-date-range-start,
27+
igx-date-range-end {
28+
min-width: 0;
29+
}
30+
2631
igx-date-range-start,
2732
igx-date-range-end,
2833
%igx-date-range-picker__start,
@@ -57,18 +62,18 @@
5762
}
5863

5964
/// Adds typography styles for the igx-date-range-picker component.
60-
/// Uses the 'subtitle-1'
65+
/// Uses the 'caption'
6166
/// categories from the typographic scale.
6267
/// @group typography
63-
/// @param {Map} $categories [(label: 'subtitle-1')] - The categories from the typographic scale used for type styles.
68+
/// @param {Map} $categories [(label: 'caption')] - The categories from the typographic scale used for type styles.
6469
@mixin date-range-typography(
6570
$categories: (
66-
label: 'subtitle-1',
71+
label: 'caption',
6772
)
6873
) {
6974
$label: map.get($categories, 'label');
7075

71-
%igx-date-range__label {
76+
%igx-date-range-picker__label {
7277
@include type-style($label);
7378
}
7479
}

0 commit comments

Comments
 (0)