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
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
import { Component } from 'preact';
|
|
17
|
-
import { OutlineText } from 'src/components/react/base/outlinetext/OutlineText';
|
|
18
|
-
var OutlineDemo = /** @class */ (function (_super) {
|
|
19
|
-
__extends(OutlineDemo, _super);
|
|
20
|
-
function OutlineDemo(param) {
|
|
21
|
-
var _this = _super.call(this, param) || this;
|
|
22
|
-
_this.setState({
|
|
23
|
-
style: { width: '200px', height: '200px', backgroundColor: '#FF00FFFF' },
|
|
24
|
-
outlineDistance: {
|
|
25
|
-
x: 2,
|
|
26
|
-
y: 2
|
|
27
|
-
},
|
|
28
|
-
outlineColor: {
|
|
29
|
-
r: 0,
|
|
30
|
-
g: 204,
|
|
31
|
-
b: 0,
|
|
32
|
-
a: 1,
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return _this;
|
|
36
|
-
}
|
|
37
|
-
OutlineDemo.prototype.onClickButton = function () {
|
|
38
|
-
this.setState({
|
|
39
|
-
style: { width: '100px', height: '100px', backgroundColor: '#FFFF00FF' },
|
|
40
|
-
outlineDistance: {
|
|
41
|
-
x: 1,
|
|
42
|
-
y: 1
|
|
43
|
-
},
|
|
44
|
-
outlineColor: {
|
|
45
|
-
r: 255,
|
|
46
|
-
g: 0,
|
|
47
|
-
b: 0,
|
|
48
|
-
a: 1,
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
};
|
|
52
|
-
OutlineDemo.prototype.render = function () {
|
|
53
|
-
return (<div>
|
|
54
|
-
<div style={{ width: '100px', height: '100px', backgroundColor: '#FF00FFFF' }} onClick={this.onClickButton.bind(this)}>点击更新组件状态</div>
|
|
55
|
-
<OutlineText style={this.state.style} outlineDistance={this.state.outlineDistance} outlineColor={this.state.outlineColor}/>
|
|
56
|
-
</div>);
|
|
57
|
-
};
|
|
58
|
-
return OutlineDemo;
|
|
59
|
-
}(Component));
|
|
60
|
-
export { OutlineDemo };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Component } from 'preact';
|
|
2
|
-
export declare class BulletDemo extends Component<any, {
|
|
3
|
-
screenWidth: number;
|
|
4
|
-
screenHeight: number;
|
|
5
|
-
}> {
|
|
6
|
-
constructor(props: any);
|
|
7
|
-
private refRoot;
|
|
8
|
-
private refBulletScreen;
|
|
9
|
-
componentDidMount(): void;
|
|
10
|
-
getRootComputedSize: (key: string) => number | undefined;
|
|
11
|
-
render(): any;
|
|
12
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
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
|
-
import { createRef } from 'lib/preact/src/create-element';
|
|
17
|
-
import { Component } from 'preact';
|
|
18
|
-
import { BulletScreenAnimation } from '../../components/react/app/bulletscreen/BulletScreenAnimation';
|
|
19
|
-
var rootStyle = {
|
|
20
|
-
width: '100%',
|
|
21
|
-
height: '750px',
|
|
22
|
-
display: 'flex',
|
|
23
|
-
flexDirection: 'row',
|
|
24
|
-
justifyContent: 'center',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
backgroundColor: '#FF000055'
|
|
27
|
-
};
|
|
28
|
-
var bulletScreenConfigData = {
|
|
29
|
-
generateCycle: 200,
|
|
30
|
-
channelHeight: 50,
|
|
31
|
-
screenWidth: 0,
|
|
32
|
-
screenHeight: 0,
|
|
33
|
-
totalTime: 8000
|
|
34
|
-
};
|
|
35
|
-
var GetBulletData = (function () {
|
|
36
|
-
var BULLET_NUM = 1;
|
|
37
|
-
return function () {
|
|
38
|
-
console.log('测试弹幕1');
|
|
39
|
-
return '测试弹幕' + BULLET_NUM++;
|
|
40
|
-
};
|
|
41
|
-
}());
|
|
42
|
-
var BulletDemo = /** @class */ (function (_super) {
|
|
43
|
-
__extends(BulletDemo, _super);
|
|
44
|
-
function BulletDemo(props) {
|
|
45
|
-
var _this = _super.call(this, props) || this;
|
|
46
|
-
_this.refRoot = createRef();
|
|
47
|
-
_this.refBulletScreen = createRef();
|
|
48
|
-
_this.getRootComputedSize = function (key) {
|
|
49
|
-
if (key == '' || key == undefined)
|
|
50
|
-
return undefined;
|
|
51
|
-
var realWidthStr = window.getComputedStyle(_this.refRoot.current, null).getPropertyValue(key);
|
|
52
|
-
var widthNum = parseInt(realWidthStr.substring(0, realWidthStr.length - 2));
|
|
53
|
-
return widthNum;
|
|
54
|
-
};
|
|
55
|
-
_this.state = {
|
|
56
|
-
screenWidth: 0,
|
|
57
|
-
screenHeight: 0
|
|
58
|
-
};
|
|
59
|
-
return _this;
|
|
60
|
-
}
|
|
61
|
-
BulletDemo.prototype.componentDidMount = function () {
|
|
62
|
-
var _this = this;
|
|
63
|
-
var _width = this.getRootComputedSize('width');
|
|
64
|
-
var _height = this.getRootComputedSize('height');
|
|
65
|
-
console.warn(_width, '___', _height);
|
|
66
|
-
this.setState({
|
|
67
|
-
screenWidth: _width,
|
|
68
|
-
screenHeight: _height
|
|
69
|
-
}, function () {
|
|
70
|
-
_this.refBulletScreen.current.StartRunBullets();
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
BulletDemo.prototype.render = function () {
|
|
74
|
-
console.warn('[[render]]---)))');
|
|
75
|
-
bulletScreenConfigData.screenWidth = this.state.screenWidth;
|
|
76
|
-
bulletScreenConfigData.screenHeight = this.state.screenHeight;
|
|
77
|
-
return (<div ref={this.refRoot} style={rootStyle}>
|
|
78
|
-
<BulletScreenAnimation screenWidth={this.state.screenWidth} screenHeight={this.state.screenHeight} ref={this.refBulletScreen} isRun={true} screenData={bulletScreenConfigData} getBulletText={GetBulletData}/>
|
|
79
|
-
</div>);
|
|
80
|
-
};
|
|
81
|
-
return BulletDemo;
|
|
82
|
-
}(Component));
|
|
83
|
-
export { BulletDemo };
|
|
@@ -1,30 +0,0 @@
|
|
|
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
|
-
import { Component } from 'preact';
|
|
17
|
-
import { Button } from 'src/components/react/app/button/Button';
|
|
18
|
-
var ButtonDemo = /** @class */ (function (_super) {
|
|
19
|
-
__extends(ButtonDemo, _super);
|
|
20
|
-
function ButtonDemo() {
|
|
21
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
22
|
-
}
|
|
23
|
-
ButtonDemo.prototype.render = function () {
|
|
24
|
-
return (<Button normalStyle={{ width: '100px', height: '50px', backgroundColor: 'rgba(0,255,0,0.5)', border: '1px solid black' }} hoverStyle={{ width: '100px', height: '50px', backgroundColor: 'rgba(255,0,0,0.5)', border: '1px solid black' }} pressStyle={{ width: '100px', height: '50px', backgroundColor: 'rgba(0,0,255,0.5)', border: '1px solid black' }} clickEvent={function () {
|
|
25
|
-
console.log('clicked');
|
|
26
|
-
}} text={'按钮'}/>);
|
|
27
|
-
};
|
|
28
|
-
return ButtonDemo;
|
|
29
|
-
}(Component));
|
|
30
|
-
export { ButtonDemo };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function CarouselDemo(): any;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { useRef, useState } from 'preact/hooks';
|
|
2
|
-
import { memo } from 'lib/preact/compat/src';
|
|
3
|
-
import { Carousel } from 'src/components/react/app/carousel/Carousel';
|
|
4
|
-
//阻止demo中state改变引起函数变化,导致组件刷新
|
|
5
|
-
var CarouselComp = memo(Carousel, function (prev, next) {
|
|
6
|
-
var isSame = true;
|
|
7
|
-
Object.keys(prev).forEach(function (key) {
|
|
8
|
-
if (key === 'children' && prev.children && next.children) {
|
|
9
|
-
if (prev.children.length !== next.children.length) {
|
|
10
|
-
isSame = false;
|
|
11
|
-
}
|
|
12
|
-
for (var i = 0; i < prev.children.length; i++) {
|
|
13
|
-
if (prev.children[i][key] !== next.children[i][key]) {
|
|
14
|
-
isSame = false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
else if (!(prev[key] instanceof Function)) {
|
|
19
|
-
if (prev[key] !== next[key]) {
|
|
20
|
-
isSame = false;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
return isSame;
|
|
25
|
-
});
|
|
26
|
-
/*
|
|
27
|
-
选项:
|
|
28
|
-
defaultIndex: number = 1, //默认index,从1开始
|
|
29
|
-
compWidth: number = 100, //组件宽度
|
|
30
|
-
compHeight: number = 100, //组件高度
|
|
31
|
-
autoplay: boolean = true, //自动轮播
|
|
32
|
-
switchDuration: number = 3000, //自动轮播切换间隔(>1000)
|
|
33
|
-
loop: boolean = true, //播到最后是否停止
|
|
34
|
-
isVertical: boolean = false, //轮播元素滚动方向
|
|
35
|
-
touchable: boolean = true, //是否允许手势切换
|
|
36
|
-
onSlideChange: Function | null = null//切换元素后的回调函数
|
|
37
|
-
onclickEvent: Function
|
|
38
|
-
cRef: PropRef //Carousel的引用,通过ref可以拿到组件的切换方法
|
|
39
|
-
*/
|
|
40
|
-
export function CarouselDemo() {
|
|
41
|
-
var CarouselRef = useRef();
|
|
42
|
-
var _a = useState([1, 2, 3]), carouselData = _a[0], setcarouselData = _a[1];
|
|
43
|
-
var _b = useState(0), showIndex = _b[0], setShowIndex = _b[1];
|
|
44
|
-
var w = 618, h = 400;
|
|
45
|
-
var clicked = function (i) {
|
|
46
|
-
console.log('clicked ' + i);
|
|
47
|
-
};
|
|
48
|
-
var switchNext = function () {
|
|
49
|
-
CarouselRef.current.handleNext();
|
|
50
|
-
};
|
|
51
|
-
var switchPrev = function () {
|
|
52
|
-
CarouselRef.current.handlePrev();
|
|
53
|
-
};
|
|
54
|
-
var _c = useState(true), aut = _c[0], setaut = _c[1];
|
|
55
|
-
var btnSty = { width: '50px', height: '50px', backgroundColor: 'rgba(0,255,0,0.5)', border: '1px solid black' };
|
|
56
|
-
return (<div style={{ display: 'flex', flexShrink: '0', flexDirection: 'column' }}>
|
|
57
|
-
<CarouselComp onclickEvent={clicked} compWidth={w} compHeight={h} switchDuration={2000} cRef={CarouselRef} autoplay={aut} onSlideChange={function (ind) {
|
|
58
|
-
// console.log('onSlideChange', ind);
|
|
59
|
-
setShowIndex(ind);
|
|
60
|
-
}}>
|
|
61
|
-
{/* 在Carousel.Item的子节点放入要展示的内容,节点宽高要和compWidth,compHeight一致 */}
|
|
62
|
-
{carouselData.map(function (item, i) { return (<div style={{
|
|
63
|
-
width: w + 'px',
|
|
64
|
-
height: h + 'px',
|
|
65
|
-
backgroundColor: "white",
|
|
66
|
-
fontSize: '20px',
|
|
67
|
-
}}>
|
|
68
|
-
<div style={{ backgroundImage: "url(https://game.gtimg.cn/images/gamelet/cp/pxidePreView-carousel/zwt.png)", width: w + 'px', height: h + 'px' }}></div>
|
|
69
|
-
</div>); })}
|
|
70
|
-
</CarouselComp>
|
|
71
|
-
<div style={{ flexDirection: 'row' }}>
|
|
72
|
-
<div onClick={switchNext} style={btnSty}>
|
|
73
|
-
next
|
|
74
|
-
</div>
|
|
75
|
-
<div onClick={switchPrev} style={btnSty}>
|
|
76
|
-
prev
|
|
77
|
-
</div>
|
|
78
|
-
|
|
79
|
-
<div onClick={function () {
|
|
80
|
-
setaut(true);
|
|
81
|
-
}} style={btnSty}>
|
|
82
|
-
auto
|
|
83
|
-
</div>
|
|
84
|
-
<div onClick={function () {
|
|
85
|
-
setaut(false);
|
|
86
|
-
}} style={btnSty}>
|
|
87
|
-
notauto
|
|
88
|
-
</div>
|
|
89
|
-
<div onClick={function () {
|
|
90
|
-
if (carouselData.length - 1 > 0) {
|
|
91
|
-
setcarouselData(carouselData.slice(0, carouselData.length - 1));
|
|
92
|
-
}
|
|
93
|
-
}} style={btnSty}>
|
|
94
|
-
child-
|
|
95
|
-
</div>
|
|
96
|
-
<div onClick={function () {
|
|
97
|
-
setcarouselData(carouselData.concat(carouselData.length + 1));
|
|
98
|
-
setTimeout(function () {
|
|
99
|
-
console.log('ppp', carouselData.length);
|
|
100
|
-
});
|
|
101
|
-
}} style={btnSty}>
|
|
102
|
-
child+
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
{'showIndex-- ' + (showIndex + 1)}
|
|
106
|
-
</div>);
|
|
107
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function CheckboxDemo(): any;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useState } from 'preact/hooks';
|
|
2
|
-
import { Checkbox } from 'src/components/react/app/checkBox/CheckBox';
|
|
3
|
-
var boxNormalStyle = {
|
|
4
|
-
width: '20px',
|
|
5
|
-
height: '20px',
|
|
6
|
-
backgroundImage: "url(https://game.gtimg.cn/images/gamelet/cp/pxidePreView-checkbox/checkbox0.png)",
|
|
7
|
-
backgroundSize: '100% 100%',
|
|
8
|
-
};
|
|
9
|
-
var boxCheckedStyle = {
|
|
10
|
-
width: '20px',
|
|
11
|
-
height: '20px',
|
|
12
|
-
backgroundImage: "url(https://game.gtimg.cn/images/gamelet/cp/pxidePreView-checkbox/checkbox1.png)",
|
|
13
|
-
backgroundSize: '100% 100%',
|
|
14
|
-
};
|
|
15
|
-
export function CheckboxDemo() {
|
|
16
|
-
var _a = useState('未选中'), showText = _a[0], setShowText = _a[1];
|
|
17
|
-
return (<div>
|
|
18
|
-
<Checkbox defauleSelected={false} selectedChanged={function (b) {
|
|
19
|
-
setShowText(b ? ' 选中了' : ' 未选中');
|
|
20
|
-
}} selectedNode={<div style={boxCheckedStyle}></div>} notSelectedNode={<div style={boxNormalStyle}></div>}/>
|
|
21
|
-
<div style={{ marginLeft: '10px' }}>{showText}</div>
|
|
22
|
-
</div>);
|
|
23
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
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
|
-
import { Component } from 'preact';
|
|
17
|
-
import { Images } from '../Images';
|
|
18
|
-
import { MoneyDropdownOption } from './MoneyDropdownOption';
|
|
19
|
-
import { MoneyDropdownSpreadMain } from './MoneyDropdownSpreadMain';
|
|
20
|
-
import { MoneyDropdownUnspreadMain } from './MoneyDropdownUnspreadMain';
|
|
21
|
-
import { Dropdown } from 'src/components/react/app/dropdown/Dropdown';
|
|
22
|
-
var dropdownAreaStyle = {
|
|
23
|
-
position: 'absolute',
|
|
24
|
-
top: '0px',
|
|
25
|
-
right: '17px',
|
|
26
|
-
width: '98px',
|
|
27
|
-
height: '40px',
|
|
28
|
-
// backgroundColor: '#FF00FF33',
|
|
29
|
-
};
|
|
30
|
-
var TYPES = ['团队', '单人路', '打野', '中路', '射手', '辅助'];
|
|
31
|
-
var DropdownDemo = /** @class */ (function (_super) {
|
|
32
|
-
__extends(DropdownDemo, _super);
|
|
33
|
-
function DropdownDemo(props) {
|
|
34
|
-
var _this = _super.call(this, props) || this;
|
|
35
|
-
_this.onChoose = function () {
|
|
36
|
-
};
|
|
37
|
-
return _this;
|
|
38
|
-
}
|
|
39
|
-
DropdownDemo.prototype.render = function () {
|
|
40
|
-
// dropdown展开的样式
|
|
41
|
-
var _spreadStyle = {
|
|
42
|
-
position: 'absolute',
|
|
43
|
-
display: 'flex',
|
|
44
|
-
flexDirection: 'column',
|
|
45
|
-
justifyContent: 'flex-start',
|
|
46
|
-
alignItems: 'center',
|
|
47
|
-
borderImage: "url(".concat(Images.money_dropdownall, ") 45 10 10 10"),
|
|
48
|
-
width: '98px',
|
|
49
|
-
height: '182px',
|
|
50
|
-
top: '4px',
|
|
51
|
-
};
|
|
52
|
-
var _config = {
|
|
53
|
-
spreadStyle: _spreadStyle,
|
|
54
|
-
datas: TYPES,
|
|
55
|
-
};
|
|
56
|
-
var _options = Array(TYPES.length).fill('').map(function (value, index) {
|
|
57
|
-
return <MoneyDropdownOption index={index} info={TYPES[index]}/>;
|
|
58
|
-
});
|
|
59
|
-
return (<div style={dropdownAreaStyle}>
|
|
60
|
-
<Dropdown config={_config} onChoose={this.onChoose} unspreadMainUI={<MoneyDropdownUnspreadMain />} spreadMainUI={<MoneyDropdownSpreadMain />} optionsUI={_options} defaultIndex={this.state.selectedType}/>
|
|
61
|
-
</div>);
|
|
62
|
-
};
|
|
63
|
-
return DropdownDemo;
|
|
64
|
-
}(Component));
|
|
65
|
-
export { DropdownDemo };
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
import videoLess from './../less/video.less';
|
|
17
|
-
import { DropdownOptionUI } from 'src/components/react/app/dropdown/DropdownOptionUI';
|
|
18
|
-
var rootStyle = {
|
|
19
|
-
width: '98px',
|
|
20
|
-
height: '29px',
|
|
21
|
-
flexShrink: 0, //如果需要使用滚动条需加该属性
|
|
22
|
-
// backgroundColor: "#FF000044"
|
|
23
|
-
};
|
|
24
|
-
var textStyle = {
|
|
25
|
-
color: '#CDBE91',
|
|
26
|
-
fontSize: 14,
|
|
27
|
-
marginLeft: '17px',
|
|
28
|
-
marginTop: '7px'
|
|
29
|
-
};
|
|
30
|
-
var lineStyle = {
|
|
31
|
-
height: '1px',
|
|
32
|
-
width: '65px',
|
|
33
|
-
marginLeft: '17px',
|
|
34
|
-
backgroundColor: '#C4C4C4',
|
|
35
|
-
};
|
|
36
|
-
var MoneyDropdownOption = /** @class */ (function (_super) {
|
|
37
|
-
__extends(MoneyDropdownOption, _super);
|
|
38
|
-
function MoneyDropdownOption(props) {
|
|
39
|
-
var _this = _super.call(this, props) || this;
|
|
40
|
-
_this.isLast = false;
|
|
41
|
-
if (props['isLast'])
|
|
42
|
-
_this.isLast = true;
|
|
43
|
-
return _this;
|
|
44
|
-
// this.props.isLast : boolean
|
|
45
|
-
// 最后一个不要横线...
|
|
46
|
-
}
|
|
47
|
-
MoneyDropdownOption.prototype.render = function () {
|
|
48
|
-
return (<div style={rootStyle} className={videoLess.column_start_start} onClick={this.props.onChoose}>
|
|
49
|
-
<div style={{ width: '100%', height: '28px' }} className={videoLess.row_start_center}>
|
|
50
|
-
<text style={textStyle}>{this.props.info}</text>
|
|
51
|
-
</div>
|
|
52
|
-
{this.isLast ? null : <div style={lineStyle}></div>}
|
|
53
|
-
</div>);
|
|
54
|
-
};
|
|
55
|
-
return MoneyDropdownOption;
|
|
56
|
-
}(DropdownOptionUI));
|
|
57
|
-
export { MoneyDropdownOption };
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
import { Images } from '../Images';
|
|
17
|
-
import videoLess from './../less/video.less';
|
|
18
|
-
import { DropdownSpreadMainUI } from 'src/components/react/app/dropdown/DropdownSpreadMainUI';
|
|
19
|
-
var rootStyle = {
|
|
20
|
-
width: '98px',
|
|
21
|
-
height: '32px',
|
|
22
|
-
// backgroundColor: '#FF000F77'
|
|
23
|
-
};
|
|
24
|
-
var textStyle = {
|
|
25
|
-
color: '#CDBE91',
|
|
26
|
-
fontSize: 16,
|
|
27
|
-
marginLeft: '13px',
|
|
28
|
-
top: '4px',
|
|
29
|
-
};
|
|
30
|
-
var arrowStyle = {
|
|
31
|
-
width: '15px',
|
|
32
|
-
height: '18px',
|
|
33
|
-
marginRight: '20px',
|
|
34
|
-
top: '-2px',
|
|
35
|
-
};
|
|
36
|
-
var MoneyDropdownSpreadMain = /** @class */ (function (_super) {
|
|
37
|
-
__extends(MoneyDropdownSpreadMain, _super);
|
|
38
|
-
function MoneyDropdownSpreadMain(props) {
|
|
39
|
-
return _super.call(this, props) || this;
|
|
40
|
-
// console.warn("MoneyDropdownSpreadMain constructor ---")
|
|
41
|
-
}
|
|
42
|
-
MoneyDropdownSpreadMain.prototype.render = function () {
|
|
43
|
-
return (<div style={rootStyle} className={videoLess.row_between_center} onClick={this.props.closeList}>
|
|
44
|
-
<text style={textStyle}>{this.props.info}</text>
|
|
45
|
-
<img style={arrowStyle} src={Images.data_arrow_up}/>
|
|
46
|
-
</div>);
|
|
47
|
-
};
|
|
48
|
-
return MoneyDropdownSpreadMain;
|
|
49
|
-
}(DropdownSpreadMainUI));
|
|
50
|
-
export { MoneyDropdownSpreadMain };
|
|
@@ -1,50 +0,0 @@
|
|
|
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
|
-
import { Images } from '../Images';
|
|
17
|
-
import videoLess from './../less/video.less';
|
|
18
|
-
import { DropdownUnspreadMainUI } from 'src/components/react/app/dropdown/DropdownUnspreadMainUI';
|
|
19
|
-
var rootStyle = {
|
|
20
|
-
width: '98px',
|
|
21
|
-
height: '40px',
|
|
22
|
-
top: '4px',
|
|
23
|
-
backgroundImage: "url(".concat(Images.money_dropdown, ")")
|
|
24
|
-
};
|
|
25
|
-
var textStyle = {
|
|
26
|
-
color: '#CDBE91',
|
|
27
|
-
fontSize: 16,
|
|
28
|
-
marginLeft: '13px',
|
|
29
|
-
};
|
|
30
|
-
var arrowStyle = {
|
|
31
|
-
width: '15px',
|
|
32
|
-
height: '18px',
|
|
33
|
-
marginRight: '20px',
|
|
34
|
-
top: '-4px',
|
|
35
|
-
};
|
|
36
|
-
var MoneyDropdownUnspreadMain = /** @class */ (function (_super) {
|
|
37
|
-
__extends(MoneyDropdownUnspreadMain, _super);
|
|
38
|
-
function MoneyDropdownUnspreadMain(props) {
|
|
39
|
-
return _super.call(this, props) || this;
|
|
40
|
-
// console.warn("UnspreadMain constructor----")
|
|
41
|
-
}
|
|
42
|
-
MoneyDropdownUnspreadMain.prototype.render = function () {
|
|
43
|
-
return (<div style={rootStyle} className={videoLess.row_between_center} onClick={this.props.openList}>
|
|
44
|
-
<text style={textStyle}>{this.props.info}</text>
|
|
45
|
-
<img style={arrowStyle} src={Images.data_arrow_down}/>
|
|
46
|
-
</div>);
|
|
47
|
-
};
|
|
48
|
-
return MoneyDropdownUnspreadMain;
|
|
49
|
-
}(DropdownUnspreadMainUI));
|
|
50
|
-
export { MoneyDropdownUnspreadMain };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Component, CSSProperties } from 'preact';
|
|
2
|
-
interface DemoProps {
|
|
3
|
-
buttonText?: string;
|
|
4
|
-
fontSize?: number;
|
|
5
|
-
text?: string;
|
|
6
|
-
fontStyle?: string;
|
|
7
|
-
style?: CSSProperties;
|
|
8
|
-
colorTop?: string;
|
|
9
|
-
direction?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare class GradientTextDemo extends Component<DemoProps, DemoProps> {
|
|
12
|
-
constructor(param: any);
|
|
13
|
-
onClickButton(): void;
|
|
14
|
-
render(): any;
|
|
15
|
-
}
|
|
16
|
-
export {};
|
|
@@ -1,53 +0,0 @@
|
|
|
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
|
-
import { Component, } from 'preact';
|
|
17
|
-
import { GradientText } from 'src/components/react/base/gradient/GradientText';
|
|
18
|
-
var GradientTextDemo = /** @class */ (function (_super) {
|
|
19
|
-
__extends(GradientTextDemo, _super);
|
|
20
|
-
function GradientTextDemo(param) {
|
|
21
|
-
var _this = _super.call(this, param) || this;
|
|
22
|
-
_this.setState({
|
|
23
|
-
buttonText: '点击更新组件属性',
|
|
24
|
-
fontSize: 25,
|
|
25
|
-
text: '1111',
|
|
26
|
-
fontStyle: 'Normal',
|
|
27
|
-
style: { width: '200px', height: '200px', backgroundColor: '#FFFFFFFF' },
|
|
28
|
-
colorTop: '#4CE0314F',
|
|
29
|
-
direction: 'Vertical',
|
|
30
|
-
});
|
|
31
|
-
return _this;
|
|
32
|
-
}
|
|
33
|
-
GradientTextDemo.prototype.onClickButton = function () {
|
|
34
|
-
this.setState({
|
|
35
|
-
buttonText: '已更新属性',
|
|
36
|
-
fontSize: 30,
|
|
37
|
-
fontStyle: 'BoldAndItalic',
|
|
38
|
-
text: '123123',
|
|
39
|
-
style: { width: '500px', height: '200px', backgroundColor: '#FFFFFFFF' },
|
|
40
|
-
colorTop: '#8757FFFF',
|
|
41
|
-
direction: 'Both',
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
GradientTextDemo.prototype.render = function () {
|
|
45
|
-
console.log(this.state.text + '|22222222222222222222222222222222222222222222222222222222222222222222222222');
|
|
46
|
-
return (<div>
|
|
47
|
-
<div style={{ width: '150px', height: '50px', backgroundColor: '#FF00FFFF' }} onClick={this.onClickButton.bind(this)}>{this.state.buttonText}</div>
|
|
48
|
-
<GradientText style={this.state.style} fontStyle={this.state.fontStyle} fontSize={this.state.fontSize} text={this.state.text} colorTop={this.state.colorTop} direction={this.state.direction}/>
|
|
49
|
-
</div>);
|
|
50
|
-
};
|
|
51
|
-
return GradientTextDemo;
|
|
52
|
-
}(Component));
|
|
53
|
-
export { GradientTextDemo };
|