-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
117 lines (99 loc) · 3.84 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
///<reference path="typings/react-native-tableview/react-native-tableview.d.ts" />
///<reference path="typings/react-native/react-native.d.ts" />
//import TableView from 'react-native-tableview'
var React = require('react-native');
var { requireNativeComponent } = React;
var CellSwipeButtonView = requireNativeComponent('CellSwipeButtonView', null);
var CellSwipeButtonsView = requireNativeComponent('CellSwipeButtonsView', null);
;
var TableView = require('react-native-tableview');
class Left extends React.Component {
constructor(props) {
super(props);
}
render() {
return React.createElement(CellSwipeButtons, React.__spread({}, this.props, {"type": "left"}), this.props.children);
}
}
class Right extends React.Component {
constructor(props) {
super(props);
}
render() {
return React.createElement(CellSwipeButtons, React.__spread({}, this.props, {"type": "right"}), this.props.children);
}
}
class CellSwipeButtons extends React.Component {
constructor(props) {
super(props);
}
render() {
var style = this.props.style || {};
style.position = "absolute";
return (React.createElement(CellSwipeButtonsView, React.__spread({}, this.props, {"style": style}), this.props.children));
}
}
CellSwipeButtons.Left = Left;
CellSwipeButtons.Right = Right;
class CellSwipeButton extends React.Component {
constructor(props) {
super(props);
this.state = { width: 0, height: 0 };
}
render() {
var style = this.props.style || {};
style.position = "absolute";
return React.createElement(CellSwipeButtonView, React.__spread({"onAction": this.onAction.bind(this)}, this.props, {"style": style, "onLayout": (event) => { console.log("LAYOUT:", event.nativeEvent.layout); this.setState(event.nativeEvent.layout); }, "componentWidth": this.state.width, "componentHeight": this.state.height}), this.props.children);
}
onAction(event) {
console.log("ONACTION", arguments);
if (this.props.onAction) {
this.props.onAction(event);
}
}
}
TableView.CellSwipeButtons = CellSwipeButtons;
TableView.CellSwipeButton = CellSwipeButton;
exports.SwipeTableView = TableView;
/*
SwipeTableView.CellSwipeButton = React.createClass({
mixins: [React.NativeMethodsMixin],
propTypes: {
onAction: React.PropTypes.func,
},
getInitialState(){
return {width:0, height:0}
},
//{...this.props}
render: function() {
var style = this.props.style || {};
style.position = "absolute";
return <CellSwipeButton onAction={event=>alert(event)} {...this.props} style={style} onLayout={(event)=>{console.log("LAYOUT:",event.nativeEvent.layout); this.setState(event.nativeEvent.layout)}} componentWidth={this.state.width} componentHeight={this.state.height}>
</CellSwipeButton>
},
onAction: function(event){
alert(event);
console.log(event);
}
});
TableView.CellSwipeButtons = React.createClass({
render: function(){
var style = this.props.style || {};
style.position = "absolute";
return (<CellSwipeButtons {...this.props} style={style} >{this.props.children}</CellSwipeButtons>);
}
});
TableView.CellSwipeButtons.Left = React.createClass({
render: function(){
// expansionSettings={this.props.expansionSettings}
return <TableView.CellSwipeButtons {...this.props} type="left">{this.props.children}</TableView.CellSwipeButtons>
}
});
TableView.CellSwipeButtons.Right = React.createClass({
render: function(){
// expansionSettings={this.props.expansionSettings}
return (<TableView.CellSwipeButtons {...this.props} type="right" >{this.props.children}</TableView.CellSwipeButtons>);
}
});
*/
//# sourceMappingURL=index.js.map