pixuireactcomponents 1.1.20 → 1.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +5 -5
  2. package/index.d.ts +15 -15
  3. package/index.js +16 -16
  4. package/package.json +11 -11
  5. package/tools/EventDispatcherJs.d.ts +10 -10
  6. package/tools/EventDispatcherJs.js +71 -71
  7. package/tools/Logger.d.ts +6 -6
  8. package/tools/Logger.js +138 -138
  9. package/tools/tools.md +21 -21
  10. package/ui/components/button/Button.d.ts +5 -5
  11. package/ui/components/button/Button.js +37 -37
  12. package/ui/components/carousel/Carousel.d.ts +5 -5
  13. package/ui/components/carousel/Carousel.js +219 -216
  14. package/ui/components/dropdown/Dropdown.d.ts +30 -30
  15. package/ui/components/dropdown/Dropdown.js +92 -92
  16. package/ui/components/dropdown/DropdownOptionUI.d.ts +11 -11
  17. package/ui/components/dropdown/DropdownOptionUI.js +28 -28
  18. package/ui/components/dropdown/DropdownSpreadMainUI.d.ts +9 -9
  19. package/ui/components/dropdown/DropdownSpreadMainUI.js +27 -27
  20. package/ui/components/dropdown/DropdownUnspreadMainUI.d.ts +9 -9
  21. package/ui/components/dropdown/DropdownUnspreadMainUI.js +27 -27
  22. package/ui/components/gradient/GradientText.d.ts +63 -63
  23. package/ui/components/gradient/GradientText.js +329 -329
  24. package/ui/components/outlinetext/OutlineText.d.ts +73 -73
  25. package/ui/components/outlinetext/OutlineText.js +157 -157
  26. package/ui/components/progress/Progress.d.ts +34 -34
  27. package/ui/components/progress/Progress.js +142 -142
  28. package/ui/components/slapface/Slapface.d.ts +12 -12
  29. package/ui/components/slapface/Slapface.js +227 -221
  30. package/ui/components/slider/Slider.d.ts +57 -57
  31. package/ui/components/slider/Slider.js +289 -289
  32. package/ui/components/tab/Tab.d.ts +6 -6
  33. package/ui/components/tab/Tab.js +27 -27
  34. package/ui/components/tab/Tabs.d.ts +12 -12
  35. package/ui/components/tab/Tabs.js +54 -54
  36. package/ui/ui.md +1 -1
  37. package/ui/components/slapface/less/Slapface.less +0 -107
