pixuireactcomponents 1.2.2 → 1.2.31

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 (104) hide show
  1. package/index.d.ts +15 -0
  2. package/index.js +16 -20
  3. package/package.json +9 -9
  4. package/tools/EventDispatcherJs.d.ts +10 -0
  5. package/tools/EventDispatcherJs.js +71 -0
  6. package/tools/Logger.d.ts +6 -0
  7. package/tools/Logger.js +138 -0
  8. package/ui/components/button/Button.d.ts +5 -0
  9. package/ui/components/button/Button.js +37 -0
  10. package/ui/components/carousel/Carousel.d.ts +5 -0
  11. package/ui/components/carousel/Carousel.js +219 -0
  12. package/ui/components/dropdown/Dropdown.d.ts +30 -0
  13. package/ui/components/dropdown/Dropdown.js +92 -0
  14. package/ui/components/dropdown/DropdownOptionUI.d.ts +11 -0
  15. package/ui/components/dropdown/DropdownOptionUI.js +28 -0
  16. package/ui/components/dropdown/DropdownSpreadMainUI.d.ts +9 -0
  17. package/ui/components/dropdown/DropdownSpreadMainUI.js +27 -0
  18. package/ui/components/dropdown/DropdownUnspreadMainUI.d.ts +9 -0
  19. package/ui/components/dropdown/DropdownUnspreadMainUI.js +27 -0
  20. package/ui/components/gradient/GradientText.d.ts +63 -0
  21. package/ui/components/gradient/{GradientText.tsx → GradientText.js} +174 -183
  22. package/ui/components/outlinetext/OutlineText.d.ts +94 -0
  23. package/ui/components/outlinetext/OutlineText.js +168 -0
  24. package/ui/components/progress/Progress.d.ts +34 -0
  25. package/ui/components/progress/Progress.js +142 -0
  26. package/ui/components/slapface/Slapface.d.ts +12 -0
  27. package/ui/components/slapface/Slapface.js +235 -0
  28. package/ui/components/slider/Slider.d.ts +57 -0
  29. package/ui/components/slider/Slider.js +289 -0
  30. package/ui/components/tab/Tab.d.ts +6 -0
  31. package/ui/components/tab/Tab.js +27 -0
  32. package/ui/components/tab/Tabs.d.ts +12 -0
  33. package/ui/components/tab/Tabs.js +54 -0
  34. package/cmdAfterTsBuild.js +0 -8
  35. package/tools/EventDispatcherJs.tsx +0 -74
  36. package/tools/Logger.tsx +0 -161
  37. package/tools/img/logger.png +0 -0
  38. package/tsconfig.json +0 -45
  39. package/ui/components/bulletscreen/BulletItemAnimation.tsx +0 -117
  40. package/ui/components/bulletscreen/BulletScreenAnimation.tsx +0 -278
  41. package/ui/components/bulletscreen/bullet.less +0 -17
  42. package/ui/components/button/Button.tsx +0 -18
  43. package/ui/components/carousel/Carousel.tsx +0 -279
  44. package/ui/components/checkBox/CheckBox.tsx +0 -40
  45. package/ui/components/dropdown/Dropdown.tsx +0 -126
  46. package/ui/components/dropdown/DropdownOptionUI.tsx +0 -14
  47. package/ui/components/dropdown/DropdownSpreadMainUI.tsx +0 -11
  48. package/ui/components/dropdown/DropdownUnspreadMainUI.tsx +0 -11
  49. package/ui/components/outlinetext/OutlineText.tsx +0 -184
  50. package/ui/components/progress/Progress.tsx +0 -174
  51. package/ui/components/slapface/Slapface.tsx +0 -284
  52. package/ui/components/slider/Slider.tsx +0 -366
  53. package/ui/components/tab/Tab.tsx +0 -12
  54. package/ui/components/tab/Tabs.tsx +0 -56
  55. package/ui/components/togglegroup/ToggleGroup.tsx +0 -105
  56. package/ui/components/videoplayer/VideoPlayer.tsx +0 -200
  57. package/ui/components/waterfallcomponent/WaterfallComponent.jsx +0 -687
  58. package/ui/components/waterfallcomponent/less/WaterfallComponent.less +0 -13
  59. package/ui/sample/Images.tsx +0 -60
  60. package/ui/sample/OutlineText/OutlineDemo.tsx +0 -61
  61. package/ui/sample/Slapface/SlapfaceDemo.tsx +0 -30
  62. package/ui/sample/asset/btn_close.png +0 -0
  63. package/ui/sample/asset/changtai_button.jpg +0 -0
  64. package/ui/sample/asset/checkbox0.png +0 -0
  65. package/ui/sample/asset/checkbox1.png +0 -0
  66. package/ui/sample/asset/data_arrow_down.png +0 -0
  67. package/ui/sample/asset/data_arrow_up.png +0 -0
  68. package/ui/sample/asset/dot.png +0 -0
  69. package/ui/sample/asset/inner.png +0 -0
  70. package/ui/sample/asset/item_reddot.png +0 -0
  71. package/ui/sample/asset/loading.png +0 -0
  72. package/ui/sample/asset/money_dropdown.png +0 -0
  73. package/ui/sample/asset/money_dropdownall.png +0 -0
  74. package/ui/sample/asset/outer.png +0 -0
  75. package/ui/sample/asset/slapface_samplepic1.png +0 -0
  76. package/ui/sample/asset/slapface_samplepic2.png +0 -0
  77. package/ui/sample/asset/slapface_samplepic3.png +0 -0
  78. package/ui/sample/asset/slapface_samplepic4.png +0 -0
  79. package/ui/sample/asset/slapface_samplepic5.png +0 -0
  80. package/ui/sample/asset/slapface_samplepic6.png +0 -0
  81. package/ui/sample/asset/tab_choosed.png +0 -0
  82. package/ui/sample/asset/tabs_bg.png +0 -0
  83. package/ui/sample/asset/video_pause.png +0 -0
  84. package/ui/sample/asset/video_play.png +0 -0
  85. package/ui/sample/asset/video_reload.png +0 -0
  86. package/ui/sample/asset/xuanfu_button.jpg +0 -0
  87. package/ui/sample/asset/yaxia_button.jpg +0 -0
  88. package/ui/sample/bulletscreen/BulletDemo.tsx +0 -84
  89. package/ui/sample/button/ButtonDemo.tsx +0 -19
  90. package/ui/sample/carousel/carouselDemo.tsx +0 -52
  91. package/ui/sample/checkBox/checkBoxDemo.tsx +0 -7
  92. package/ui/sample/dropdown/DropdownDemo.tsx +0 -65
  93. package/ui/sample/dropdown/MoneyDropdownOption.tsx +0 -50
  94. package/ui/sample/dropdown/MoneyDropdownSpreadMain.tsx +0 -42
  95. package/ui/sample/dropdown/MoneyDropdownUnspreadMain.tsx +0 -44
  96. package/ui/sample/gradient/GradientDemo.tsx +0 -51
  97. package/ui/sample/less/video.less +0 -144
  98. package/ui/sample/progress/ProgressDemo.tsx +0 -74
  99. package/ui/sample/slider/SliderDemo.tsx +0 -116
  100. package/ui/sample/tab/TabDemo.tsx +0 -67
  101. package/ui/sample/tab/TopTab.tsx +0 -74
  102. package/ui/sample/togglegroup/ToggleGroupDemo.tsx +0 -35
  103. package/ui/sample/videoplayer/VideoPlayerDemo.tsx +0 -57
  104. package/ui/sample/waterfallcomponent/WaterfallComponentDemo.jsx +0 -137
