Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ All notable changes for each version of this project will be documented in this
- `ticksOrientation` input was added. Allows to change ticks orientation to top|bottom|mirror.
- `tickLabelsOrientation` input was added. Allows you to change the rotation of all tick labels from horizontal to vertical(toptobottom, bottomtotop).
- `igxSliderTickLabel` directive has been introduced. Allows you to set a custom template for all tick labels.
- `isContinuous` - input has been deleted. The option is not supported anymore.

- `IgxCarousel`:
- `keyboardSupport` input is added, which can be used to enable and disable keyboard navigation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"@scheme": "../../common/schema/binding.schema.json",
"changes": [
{
"name": "isContinuous",
"replaceWith": "continuous",
"owner": {
"selector": "igx-slider",
"type": "component"
}
}
]
}
19 changes: 19 additions & 0 deletions projects/igniteui-angular/src/lib/core/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { Injectable, PLATFORM_ID, Inject } from '@angular/core';
import { isPlatformBrowser } from '@angular/common';
import { Observable } from 'rxjs';
import ResizeObserver from 'resize-observer-polyfill';

/**
*@hidden
Expand Down Expand Up @@ -321,3 +323,20 @@ export const NAVIGATION_KEYS = new Set([
export const ROW_EXPAND_KEYS = new Set('right down arrowright arrowdown'.split(' '));
export const ROW_COLLAPSE_KEYS = new Set('left up arrowleft arrowup'.split(' '));
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'tab', 'enter', 'f2', 'escape', 'esc']);

/**
* @hidden
* @internal
*
* Creates a new ResizeObserver on `target` and returns it as an Observable.
*/
export function resizeObservable(target: HTMLElement): Observable<ResizeObserverEntry[]> {
return new Observable((observer) => {
const instance = new ResizeObserver((entries: ResizeObserverEntry[]) => {
observer.next(entries);
});
instance.observe(target);
const unsubscribe = () => instance.disconnect();
return unsubscribe;
});
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, NgModule, Input, TemplateRef, HostBinding, ElementRef } from '@angular/core';
import { Component, Input, TemplateRef, HostBinding, ElementRef } from '@angular/core';
import { SliderHandle } from '../slider.common';

@Component({
Expand Down
12 changes: 6 additions & 6 deletions projects/igniteui-angular/src/lib/slider/slider.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@ export enum SliderHandle {
* Slider Tick labels Orientation
*/
export enum TickLabelsOrientation {
horizontal,
toptobottom,
bottomtotop
Horizontal,
TopToBottom,
BottomToTop
}

/**
* Slider Ticks orientation
*/
export enum TicksOrientation {
top,
bottom,
mirror
Top,
Bottom,
Mirror
}
Original file line number Diff line number Diff line change
Expand Up @@ -1400,7 +1400,7 @@ describe('IgxSlider', () => {
expect(ticksTop).toBeNull();

fixture.componentInstance.showTicks = true;
fixture.componentInstance.ticksOrientation = TicksOrientation.mirror;
fixture.componentInstance.ticksOrientation = TicksOrientation.Mirror;
fixture.detectChanges();

ticks = fixture.debugElement.nativeElement.querySelector(SLIDER_TICKS_ELEMENT);
Expand Down Expand Up @@ -1470,7 +1470,7 @@ describe('IgxSlider', () => {

expect(bottomTicks).not.toBeNull();

fixture.componentInstance.ticksOrientation = TicksOrientation.top;
fixture.componentInstance.ticksOrientation = TicksOrientation.Top;
fixture.detectChanges();

let topTIcks = fixture.debugElement.nativeElement.querySelector(SLIDER_TICKS_TOP_ELEMENT);
Expand All @@ -1479,7 +1479,7 @@ describe('IgxSlider', () => {
expect(topTIcks).not.toBeNull();
expect(bottomTicks).toBeNull();

fixture.componentInstance.ticksOrientation = TicksOrientation.mirror;
fixture.componentInstance.ticksOrientation = TicksOrientation.Mirror;
fixture.detectChanges();

topTIcks = fixture.debugElement.nativeElement.querySelector(SLIDER_TICKS_TOP_ELEMENT);
Expand All @@ -1499,15 +1499,15 @@ describe('IgxSlider', () => {
expect(labelsBottomTop).toBeNull();
expect(labelsTopBottom).toBeNull();

fixture.componentInstance.tickLabelsOrientation = TickLabelsOrientation.bottomtotop;
fixture.componentInstance.tickLabelsOrientation = TickLabelsOrientation.BottomToTop;
fixture.detectChanges();

labelsBottomTop = nativeElem.querySelector(BOTTOM_TO_TOP_TICK_LABLES);
labelsTopBottom = nativeElem.querySelector(TOP_TO_BOTTOM_TICK_LABLES);
expect(labelsBottomTop).not.toBeNull();
expect(labelsTopBottom).toBeNull();

fixture.componentInstance.tickLabelsOrientation = TickLabelsOrientation.toptobottom;
fixture.componentInstance.tickLabelsOrientation = TickLabelsOrientation.TopToBottom;
fixture.detectChanges();

labelsBottomTop = nativeElem.querySelector(BOTTOM_TO_TOP_TICK_LABLES);
Expand Down Expand Up @@ -1596,10 +1596,10 @@ export class SliderTicksComponent {
public primaryTicks = 0;
public secondaryTicks = 0;
public showTicks = true;
public ticksOrientation = TicksOrientation.bottom;
public ticksOrientation = TicksOrientation.Bottom;
public primaryTickLabels = true;
public secondaryTickLabels = true;
public tickLabelsOrientation = TickLabelsOrientation.horizontal;
public tickLabelsOrientation = TickLabelsOrientation.Horizontal;
}
@Component({
selector: 'igx-slider-test-component',
Expand Down
Loading