@@ -1,221 +1,227 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
- var __assign = (this && this.__assign) || function () {
17
- __assign = Object.assign || function(t) {
18
- for (var s, i = 1, n = arguments.length; i < n; i++) {
19
- s = arguments[i];
20
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
- t[p] = s[p];
22
- }
23
- return t;
24
- };
25
- return __assign.apply(this, arguments);
26
- };
27
- import { h, Component } from "preact";
28
- // @ts-ignore
29
- import SlapfaceLess from "./less/Slapface.less";
30
- //默认配置项
31
- var settingsitems = {
32
- ani_switch_type: 1,
33
- is_mask: false
34
- };
35
- //默认无跳转按钮
36
- var jumpButton = {
37
- pic_changtai: '',
38
- pic_yaxia: '',
39
- pic_xuanfu: ''
40
- };
41
- var node = /** @class */ (function () {
42
- function node(par_index) {
43
- if (par_index == undefined)
44
- this.index = -1;
45
- else
46
- this.index = par_index;
47
- this.next = null;
48
- }
49
- return node;
50
- }());
51
- var nodeList = /** @class */ (function () {
52
- function nodeList(groupArr) {
53
- this.head = new node();
54
- var cur = this.head;
55
- this.size = 0;
56
- if (groupArr) {
57
- for (var i = 0; i < groupArr.length; i++) {
58
- cur.next = new node(i);
59
- cur = cur.next;
60
- }
61
- this.groupArr = groupArr;
62
- this.size += groupArr.length;
63
- }
64
- this.tail = cur;
65
- }
66
- nodeList.prototype.Add = function (index, next) {
67
- this.tail.next = new node(index);
68
- this.tail = this.tail.next;
69
- ++this.size;
70
- return this.tail;
71
- };
72
- nodeList.prototype.DeleteNext = function (curParam) {
73
- if (curParam.next == null)
74
- return;
75
- else {
76
- curParam.next = curParam.next.next;
77
- }
78
- --this.size;
79
- };
80
- nodeList.prototype.CheckReady = function () {
81
- var cur = this.head;
82
- while (cur.next != null) {
83
- if (!this.groupArr[cur.next.index].isLoadDone) {
84
- cur = cur.next;
85
- }
86
- else {
87
- var retIndex = cur.next.index;
88
- this.DeleteNext(cur);
89
- return retIndex;
90
- }
91
- }
92
- return -1;
93
- };
94
- return nodeList;
95
- }());
96
- var Slapface = /** @class */ (function (_super) {
97
- __extends(Slapface, _super);
98
- function Slapface(props) {
99
- var _this = _super.call(this, props) || this;
100
- _this.closeAct = function () {
101
- _this.actDisplay = "none";
102
- _this.forceUpdate();
103
- };
104
- _this.LoadGroup = _this.props.LoadGroup;
105
- _this.jumpButton = _this.props.jumpButton ? _this.props.jumpButton : jumpButton;
106
- _this.settingsitems = _this.props.settingsitems ? _this.props.settingsitems : settingsitems;
107
- _this.btn_closeButton = _this.props.btn_closeButton;
108
- _this.pic_loading = _this.props.pic_loading;
109
- _this.actDisplay = "flex";
110
- return _this;
111
- }
112
- Slapface.prototype.render = function () {
113
- var slapfaceinfo = {
114
- LoadGroup: this.LoadGroup,
115
- jumpButton: this.jumpButton,
116
- settingsitems: this.settingsitems,
117
- btn_closeButton: this.btn_closeButton,
118
- pic_loading: this.pic_loading
119
- };
120
- return (h("div", { className: SlapfaceLess.maininterface, style: { display: this.actDisplay } },
121
- h("div", { style: { flexDirection: 'row', flexWrap: 'nowrap' } }),
122
- h("div", { style: { width: '100%', height: '100%', backgroundColor: "rgba(0,0,0,0.5)" } }, h(Group, __assign({}, slapfaceinfo, { closeAct: this.closeAct })))));
123
- };
124
- return Slapface;
125
- }(Component));
126
- export { Slapface };
127
- var Group = /** @class */ (function (_super) {
128
- __extends(Group, _super);
129
- function Group(props) {
130
- var _this = _super.call(this, props) || this;
131
- var emptyGroup = [
132
- {
133
- isLoadDone: true,
134
- picture: "",
135
- width: 0,
136
- height: 0
137
- }
138
- ];
139
- _this.groupArr = emptyGroup.concat(_this.props.LoadGroup);
140
- _this.groupIndexList = new nodeList(_this.groupArr);
141
- _this.loadDisplay = "visible";
142
- _this.state = {
143
- curIndex: _this.groupIndexList.CheckReady()
144
- };
145
- return _this;
146
- }
147
- Group.prototype.componentDidMount = function () {
148
- var _this = this;
149
- if (this.picBack.style.visibility == 'hidden') {
150
- setTimeout(function () {
151
- _this.picBack.style.visibility = 'visible';
152
- _this.closeClick();
153
- }, 600);
154
- }
155
- };
156
- Group.prototype.componentDidUpdate = function () {
157
- var _this = this;
158
- var curIndex = this.state.curIndex;
159
- setTimeout(function () {
160
- if (_this.groupArr[curIndex].isLoadDone) {
161
- _this.groupArr[curIndex].isLoadDone = false;
162
- _this.closeClick();
163
- }
164
- }, 1000);
165
- };
166
- Group.prototype.closeClick = function (e) {
167
- e === null || e === void 0 ? void 0 : e.stopPropagation();
168
- var nextIndex = this.groupIndexList.CheckReady();
169
- this.loadDisplay = "visibility";
170
- if (nextIndex != -1) {
171
- if (this.props.settingsitems.ani_switch_type == 2) {
172
- this.picBack.className = SlapfaceLess.groupBack;
173
- }
174
- this.setState({ curIndex: nextIndex });
175
- }
176
- else {
177
- this.props.closeAct();
178
- }
179
- };
180
- Group.prototype.render = function () {
181
- var _this = this;
182
- if (this.state.curIndex == -1) {
183
- this.setState({ curIndex: this.groupIndexList.CheckReady() });
184
- }
185
- return (h("div", { ref: function (div) { _this.picBack = div; }, style: { width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center', position: 'absolute', visibility: 'hidden' }, onAnimationEnd: function () { _this.picBack.className = SlapfaceLess.groupBackReverse; } },
186
- h("div", { onClick: function () { if (_this.props.settingsitems.is_mask == false)
187
- return; _this.closeClick(); }, style: { position: "absolute", width: "100%", height: "100%" } }),
188
- h("div", null,
189
- h("img", { src: this.groupArr[this.state.curIndex].picture, style: { width: this.groupArr[this.state.curIndex].width, height: this.groupArr[this.state.curIndex].height }, onLoad: function () { var curIndex = _this.state.curIndex; if (_this.groupArr[curIndex].isLoadDone) {
190
- _this.groupArr[curIndex].isLoadDone = false;
191
- _this.loadDisplay = "hidden";
192
- _this.forceUpdate();
193
- } } }),
194
- h("div", { className: SlapfaceLess.loading_anim, src: this.props.pic_loading, style: { width: this.groupArr[this.state.curIndex].width, height: this.groupArr[this.state.curIndex].height, position: "absolute", visibility: this.loadDisplay } }, " "),
195
- h(CloseButton, { btn_closeButton: this.props.btn_closeButton, onClick: function (e) { _this.closeClick(e); } }),
196
- h(JumpButton, { jumpButton: this.props.jumpButton }))));
197
- };
198
- return Group;
199
- }(Component));
200
- var CloseButton = /** @class */ (function (_super) {
201
- __extends(CloseButton, _super);
202
- function CloseButton() {
203
- return _super !== null && _super.apply(this, arguments) || this;
204
- }
205
- CloseButton.prototype.render = function () {
206
- return (h("button", { className: SlapfaceLess.closeButton, style: { backgroundImage: "url(".concat(this.props.btn_closeButton, ")") }, onClick: this.props.onClick }));
207
- };
208
- return CloseButton;
209
- }(Component));
210
- var JumpButton = /** @class */ (function (_super) {
211
- __extends(JumpButton, _super);
212
- function JumpButton() {
213
- return _super !== null && _super.apply(this, arguments) || this;
214
- }
215
- JumpButton.prototype.render = function () {
216
- var _this = this;
217
- return (h("div", { className: SlapfaceLess.jumpButton, onMouseDown: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_yaxia; }, onMouseUp: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_xuanfu; }, onMouseOver: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_xuanfu; }, onMouseOut: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_changtai; } },
218
- h("img", { ref: function (img) { _this.jumpbtnImg = img; }, src: this.props.jumpButton.pic_changtai })));
219
- };
220
- return JumpButton;
221
- }(Component));
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __assign = (this && this.__assign) || function () {
17
+ __assign = Object.assign || function(t) {
18
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
19
+ s = arguments[i];
20
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
+ t[p] = s[p];
22
+ }
23
+ return t;
24
+ };
25
+ return __assign.apply(this, arguments);
26
+ };
27
+ import { h, Component } from "preact";
28
+ // @ts-ignore
29
+ import SlapfaceLess from "./less/Slapface.less";
30
+ // @ts-ignore
31
+ import btn_close from "src/pixUIReactComponents/ui/sample/asset/btn_close.png";
32
+ //默认配置项
33
+ var settingsitems = {
34
+ ani_switch_type: 1,
35
+ is_mask: false
36
+ };
37
+ //默认无跳转按钮
38
+ var jumpButton = {
39
+ pic_changtai: '',
40
+ pic_yaxia: '',
41
+ pic_xuanfu: ''
42
+ };
43
+ var node = /** @class */ (function () {
44
+ function node(par_index) {
45
+ if (par_index == undefined)
46
+ this.index = -1;
47
+ else
48
+ this.index = par_index;
49
+ this.next = null;
50
+ }
51
+ return node;
52
+ }());
53
+ var nodeList = /** @class */ (function () {
54
+ function nodeList(groupArr) {
55
+ this.head = new node();
56
+ var cur = this.head;
57
+ this.size = 0;
58
+ if (groupArr) {
59
+ for (var i = 0; i < groupArr.length; i++) {
60
+ cur.next = new node(i);
61
+ cur = cur.next;
62
+ }
63
+ this.groupArr = groupArr;
64
+ this.size += groupArr.length;
65
+ }
66
+ this.tail = cur;
67
+ }
68
+ nodeList.prototype.Add = function (index, next) {
69
+ this.tail.next = new node(index);
70
+ this.tail = this.tail.next;
71
+ ++this.size;
72
+ return this.tail;
73
+ };
74
+ nodeList.prototype.DeleteNext = function (curParam) {
75
+ if (curParam.next == null)
76
+ return;
77
+ else {
78
+ curParam.next = curParam.next.next;
79
+ }
80
+ --this.size;
81
+ };
82
+ nodeList.prototype.CheckReady = function () {
83
+ var cur = this.head;
84
+ while (cur.next != null) {
85
+ if (this.groupArr[cur.next.index].isLoadDone) {
86
+ cur = cur.next;
87
+ }
88
+ else {
89
+ var retIndex = cur.next.index;
90
+ this.DeleteNext(cur);
91
+ return retIndex;
92
+ }
93
+ }
94
+ return -1;
95
+ };
96
+ return nodeList;
97
+ }());
98
+ var Slapface = /** @class */ (function (_super) {
99
+ __extends(Slapface, _super);
100
+ function Slapface(props) {
101
+ var _this = _super.call(this, props) || this;
102
+ _this.closeAct = function () {
103
+ _this.actDisplay = "none";
104
+ _this.forceUpdate();
105
+ };
106
+ _this.LoadGroup = _this.props.LoadGroup;
107
+ _this.jumpButton = _this.props.jumpButton ? _this.props.jumpButton : jumpButton;
108
+ _this.settingsitems = _this.props.settingsitems ? _this.props.settingsitems : settingsitems;
109
+ _this.btn_closeButton = _this.props.btn_closeButton ? _this.props.btn_closeButton : btn_close;
110
+ _this.pic_loading = _this.props.pic_loading;
111
+ _this.actDisplay = "flex";
112
+ return _this;
113
+ }
114
+ Slapface.prototype.render = function () {
115
+ var slapfaceinfo = {
116
+ LoadGroup: this.LoadGroup,
117
+ jumpButton: this.jumpButton,
118
+ settingsitems: this.settingsitems,
119
+ btn_closeButton: this.btn_closeButton,
120
+ pic_loading: this.pic_loading
121
+ };
122
+ return (h("div", { className: SlapfaceLess.maininterface, style: { display: this.actDisplay } },
123
+ h("div", { style: { flexDirection: 'row', flexWrap: 'nowrap' } }),
124
+ h("div", { style: { width: '100%', height: '100%', backgroundColor: "rgba(0,0,0,0.5)" } }, h(Group, __assign({}, slapfaceinfo, { closeAct: this.closeAct })))));
125
+ };
126
+ return Slapface;
127
+ }(Component));
128
+ export { Slapface };
129
+ var Group = /** @class */ (function (_super) {
130
+ __extends(Group, _super);
131
+ function Group(props) {
132
+ var _this = _super.call(this, props) || this;
133
+ var emptyGroup = [
134
+ {
135
+ isLoadDone: false,
136
+ picture: "",
137
+ width: 0,
138
+ height: 0
139
+ }
140
+ ];
141
+ _this.groupArr = emptyGroup.concat(_this.props.LoadGroup);
142
+ _this.groupIndexList = new nodeList(_this.groupArr);
143
+ _this.loadDisplay = "hidden";
144
+ _this.elseDisplay = "visible";
145
+ _this.state = {
146
+ curIndex: _this.groupIndexList.CheckReady()
147
+ };
148
+ return _this;
149
+ }
150
+ Group.prototype.componentDidMount = function () {
151
+ var _this = this;
152
+ if (this.picBack.style.visibility == 'hidden') {
153
+ setTimeout(function () {
154
+ _this.picBack.style.visibility = 'visible';
155
+ _this.closeClick();
156
+ }, 600);
157
+ }
158
+ };
159
+ Group.prototype.componentDidUpdate = function () {
160
+ var _this = this;
161
+ var curIndex = this.state.curIndex;
162
+ setTimeout(function () {
163
+ if (!_this.groupArr[curIndex].isLoadDone) {
164
+ _this.groupArr[curIndex].isLoadDone = true;
165
+ _this.closeClick();
166
+ }
167
+ }, 1000);
168
+ };
169
+ Group.prototype.closeClick = function (e) {
170
+ var _this = this;
171
+ e === null || e === void 0 ? void 0 : e.stopPropagation();
172
+ var nextIndex = this.groupIndexList.CheckReady();
173
+ setTimeout(function () { _this.loadDisplay = "visible"; }, 1000);
174
+ this.elseDisplay = "hidden";
175
+ if (nextIndex != -1) {
176
+ if (this.props.settingsitems.ani_switch_type == 2) {
177
+ this.picBack.className = SlapfaceLess.groupBack;
178
+ }
179
+ this.setState({ curIndex: nextIndex });
180
+ }
181
+ else {
182
+ this.props.closeAct();
183
+ }
184
+ };
185
+ Group.prototype.render = function () {
186
+ var _this = this;
187
+ if (this.state.curIndex == -1) {
188
+ this.setState({ curIndex: this.groupIndexList.CheckReady() });
189
+ }
190
+ return (h("div", { ref: function (div) { _this.picBack = div; }, style: { width: '100%', height: '100%', alignItems: 'center', justifyContent: 'center', position: 'absolute', visibility: 'hidden' }, onAnimationEnd: function () { _this.picBack.className = SlapfaceLess.groupBackReverse; } },
191
+ h("div", { onClick: function () { if (_this.props.settingsitems.is_mask == false)
192
+ return; _this.closeClick(); }, style: { position: "absolute", width: "100%", height: "100%" } }),
193
+ h("div", null,
194
+ h("img", { src: this.groupArr[this.state.curIndex].picture, style: { visibility: this.elseDisplay, width: this.groupArr[this.state.curIndex].width, height: this.groupArr[this.state.curIndex].height }, onLoad: function () { var curIndex = _this.state.curIndex; if (!_this.groupArr[curIndex].isLoadDone) {
195
+ _this.groupArr[curIndex].isLoadDone = true;
196
+ _this.loadDisplay = "hidden";
197
+ _this.elseDisplay = "visible";
198
+ _this.forceUpdate();
199
+ } } }),
200
+ h("div", { ref: function (div) { _this.loadPic = div; }, className: SlapfaceLess.loading_anim, style: { backgroundImage: "url(".concat(this.props.pic_loading, ")"), width: this.groupArr[this.state.curIndex].width, height: this.groupArr[this.state.curIndex].height, position: "absolute", visibility: this.loadDisplay } }, " "),
201
+ h(CloseButton, { btn_closeButton: this.props.btn_closeButton, elseDisplay: this.elseDisplay, onClick: function (e) { _this.closeClick(e); } }),
202
+ h(JumpButton, { elseDisplay: this.elseDisplay, jumpButton: this.props.jumpButton }))));
203
+ };
204
+ return Group;
205
+ }(Component));
206
+ var CloseButton = /** @class */ (function (_super) {
207
+ __extends(CloseButton, _super);
208
+ function CloseButton() {
209
+ return _super !== null && _super.apply(this, arguments) || this;
210
+ }
211
+ CloseButton.prototype.render = function () {
212
+ return (h("button", { className: SlapfaceLess.closeButton, style: { visibility: this.props.elseDisplay, backgroundImage: "url(".concat(this.props.btn_closeButton, ")") }, onClick: this.props.onClick }));
213
+ };
214
+ return CloseButton;
215
+ }(Component));
216
+ var JumpButton = /** @class */ (function (_super) {
217
+ __extends(JumpButton, _super);
218
+ function JumpButton() {
219
+ return _super !== null && _super.apply(this, arguments) || this;
220
+ }
221
+ JumpButton.prototype.render = function () {
222
+ var _this = this;
223
+ return (h("div", { className: SlapfaceLess.jumpButton, style: { visibility: this.props.elseDisplay }, onMouseDown: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_yaxia; }, onMouseUp: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_xuanfu; }, onMouseOver: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_xuanfu; }, onMouseOut: function () { _this.jumpbtnImg.src = _this.props.jumpButton.pic_changtai; } },
224
+ h("img", { ref: function (img) { _this.jumpbtnImg = img; }, src: this.props.jumpButton.pic_changtai })));
225
+ };
226
+ return JumpButton;
227
+ }(Component));
@@ -1,57 +1,57 @@
1
- import { Component, h } from 'preact';
2
- export interface SliderProps {
3
- percent: number;
4
- wrapperWidth: number;
5
- wrapperHeight: number;
6
- height: number;
7
- innerHeight?: number;
8
- dotWidth: number;
9
- dotHeight: number;
10
- dotWrapperWidth: number;
11
- dotWrapperHeight: number;
12
- outerBg: string;
13
- innerBg: string;
14
- dotBg: string;
15
- onDragStart: Function | null;
16
- onDrag: Function | null;
17
- onDragEnd: Function | null;
18
- isDiscrete: boolean | null;
19
- discrete?: number;
20
- maxDiscrete?: number;
21
- hasIncDecButton: boolean | null;
22
- incButtonWidth?: number;
23
- incButtonHeight?: number;
24
- decButtonWidth?: number;
25
- decButtonHeight?: number;
26
- incButtonBg?: string;
27
- decButtonBg?: string;
28
- overallWidth?: number;
29
- onIncClick?: Function | null;
30
- onDecClick?: Function | null;
31
- rangeControl?: boolean;
32
- startRange?: number;
33
- endRange?: number;
34
- }
35
- export declare class Slider extends Component<SliderProps, {
36
- percent: number;
37
- }> {
38
- discrete: number;
39
- private refWrapper;
40
- constructor(props: any);
41
- componentDidMount(): void;
42
- componentWillReceiveProps(nextProps: any): void;
43
- onDragStart: (event: any) => void;
44
- onDrag: (event: any) => void;
45
- onDragEnd: (event: any) => void;
46
- onDecClick: () => void;
47
- onIncClick: () => void;
48
- computeWrapperStyle: () => void;
49
- computeOuterStyle: () => void;
50
- computeInnerStyle: () => void;
51
- computeDotWrapperStyle: () => void;
52
- computeDotStyle: () => void;
53
- computeIncButtonStyle: () => void;
54
- computeDecButtonStyle: () => void;
55
- computeWithButtonStyle: () => void;
56
- render(): h.JSX.Element;
57
- }
1
+ import { Component, h } from 'preact';
2
+ export interface SliderProps {
3
+ percent: number;
4
+ wrapperWidth: number;
5
+ wrapperHeight: number;
6
+ height: number;
7
+ innerHeight?: number;
8
+ dotWidth: number;
9
+ dotHeight: number;
10
+ dotWrapperWidth: number;
11
+ dotWrapperHeight: number;
12
+ outerBg: string;
13
+ innerBg: string;
14
+ dotBg: string;
15
+ onDragStart: Function | null;
16
+ onDrag: Function | null;
17
+ onDragEnd: Function | null;
18
+ isDiscrete: boolean | null;
19
+ discrete?: number;
20
+ maxDiscrete?: number;
21
+ hasIncDecButton: boolean | null;
22
+ incButtonWidth?: number;
23
+ incButtonHeight?: number;
24
+ decButtonWidth?: number;
25
+ decButtonHeight?: number;
26
+ incButtonBg?: string;
27
+ decButtonBg?: string;
28
+ overallWidth?: number;
29
+ onIncClick?: Function | null;
30
+ onDecClick?: Function | null;
31
+ rangeControl?: boolean;
32
+ startRange?: number;
33
+ endRange?: number;
34
+ }
35
+ export declare class Slider extends Component<SliderProps, {
36
+ percent: number;
37
+ }> {
38
+ discrete: number;
39
+ private refWrapper;
40
+ constructor(props: any);
41
+ componentDidMount(): void;
42
+ componentWillReceiveProps(nextProps: any): void;
43
+ onDragStart: (event: any) => void;
44
+ onDrag: (event: any) => void;
45
+ onDragEnd: (event: any) => void;
46
+ onDecClick: () => void;
47
+ onIncClick: () => void;
48
+ computeWrapperStyle: () => void;
49
+ computeOuterStyle: () => void;
50
+ computeInnerStyle: () => void;
51
+ computeDotWrapperStyle: () => void;
52
+ computeDotStyle: () => void;
53
+ computeIncButtonStyle: () => void;
54
+ computeDecButtonStyle: () => void;
55
+ computeWithButtonStyle: () => void;
56
+ render(): h.JSX.Element;
57
+ }