|
| 1 | +import properties from './properties' |
| 2 | +import watchers from './watchers' |
| 3 | + |
1 | 4 | export const props = {
|
2 |
| - props: { |
3 |
| - min: { |
4 |
| - type: Number, |
5 |
| - default: 0 |
6 |
| - }, |
7 |
| - max: { |
8 |
| - type: Number, |
9 |
| - default: 10 |
10 |
| - }, |
11 |
| - step: { |
12 |
| - type: Number, |
13 |
| - default: 1 |
14 |
| - }, |
15 |
| - precision: { |
16 |
| - type: Number |
17 |
| - }, |
18 |
| - orientation: { |
19 |
| - type: String, |
20 |
| - default: 'horizontal' |
21 |
| - }, |
22 |
| - value: { |
23 |
| - type: [Number, Array], |
24 |
| - default: () => null |
25 |
| - }, |
26 |
| - range: { |
27 |
| - type: Boolean, |
28 |
| - default: false |
29 |
| - }, |
30 |
| - selection: { |
31 |
| - type: String, |
32 |
| - default: 'before' |
33 |
| - }, |
34 |
| - tooltip: { |
35 |
| - type: String, |
36 |
| - default: 'show' |
37 |
| - }, |
38 |
| - tooltipSplit: { |
39 |
| - type: Boolean, |
40 |
| - default: false |
41 |
| - }, |
42 |
| - tooltipPosition: { |
43 |
| - type: String |
44 |
| - }, |
45 |
| - handle: { |
46 |
| - type: String, |
47 |
| - default: 'round' |
48 |
| - }, |
49 |
| - reversed: { |
50 |
| - type: Boolean, |
51 |
| - default: false |
52 |
| - }, |
53 |
| - rtl: { |
54 |
| - type: String, |
55 |
| - default: 'auto' |
56 |
| - }, |
57 |
| - formatter: { |
58 |
| - type: Function |
59 |
| - }, |
60 |
| - naturalArrowKeys: { |
61 |
| - type: Boolean, |
62 |
| - default: false |
63 |
| - }, |
64 |
| - ticks: { |
65 |
| - type: Array, |
66 |
| - default: () => [] |
67 |
| - }, |
68 |
| - ticksPositions: { |
69 |
| - type: Array, |
70 |
| - default: () => [] |
71 |
| - }, |
72 |
| - ticksLabels: { |
73 |
| - type: Array, |
74 |
| - default: () => [] |
75 |
| - }, |
76 |
| - ticksSnapBounds: { |
77 |
| - type: Number, |
78 |
| - default: 0 |
79 |
| - }, |
80 |
| - ticksTooltip: { |
81 |
| - type: Boolean, |
82 |
| - default: false |
83 |
| - }, |
84 |
| - scale: { |
85 |
| - type: String, |
86 |
| - default: 'linear' |
87 |
| - }, |
88 |
| - focus: { |
89 |
| - type: Boolean, |
90 |
| - default: false |
91 |
| - }, |
92 |
| - labelledby: { |
93 |
| - type: [String, Array], |
94 |
| - default: () => null |
95 |
| - }, |
96 |
| - rangeHighlights: { |
97 |
| - type: Array, |
98 |
| - default: () => [] |
99 |
| - }, |
100 |
| - disabled: { |
101 |
| - type: Boolean, |
102 |
| - default: false |
103 |
| - }, |
104 |
| - triggerSlideEvent: { |
105 |
| - type: Boolean, |
106 |
| - default: false |
107 |
| - }, |
108 |
| - triggerChangeEvent: { |
109 |
| - type: Boolean, |
110 |
| - default: false |
111 |
| - }, |
112 |
| - debounce: { |
113 |
| - type: Number, |
114 |
| - default: 0 |
115 |
| - } |
116 |
| - } |
| 5 | + props: properties |
117 | 6 | }
|
118 | 7 |
|
119 | 8 | export const watch = {
|
120 |
| - watch: { |
121 |
| - min(value, oldValue) { |
122 |
| - if (this.slider && value !== oldValue) { |
123 |
| - this.slider.setAttribute('min', value) |
124 |
| - this.refresh() |
125 |
| - } |
126 |
| - }, |
127 |
| - max(value, oldValue) { |
128 |
| - if (this.slider && value !== oldValue) { |
129 |
| - this.slider.setAttribute('max', value) |
130 |
| - this.refresh() |
131 |
| - } |
132 |
| - }, |
133 |
| - step(value, oldValue) { |
134 |
| - if (this.slider && value !== oldValue) { |
135 |
| - this.slider.setAttribute('step', value) |
136 |
| - this.refresh() |
137 |
| - } |
138 |
| - }, |
139 |
| - precision(value, oldValue) { |
140 |
| - if (this.slider && value !== oldValue) { |
141 |
| - this.slider.setAttribute('precision', value) |
142 |
| - this.refresh() |
143 |
| - } |
144 |
| - }, |
145 |
| - orientation(value, oldValue) { |
146 |
| - if (this.slider && value !== oldValue) { |
147 |
| - this.slider.setAttribute('orientation', value) |
148 |
| - this.refresh() |
149 |
| - } |
150 |
| - }, |
151 |
| - range(value, oldValue) { |
152 |
| - if (this.slider && value !== oldValue) { |
153 |
| - this.slider.setAttribute('range', value) |
154 |
| - this.refresh() |
155 |
| - } |
156 |
| - }, |
157 |
| - selection(value, oldValue) { |
158 |
| - if (this.slider && value !== oldValue) { |
159 |
| - this.slider.setAttribute('selection', value) |
160 |
| - this.refresh() |
161 |
| - } |
162 |
| - }, |
163 |
| - tooltip(value, oldValue) { |
164 |
| - if (this.slider && value !== oldValue) { |
165 |
| - this.slider.setAttribute('tooltip', value) |
166 |
| - this.refresh() |
167 |
| - } |
168 |
| - }, |
169 |
| - tooltipSplit(value, oldValue) { |
170 |
| - if (this.slider && value !== oldValue) { |
171 |
| - this.slider.setAttribute('tooltipSplit', value) |
172 |
| - this.refresh() |
173 |
| - } |
174 |
| - }, |
175 |
| - tooltipPosition(value, oldValue) { |
176 |
| - if (this.slider && value !== oldValue) { |
177 |
| - this.slider.setAttribute('tooltipPosition', value) |
178 |
| - this.refresh() |
179 |
| - } |
180 |
| - }, |
181 |
| - handle(value, oldValue) { |
182 |
| - if (this.slider && value !== oldValue) { |
183 |
| - this.slider.setAttribute('handle', value) |
184 |
| - this.refresh() |
185 |
| - } |
186 |
| - }, |
187 |
| - reversed(value, oldValue) { |
188 |
| - if (this.slider && value !== oldValue) { |
189 |
| - this.slider.setAttribute('reversed', value) |
190 |
| - this.refresh() |
191 |
| - } |
192 |
| - }, |
193 |
| - rtl(value, oldValue) { |
194 |
| - if (this.slider && value !== oldValue) { |
195 |
| - this.slider.setAttribute('rtl', value) |
196 |
| - this.refresh() |
197 |
| - } |
198 |
| - }, |
199 |
| - formatter(value, oldValue) { |
200 |
| - if (this.slider && value !== oldValue) { |
201 |
| - this.slider.setAttribute('formatter', value) |
202 |
| - this.refresh() |
203 |
| - } |
204 |
| - }, |
205 |
| - naturalArrowKeys(value, oldValue) { |
206 |
| - if (this.slider && value !== oldValue) { |
207 |
| - this.slider.setAttribute('naturalArrowKeys', value) |
208 |
| - this.refresh() |
209 |
| - } |
210 |
| - }, |
211 |
| - ticks(value, oldValue) { |
212 |
| - if (this.slider) { |
213 |
| - this.slider.setAttribute('ticks', value) |
214 |
| - this.refresh() |
215 |
| - } |
216 |
| - }, |
217 |
| - ticksPositions(value, oldValue) { |
218 |
| - if (this.slider) { |
219 |
| - this.slider.setAttribute('ticksPositions', value) |
220 |
| - this.refresh() |
221 |
| - } |
222 |
| - }, |
223 |
| - ticksLabels(value, oldValue) { |
224 |
| - if (this.slider) { |
225 |
| - this.slider.setAttribute('ticksLabels', value) |
226 |
| - this.refresh() |
227 |
| - } |
228 |
| - }, |
229 |
| - ticksSnapBounds(value, oldValue) { |
230 |
| - if (this.slider && value !== oldValue) { |
231 |
| - this.slider.setAttribute('ticksSnapBounds', value) |
232 |
| - this.refresh() |
233 |
| - } |
234 |
| - }, |
235 |
| - ticksTooltip(value, oldValue) { |
236 |
| - if (this.slider && value !== oldValue) { |
237 |
| - this.slider.setAttribute('ticksTooltip', value) |
238 |
| - this.refresh() |
239 |
| - } |
240 |
| - }, |
241 |
| - scale(value, oldValue) { |
242 |
| - if (this.slider && value !== oldValue) { |
243 |
| - this.slider.setAttribute('scale', value) |
244 |
| - this.refresh() |
245 |
| - } |
246 |
| - }, |
247 |
| - focus(value, oldValue) { |
248 |
| - if (this.slider && value !== oldValue) { |
249 |
| - this.slider.setAttribute('focus', value) |
250 |
| - this.refresh() |
251 |
| - } |
252 |
| - }, |
253 |
| - labelledby(value, oldValue) { |
254 |
| - if (this.slider) { |
255 |
| - this.slider.setAttribute('labelledby', value) |
256 |
| - this.refresh() |
257 |
| - } |
258 |
| - }, |
259 |
| - rangeHighlights(value, oldValue) { |
260 |
| - if (this.slider) { |
261 |
| - this.slider.setAttribute('rangeHighlights', value) |
262 |
| - this.refresh() |
263 |
| - } |
264 |
| - }, |
265 |
| - disabled(value) { |
266 |
| - if (value) { |
267 |
| - this.slider.disable() |
268 |
| - } else { |
269 |
| - this.slider.enable() |
270 |
| - } |
271 |
| - }, |
272 |
| - value(value) { |
273 |
| - this.slider.setValue(value, this.triggerSlideEvent, this.triggerChangeEvent) |
274 |
| - } |
275 |
| - } |
| 9 | + watch: watchers |
276 | 10 | }
|
277 | 11 |
|
278 | 12 | export default props
|
0 commit comments