1 | import { ComponentOption } from '../../interface';
|
2 | import View from '../view';
|
3 | import { Controller } from './base';
|
4 | import { SliderOption } from '../../interface';
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | export default class Slider extends Controller<SliderOption> {
|
10 | private slider;
|
11 | private container;
|
12 | private width;
|
13 | private start;
|
14 | private end;
|
15 | private onChangeFn;
|
16 | constructor(view: View);
|
17 | get name(): string;
|
18 | destroy(): void;
|
19 | /**
|
20 | * 初始化
|
21 | */
|
22 | init(): void;
|
23 | /**
|
24 | * 渲染
|
25 | */
|
26 | render(): void;
|
27 | /**
|
28 | * 布局
|
29 | */
|
30 | layout(): void;
|
31 | /**
|
32 | * 更新
|
33 | */
|
34 | update(): void;
|
35 | /**
|
36 | * 创建 slider 组件
|
37 | */
|
38 | private createSlider;
|
39 | /**
|
40 | * 更新配置
|
41 | */
|
42 | private updateSlider;
|
43 | /**
|
44 | * 进行测量操作
|
45 | */
|
46 | private measureSlider;
|
47 | /**
|
48 | * 清除测量
|
49 | */
|
50 | private resetMeasure;
|
51 | /**
|
52 | * 生成 slider 配置
|
53 | */
|
54 | private getSliderCfg;
|
55 | /**
|
56 | * 从 view 中获取数据,缩略轴使用全量的数据
|
57 | */
|
58 | private getData;
|
59 | /**
|
60 | * 获取 slider 的主题配置
|
61 | */
|
62 | private getThemeOptions;
|
63 | /**
|
64 | * 滑块滑动的时候出发
|
65 | * @param v
|
66 | */
|
67 | private onValueChange;
|
68 | /**
|
69 | * 根据 start/end 和当前数据计算出当前的 minText/maxText
|
70 | * @param min
|
71 | * @param max
|
72 | */
|
73 | private getMinMaxText;
|
74 | /**
|
75 | * 更新 view 过滤数据
|
76 | * @param min
|
77 | * @param max
|
78 | */
|
79 | private changeViewData;
|
80 | /**
|
81 | * 覆写父类方法
|
82 | */
|
83 | getComponents(): ComponentOption[];
|
84 | /**
|
85 | * 覆盖父类
|
86 | */
|
87 | clear(): void;
|
88 | }
|