This repository was archived by the owner on Jul 30, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy paththumb-customization.tsx
More file actions
166 lines (144 loc) · 5.27 KB
/
thumb-customization.tsx
File metadata and controls
166 lines (144 loc) · 5.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
import * as ReactDOM from 'react-dom';
import * as React from 'react';
import { SliderComponent } from '@syncfusion/ej2-react-inputs';
import { DropDownListComponent } from '@syncfusion/ej2-react-dropdowns';
import { SampleBase } from '../common/sample-base';
import { PropertyPane } from '../common/property-pane';
const slidercss = `
.slider-content-wrapper {
width: 40%;
margin: 0 auto;
min-width: 185px;
}
.slider-userselect {
-webkit-user-select: none;
/* Safari 3.1+ */
-moz-user-select: none;
/* Firefox 2+ */
-ms-user-select: none;
/* IE 10+ */
user-select: none;
/* Standard syntax */
}
.labelText {
text-align: -webkit-left;
font-weight: 500;
font-size: 13px;
padding-bottom: 10px;
}
.slider_container {
margin-top: 40px;
}
.e-bigger .content-wrapper {
width: 80%;
}
#square_slider.e-control.e-slider .e-handle {
border-radius: 0%;
background-color: #f9920b;
border: 0;
}
#circle_slider.e-control.e-slider .e-handle {
background-color: #f9920b;
border-radius: 50%;
border: 0;
}
.material.e-bigger .e-slider-container.e-horizontal #image_slider.e-slider .e-handle,
.material .e-slider-container.e-bigger.e-horizontal #image_slider.e-slider .e-handle {
top: calc(50% - 7px);
}
.material.e-bigger .e-slider-container.e-horizontal #image_slider.e-slider .e-handle.e-handle-active,
.material .e-slider-container.e-bigger.e-horizontal #image_slider.e-slider .e-handle.e-handle-active {
top: calc(50% - 6px);
transform: scale(1.3) !important;
}
.e-bigger .e-slider-container.e-horizontal #image_slider.e-slider .e-handle,
.e-slider-container.e-bigger.e-horizontal #image_slider.e-slider .e-handle {
top: calc(50% - 9px);
}
#image_slider.e-control.e-slider .e-handle {
height: 25px;
width: 24px;
background-size: 24px;
}
.material #image_slider.e-control.e-slider .e-handle {
height: 20px;
width: 20px;
background-size: 20px;
}
.material #image_slider.e-control.e-slider .e-handle {
background-image: url('./src/slider/images/thumb-mat.png');
background-repeat: no-repeat;
background-color: transparent;
border: 0;
}
#image_slider.e-control.e-slider .e-handle {
background-image: url('./src/slider/images/thumb.png');
background-repeat: no-repeat;
background-color: transparent;
border: 0;
}
#square_slider .e-tab-handle::after,
#circle_slider .e-tab-handle::after {
background-color: #f9920b;
}
#image_slider .e-tab-handle::after {
background-color: transparent;
}
#oval_slider.e-control.e-slider .e-handle {
height: 25px;
width: 8px;
top: 3px;
border-radius: 15px;
background-color: #f9920b;
}
`
export class Thumb extends SampleBase<{}, {}> {
public ticks: object = {
placement: 'After'
};
render() {
return (
<div className='control-pane'>
<div className='control-section'>
<style>{slidercss}</style>
<div className="slider-content-wrapper">
<div className="slider_container">
<div className="labelText slider-userselect">Square</div>
{/* Square slider element */}
<SliderComponent id="square_slider" value={30} min={0} max={100} />
</div>
<div className="slider_container">
<div className="labelText slider-userselect">Circle</div>
{/* Circle slider element */}
<SliderComponent id="circle_slider" value={30} min={0} max={100} />
</div>
<div className="slider_container">
<div className="labelText slider-userselect">Oval</div>
{/* Oval slider element */}
<SliderComponent id="oval_slider" value={30} min={0} max={100} />
</div>
<div className="slider_container">
<div className="labelText slider-userselect">Custom image</div>
{/* Image slider element */}
<SliderComponent id="image_slider" value={30} min={0} max={100} ticks={this.ticks} />
</div>
</div>
</div>
<div id="action-description">
<p>This sample demonstrates the customization of Slider's Thumb. Drag the thumb over the bar for selecting the values between
min and max.
</p>
</div>
<div id="description">
<p>In this demo, we have demonstrated the following customization of Thumb by changing CSS.</p>
<ul>
<li>Square - In this sample, Thumb has been customized to Square shape.</li>
<li>Circle - In this sample, Thumb has been customized to Circle shape. </li>
<li>Oval - In this sample, Thumb has been customized to Oval shape. </li>
<li>Custom image - In this sample, Thumb has been replaced with custom image. </li>
</ul>
</div>
</div>
)
}
}