forked from subschema/subschema
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
juspears
committed
Dec 2, 2015
1 parent
d774273
commit 3fa75d5
Showing
7 changed files
with
220 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var {PropTypes, decorators} = Subschema; | ||
var {provide} = decorators; | ||
|
||
@provide.type | ||
class Anchor extends React.Component { | ||
static propTypes = { | ||
//by making this propType an expression it will evaluate it dynamically. | ||
href:PropTypes.expression, | ||
label:PropTypes.expression | ||
}; | ||
static defaultProps = { | ||
href:'/somewhere/{..page}' | ||
} | ||
render(){ | ||
return <a href={this.props.href}>{this.props.label}</a> | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
description: 'Shows how you can use Expressions on Custom Types', | ||
schema: { | ||
schema:{ | ||
selectPage:{ | ||
type:'Select', | ||
options:'Content, Conditional, Basic, Autocomplete' | ||
}, | ||
link1:{ | ||
type:'Anchor', | ||
label:'Go To {..selectPage}', | ||
href:'/#/{..selectPage}' | ||
} | ||
}, | ||
fields:"selectPage, link1" | ||
}, | ||
data: { | ||
selectPage: 'Content' | ||
}, | ||
setupTxt: require('!!raw!./Expression-setup.js') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters