|
@@ -4,7 +4,7 @@ import Library from 'trapilib/dist/lib';
|
|
import { TextInput } from 'react-native';
|
|
import { TextInput } from 'react-native';
|
|
|
|
|
|
import TextEditor from '../Components/TextEditor';
|
|
import TextEditor from '../Components/TextEditor';
|
|
-
|
|
|
|
|
|
+import Numbers from '../Components/Numbers';
|
|
let {
|
|
let {
|
|
CoreSystem,
|
|
CoreSystem,
|
|
ViewSystem,
|
|
ViewSystem,
|
|
@@ -39,15 +39,12 @@ export default class SideBar{
|
|
|
|
|
|
|
|
|
|
editNode(text,key){
|
|
editNode(text,key){
|
|
- console.log(text,key);
|
|
|
|
- this.viewNode.props[key] = text;
|
|
|
|
- this.forceUpdate();
|
|
|
|
|
|
+ this.viewNode.props[key] = text;
|
|
|
|
+ this.forceUpdate();
|
|
}
|
|
}
|
|
- //TODO Change everything :P
|
|
|
|
render(){
|
|
render(){
|
|
|
|
+
|
|
let tool = this.tool;
|
|
let tool = this.tool;
|
|
- console.log("@@@@@@@@@@@@@")
|
|
|
|
- console.log(tool)
|
|
|
|
let ModuleSystem = this.CoreSystem.ModuleSystem;
|
|
let ModuleSystem = this.CoreSystem.ModuleSystem;
|
|
let CurrentView = this.CoreSystem.getCurrentView();
|
|
let CurrentView = this.CoreSystem.getCurrentView();
|
|
let Routing = this.CoreSystem.Routing;
|
|
let Routing = this.CoreSystem.Routing;
|
|
@@ -57,9 +54,9 @@ export default class SideBar{
|
|
{
|
|
{
|
|
this.ColNode = tool.selectedNode;
|
|
this.ColNode = tool.selectedNode;
|
|
this.RowNode = CurrentView.getParent(this.ColNode);
|
|
this.RowNode = CurrentView.getParent(this.ColNode);
|
|
- console.log("ROWNODE" , this.RowNode);
|
|
|
|
- console.log("ColNode" , this.ColNode);
|
|
|
|
- console.log("viewNode" , this.viewNode);
|
|
|
|
|
|
+ //console.log("ROWNODE" , this.RowNode);
|
|
|
|
+ //console.log("ColNode" , this.ColNode);
|
|
|
|
+ //console.log("viewNode" , this.viewNode);
|
|
|
|
|
|
if(tool.selectedNode.content && tool.selectedNode.content.value){
|
|
if(tool.selectedNode.content && tool.selectedNode.content.value){
|
|
this.viewNode = tool.selectedNode.content;
|
|
this.viewNode = tool.selectedNode.content;
|
|
@@ -67,19 +64,23 @@ export default class SideBar{
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ console.log("###################")
|
|
|
|
+ console.log(Structure)
|
|
let data = Object.keys(Structure || {}).map((key) => {
|
|
let data = Object.keys(Structure || {}).map((key) => {
|
|
- return(
|
|
|
|
- <View style={SideBarStyle.body}>
|
|
|
|
- <Text>{key}</Text>
|
|
|
|
- {key === 'text' ? (
|
|
|
|
- <TextInput
|
|
|
|
- style={{height: 40, borderColor: 'gray', borderWidth: 1}}
|
|
|
|
- onChangeText={(text) => this.editNode(text, key)}
|
|
|
|
- value={this.viewNode.props[key]}
|
|
|
|
- />
|
|
|
|
- ):(null)}
|
|
|
|
- </View>
|
|
|
|
- )
|
|
|
|
|
|
+ console.log("@@@@@@ from here")
|
|
|
|
+ console.log(Structure[key])
|
|
|
|
+
|
|
|
|
+ switch(Structure[key].constructor.name){
|
|
|
|
+ case 'Integer':
|
|
|
|
+ return <Numbers title={key} number={2}
|
|
|
|
+ onChange={(number) => this.editNode(number, key)}
|
|
|
|
+ />
|
|
|
|
+ case 'Text':
|
|
|
|
+ return <TextEditor title={key} text = {this.viewNode.props[key]} onChange={(text) => this.editNode(text,key)} />
|
|
|
|
+ default:
|
|
|
|
+ //Must create a generic Vuiew Component
|
|
|
|
+ return (<View></View>)
|
|
|
|
+ }
|
|
|
|
|
|
})
|
|
})
|
|
console.log("ROW NODE DATA DATA" , this.RowNode , this.RowNode && CurrentView.getColumns(this.RowNode).length);
|
|
console.log("ROW NODE DATA DATA" , this.RowNode , this.RowNode && CurrentView.getColumns(this.RowNode).length);
|
|
@@ -102,7 +103,11 @@ export default class SideBar{
|
|
<Text>Col</Text>
|
|
<Text>Col</Text>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
- {data}
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ <View style={PropertiesContainer.container}>
|
|
|
|
+ {data}
|
|
|
|
+ </View>
|
|
</View>
|
|
</View>
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@@ -121,6 +126,17 @@ const SelectedStyle = StyleSheet.create({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+const PropertiesContainer = StyleSheet.create({
|
|
|
|
+ container:{
|
|
|
|
+ marginTop:20,
|
|
|
|
+ borderTopWidth:0.8,
|
|
|
|
+ borderColor:'#D0D0D0'
|
|
|
|
+ },
|
|
|
|
+ child:{
|
|
|
|
+ padding:10
|
|
|
|
+ }
|
|
|
|
+})
|
|
|
|
+
|
|
const SideBarStyle = StyleSheet.create({
|
|
const SideBarStyle = StyleSheet.create({
|
|
container:{
|
|
container:{
|
|
padding:1,
|
|
padding:1,
|