@@ -1,144 +0,0 @@
1
- .row_start_center{
2
- display: flex;
3
- flex-direction: row;
4
- justify-content: flex-start;
5
- align-items: center;
6
- }
7
- .row_start_end{
8
- display: flex;
9
- flex-direction: row;
10
- justify-content: flex-start;
11
- align-items: flex-end;
12
- }
13
- .row_center_center{
14
- display: flex;
15
- flex-direction: row;
16
- justify-content: center;
17
- align-items: center;
18
- }
19
-
20
- .row_end_end{
21
- display: flex;
22
- flex-direction: row;
23
- justify-content: flex-end;
24
- align-items: flex-end;
25
- }
26
-
27
- .row_end_center{
28
- display: flex;
29
- flex-direction: row;
30
- justify-content: flex-end;
31
- align-items: center;
32
- }
33
-
34
- .row_end_start{
35
- display: flex;
36
- flex-direction: row;
37
- justify-content: flex-end;
38
- align-items: flex-start;
39
- }
40
-
41
- .row_center_end{
42
- display: flex;
43
- flex-direction: row;
44
- justify-content: center;
45
- align-items: flex-end;
46
- }
47
- .row_between_center{
48
- display: flex;
49
- flex-direction: row;
50
- justify-content: space-between;
51
- align-items: center;
52
- }
53
-
54
- .row_around_center{
55
- display: flex;
56
- flex-direction: row;
57
- justify-content: space-around;
58
- align-items: center;
59
- }
60
-
61
- .column_start_center{
62
- display: flex;
63
- flex-direction: column;
64
- justify-content: flex-start;
65
- align-items: center;
66
- }
67
- .column_center_center{
68
- display: flex;
69
- flex-direction: column;
70
- justify-content: center;
71
- align-items: center;
72
- }
73
- .column_between_center{
74
- display: flex;
75
- flex-direction: column;
76
- justify-content: space-between;
77
- align-items: center;
78
- }
79
- .column_end_center{
80
- display: flex;
81
- flex-direction: column;
82
- justify-content: flex-end;
83
- align-items: center;
84
- }
85
- .column_around_start{
86
- display: flex;
87
- flex-direction: column;
88
- justify-content: space-around;
89
- align-items: flex-start;
90
- }
91
- .column_start_start{
92
- display: flex;
93
- flex-direction: column;
94
- justify-content: flex-start;
95
- align-items: flex-start;
96
- }
97
-
98
- @keyframes rotate_by_myself{
99
- from {
100
- transform: rotate(0deg);
101
- }
102
-
103
- 50% {
104
- transform: rotate(180deg);
105
- }
106
-
107
- to {
108
- transform: rotate(360deg);
109
- }
110
- }
111
-
112
- .loading_anim{
113
- animation-name: rotate_by_myself;
114
- animation-duration: 1.5s;
115
- animation-timing-function: linear;
116
- animation-iteration-count: infinite
117
- }
118
-
119
- .row_start_center{
120
- display: flex;
121
- flex-direction: row;
122
- justify-content: flex-start;
123
- align-items: center;
124
- }
125
-
126
- .row_end_center{
127
- display: flex;
128
- flex-direction: row;
129
- justify-content: flex-end;
130
- align-items: center;
131
- }
132
-
133
- .hidden_scrollbar{
134
- -ms-overflow-style: none;
135
- }
136
-
137
-
138
- // 单行多文本出现省略号
139
- .ellipsis {
140
- overflow: hidden;
141
- text-overflow:ellipsis;
142
- white-space: nowrap;
143
- }
144
-
@@ -1,74 +0,0 @@
1
- import { Component, CSSProperties } from 'preact';
2
- import { Progress, ProgressProps } from '../../components/progress/Progress';
3
- import { Images } from '../Images';
4
-
5
- const progressWrapperStyle: CSSProperties = {
6
- width: '376px',
7
- height: '34px',
8
- marginLeft: '32px',
9
- marginTop: '14px',
10
- };
11
-
12
- const progressData: ProgressProps = {
13
- percent: 0,
14
- wrapperHeight: 34,
15
- wrapperWidth: 376,
16
- height: 5,
17
- dotWidth: 26,
18
- dotHeight: 27,
19
- dotWrapperWidth: 56,
20
- dotWrapperHeight: 57,
21
-
22
- outerBg: Images.outer,
23
- innerBg: Images.inner,
24
- dotBg: Images.dot,
25
- onDragStart: null,
26
- onDrag: null,
27
- onDragEnd: null
28
- };
29
-
30
- const percentTextStyle: CSSProperties = {
31
- position: 'absolute',
32
- width: '60px',
33
- height: '34px',
34
- marginLeft: '386px', // 100% + 10px
35
- color: '#000000',
36
- fontSize: '20px',
37
- // backgroundColor: '#FF000055'
38
- };
39
-
40
- export class ProgressDemo extends Component<any,
41
- {
42
- percent: number;
43
- }>{
44
- constructor(props) {
45
- super(props);
46
-
47
-
48
- this.state = {
49
- percent: 10
50
- };
51
-
52
- progressData.percent = this.state.percent;
53
- progressData.onDrag = this.onDrag;
54
- }
55
-
56
- onDrag = (value: number) => {
57
- let formatPercent = Math.floor(value + 0.5);
58
- formatPercent = Math.max(0, formatPercent);
59
- formatPercent = Math.min(100, formatPercent);
60
-
61
- this.setState({
62
- percent: formatPercent
63
- });
64
- }
65
-
66
- render() {
67
- return (
68
- <div style={progressWrapperStyle}>
69
- <Progress {...progressData} />
70
- <text style={percentTextStyle}>{this.state.percent + '%'}</text>
71
- </div>
72
- );
73
- }
74
- }
@@ -1,116 +0,0 @@
1
- import { Component, CSSProperties } from 'preact';
2
- import { Slider, SliderProps } from '../../components/slider/Slider';
3
- import { Images } from '../Images';
4
-
5
- const SliderWrapperStyle: CSSProperties = {
6
- position: 'absolute',
7
- width: '376px',
8
- height: '34px',
9
- marginLeft: '32px',
10
- marginTop: '14px',
11
- };
12
-
13
- const SliderData: SliderProps = {
14
- percent: 0,
15
- wrapperHeight: 34,
16
- wrapperWidth: 376,
17
- height: 5,
18
- innerHeight: 15,
19
- dotWidth: 26,
20
- dotHeight: 27,
21
- dotWrapperWidth: 56,
22
- dotWrapperHeight: 57,
23
-
24
- outerBg: Images.outer,
25
- innerBg: Images.inner,
26
- dotBg: Images.dot,
27
- onDragStart: null,
28
- onDrag: null,
29
- onDragEnd: null,
30
-
31
- isDiscrete: true, //是否具有离散值
32
- discrete: 0,
33
- maxDiscrete: 300,
34
-
35
- hasIncDecButton: true, //是否具有增减按钮
36
- incButtonWidth: 30,
37
- incButtonHeight: 30,
38
- decButtonWidth: 30,
39
- decButtonHeight: 30,
40
- incButtonBg: Images.dot,
41
- decButtonBg: Images.dot,
42
- overallWidth: 500,
43
-
44
- //控制可拖拽范围
45
- rangeControl: false,
46
- startRange: 0,
47
- endRange: 10
48
- };
49
-
50
- const percentTextStyle: CSSProperties = {
51
- position: 'absolute',
52
- width: '60px',
53
- height: '34px',
54
- marginLeft: '600px', // 100% + 10px
55
- color: '#ffffff',
56
- fontSize: '20px',
57
- // backgroundColor: '#FF000055'
58
- };
59
-
60
- export class SliderDemo extends Component<any,
61
- {
62
- percent: number;
63
- }>{
64
- constructor(props) {
65
- super(props);
66
-
67
-
68
- this.state = {
69
- percent: (SliderData.isDiscrete && SliderData.discrete) ? SliderData.discrete : SliderData.percent
70
- };
71
-
72
- SliderData.percent = this.state.percent;
73
- SliderData.onDrag = this.onDrag;
74
- SliderData.onDecClick = this.onDecClick;
75
- SliderData.onIncClick = this.onIncClick;
76
- }
77
-
78
- onDrag = (value: number) => {
79
- let formatPercent = Math.floor(value + 0.5);
80
- formatPercent = Math.max(0, formatPercent);
81
- formatPercent = Math.min(10000, formatPercent);
82
-
83
- this.setState({
84
- percent: formatPercent
85
- });
86
- }
87
-
88
- onDecClick = (value: number) => {
89
- let formatPercent = Math.floor(value + 0.5);
90
- formatPercent = Math.max(0, formatPercent);
91
- formatPercent = Math.min(10000, formatPercent);
92
-
93
- this.setState({
94
- percent: formatPercent
95
- });
96
- }
97
-
98
- onIncClick = (value: number) => {
99
- let formatPercent = Math.floor(value + 0.5);
100
- formatPercent = Math.max(0, formatPercent);
101
- formatPercent = Math.min(10000, formatPercent);
102
-
103
- this.setState({
104
- percent: formatPercent
105
- });
106
- }
107
-
108
- render() {
109
- return (
110
- <div style={SliderWrapperStyle}>
111
- <Slider {...SliderData} />
112
- <text style={percentTextStyle}>{this.state.percent + '%'}</text>
113
- </div>
114
- );
115
- }
116
- }
@@ -1,67 +0,0 @@
1
- import { Component, CSSProperties } from 'preact';
2
- import { Tab } from '../../components/tab/Tab';
3
- import { Tabs } from '../../components/tab/Tabs';
4
- import { Images } from '../Images';
5
- import { TopTab } from './TopTab';
6
-
7
- import videoLess from './../less/video.less';
8
-
9
-
10
- const rootStyle: CSSProperties = {
11
- width: '448px',
12
- height: '100%',
13
- backgroundColor: '#081013'
14
- };
15
-
16
- const tabBarStyle: CSSProperties = {
17
- width: '100%',
18
- height: '48px',
19
-
20
- display: 'flex',
21
- flexDirection: 'row',
22
- justifyContent: 'flex-start',
23
- alignItems: 'center',
24
-
25
-
26
- // backgroundColor: '#00FF3333',
27
- backgroundRepeat: 'no-repeat',
28
- backgroundPosition: 'bottom center',
29
- backgroundImage: `url(${Images.tabs_bg})`
30
- };
31
-
32
-
33
- const tabsData = ['赛程', '福利']; // tabs列表
34
-
35
- export class TabDemo extends Component<any,
36
- {
37
- choosedTabIndex: number;
38
- }>{
39
- constructor(props) {
40
- super(props);
41
-
42
- this.state = {
43
- choosedTabIndex: 0
44
- };
45
- }
46
-
47
- componentWillUnmount() {
48
- }
49
-
50
- onChoose = (index: number) => {
51
- this.setState({
52
- choosedTabIndex: index
53
- });
54
- }
55
-
56
- render() {
57
- return (
58
- <div style={rootStyle} className={videoLess.column_start_center}>
59
- <Tabs tabBarStyle={tabBarStyle} onChoose={this.onChoose}>
60
- {tabsData.map((v, index) => {
61
- return <Tab realTab={<TopTab title={v} isChoosed={index == this.state.choosedTabIndex} />} />;
62
- })}
63
- </Tabs>
64
- </div>
65
- );
66
- }
67
- }
@@ -1,74 +0,0 @@
1
- import { Component, createRef, CSSProperties } from 'preact';
2
- import { Images } from '../Images';
3
-
4
- import videoLess from './../less/video.less';
5
-
6
- const rootStyle: CSSProperties = {
7
- height: '48px', // 100%
8
- width: '100%',
9
- fontSize: '20px',
10
- color: '#F0E6D2',
11
- // backgroundColor: '#FF000066'
12
- };
13
-
14
- const imgShowStyle: CSSProperties = {
15
- width: '20px',
16
- height: '10px',
17
- marginBottom: '2px',
18
- visibility: 'visible'
19
- };
20
-
21
- const imgHideStyle: CSSProperties = {
22
- width: '20px',
23
- height: '10px',
24
- marginBottom: '2px',
25
- visibility: 'hidden'
26
- };
27
-
28
- const reddotStyle: CSSProperties = {
29
- width: '32px',
30
- height: '32px',
31
- position: 'absolute',
32
- top: '-20px',
33
- right: '-20px'
34
- };
35
-
36
- export class TopTab extends Component<
37
- {
38
- title: string;
39
- isChoosed: boolean;
40
- },
41
- any> {
42
- private refRoot = createRef()
43
- private hasYelloDot = false //是否可能有黄点
44
-
45
- constructor(props) {
46
- super(props);
47
-
48
- this.state = {
49
- showYelloDot: false
50
- };
51
-
52
- this.checkYellowDot();
53
- }
54
-
55
- componentDidMount() {
56
- this.refRoot.current.parentNode.style.flexGrow = 1; //处理掉react自动生成的空div
57
- }
58
-
59
- checkYellowDot = () => {
60
- if (this.props.title == '福利') this.hasYelloDot = true;
61
- }
62
-
63
- render() {
64
- return (
65
- <div ref={this.refRoot} style={rootStyle} className={videoLess.column_end_center}>
66
- <div>
67
- {this.hasYelloDot ? <img src={Images.item_reddot} style={reddotStyle} /> : null}
68
- <text>{this.props.title}</text>
69
- </div>
70
- <img src={Images.tab_choosed} style={this.props.isChoosed ? imgShowStyle : imgHideStyle} />
71
- </div>
72
- );
73
- }
74
- }
@@ -1,35 +0,0 @@
1
- import { Component } from 'preact';
2
- import { ToggleGroup } from 'src/pixUIReactComponents/ui/components/togglegroup/ToggleGroup';
3
- import { Images } from 'src/pixUIReactComponents/ui/sample/Images'
4
-
5
- let togglePic = {
6
- selected_pic: Images.checkbox1,
7
- not_selected_pic: Images.checkbox0
8
- }
9
-
10
- let toggleArray = [
11
- {
12
- toggleText : "111",
13
- selectedFun : ()=>{console.log("111")},
14
- notSelectedFun : ()=>{console.log("-111")}
15
- },
16
- {
17
- toggleText : "222",
18
- selectedFun : ()=>{console.log("222")},
19
- notSelectedFun : ()=>{console.log("-222")}
20
- },
21
- {
22
- toggleText : "333",
23
- selectedFun : ()=>{console.log("333")},
24
- notSelectedFun : ()=>{console.log("-333")}
25
- }
26
- ]
27
- export class ToggleGroupDemo extends Component<any, any>{
28
- render() {
29
- return (
30
- <div>
31
- <ToggleGroup togglePic = {togglePic} toggleArray = {toggleArray} isMultiOption = {false}/>
32
- </div>
33
- )
34
- }
35
- }
@@ -1,57 +0,0 @@
1
- import { Component, CSSProperties } from 'preact';
2
- import { VideoPlayer, VideoPlayerProps } from '../../components/videoplayer/VideoPlayer';
3
-
4
- const rootStyle: CSSProperties = {
5
- position: 'absolute',
6
- width: '100%',
7
- height: '100%',
8
-
9
- // backgroundColor: '#000000'
10
- };
11
-
12
- export class VideoPlayerDemo extends Component<any, any>{
13
- constructor(props) {
14
- super(props);
15
-
16
- this.addNetEvents();
17
- this.addLogicEvents();
18
- }
19
-
20
- componentWillUnmount() {
21
- this.removeLogicEvents();
22
- this.removeNetEvents();
23
- }
24
-
25
- addNetEvents = () => {
26
-
27
- }
28
-
29
- removeNetEvents = () => {
30
-
31
- }
32
-
33
- addLogicEvents = () => {
34
-
35
- }
36
-
37
- removeLogicEvents = () => {
38
-
39
- }
40
-
41
-
42
- render() {
43
- const videoProps: VideoPlayerProps = {
44
- playUrl: 'http://image.smoba.qq.com/Video/playonline/Nobe_Video.mp4',
45
- onPlaying: null,
46
- onEnded: null,
47
- onError: null,
48
- onNetworkFailed: null
49
- };
50
-
51
- return (
52
- <div style={rootStyle}>
53
- <VideoPlayer config={videoProps} />
54
- </div>
55
- );
56
- }
57
- }
@@ -1,137 +0,0 @@
1
- //libs and frame
2
- import { Component } from 'preact';
3
- //components
4
- import {WaterfallComponent} from 'src/pixUIReactComponents/ui/components/waterfallcomponent/WaterfallComponent'
5
- export class WaterfallComponentDemo extends Component {
6
- constructor(props){
7
- super(props);
8
- this.state = {
9
-
10
- }
11
- this.data = [];
12
- for(var i = 0; i < 100; i++){
13
- this.data.push({
14
- name : "name_" + i,
15
- age : i,
16
- id : "demo_id_" + i,
17
- });
18
- }
19
- this.listRef = {};
20
- this.listRefH = {};
21
- }
22
-
23
- getItemCount(){
24
- return this.data.length;
25
- }
26
-
27
- Item = (index) => {
28
- console.log("Item index:" + index + ", itemCount:" + this.getItemCount());
29
- const info = this.data[index];
30
-
31
- return(
32
- //可加上key={index}, 但某些版本下可能遇到diff不正确的问题,导致数据没刷新,但用了效率能提高,酌情使用
33
- <div style={{backgroundColor:`rgb(211,212,204)`, width:"130px", height:"100px",flexShrink:0}} >
34
- <div style={{marginTop:"10px", marginLeft:"4px"}} >{"name:" + info.name}</div>
35
- {/* <div style={{marginTop:"10px", marginLeft:"4px"}} >{"age:" + info.age}</div> */}
36
- {/* <div style={{marginTop:"10px", marginLeft:"4px"}} >{"id:" + info.id}</div> */}
37
- </div>
38
- );
39
- };
40
-
41
- getWaterfall(){
42
- let result = <WaterfallComponent direction={'vertical'}
43
- itemCount={this.getItemCount()}
44
- onBottom={() =>{
45
- console.log("demo on bottom")
46
- }}
47
-
48
- onTop={() =>{
49
- console.log("demo on top")
50
- }}
51
-
52
- scroll_type = {1}
53
- scroll_bar_display = {0}
54
- scrollDir = {1}
55
- bottomHeight = {10}
56
- topHeight = {10}
57
- initFillCount={7}
58
- onFillItem={this.Item}
59
- recycleBottomHeight = {100}
60
- recycleTopHeight = {100}
61
- generateBottomHeight = {100}
62
- generateTopHeight = {100}
63
- refObj={this.listRef}
64
- enableLog={true}
65
- >
66
- </WaterfallComponent>
67
-
68
- return result;
69
-
70
- }
71
-
72
- getWaterfallH(){
73
-
74
- let result = <WaterfallComponent direction={'horizontal'}
75
- itemCount={this.getItemCount()}
76
- onBottom={() =>{
77
- console.log("demo on bottom")
78
- }}
79
-
80
- onTop={() =>{
81
- console.log("demo on top")
82
- }}
83
-
84
- scroll_type = {1}
85
- scroll_bar_display = {0}
86
- scrollDir = {1}
87
- bottomHeight = {10}
88
- topHeight = {10}
89
- initFillCount={7}
90
- onFillItem={this.Item}
91
- recycleBottomHeight = {200}
92
- recycleTopHeight = {200}
93
- generateBottomHeight = {200}
94
- generateTopHeight = {200}
95
- refObj={this.listRefH}
96
- enableLog={true}
97
- >
98
- </WaterfallComponent>
99
-
100
- return result;
101
-
102
- }
103
-
104
- refresh() {
105
- //maybe need setTimeout
106
-
107
- //refresh vertical
108
- this.listRef.current.clear();
109
- this.listRef.current.itemCount = this.getItemCount();
110
- this.listRef.current.fill();
111
-
112
- //refresh horizental
113
- this.listRefH.current.clear();
114
- this.listRefH.current.itemCount = this.getItemCount();
115
- this.listRefH.current.fill();
116
- }
117
-
118
- render(props, state) {
119
- return (
120
- <div style={{width:"600px", height:"600px", backgroundColor:`rgb(238,229,248)`}} >
121
- {/* <p style={{fontSize:"24px", margin:"40px"}}>滑动列表</p> */}
122
- {/* horizontal */}
123
- <div id="horizontal" style={{ left:"10px",width:"500px", height:"100px", overflow: 'hidden',}}
124
- ref={div => {this.myDivH = div;}}>
125
- {this.getWaterfallH()}
126
- </div>
127
- <div style={{width:"50px", height:"50px"}} ></div>
128
- {/* verticle */}
129
- <div id="verticle" style={{ height:"400px", width:"155px", overflow: 'hidden',}}
130
- ref={div => {this.myDiv = div;}}>
131
- {this.getWaterfall()}
132
- </div>
133
-
134
- </div>
135
- );
136
- }
137
- }