Skip to content

Commit 6408297

Browse files
authored
Merge branch '10.1.x' into header-title
2 parents f4414a2 + 99b2c5d commit 6408297

File tree

5 files changed

+72
-8
lines changed

5 files changed

+72
-8
lines changed

projects/igniteui-angular/src/lib/core/styles/components/column-actions/_column-actions-theme.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
display: flex;
113113
flex-flow: column nowrap;
114114
overflow-y: auto;
115+
outline-style: none;
115116
}
116117

117118
%column-actions-item {

projects/igniteui-angular/src/lib/grids/column-actions/column-actions.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ <h4 [attr.id]='titleID' class="igx-column-actions__header-title" *ngIf="title">{
1111
</igx-input-group>
1212
</div>
1313

14-
<div class="igx-column-actions__columns"
14+
<div class="igx-column-actions__columns" tabindex="0"
1515
[style.max-height]="columnsAreaMaxHeight">
1616
<igx-checkbox
1717
*ngFor="let column of columns
1818
| columnActionEnabled:actionsDirective.actionEnabledColumnsFilter:pipeTrigger
1919
| filterActionColumns:filterCriteria:pipeTrigger
2020
| sortActionColumns:columnDisplayOrder:pipeTrigger;"
2121
class="igx-column-actions__columns-item"
22-
22+
2323
(change)="toggleColumn($event, column)"
2424
[checked]="actionsDirective.columnChecked(column)"
2525
[style.margin-left.px]="column.level * indentation">

projects/igniteui-angular/src/lib/grids/toolbar/grid-toolbar.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<span>{{ grid.hiddenColumnsText }}</span>
3232
</div>
3333
</button>
34-
<igx-drop-down #columnHidingDropdown>
34+
<igx-drop-down #columnHidingDropdown (onClosing)="onClosingColumnHiding($event)">
3535
<igx-column-actions
3636
igxColumnHiding
3737
[columns]="grid.columns"
@@ -52,7 +52,7 @@
5252
<span></span>
5353
</div>
5454
</button>
55-
<igx-drop-down #columnPinningDropdown>
55+
<igx-drop-down #columnPinningDropdown (onClosing)="onClosingColumnPinning($event)">
5656
<igx-column-actions
5757
igxColumnPinning
5858
[columns]="grid.columns"

projects/igniteui-angular/src/lib/grids/toolbar/grid-toolbar.component.ts

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import { OverlaySettings, PositionSettings, HorizontalAlignment, VerticalAlignme
3030
import { ConnectedPositioningStrategy } from '../../services/overlay/position';
3131
import { GridType } from '../common/grid.interface';
3232
import { IgxGridIconService } from '../common/grid-icon.service';
33-
import { PINNING_ICONS_FONT_SET, PINNING_ICONS} from '../pinning/pinning-icons';
33+
import { PINNING_ICONS_FONT_SET, PINNING_ICONS } from '../pinning/pinning-icons';
3434
import { GridIconsFeature } from '../common/enums';
3535
import { IgxColumnActionsComponent } from '../column-actions/column-actions.component';
3636
import { IgxColumnHidingDirective } from '../column-actions/column-hiding.directive';
@@ -238,7 +238,7 @@ export class IgxGridToolbarComponent extends DisplayDensityBase implements After
238238
@Optional() public csvExporter: IgxCsvExporterService,
239239
@Optional() @Inject(DisplayDensityToken) protected _displayDensityOptions: IDisplayDensityOptions,
240240
private iconService: IgxGridIconService) {
241-
super(_displayDensityOptions);
241+
super(_displayDensityOptions);
242242
}
243243

244244
private _positionSettings: PositionSettings = {
@@ -407,4 +407,28 @@ export class IgxGridToolbarComponent extends DisplayDensityBase implements After
407407
ngAfterViewInit() {
408408
this.iconService.registerSVGIcons(GridIconsFeature.RowPinning, PINNING_ICONS, PINNING_ICONS_FONT_SET);
409409
}
410+
411+
/**
412+
* @hidden @internal
413+
*/
414+
public onClosingColumnHiding(args) {
415+
const activeElem = document.activeElement;
416+
417+
if (!args.event && activeElem !== this.grid.nativeElement &&
418+
!this.columnHidingButton.nativeElement.contains(activeElem)) {
419+
args.cancel = true;
420+
}
421+
}
422+
423+
/**
424+
* @hidden @internal
425+
*/
426+
public onClosingColumnPinning(args) {
427+
const activeElem = document.activeElement;
428+
429+
if (!args.event && activeElem !== this.grid.nativeElement &&
430+
!this.columnPinningButton.nativeElement.contains(activeElem)) {
431+
args.cancel = true;
432+
}
433+
}
410434
}

projects/igniteui-angular/src/lib/slider/slider.component.spec.ts

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const THUMB_TO_CLASS = '.igx-slider__thumb-to';
1515
const THUMB_FROM_CLASS = '.igx-slider__thumb-from';
1616
const SLIDER_TICKS_ELEMENT = '.igx-slider__ticks';
1717
const SLIDER_TICKS_TOP_ELEMENT = '.igx-slider__ticks--top';
18-
const SLIDER_PRIMARY_GROUP_TICKS_CLASS = '.igx-slider__ticks-group--tall';
1918
const SLIDER_PRIMARY_GROUP_TICKS_CLASS_NAME = 'igx-slider__ticks-group--tall';
19+
const SLIDER_PRIMARY_GROUP_TICKS_CLASS = `.${SLIDER_PRIMARY_GROUP_TICKS_CLASS_NAME}`;
2020
const SLIDER_GROUP_TICKS_CLASS = '.igx-slider__ticks-group';
2121
const SLIDER_TICK_LABELS_CLASS = '.igx-slider__ticks-label';
2222
const SLIDER_TICK_LABELS_HIDDEN_CLASS = 'igx-slider__tick-label--hidden';
@@ -1427,6 +1427,24 @@ describe('IgxSlider', () => {
14271427
expect(secondaryTicks.length).toEqual((expectedPrimary - 1) * expectedSecondary);
14281428
});
14291429

1430+
it('check primary ticks length (16px)', () => {
1431+
const ticks = fixture.debugElement.query(By.css(SLIDER_TICKS_ELEMENT));
1432+
fixture.componentInstance.primaryTicks = 5;
1433+
fixture.detectChanges();
1434+
1435+
const primaryTick = ticks.nativeElement.querySelectorAll(SLIDER_PRIMARY_GROUP_TICKS_CLASS)[0];
1436+
expect(primaryTick.firstElementChild.getBoundingClientRect().height).toEqual(16);
1437+
});
1438+
1439+
it('check secondary ticks length (8px)', () => {
1440+
const ticks = fixture.debugElement.query(By.css(SLIDER_TICKS_ELEMENT));
1441+
fixture.componentInstance.secondaryTicks = 5;
1442+
fixture.detectChanges();
1443+
1444+
const primaryTick = ticks.nativeElement.querySelectorAll(SLIDER_GROUP_TICKS_CLASS)[0];
1445+
expect(primaryTick.firstElementChild.getBoundingClientRect().height).toEqual(8);
1446+
});
1447+
14301448
it('hide/show top and bottom ticks', () => {
14311449
let ticks = fixture.debugElement.nativeElement.querySelector(SLIDER_TICKS_ELEMENT);
14321450
let ticksTop = fixture.debugElement.nativeElement.querySelector(SLIDER_TICKS_TOP_ELEMENT);
@@ -1485,6 +1503,7 @@ describe('IgxSlider', () => {
14851503
verifySecondaryTicsLabelsAreHidden(ticks, false);
14861504
});
14871505

1506+
14881507
it('show/hide secondary tick labels', () => {
14891508
const ticks = fixture.debugElement.query(By.css(SLIDER_TICKS_ELEMENT));
14901509
const primaryTicks = 5;
@@ -1559,6 +1578,25 @@ describe('IgxSlider', () => {
15591578
expect(labelsTopBottom).not.toBeNull();
15601579
expect(labelsBottomTop).toBeNull();
15611580
});
1581+
1582+
it('ticks change should reflect dynamically when slider labels are changed', () => {
1583+
const ticks = fixture.debugElement.query(By.css(SLIDER_TICKS_ELEMENT));
1584+
let labels = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
1585+
slider.labels = labels;
1586+
fixture.detectChanges();
1587+
1588+
let primaryTicks = ticks.nativeElement.querySelectorAll(SLIDER_PRIMARY_GROUP_TICKS_CLASS);
1589+
expect(primaryTicks.length).toEqual(labels.length);
1590+
1591+
labels = labels.splice(0, labels.length - 2);
1592+
slider.labels = labels;
1593+
fixture.detectChanges();
1594+
1595+
primaryTicks = ticks.nativeElement.querySelectorAll(SLIDER_PRIMARY_GROUP_TICKS_CLASS);
1596+
1597+
expect(primaryTicks.length).toEqual(labels.length);
1598+
1599+
});
15621600
});
15631601

15641602
describe('EditorProvider', () => {
@@ -1677,7 +1715,8 @@ export class SliderRtlComponent {
16771715
`
16781716
})
16791717
export class SliderTicksComponent {
1680-
@ViewChild(IgxSliderComponent)
1718+
1719+
@ViewChild(IgxSliderComponent, {static: true})
16811720
public slider: IgxSliderComponent;
16821721

16831722
public primaryTicks = 0;

0 commit comments

Comments
 (0)