pixuireactcomponents 1.3.24 → 1.3.26
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.
- package/index.d.ts +1 -1
- package/lib/check/{util.jsx → util.js} +33 -39
- package/lib/preact-router/match/src/index.js +16 -7
- package/package.json +1 -1
- package/src/components/react/app/bulletscreen/BulletItemAnimation.d.ts +2 -2
- package/src/components/react/app/bulletscreen/{BulletItemAnimation.jsx → BulletItemAnimation.js} +7 -8
- package/src/components/react/app/bulletscreen/BulletScreenAnimation.d.ts +2 -2
- package/src/components/react/app/bulletscreen/{BulletScreenAnimation.jsx → BulletScreenAnimation.js} +8 -11
- package/src/components/react/app/button/{Button.jsx → Button.js} +6 -8
- package/src/components/react/app/carousel/Carousel.d.ts +1 -1
- package/src/components/react/app/carousel/{Carousel.jsx → Carousel.js} +29 -70
- package/src/components/react/app/checkBox/{CheckBox.jsx → CheckBox.js} +1 -1
- package/src/components/react/app/dropdown/{Dropdown.jsx → Dropdown.js} +5 -9
- package/src/components/react/app/imageViewer/{imageViewer.jsx → imageViewer.js} +7 -11
- package/src/components/react/app/slider/Slider.d.ts +55 -21
- package/src/components/react/app/slider/{Slider.jsx → Slider.js} +152 -96
- package/src/components/react/app/togglegroup/{ToggleGroup.jsx → ToggleGroup.js} +16 -18
- package/src/components/react/base/gradient/{GradientText.jsx → GradientText.js} +1 -1
- package/src/components/react/base/outlinetext/{OutlineText.jsx → OutlineText.js} +2 -3
- package/src/components/react/base/pixVideo/PixPlaceHolder.d.ts +2 -2
- package/src/components/react/base/pixVideo/{PixPlaceHolder.jsx → PixPlaceHolder.js} +3 -5
- package/src/sample/Images.d.ts +0 -31
- package/src/sample/Images.js +0 -60
- package/src/sample/OutlineText/OutlineDemo.d.ts +0 -20
- package/src/sample/OutlineText/OutlineDemo.jsx +0 -60
- package/src/sample/bulletscreen/BulletDemo.d.ts +0 -12
- package/src/sample/bulletscreen/BulletDemo.jsx +0 -83
- package/src/sample/button/ButtonDemo.d.ts +0 -4
- package/src/sample/button/ButtonDemo.jsx +0 -30
- package/src/sample/carousel/carouselDemo.d.ts +0 -1
- package/src/sample/carousel/carouselDemo.jsx +0 -107
- package/src/sample/checkBox/checkBoxDemo.d.ts +0 -1
- package/src/sample/checkBox/checkBoxDemo.jsx +0 -23
- package/src/sample/dropdown/DropdownDemo.d.ts +0 -6
- package/src/sample/dropdown/DropdownDemo.jsx +0 -65
- package/src/sample/dropdown/MoneyDropdownOption.d.ts +0 -6
- package/src/sample/dropdown/MoneyDropdownOption.jsx +0 -57
- package/src/sample/dropdown/MoneyDropdownSpreadMain.d.ts +0 -5
- package/src/sample/dropdown/MoneyDropdownSpreadMain.jsx +0 -50
- package/src/sample/dropdown/MoneyDropdownUnspreadMain.d.ts +0 -5
- package/src/sample/dropdown/MoneyDropdownUnspreadMain.jsx +0 -50
- package/src/sample/gradient/GradientDemo.d.ts +0 -16
- package/src/sample/gradient/GradientDemo.jsx +0 -53
- package/src/sample/imageViewer/Images.d.ts +0 -4
- package/src/sample/imageViewer/Images.jsx +0 -6
- package/src/sample/imageViewer/imageViewerDemo.d.ts +0 -10
- package/src/sample/imageViewer/imageViewerDemo.jsx +0 -70
- package/src/sample/slider/SliderDemo.d.ts +0 -10
- package/src/sample/slider/SliderDemo.jsx +0 -117
- package/src/sample/togglegroup/ToggleGroupDemo.d.ts +0 -4
- package/src/sample/togglegroup/ToggleGroupDemo.jsx +0 -64
- package/tsconfig.json +0 -55
- /package/lib/check/{main.jsx → main.js} +0 -0
- /package/lib/pi_component/tinyList/{tinyList.jsx → tinyList.js} +0 -0
- /package/src/components/react/app/dropdown/{DropdownOptionUI.jsx → DropdownOptionUI.js} +0 -0
- /package/src/components/react/app/dropdown/{DropdownSpreadMainUI.jsx → DropdownSpreadMainUI.js} +0 -0
- /package/src/components/react/app/dropdown/{DropdownUnspreadMainUI.jsx → DropdownUnspreadMainUI.js} +0 -0
- /package/src/components/react/base/pixVideo/{PixVideo.jsx → PixVideo.js} +0 -0
- /package/src/components/tools/{Logger.jsx → Logger.js} +0 -0
package/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export { Button } from "./src/components/react/app/button/Button";
|
|
|
3
3
|
export { Checkbox } from "./src/components/react/app/checkBox/CheckBox";
|
|
4
4
|
export { Dropdown } from "./src/components/react/app/dropdown/Dropdown";
|
|
5
5
|
export { ImageViewer } from "./src/components/react/app/imageViewer/imageViewer";
|
|
6
|
-
export { Slider } from "./src/components/react/app/slider/Slider";
|
|
7
6
|
export { ToggleGroup } from "./src/components/react/app/togglegroup/ToggleGroup";
|
|
8
7
|
export { GradientText } from "./src/components/react/base/gradient/GradientText";
|
|
9
8
|
export { PVideo } from "./src/components/react/base/pixVideo/PixVideo";
|
|
10
9
|
export { OutlineText } from "./src/components/react/base/outlinetext/OutlineText";
|
|
11
10
|
export { ImgPreLoader } from "./src/components/tools/ImgPreLoader";
|
|
12
11
|
export { Logger } from "./src/components/tools/Logger";
|
|
12
|
+
export { Slider, SliderProps } from "./src/components/react/app/slider/Slider";
|
|
@@ -69,16 +69,16 @@ var Counter = /** @class */ (function (_super) {
|
|
|
69
69
|
return _this;
|
|
70
70
|
}
|
|
71
71
|
Counter.prototype.render = function (props, state) {
|
|
72
|
-
return (
|
|
72
|
+
return (h("div", { style: {
|
|
73
73
|
display: 'flex',
|
|
74
74
|
flexDirection: 'row',
|
|
75
75
|
// color: '#f93f00',
|
|
76
76
|
backgroundColor: state.value % 2 ? '#992288' : '#33ff54',
|
|
77
|
-
}}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
} },
|
|
78
|
+
"Counter: ",
|
|
79
|
+
state.value,
|
|
80
|
+
h("div", { style: { width: '20px' } }),
|
|
81
|
+
h("div", { onClick: this.increment }, "Increment")));
|
|
82
82
|
};
|
|
83
83
|
return Counter;
|
|
84
84
|
}(Component));
|
|
@@ -93,14 +93,14 @@ var Title = /** @class */ (function (_super) {
|
|
|
93
93
|
return _this;
|
|
94
94
|
}
|
|
95
95
|
Title.prototype.render = function (props, state) {
|
|
96
|
-
return (
|
|
96
|
+
return (h("div", { style: {
|
|
97
97
|
display: 'flex',
|
|
98
98
|
flexDirection: 'column',
|
|
99
99
|
backgroundColor: '#f98833',
|
|
100
|
-
}}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
} },
|
|
101
|
+
"title: ",
|
|
102
|
+
state.title,
|
|
103
|
+
h(Link, { href: wp('') }, "back home")));
|
|
104
104
|
};
|
|
105
105
|
return Title;
|
|
106
106
|
}(Component));
|
|
@@ -116,32 +116,26 @@ var makeError3 = function () { return __awaiter(void 0, void 0, void 0, function
|
|
|
116
116
|
});
|
|
117
117
|
}); };
|
|
118
118
|
export var getView = function () {
|
|
119
|
-
return (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<div>easy! </div>
|
|
142
|
-
<div>beautiful!</div>
|
|
143
|
-
<div>crossplatform!</div>
|
|
144
|
-
</div>
|
|
145
|
-
<div>let's start and go further!</div>
|
|
146
|
-
</div>);
|
|
119
|
+
return (h("div", { style: { width: '99%' } },
|
|
120
|
+
h(Router, null,
|
|
121
|
+
h(Counter, { loggedIn: true, path: wp('') }),
|
|
122
|
+
h(Title, { path: wp('hi') })),
|
|
123
|
+
h(Link, { href: wp('hi') }, "Profile"),
|
|
124
|
+
h("div", { className: css.flexrow },
|
|
125
|
+
h("img", { src: preact, onClick: function () {
|
|
126
|
+
console.log('click preact...');
|
|
127
|
+
makeError2();
|
|
128
|
+
} }),
|
|
129
|
+
h("img", { src: pix }),
|
|
130
|
+
h("div", { style: { width: '200px', height: '100px', borderImage: "url(".concat(border, ") 2 2 2 2 fill stretch") } })),
|
|
131
|
+
h("div", { style: { border: '1px solid black', width: 200, height: 200 } },
|
|
132
|
+
h("video", { autoPlay: true, src: 'https://www.runoob.com/try/demo_source/mov_bbb.mp4', style: { loop: 'loop', width: 200, height: 200 } })),
|
|
133
|
+
h("div", { onClick: function (e) { return console.log('click', e); } }, "Pixui is a embeddable browser engine"),
|
|
134
|
+
h("div", null, "Preact is a react-like framework"),
|
|
135
|
+
h("div", null, "with webpack and typescript workflow"),
|
|
136
|
+
h("div", { className: css.flexrow },
|
|
137
|
+
h("div", null, "easy! "),
|
|
138
|
+
h("div", null, "beautiful!"),
|
|
139
|
+
h("div", null, "crossplatform!")),
|
|
140
|
+
h("div", null, "let's start and go further!")));
|
|
147
141
|
};
|
|
@@ -13,6 +13,17 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
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
|
+
};
|
|
16
27
|
var __rest = (this && this.__rest) || function (s, e) {
|
|
17
28
|
var t = {};
|
|
18
29
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
@@ -56,12 +67,10 @@ var Match = /** @class */ (function (_super) {
|
|
|
56
67
|
export { Match };
|
|
57
68
|
export var Link = function (_a) {
|
|
58
69
|
var activeClassName = _a.activeClassName, path = _a.path, props = __rest(_a, ["activeClassName", "path"]);
|
|
59
|
-
return (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}}
|
|
65
|
-
</Match>);
|
|
70
|
+
return (h(Match, { path: path || props.href }, function (_a) {
|
|
71
|
+
var matches = _a.matches;
|
|
72
|
+
var cls = [props.class || props.className, matches && activeClassName].filter(Boolean).join(' ');
|
|
73
|
+
return h(StaticLink, __assign({}, props, { className: cls }));
|
|
74
|
+
}));
|
|
66
75
|
};
|
|
67
76
|
export default Match;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from 'preact';
|
|
1
|
+
import { Component, h } from 'preact';
|
|
2
2
|
export declare class BulletInfo {
|
|
3
3
|
key: number;
|
|
4
4
|
text: string;
|
|
@@ -27,5 +27,5 @@ export declare class BulletItemAnimation extends Component<{
|
|
|
27
27
|
onAnimationEnd: () => void;
|
|
28
28
|
setFreeChannelTimer: () => void;
|
|
29
29
|
freeChannel: () => void;
|
|
30
|
-
render():
|
|
30
|
+
render(): h.JSX.Element;
|
|
31
31
|
}
|
package/src/components/react/app/bulletscreen/{BulletItemAnimation.jsx → BulletItemAnimation.js}
RENAMED
|
@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import { createRef } from 'lib/preact/src/create-element';
|
|
17
|
-
import { Component } from 'preact';
|
|
17
|
+
import { Component, h } from 'preact';
|
|
18
18
|
// 弹幕相关个性化信息
|
|
19
19
|
var BulletInfo = /** @class */ (function () {
|
|
20
20
|
function BulletInfo(key, text, channel, color, fontSize) {
|
|
@@ -48,15 +48,15 @@ var BulletItemAnimation = /** @class */ (function (_super) {
|
|
|
48
48
|
var _this = _super.call(this, props) || this;
|
|
49
49
|
_this.freeChannelTimer = undefined;
|
|
50
50
|
_this.refText = createRef();
|
|
51
|
-
_this.onAnimationStart = function () {
|
|
52
|
-
};
|
|
51
|
+
_this.onAnimationStart = function () { };
|
|
53
52
|
_this.onAnimationEnd = function () {
|
|
54
53
|
_this.props.onItemFree();
|
|
55
54
|
};
|
|
56
55
|
_this.setFreeChannelTimer = function () {
|
|
57
56
|
var realWidthStr = window.getComputedStyle(_this.refText.current, null).getPropertyValue('width');
|
|
58
57
|
var widthNum = parseInt(realWidthStr.substring(0, realWidthStr.length - 2));
|
|
59
|
-
_this.freeChannelTimer = setTimeout(_this.freeChannel, (widthNum + BULLET_DISTANCE) / (_this.props.bulletConfig.screenWidth + BULLET_MAX_LEN) *
|
|
58
|
+
_this.freeChannelTimer = setTimeout(_this.freeChannel, ((widthNum + BULLET_DISTANCE) / (_this.props.bulletConfig.screenWidth + BULLET_MAX_LEN)) *
|
|
59
|
+
_this.props.bulletConfig.totalTime);
|
|
60
60
|
};
|
|
61
61
|
_this.freeChannel = function () {
|
|
62
62
|
_this.props.onChannelFree(_this.props.bulletInfo.channel);
|
|
@@ -72,7 +72,7 @@ var BulletItemAnimation = /** @class */ (function (_super) {
|
|
|
72
72
|
BulletItemAnimation.prototype.render = function () {
|
|
73
73
|
var isMe = false;
|
|
74
74
|
var bulletStyle = {
|
|
75
|
-
marginTop:
|
|
75
|
+
marginTop: this.props.bulletInfo.channel * this.props.bulletConfig.channelHeight + 'px',
|
|
76
76
|
height: this.props.bulletConfig.channelHeight + 'px',
|
|
77
77
|
left: this.props.bulletConfig.screenWidth + 'px',
|
|
78
78
|
animation: 'bulletKeyframe 10s linear 1',
|
|
@@ -85,9 +85,8 @@ var BulletItemAnimation = /** @class */ (function (_super) {
|
|
|
85
85
|
fontSize: this.props.bulletInfo.fontSize + 'px',
|
|
86
86
|
color: this.props.bulletInfo.color,
|
|
87
87
|
};
|
|
88
|
-
return (
|
|
89
|
-
|
|
90
|
-
</div>);
|
|
88
|
+
return (h("div", { ref: this.refText, style: bulletStyle },
|
|
89
|
+
h("text", null, this.props.bulletInfo.text)));
|
|
91
90
|
};
|
|
92
91
|
return BulletItemAnimation;
|
|
93
92
|
}(Component));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component } from 'preact';
|
|
1
|
+
import { Component, h } from 'preact';
|
|
2
2
|
import { BulletInfo } from './BulletItemAnimation';
|
|
3
3
|
export declare class BulletScreenAnimationData {
|
|
4
4
|
generateCycle: number;
|
|
@@ -47,5 +47,5 @@ export declare class BulletScreenAnimation extends Component<{
|
|
|
47
47
|
getAvailableChannelByPosition: () => any;
|
|
48
48
|
onItemFree: () => void;
|
|
49
49
|
onChannelFree: (channel: any) => void;
|
|
50
|
-
render():
|
|
50
|
+
render(): h.JSX.Element;
|
|
51
51
|
}
|
package/src/components/react/app/bulletscreen/{BulletScreenAnimation.jsx → BulletScreenAnimation.js}
RENAMED
|
@@ -14,7 +14,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
/* eslint-disable linebreak-style */
|
|
17
|
-
import { Component } from 'preact';
|
|
17
|
+
import { Component, h } from 'preact';
|
|
18
18
|
import { BulletInfo, BulletConfig, BulletItemAnimation } from './BulletItemAnimation';
|
|
19
19
|
import { Logger } from '../../../tools/Logger';
|
|
20
20
|
// item数据类型
|
|
@@ -69,7 +69,7 @@ var BulletScreenAnimation = /** @class */ (function (_super) {
|
|
|
69
69
|
_this.initChannels();
|
|
70
70
|
var newIndex = _this.state.refreshIndex + 1;
|
|
71
71
|
_this.setState({
|
|
72
|
-
refreshIndex: newIndex
|
|
72
|
+
refreshIndex: newIndex,
|
|
73
73
|
});
|
|
74
74
|
};
|
|
75
75
|
_this.SetScreenSizeChanging = function () {
|
|
@@ -82,8 +82,7 @@ var BulletScreenAnimation = /** @class */ (function (_super) {
|
|
|
82
82
|
_this.generateDynamicAnimation('bulletKeyframe', "from{\n left: ".concat(currentProps.screenWidth, "px\n }\n to{\n left: -400px;\n }"));
|
|
83
83
|
};
|
|
84
84
|
_this.isScreenSizeSame = function (oldProps, newProps) {
|
|
85
|
-
if (oldProps.screenWidth == newProps.screenWidth &&
|
|
86
|
-
oldProps.screenHeight == newProps.screenHeight) {
|
|
85
|
+
if (oldProps.screenWidth == newProps.screenWidth && oldProps.screenHeight == newProps.screenHeight) {
|
|
87
86
|
return true;
|
|
88
87
|
}
|
|
89
88
|
return false;
|
|
@@ -160,7 +159,7 @@ var BulletScreenAnimation = /** @class */ (function (_super) {
|
|
|
160
159
|
_this.hasPosition[channel] = true;
|
|
161
160
|
};
|
|
162
161
|
_this.setState({
|
|
163
|
-
refreshIndex: 0
|
|
162
|
+
refreshIndex: 0,
|
|
164
163
|
});
|
|
165
164
|
_this.initChannels();
|
|
166
165
|
_this.consumeBulletTimer = setInterval(function () {
|
|
@@ -179,7 +178,7 @@ var BulletScreenAnimation = /** @class */ (function (_super) {
|
|
|
179
178
|
_this.hasPosition[curChannel] = false;
|
|
180
179
|
var newIndex = _this.state.refreshIndex + 1;
|
|
181
180
|
_this.setState({
|
|
182
|
-
refreshIndex: newIndex
|
|
181
|
+
refreshIndex: newIndex,
|
|
183
182
|
});
|
|
184
183
|
}
|
|
185
184
|
}, _this.props.screenData.generateCycle);
|
|
@@ -222,11 +221,9 @@ var BulletScreenAnimation = /** @class */ (function (_super) {
|
|
|
222
221
|
};
|
|
223
222
|
var screenData = this.props.screenData;
|
|
224
223
|
var commonInfo = new BulletConfig(this.props.screenWidth, screenData.channelHeight, screenData.totalTime);
|
|
225
|
-
return (
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
})}
|
|
229
|
-
</div>);
|
|
224
|
+
return (h("div", { style: container }, bulletDataList.map(function (value, index) {
|
|
225
|
+
return (h(BulletItemAnimation, { key: value.key, bulletInfo: value, bulletConfig: commonInfo, onItemFree: _this.onItemFree, onChannelFree: _this.onChannelFree }));
|
|
226
|
+
})));
|
|
230
227
|
};
|
|
231
228
|
return BulletScreenAnimation;
|
|
232
229
|
}(Component));
|
|
@@ -9,20 +9,18 @@ var ButtonState;
|
|
|
9
9
|
export var Button = function (props) {
|
|
10
10
|
var _a;
|
|
11
11
|
var buttonState = (_a = useState(ButtonState.normal), _a[0]), setButtonState = _a[1];
|
|
12
|
-
return (
|
|
12
|
+
return (h("div", { style: buttonState == ButtonState.normal
|
|
13
13
|
? props.normalStyle
|
|
14
14
|
: buttonState == ButtonState.hover
|
|
15
15
|
? props.hoverStyle
|
|
16
|
-
: props.pressStyle
|
|
16
|
+
: props.pressStyle, onMouseDown: function () {
|
|
17
17
|
setButtonState(ButtonState.press);
|
|
18
|
-
}
|
|
18
|
+
}, onMouseUp: function () {
|
|
19
19
|
setButtonState(ButtonState.hover);
|
|
20
20
|
props.clickEvent();
|
|
21
|
-
}
|
|
21
|
+
}, onMouseOver: function () {
|
|
22
22
|
setButtonState(ButtonState.hover);
|
|
23
|
-
}
|
|
23
|
+
}, onMouseOut: function () {
|
|
24
24
|
setButtonState(ButtonState.normal);
|
|
25
|
-
}}
|
|
26
|
-
{props.text}
|
|
27
|
-
</div>);
|
|
25
|
+
} }, props.text));
|
|
28
26
|
};
|
|
@@ -101,7 +101,7 @@ export function Carousel(props) {
|
|
|
101
101
|
//组件展示内容长度改变的时候改回到第一个元素,刷新autoplay判断
|
|
102
102
|
useEffect(function () {
|
|
103
103
|
setNextInterval();
|
|
104
|
-
setShowIndex(
|
|
104
|
+
setShowIndex(defaultIndex);
|
|
105
105
|
}, [children]);
|
|
106
106
|
useEffect(function () {
|
|
107
107
|
//每次跳转前判断打开动画,否则动画关闭以后不会调用handleTransitionEnd
|
|
@@ -232,73 +232,32 @@ export function Carousel(props) {
|
|
|
232
232
|
onclickEvent(showIndex - 1);
|
|
233
233
|
}
|
|
234
234
|
};
|
|
235
|
-
return (
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
}} onDragEnd={function () {
|
|
264
|
-
if (children.length > 1) {
|
|
265
|
-
gestureUp();
|
|
266
|
-
}
|
|
267
|
-
}}/>
|
|
268
|
-
|
|
269
|
-
{/* 调试信息 */}
|
|
270
|
-
{/* {logTex}
|
|
271
|
-
{gesteroffset[0]}
|
|
272
|
-
{gesteroffset[1]} */}
|
|
273
|
-
|
|
274
|
-
{/* 页码图标 */}
|
|
275
|
-
{/* <div style={{ flexDirection: isVertical ? 'column' : 'row' }}>
|
|
276
|
-
{children.map((v, i) => {
|
|
277
|
-
return (
|
|
278
|
-
<div
|
|
279
|
-
style={showIndex == i + 1 ? indicatorSelectedStyle : indicatorStyle}
|
|
280
|
-
onClick={() => {
|
|
281
|
-
setShowIndex(i + 1);
|
|
282
|
-
}}
|
|
283
|
-
/>
|
|
284
|
-
);
|
|
285
|
-
})}
|
|
286
|
-
</div> */}
|
|
287
|
-
</div>);
|
|
235
|
+
return (h("div", { style: { flexDirection: 'column' } },
|
|
236
|
+
h("div", { draggable: true, style: __assign(__assign({}, itemBoxStyle), { position: 'absolute' }), onClick: function (ev) {
|
|
237
|
+
gestureClick(props);
|
|
238
|
+
}, class: 'GestureComp', onDragStart: function (e) {
|
|
239
|
+
if (children.length > 1) {
|
|
240
|
+
gestureDown(e);
|
|
241
|
+
}
|
|
242
|
+
}, onDrag: function (e) {
|
|
243
|
+
if (children.length > 1) {
|
|
244
|
+
gestureMove(e);
|
|
245
|
+
}
|
|
246
|
+
}, onDragEnd: function () {
|
|
247
|
+
if (children.length > 1) {
|
|
248
|
+
gestureUp();
|
|
249
|
+
}
|
|
250
|
+
} },
|
|
251
|
+
h("div", { style: __assign(__assign({ position: 'relative' }, itemBoxStyle), { overflow: 'hidden', flexShrink: 0 }) },
|
|
252
|
+
h("div", { style: {
|
|
253
|
+
display: 'flex',
|
|
254
|
+
width: isVertical ? compWidth : compWidth * carouselItems.length + 'px',
|
|
255
|
+
height: isVertical ? compHeight * carouselItems.length : compHeight + 'px',
|
|
256
|
+
transition: "transform ".concat(showTransition ? '0.5s' : '0s', " ease 0s"),
|
|
257
|
+
transform: isVertical
|
|
258
|
+
? "translate(0px, ".concat(offset + gesteroffset[1], "px)")
|
|
259
|
+
: "translate(".concat(offset + gesteroffset[0], "px, 0px)"),
|
|
260
|
+
flexDirection: isVertical ? 'column' : 'row',
|
|
261
|
+
flexShrink: 0,
|
|
262
|
+
}, class: "wrapper", onTransitionEnd: handleTransitionEnd }, carouselItems.map(function (child) { return child; }))))));
|
|
288
263
|
}
|
|
289
|
-
// Carousel.Item = (props) => {
|
|
290
|
-
// return (
|
|
291
|
-
// <div
|
|
292
|
-
// style={
|
|
293
|
-
// {
|
|
294
|
-
// // width: '100%',
|
|
295
|
-
// // height: '100%',
|
|
296
|
-
// // flexShrink: 0,
|
|
297
|
-
// }
|
|
298
|
-
// }
|
|
299
|
-
// >
|
|
300
|
-
// {' '}
|
|
301
|
-
// {props.children}
|
|
302
|
-
// </div>
|
|
303
|
-
// );
|
|
304
|
-
// }
|
|
@@ -74,9 +74,7 @@ var Dropdown = /** @class */ (function (_super) {
|
|
|
74
74
|
if (!this.state.isSpread) {
|
|
75
75
|
this.props.unspreadMainUI.props.info = this.props.config.datas[this.state.selectedIndex];
|
|
76
76
|
this.props.unspreadMainUI.props.openList = this.openList;
|
|
77
|
-
return (
|
|
78
|
-
{this.props.unspreadMainUI}
|
|
79
|
-
</div>);
|
|
77
|
+
return (h("div", null, this.props.unspreadMainUI));
|
|
80
78
|
}
|
|
81
79
|
this.props.spreadMainUI.props.info = this.props.config.datas[this.state.selectedIndex];
|
|
82
80
|
this.props.spreadMainUI.props.closeList = this.closeList;
|
|
@@ -84,12 +82,10 @@ var Dropdown = /** @class */ (function (_super) {
|
|
|
84
82
|
var _optionsUI = this.props.optionsUI.filter(function (v) { return v.props.index != _this.state.selectedIndex; });
|
|
85
83
|
if (_optionsUI.length > 0)
|
|
86
84
|
_optionsUI[_optionsUI.length - 1].props['isLast'] = true;
|
|
87
|
-
return (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</div>
|
|
92
|
-
</div>);
|
|
85
|
+
return (h("div", null,
|
|
86
|
+
h("div", { style: this.props.config.spreadStyle },
|
|
87
|
+
this.props.spreadMainUI,
|
|
88
|
+
h("div", { style: optionsDivStyle }, _optionsUI))));
|
|
93
89
|
};
|
|
94
90
|
return Dropdown;
|
|
95
91
|
}(Component));
|
|
@@ -90,17 +90,13 @@ var ImageViewer = /** @class */ (function (_super) {
|
|
|
90
90
|
// forceupdate: false,
|
|
91
91
|
// })
|
|
92
92
|
// }
|
|
93
|
-
return (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
{
|
|
100
|
-
<img onLoad={this.handleImageLoad} style={{ display: 'hidden' }} src={this.props.src}/>}
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
</div>);
|
|
93
|
+
return (h("div", { style: this.props.backgroundStyle, onClick: this.onClose },
|
|
94
|
+
h("div", { style: this.props.imageBoxStyle },
|
|
95
|
+
h("div", { id: "imageArea", style: this.props.imageAreaStyle },
|
|
96
|
+
this.state.reCalSize &&
|
|
97
|
+
h("img", { style: this.props.imageStyle, src: this.props.src, width: this.state.imageWidth, height: this.state.imageHeight, onClick: this.onBlock }),
|
|
98
|
+
!this.state.reCalSize &&
|
|
99
|
+
h("img", { onLoad: this.handleImageLoad, style: { display: 'hidden' }, src: this.props.src })))));
|
|
104
100
|
};
|
|
105
101
|
return ImageViewer;
|
|
106
102
|
}(Component));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Component, h } from 'preact';
|
|
1
|
+
import { Component, CSSProperties, h } from 'preact';
|
|
2
2
|
export interface SliderProps {
|
|
3
|
-
percent
|
|
4
|
-
wrapperWidth
|
|
5
|
-
wrapperHeight
|
|
6
|
-
height
|
|
3
|
+
percent?: number;
|
|
4
|
+
wrapperWidth?: number;
|
|
5
|
+
wrapperHeight?: number;
|
|
6
|
+
height?: number;
|
|
7
7
|
innerHeight?: number;
|
|
8
|
-
dotWidth
|
|
9
|
-
dotHeight
|
|
10
|
-
dotWrapperWidth
|
|
11
|
-
dotWrapperHeight
|
|
8
|
+
dotWidth?: number;
|
|
9
|
+
dotHeight?: number;
|
|
10
|
+
dotWrapperWidth?: number;
|
|
11
|
+
dotWrapperHeight?: number;
|
|
12
12
|
outerBg: string;
|
|
13
13
|
innerBg: string;
|
|
14
14
|
dotBg: string;
|
|
@@ -18,7 +18,7 @@ export interface SliderProps {
|
|
|
18
18
|
isDiscrete: boolean | null;
|
|
19
19
|
discrete?: number;
|
|
20
20
|
maxDiscrete?: number;
|
|
21
|
-
hasIncDecButton
|
|
21
|
+
hasIncDecButton?: boolean | null;
|
|
22
22
|
incButtonWidth?: number;
|
|
23
23
|
incButtonHeight?: number;
|
|
24
24
|
decButtonWidth?: number;
|
|
@@ -33,10 +33,43 @@ export interface SliderProps {
|
|
|
33
33
|
endRange?: number;
|
|
34
34
|
hasDot?: boolean;
|
|
35
35
|
}
|
|
36
|
-
|
|
36
|
+
interface SliderState {
|
|
37
37
|
percent: number;
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
onDraging: boolean;
|
|
39
|
+
wrapperStyle: CSSProperties;
|
|
40
|
+
outerStyle: CSSProperties;
|
|
41
|
+
innerStyle: CSSProperties;
|
|
42
|
+
dotStyle: CSSProperties;
|
|
43
|
+
dotWrapperStyle: CSSProperties;
|
|
44
|
+
incButtonStyle: CSSProperties;
|
|
45
|
+
decButtonStyle: CSSProperties;
|
|
46
|
+
withButtonStyle: CSSProperties;
|
|
47
|
+
}
|
|
48
|
+
export declare class Slider extends Component<SliderProps, SliderState> {
|
|
49
|
+
static defaultProps: {
|
|
50
|
+
percent: number;
|
|
51
|
+
wrapperHeight: number;
|
|
52
|
+
wrapperWidth: number;
|
|
53
|
+
height: number;
|
|
54
|
+
dotWidth: number;
|
|
55
|
+
dotHeight: number;
|
|
56
|
+
dotWrapperWidth: number;
|
|
57
|
+
dotWrapperHeight: number;
|
|
58
|
+
onDragStart: null;
|
|
59
|
+
onDrag: null;
|
|
60
|
+
onDragEnd: null;
|
|
61
|
+
isDiscrete: boolean;
|
|
62
|
+
discrete: number;
|
|
63
|
+
maxDiscrete: number;
|
|
64
|
+
hasIncDecButton: boolean;
|
|
65
|
+
overallWidth: number;
|
|
66
|
+
rangeControl: boolean;
|
|
67
|
+
hasDot: boolean;
|
|
68
|
+
};
|
|
69
|
+
private lastX;
|
|
70
|
+
private count;
|
|
71
|
+
private rect;
|
|
72
|
+
private discrete;
|
|
40
73
|
private refWrapper;
|
|
41
74
|
constructor(props: any);
|
|
42
75
|
componentDidMount(): void;
|
|
@@ -46,13 +79,14 @@ export declare class Slider extends Component<SliderProps, {
|
|
|
46
79
|
onDragEnd: (event: any) => void;
|
|
47
80
|
onDecClick: () => void;
|
|
48
81
|
onIncClick: () => void;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
82
|
+
wrapperStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
83
|
+
outerStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
84
|
+
innerStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
85
|
+
dotWrapperStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
86
|
+
dotStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
87
|
+
incButtonStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
88
|
+
decButtonStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
89
|
+
withButtonStyle: () => import("../../../../../lib/preact/src/jsx").JCSSProperties;
|
|
57
90
|
render(): h.JSX.Element;
|
|
58
91
|
}
|
|
92
|
+
export {};
|