-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stark-demo): add Slider component to the Showcase Demo
ISSUES CLOSED: #561
- Loading branch information
1 parent
436e215
commit 0c75595
Showing
25 changed files
with
831 additions
and
98 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
packages/stark-ui/src/modules/slider/components/slider.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
<div [ngClass]="{'horizontal': isHorizontal, 'vertical': !isHorizontal}"> | ||
<div [id]="sliderId" class="slider" [attr.disabled]="isDisabled"></div> | ||
<div [id]="sliderId" class="slider" [attr.disabled]="isDisabled ? '' : null"></div> | ||
<!-- for the disabled attribute solution see: https://github.com/angular/angular/issues/13940 answer by Zec2703 --> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from "./slider.component"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
<example-viewer [extensions]="['HTML', 'SCSS', 'TS']" | ||
filesPath="slider/simple-horizontal-slider" | ||
exampleTitle="SHOWCASE.DEMO.SLIDER.SIMPLE_HORIZONTAL_SLIDER"> | ||
<div> | ||
<stark-slider [values]="simpleHorizontalSliderValues" | ||
sliderId="simple-horizontal-slider" | ||
[sliderConfig]="simpleHorizontalSliderConfig" | ||
[isDisabled]="!isSimpleHorizontalSliderEnabled" | ||
(changed)="onChangeSimpleHorizontalSlider($event)"> | ||
</stark-slider> | ||
<div> | ||
<mat-checkbox class="slider-enabled-field" | ||
(change)="$event ? toggleSimpleHorizontalSliderEnable() : null" | ||
[checked]="isSimpleHorizontalSliderEnabled"> | ||
{{ 'SHOWCASE.COMMON.ENABLED' | translate }} | ||
</mat-checkbox> | ||
<mat-form-field class="slider-value-field"> | ||
<input matInput | ||
placeholder="{{ 'SHOWCASE.COMMON.VALUE' | translate }}" | ||
type="number" | ||
step="10" | ||
[(ngModel)]="valueForSimpleHorizontalSlider" | ||
[disabled]="!isSimpleHorizontalSliderEnabled" | ||
(change)="onChangeValueForSimpleHorizontalSlider($event)"> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
</example-viewer> | ||
|
||
<example-viewer [extensions]="['HTML', 'SCSS', 'TS']" | ||
filesPath="slider/horizontal-range-slider" | ||
exampleTitle="SHOWCASE.DEMO.SLIDER.HORIZONTAL_RANGE_SLIDER"> | ||
<div> | ||
<stark-slider [values]="horizontalRangeSliderValues" | ||
sliderId="horizontal-range-slider" | ||
[sliderConfig]="horizontalRangeSliderConfig" | ||
[isDisabled]="!isHorizontalRangeSliderEnabled" | ||
(changed)="onChangeHorizontalRangeSlider($event)"> | ||
</stark-slider> | ||
<div> | ||
<mat-checkbox class="slider-enabled-field" | ||
(change)="$event ? toggleHorizontalRangeSliderEnable() : null" | ||
[checked]="isHorizontalRangeSliderEnabled"> | ||
{{ 'SHOWCASE.COMMON.ENABLED' | translate }} | ||
</mat-checkbox> | ||
<mat-form-field class="slider-value-field"> | ||
<input matInput | ||
placeholder="{{ 'SHOWCASE.COMMON.VALUE' | translate }} 1" | ||
type="number" | ||
step="10" | ||
[(ngModel)]="lowerValueForHorizontalRangeSlider" | ||
[disabled]="!isHorizontalRangeSliderEnabled" | ||
(change)="onChangeValueForHorizontalRangeSlider($event, SLIDER_HANDLES.lower)"> | ||
</mat-form-field> | ||
<mat-form-field class="slider-value-field"> | ||
<input matInput | ||
placeholder="{{ 'SHOWCASE.COMMON.VALUE' | translate }} 2" | ||
type="number" | ||
step="10" | ||
[(ngModel)]="upperValueForHorizontalRangeSlider" | ||
[disabled]="!isHorizontalRangeSliderEnabled" | ||
(change)="onChangeValueForHorizontalRangeSlider($event, SLIDER_HANDLES.upper)"> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
</example-viewer> | ||
|
||
<example-viewer [extensions]="['HTML', 'SCSS', 'TS']" | ||
filesPath="slider/simple-vertical-slider" | ||
exampleTitle="SHOWCASE.DEMO.SLIDER.SIMPLE_VERTICAL_SLIDER"> | ||
<div> | ||
<stark-slider [values]="simpleVerticalSliderValues" | ||
sliderId="simple-vertical-slider" | ||
[sliderConfig]="simpleVerticalSliderConfig" | ||
[isDisabled]="!isSimpleVerticalSliderEnabled" | ||
(changed)="onChangeSimpleVerticalSlider($event)"> | ||
</stark-slider> | ||
<div> | ||
<mat-checkbox class="slider-enabled-field" | ||
(change)="$event ? toggleSimpleVerticalSliderEnable() : null" | ||
[checked]="isSimpleVerticalSliderEnabled"> | ||
{{ 'SHOWCASE.COMMON.ENABLED' | translate }} | ||
</mat-checkbox> | ||
<mat-form-field class="slider-value-field"> | ||
<input matInput | ||
placeholder="{{ 'SHOWCASE.COMMON.VALUE' | translate }}" | ||
type="number" | ||
step="10" | ||
[(ngModel)]="valueForSimpleVerticalSlider" | ||
[disabled]="!isSimpleVerticalSliderEnabled" | ||
(change)="onChangeValueForSimpleVerticalSlider($event)"> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
</example-viewer> | ||
|
||
<example-viewer [extensions]="['HTML', 'SCSS', 'TS']" | ||
filesPath="slider/vertical-range-slider" | ||
exampleTitle="SHOWCASE.DEMO.SLIDER.VERTICAL_RANGE_SLIDER"> | ||
<div> | ||
<stark-slider [values]="verticalRangeSliderValues" | ||
sliderId="vertical-range-slider" | ||
[sliderConfig]="verticalRangeSliderConfig" | ||
[isDisabled]="!isVerticalRangeSliderEnabled" | ||
(changed)="onChangeVerticalRangeSlider($event)"> | ||
</stark-slider> | ||
<div> | ||
<mat-checkbox class="slider-enabled-field" | ||
(change)="$event ? toggleVerticalRangeSliderEnable() : null" | ||
[checked]="isVerticalRangeSliderEnabled"> | ||
{{ 'SHOWCASE.COMMON.ENABLED' | translate }} | ||
</mat-checkbox> | ||
<mat-form-field class="slider-value-field"> | ||
<input matInput | ||
placeholder="{{ 'SHOWCASE.COMMON.VALUE' | translate }} 1" | ||
type="number" | ||
step="10" | ||
[(ngModel)]="lowerValueForVerticalRangeSlider" | ||
[disabled]="!isVerticalRangeSliderEnabled" | ||
(change)="onChangeValueForVerticalRangeSlider($event, SLIDER_HANDLES.lower)"> | ||
</mat-form-field> | ||
<mat-form-field class="slider-value-field"> | ||
<input matInput | ||
placeholder="{{ 'SHOWCASE.COMMON.VALUE' | translate }} 2" | ||
type="number" | ||
step="10" | ||
[(ngModel)]="upperValueForVerticalRangeSlider" | ||
[disabled]="!isVerticalRangeSliderEnabled" | ||
(change)="onChangeValueForVerticalRangeSlider($event, SLIDER_HANDLES.upper)"> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
</example-viewer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.slider-enabled-field { | ||
margin-right: 16px; | ||
} | ||
|
||
.slider-value-field { | ||
margin-top: 8px; | ||
margin-right: 16px; | ||
} |
Oops, something went wrong.