Skip to content

Commit 2acec3a

Browse files
committed
merge labels feature slider
1 parent 147bb32 commit 2acec3a

File tree

11 files changed

+1009
-496
lines changed

11 files changed

+1009
-496
lines changed

CHANGELOG.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ In order to turn them off, you need to pass an argument and set it to `false`
99
@include igx-core($print-layout: false);
1010
```
1111

12-
- `Pager`
13-
- **Behavioral Change** - The pager is now hidden when there are no records in the grid.
14-
1512
## 7.3.1
1613
- `IgxGrid` Custom keyboard navigation
1714
- `onFocusChange` event is deprecated.
@@ -63,6 +60,14 @@ In order to turn them off, you need to pass an argument and set it to `false`
6360
</igx-drop-down>
6461
```
6562

63+
## 7.2.12
64+
### New feature
65+
- **igxSlider** - exposing new `labels` property accepting a collection of literal values that become equally spread over the slider, by placing each element as a thumb label.
66+
67+
## 7.2.9
68+
- `Pager`
69+
- **Behavioral Change** - The pager is now hidden when there are no records in the grid.
70+
6671
## 7.2.6
6772
- `igxGrid`
6873
- **Feature** The `groupsRecords` property now returns the full grouping tree as in 7.1 and also includes the grouping information for all pages.

projects/igniteui-angular/src/lib/core/styles/components/slider/_slider-theme.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
width: 100%;
135135
height: inherit;
136136
background: --var($theme, 'track-color');
137-
transform-origin: 0 0 0;
137+
transform-origin: left center;
138138
transform: scaleX(0);
139139
}
140140

projects/igniteui-angular/src/lib/slider/README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# igx-slider
22

