Consolidate properties
parent
12e18a7ed0
commit
5775ab405b
|
@ -7,7 +7,7 @@ module.exports = React.createClass
|
||||||
active : React.PropTypes.bool
|
active : React.PropTypes.bool
|
||||||
className : React.PropTypes.string
|
className : React.PropTypes.string
|
||||||
hideable : React.PropTypes.bool
|
hideable : React.PropTypes.bool
|
||||||
type : React.PropTypes.string.required
|
type : React.PropTypes.string
|
||||||
|
|
||||||
getDefaultProps: ->
|
getDefaultProps: ->
|
||||||
className : ""
|
className : ""
|
||||||
|
|
|
@ -7,7 +7,7 @@ module.exports = React.createClass
|
||||||
propTypes:
|
propTypes:
|
||||||
className : React.PropTypes.string
|
className : React.PropTypes.string
|
||||||
colors : React.PropTypes.object
|
colors : React.PropTypes.object
|
||||||
dataSource : React.PropTypes.object
|
dataSource : React.PropTypes.any
|
||||||
disabled : React.PropTypes.bool
|
disabled : React.PropTypes.bool
|
||||||
error : React.PropTypes.string
|
error : React.PropTypes.string
|
||||||
exact : React.PropTypes.bool
|
exact : React.PropTypes.bool
|
||||||
|
@ -16,7 +16,7 @@ module.exports = React.createClass
|
||||||
onChange : React.PropTypes.func
|
onChange : React.PropTypes.func
|
||||||
required : React.PropTypes.bool
|
required : React.PropTypes.bool
|
||||||
type : React.PropTypes.string
|
type : React.PropTypes.string
|
||||||
value : React.PropTypes.string
|
value : React.PropTypes.any
|
||||||
|
|
||||||
getDefaultProps: ->
|
getDefaultProps: ->
|
||||||
className : ""
|
className : ""
|
||||||
|
@ -83,14 +83,14 @@ module.exports = React.createClass
|
||||||
<ul data-role="values" data-flex="horizontal wrap" onClick={@onDelete}>
|
<ul data-role="values" data-flex="horizontal wrap" onClick={@onDelete}>
|
||||||
{
|
{
|
||||||
for key, label of @state.values
|
for key, label of @state.values
|
||||||
<li id={key} style={backgroundColor: @props.colors[key]}>{label}</li>
|
<li ref={key} id={key} style={backgroundColor: @props.colors[key]}>{label}</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
}
|
}
|
||||||
<Input {...@props} value="" ref="input" onFocus={@onFocus}
|
<Input {...@props} value="" ref="input" onFocus={@onFocus}
|
||||||
onChange={@onChange} onKeyPress={@onKeyPress} onBlur={@onBlur}/>
|
onChange={@onChange} onKeyPress={@onKeyPress} onBlur={@onBlur}/>
|
||||||
<ul ref="suggestions" data-role="suggestions" onClick={@onSelect}>
|
<ul ref="suggestions" data-role="suggestions" onClick={@onSelect}>
|
||||||
{<li id={key}>{label}</li> for key, label of @state.suggestions}
|
{<li ref={key} id={key}>{label}</li> for key, label of @state.suggestions}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ module.exports = React.createClass
|
||||||
propTypes:
|
propTypes:
|
||||||
className : React.PropTypes.string
|
className : React.PropTypes.string
|
||||||
dataSource : React.PropTypes.array
|
dataSource : React.PropTypes.array
|
||||||
disabled : React.PropTypes.disabled
|
disabled : React.PropTypes.bool
|
||||||
label : React.PropTypes.string
|
label : React.PropTypes.string
|
||||||
onChange : React.PropTypes.func
|
onChange : React.PropTypes.func
|
||||||
template : React.PropTypes.func
|
template : React.PropTypes.func
|
||||||
|
@ -25,6 +25,7 @@ module.exports = React.createClass
|
||||||
dataSource : []
|
dataSource : []
|
||||||
disabled : false
|
disabled : false
|
||||||
type : "normal"
|
type : "normal"
|
||||||
|
value : undefined
|
||||||
|
|
||||||
getInitialState: ->
|
getInitialState: ->
|
||||||
active : false
|
active : false
|
||||||
|
@ -69,8 +70,8 @@ module.exports = React.createClass
|
||||||
{ <label>{@props.label}</label> if @props.label }
|
{ <label>{@props.label}</label> if @props.label }
|
||||||
<ul ref="values" style={stylesheet} onClick={@onItem}>
|
<ul ref="values" style={stylesheet} onClick={@onItem}>
|
||||||
{
|
{
|
||||||
for item in @props.dataSource
|
for item, index in @props.dataSource
|
||||||
<li id={item.value} className={"selected" if item.value is @state.selected.value}>
|
<li id={item.value} ref={index} className={"selected" if item.value is @state.selected.value}>
|
||||||
{ if @props.template then @props.template item else item.label }
|
{ if @props.template then @props.template item else item.label }
|
||||||
{ <Ripple origin={@state.ripple}/> if item.value is @state.selected.value }
|
{ <Ripple origin={@state.ripple}/> if item.value is @state.selected.value }
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -55,9 +55,10 @@ module.exports = React.createClass
|
||||||
onChange={@onChange}
|
onChange={@onChange}
|
||||||
onKeyPress={@props.onKeyPress}
|
onKeyPress={@props.onKeyPress}
|
||||||
onFocus={@props.onFocus}
|
onFocus={@props.onFocus}
|
||||||
onBlur={@props.onBlur}>{@state.value}</textarea>
|
onBlur={@props.onBlur} />
|
||||||
else
|
else
|
||||||
<input ref='input' {...@props} value={@state.value} checked={@state.checked}
|
<input ref='input' {...@props} value={@state.value}
|
||||||
|
checked={@state.checked}
|
||||||
onChange={@onChange}
|
onChange={@onChange}
|
||||||
onKeyPress={@props.onKeyPress}
|
onKeyPress={@props.onKeyPress}
|
||||||
onFocus={@props.onFocus}
|
onFocus={@props.onFocus}
|
||||||
|
|
|
@ -5,7 +5,7 @@ module.exports = React.createClass
|
||||||
# -- States & Properties
|
# -- States & Properties
|
||||||
propTypes:
|
propTypes:
|
||||||
className : React.PropTypes.string
|
className : React.PropTypes.string
|
||||||
dataSource : React.PropTypes.Array
|
dataSource : React.PropTypes.array
|
||||||
ItemFactory : React.PropTypes.func
|
ItemFactory : React.PropTypes.func
|
||||||
onClick : React.PropTypes.func
|
onClick : React.PropTypes.func
|
||||||
type : React.PropTypes.string
|
type : React.PropTypes.string
|
||||||
|
|
|
@ -20,7 +20,7 @@ module.exports = React.createClass
|
||||||
# -- Render
|
# -- Render
|
||||||
render: ->
|
render: ->
|
||||||
<nav data-component-navigation={@props.type}>
|
<nav data-component-navigation={@props.type}>
|
||||||
{ <Link {...route} /> for route in @props.routes }
|
{ <Link key={index} {...route} /> for route, index in @props.routes }
|
||||||
{ <Button {...action} /> for action in @props.actions }
|
{ <Button key={index} {...action} /> for action, index in @props.actions }
|
||||||
{ @props.children }
|
{ @props.children }
|
||||||
</nav>
|
</nav>
|
||||||
|
|
Loading…
Reference in New Issue