pixuireactcomponents 1.1.21 → 1.1.22

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 -219
  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 +224 -227
  30. package/ui/components/slapface/less/Slapface.less +125 -0
  31. package/ui/components/slider/Slider.d.ts +57 -57
  32. package/ui/components/slider/Slider.js +289 -289
  33. package/ui/components/tab/Tab.d.ts +6 -6
  34. package/ui/components/tab/Tab.js +27 -27
  35. package/ui/components/tab/Tabs.d.ts +12 -12
  36. package/ui/components/tab/Tabs.js +54 -54
  37. package/ui/ui.md +1 -1
@@ -1,142 +1,142 @@
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 { Component, createRef, h } from 'preact';
28
- var row_center_center = {
29
- display: 'flex',
30
- flexDirection: 'row',
31
- justifyContent: 'center',
32
- alignItems: 'center'
33
- };
34
- var wrapperStyle;
35
- var outerStyle;
36
- var innerStyle;
37
- var dotStyle;
38
- var dotWrapperStyle;
39
- var lastX = undefined; // 上一次位置的横坐标
40
- var count = 0; // 拖动条距离最左端的位置 [0, this.props.wrapperWidth]
41
- var rect = undefined; // 滑动区域
42
- var Progress = /** @class */ (function (_super) {
43
- __extends(Progress, _super);
44
- function Progress(props) {
45
- var _this = _super.call(this, props) || this;
46
- _this.refWrapper = createRef();
47
- _this.onDragStart = function (event) {
48
- console.log('【Progress】DragStart event.clientX--' + event.clientX + '-----percent----' + _this.state.percent + '-----currentX----' + (_this.state.percent / 100 * _this.props.wrapperWidth));
49
- lastX = event.clentX;
50
- count = _this.state.percent / 100 * _this.props.wrapperWidth;
51
- if (_this.props.onDragStart) {
52
- _this.props.onDragStart();
53
- }
54
- };
55
- _this.onDrag = function (event) {
56
- if (event.clientX < rect.left || event.clientX > rect.right)
57
- return;
58
- if (lastX == undefined) {
59
- lastX = event.clientX;
60
- return;
61
- }
62
- var move = Number(event.clientX) - Number(lastX);
63
- count += move;
64
- count = Math.min(_this.props.wrapperWidth, count);
65
- count = Math.max(0, count);
66
- var newPercent = count / _this.props.wrapperWidth * 100;
67
- _this.setState({
68
- percent: newPercent
69
- }, function () {
70
- if (_this.props.onDrag)
71
- _this.props.onDrag(newPercent);
72
- });
73
- lastX = event.clientX;
74
- };
75
- _this.onDragEnd = function (event) {
76
- lastX = undefined;
77
- console.log('【Progress】DragEnd event.clientX--' + event.clientX + '-----percent----' + _this.state.percent + '-----currentX----' + (_this.state.percent / 100 * _this.props.wrapperWidth));
78
- if (_this.props.onDragEnd) {
79
- _this.props.onDragEnd(_this.state.percent);
80
- }
81
- };
82
- _this.computeWrapperStyle = function () {
83
- wrapperStyle = __assign({ width: _this.props.wrapperWidth + 'px', height: _this.props.wrapperHeight + 'px' }, row_center_center);
84
- };
85
- _this.computeOuterStyle = function () {
86
- outerStyle = {
87
- width: '100%',
88
- height: _this.props.height + 'px',
89
- backgroundImage: "url(".concat(_this.props.outerBg, ")"),
90
- backgroundSize: '100% 100%'
91
- };
92
- };
93
- _this.computeInnerStyle = function () {
94
- var _width = Math.floor(_this.state.percent) + '%';
95
- innerStyle = {
96
- width: _width,
97
- height: '100%',
98
- backgroundImage: "url(".concat(_this.props.innerBg, ")"),
99
- backgroundSize: '100% 100%'
100
- };
101
- };
102
- _this.computeDotWrapperStyle = function () {
103
- dotWrapperStyle = __assign({ position: 'absolute', width: _this.props.dotWrapperWidth + 'px', height: _this.props.dotWrapperHeight + 'px', marginTop: (_this.props.height - _this.props.dotWrapperHeight) / 2 + 'px', marginLeft: (_this.props.wrapperWidth * _this.state.percent / 100 - _this.props.dotWrapperWidth / 2) + 'px' }, row_center_center
104
- // backgroundColor: '#FF000066'
105
- );
106
- };
107
- _this.computeDotStyle = function () {
108
- dotStyle = {
109
- width: _this.props.dotWidth + 'px',
110
- height: _this.props.dotHeight + 'px',
111
- };
112
- };
113
- _this.state = {
114
- percent: Math.floor(_this.props.percent)
115
- };
116
- _this.computeWrapperStyle();
117
- _this.computeOuterStyle();
118
- return _this;
119
- }
120
- Progress.prototype.componentDidMount = function () {
121
- rect = this.refWrapper.current.getBoundingClientRect();
122
- };
123
- Progress.prototype.componentWillReceiveProps = function (nextProps) {
124
- if (nextProps.percent == this.props.percent)
125
- return;
126
- this.setState({
127
- percent: nextProps.percent
128
- });
129
- };
130
- Progress.prototype.render = function () {
131
- this.computeInnerStyle();
132
- this.computeDotWrapperStyle();
133
- this.computeDotStyle();
134
- return (h("div", { ref: this.refWrapper, style: wrapperStyle },
135
- h("div", { style: outerStyle },
136
- h("div", { style: innerStyle },
137
- h("div", { style: dotWrapperStyle, draggable: true, onDragStart: this.onDragStart, onDrag: this.onDrag, onDragEnd: this.onDragEnd },
138
- h("img", { src: this.props.dotBg, style: dotStyle }))))));
139
- };
140
- return Progress;
141
- }(Component));
142
- export { Progress };
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 { Component, createRef, h } from 'preact';
28
+ var row_center_center = {
29
+ display: 'flex',
30
+ flexDirection: 'row',
31
+ justifyContent: 'center',
32
+ alignItems: 'center'
33
+ };
34
+ var wrapperStyle;
35
+ var outerStyle;
36
+ var innerStyle;
37
+ var dotStyle;
38
+ var dotWrapperStyle;
39
+ var lastX = undefined; // 上一次位置的横坐标
40
+ var count = 0; // 拖动条距离最左端的位置 [0, this.props.wrapperWidth]
41
+ var rect = undefined; // 滑动区域
42
+ var Progress = /** @class */ (function (_super) {
43
+ __extends(Progress, _super);
44
+ function Progress(props) {
45
+ var _this = _super.call(this, props) || this;
46
+ _this.refWrapper = createRef();
47
+ _this.onDragStart = function (event) {
48
+ console.log('【Progress】DragStart event.clientX--' + event.clientX + '-----percent----' + _this.state.percent + '-----currentX----' + (_this.state.percent / 100 * _this.props.wrapperWidth));
49
+ lastX = event.clentX;
50
+ count = _this.state.percent / 100 * _this.props.wrapperWidth;
51
+ if (_this.props.onDragStart) {
52
+ _this.props.onDragStart();
53
+ }
54
+ };
55
+ _this.onDrag = function (event) {
56
+ if (event.clientX < rect.left || event.clientX > rect.right)
57
+ return;
58
+ if (lastX == undefined) {
59
+ lastX = event.clientX;
60
+ return;
61
+ }
62
+ var move = Number(event.clientX) - Number(lastX);
63
+ count += move;
64
+ count = Math.min(_this.props.wrapperWidth, count);
65
+ count = Math.max(0, count);
66
+ var newPercent = count / _this.props.wrapperWidth * 100;
67
+ _this.setState({
68
+ percent: newPercent
69
+ }, function () {
70
+ if (_this.props.onDrag)
71
+ _this.props.onDrag(newPercent);
72
+ });
73
+ lastX = event.clientX;
74
+ };
75
+ _this.onDragEnd = function (event) {
76
+ lastX = undefined;
77
+ console.log('【Progress】DragEnd event.clientX--' + event.clientX + '-----percent----' + _this.state.percent + '-----currentX----' + (_this.state.percent / 100 * _this.props.wrapperWidth));
78
+ if (_this.props.onDragEnd) {
79
+ _this.props.onDragEnd(_this.state.percent);
80
+ }
81
+ };
82
+ _this.computeWrapperStyle = function () {
83
+ wrapperStyle = __assign({ width: _this.props.wrapperWidth + 'px', height: _this.props.wrapperHeight + 'px' }, row_center_center);
84
+ };
85
+ _this.computeOuterStyle = function () {
86
+ outerStyle = {
87
+ width: '100%',
88
+ height: _this.props.height + 'px',
89
+ backgroundImage: "url(".concat(_this.props.outerBg, ")"),
90
+ backgroundSize: '100% 100%'
91
+ };
92
+ };
93
+ _this.computeInnerStyle = function () {
94
+ var _width = Math.floor(_this.state.percent) + '%';
95
+ innerStyle = {
96
+ width: _width,
97
+ height: '100%',
98
+ backgroundImage: "url(".concat(_this.props.innerBg, ")"),
99
+ backgroundSize: '100% 100%'
100
+ };
101
+ };
102
+ _this.computeDotWrapperStyle = function () {
103
+ dotWrapperStyle = __assign({ position: 'absolute', width: _this.props.dotWrapperWidth + 'px', height: _this.props.dotWrapperHeight + 'px', marginTop: (_this.props.height - _this.props.dotWrapperHeight) / 2 + 'px', marginLeft: (_this.props.wrapperWidth * _this.state.percent / 100 - _this.props.dotWrapperWidth / 2) + 'px' }, row_center_center
104
+ // backgroundColor: '#FF000066'
105
+ );
106
+ };
107
+ _this.computeDotStyle = function () {
108
+ dotStyle = {
109
+ width: _this.props.dotWidth + 'px',
110
+ height: _this.props.dotHeight + 'px',
111
+ };
112
+ };
113
+ _this.state = {
114
+ percent: Math.floor(_this.props.percent)
115
+ };
116
+ _this.computeWrapperStyle();
117
+ _this.computeOuterStyle();
118
+ return _this;
119
+ }
120
+ Progress.prototype.componentDidMount = function () {
121
+ rect = this.refWrapper.current.getBoundingClientRect();
122
+ };
123
+ Progress.prototype.componentWillReceiveProps = function (nextProps) {
124
+ if (nextProps.percent == this.props.percent)
125
+ return;
126
+ this.setState({
127
+ percent: nextProps.percent
128
+ });
129
+ };
130
+ Progress.prototype.render = function () {
131
+ this.computeInnerStyle();
132
+ this.computeDotWrapperStyle();
133
+ this.computeDotStyle();
134
+ return (h("div", { ref: this.refWrapper, style: wrapperStyle },
135
+ h("div", { style: outerStyle },
136
+ h("div", { style: innerStyle },
137
+ h("div", { style: dotWrapperStyle, draggable: true, onDragStart: this.onDragStart, onDrag: this.onDrag, onDragEnd: this.onDragEnd },
138
+ h("img", { src: this.props.dotBg, style: dotStyle }))))));
139
+ };
140
+ return Progress;
141
+ }(Component));
142
+ export { Progress };
@@ -1,12 +1,12 @@
1
- import { h, Component } from "preact";
2
- export declare class Slapface extends Component<any, any> {
3
- private LoadGroup;
4
- private jumpButton;
5
- private settingsitems;
6
- private btn_closeButton;
7
- private pic_loading;
8
- private actDisplay;
9
- closeAct: () => void;
10
- constructor(props: any);
11
- render(): h.JSX.Element;
12
- }
1
+ import { h, Component } from "preact";
2
+ export declare class Slapface extends Component<any, any> {
3
+ private LoadGroup;
4
+ private jumpButton;
5
+ private settingsitems;
6
+ private btn_closeButton;
7
+ private pic_loading;
8
+ private actDisplay;
9
+ closeAct: () => void;
10
+ constructor(props: any);
11
+ render(): h.JSX.Element;
12
+ }