3+
### The latest version of the SPEC could be found in the [Wiki](https://github.com/IgniteUI/igniteui-angular/wiki/igxSlider-Specification).
4+
35
The slider component allows users to select a value in certain range or select a range of values.
46
Based on its configuration it's a slider or range slider.
57
A walkthrough of how to get started can be found [here](https://www.infragistics.com/products/ignite-ui-angular/angular/components/slider.html)
@@ -60,7 +62,7 @@ import { IgxSliderComponent } from "../../../src/main";
6062
| :--- | :--- | :--- |
6163
| id | string | Unique identifier of the component. If not provided it will be automatically generated.|
6264
| disabled | boolean | Disables or enables UI interaction. |
63-
| isContinuous | boolean | Marks slider as continuous. By default is considered that the slider is discrete. Discrete slider does not have ticks and does not shows bubble labels for values. |
65+
| continuous | boolean | Marks slider as continuous. By default is considered that the slider is discrete. Discrete slider does not have ticks and does not shows bubble labels for values. |
6466
| lowerBound | number | The lower boundary of the slider value. If not set is the same as min value. |
6567
| maxValue | number | The maximal value for the slider. |
6668
| minValue | number | The minimal value for the slider. |
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,41 @@
1-
<div class="igx-slider" [class.igx-slider--disabled]="disabled" #slider (panstart)="showThumbsLabels()" (panend)="onPanEnd($event)"
2-
(pan)="update($event)" (tap)="onTap($event)">
1+
<div
2+
#slider
3+
class="igx-slider"
4+
[class.igx-slider--disabled]="disabled"
5+
(pointerdown)="findClosestThumb($event)"
6+
(pan)="update($event.srcEvent.clientX)"
7+
(tap)="onTap($event)">
38
<div class="igx-slider__track">
49
<div #track class="igx-slider__track-fill"></div>
510
<div #ticks class="igx-slider__track-ticks"></div>
611
</div>
712
<div class="igx-slider__thumbs">
8-
<div (keydown)="onKeyDown($event);" (keyup)="hideThumbsLabels()" (blur)="hideThumbLabelsOnBlur()" (focus)="onFocus($event);"
9-
*ngIf="isRange" class="igx-slider__thumb-from" tabindex="1" [ngClass]="{ 'igx-slider__thumb-from--active': isActiveLabel }"
10-
#thumbFrom>
11-
<span class="label">{{ lowerValue}}</span>
12-
<span class="dot"></span>
13-
</div>
14-
<div (keydown)="onKeyDown($event);" (keyup)="hideThumbsLabels()" (blur)="hideThumbLabelsOnBlur()" (focus)="onFocus($event);"
15-
class="igx-slider__thumb-to" tabindex="1" [ngClass]="{ 'igx-slider__thumb-to--active': isActiveLabel }" #thumbTo>
16-
<span *ngIf="isRange" class="label">{{ upperValue}}</span>
17-
<span *ngIf="!isRange" class="label">{{ value }}</span>
18-
<span class="dot"></span>
19-
</div>
13+
<igx-thumb *ngIf="isRange"
14+
#thumbFrom
15+
[type]="0"
16+
[value]="lowerLabel"
17+
[disabled]="disabled"
18+
[continuous]="continuous"
19+
[onPan]="onPan"
20+
[stepDistance]="stepDistance"
21+
[step]="step"
22+
[fromHandler]="true"
23+
[templateRef]="thumbFromTemplateRef"
24+
[context]="context"
25+
(onChange)="onThumbChange()"
26+
[thumbLabelVisibilityDuration]="thumbLabelVisibilityDuration"></igx-thumb>
27+
<igx-thumb
28+
#thumbTo
29+
[type]="1"
30+
[value]="upperLabel"
31+
[disabled]="disabled"
32+
[continuous]="continuous"
33+
[onPan]="onPan"
34+
[stepDistance]="stepDistance"
35+
[step]="step"
36+
[templateRef]="thumbToTemplateRef"
37+
[context]="context"
38+
(onChange)="onThumbChange()"
39+
[thumbLabelVisibilityDuration]="thumbLabelVisibilityDuration"></igx-thumb>
2040
</div>
2141
</div>

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -385,9 +385,9 @@ describe('IgxSlider', () => {
385385
expect((slider.value as IRangeSliderValue).upper).toBe(slider.upperBound);
386386
});
387387

388-
it('should switch from left thumb to be focused upper when lower value is near upper', () => {
388+
it('should switch from left thumb to be focused upper when lower value is equal to upper', () => {
389389
slider.value = {
390-
lower: 59,
390+
lower: 60,
391391
upper: 60
392392
};
393393

@@ -398,14 +398,14 @@ describe('IgxSlider', () => {
398398
UIInteractions.triggerKeyDownEvtUponElem('ArrowRight', fromThumb, true);
399399
fixture.detectChanges();
400400

401-
expect((slider.value as IRangeSliderValue).lower).toBe(59);
401+
expect((slider.value as IRangeSliderValue).lower).toBe(60);
402402
expect((slider.value as IRangeSliderValue).upper).toBe(60);
403403
expect(document.activeElement).toBe(fixture.nativeElement.querySelector('.igx-slider__thumb-to'));
404404
});
405405

406-
it('should switch from right thumb to be focused lower when upper value is near lower', () => {
406+
it('should switch from right thumb to be focused lower when upper value is equal to lower', () => {
407407
slider.value = {
408-
lower: 59,
408+
lower: 60,
409409
upper: 60
410410
};
411411
fixture.detectChanges();
@@ -415,7 +415,7 @@ describe('IgxSlider', () => {
415415
UIInteractions.triggerKeyDownEvtUponElem('ArrowLeft', toThumb, true);
416416
fixture.detectChanges();
417417

418-
expect((slider.value as IRangeSliderValue).lower).toBe(59);
418+
expect((slider.value as IRangeSliderValue).lower).toBe(60);
419419
expect((slider.value as IRangeSliderValue).upper).toBe(60);
420420
expect(document.activeElement).toBe(fixture.nativeElement.querySelector('.igx-slider__thumb-from'));
421421
});

0 commit comments

Comments
 (0)