This repository has been archived by the owner on Aug 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
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
ukatama
committed
Apr 6, 2016
1 parent
650229d
commit 5b3369d
Showing
14 changed files
with
977 additions
and
586 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, {PropTypes} from 'react'; | ||
|
||
export const Col = (props) => { | ||
const { | ||
style, | ||
tag, | ||
width, | ||
...otherProps, | ||
} = props; | ||
|
||
const flexWidth = typeof(width) === 'number' | ||
? `${width}px` | ||
: (width || '200px'); | ||
|
||
const Style = { | ||
flex: `1 0 ${flexWidth}`, | ||
}; | ||
const Tag = tag || 'div'; | ||
|
||
return <Tag {...otherProps} style={{...Style, ...style}} />; | ||
}; | ||
Col.propTypes = { | ||
style: PropTypes.object, | ||
tag: PropTypes.string, | ||
width: PropTypes.oneOfType([ | ||
PropTypes.number, | ||
PropTypes.string, | ||
]), | ||
}; |
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,22 @@ | ||
import React, {PropTypes} from 'react'; | ||
|
||
export const Row = (props) => { | ||
const { | ||
style, | ||
tag, | ||
...otherProps, | ||
} = props; | ||
|
||
const Style = { | ||
width: '100%', | ||
display: 'flex', | ||
flexWrap: 'wrap', | ||
}; | ||
const Tag = tag || 'div'; | ||
|
||
return <Tag {...otherProps} style={{...Style, ...style}} />; | ||
}; | ||
Row.propTypes = { | ||
style: PropTypes.object, | ||
tag: PropTypes.string, | ||
}; |
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,67 @@ | ||
import React, {PropTypes} from 'react'; | ||
import {Col} from '../../col'; | ||
import {Row} from '../../row'; | ||
import {SheetField} from '../../sheet-field'; | ||
|
||
export const Armor = ({changeHandler, data, readOnly}) => ( | ||
<div style={{padding: '0 8px'}}> | ||
<Row> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="鎧" | ||
readOnly={readOnly} | ||
value={data.armor} | ||
onChange={changeHandler('armor')} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="必筋" | ||
readOnly={readOnly} | ||
type="number" | ||
value={data.armor_str_req} | ||
onChange={changeHandler('armor_str_req')} | ||
/> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="回避修正" | ||
readOnly={readOnly} | ||
type="number" | ||
value={data.armor_evasion} | ||
onChange={changeHandler('armor_evasion')} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="防護点" | ||
readOnly={readOnly} | ||
type="number" | ||
value={data.armor_protection} | ||
onChange={changeHandler('armor_protection')} | ||
/> | ||
</Col> | ||
</Row> | ||
<div style={{padding: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
multiLine | ||
label="備考" | ||
readOnly={readOnly} | ||
value={data.armor_note} | ||
onChange={changeHandler('armor_note')} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
Armor.propTypes = { | ||
changeHandler: PropTypes.func.isRequired, | ||
data: PropTypes.object.isRequired, | ||
readOnly: PropTypes.bool.isRequired, | ||
}; |
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,54 @@ | ||
import React, {PropTypes} from 'react'; | ||
import {Col} from '../../col'; | ||
import {Row} from '../../row'; | ||
import {SheetField} from '../../sheet-field'; | ||
|
||
export const BasicStandards = ({changeHandler, data, readOnly}) => ( | ||
<div style={{margin: '0 8px'}}> | ||
<Row> | ||
<Col width={80}> | ||
<SheetField | ||
fullWidth | ||
readOnly | ||
label="生命抵抗力" | ||
type="number" | ||
value={data.vit_res} | ||
/> | ||
</Col> | ||
<Col width={80}> | ||
<SheetField | ||
fullWidth | ||
readOnly | ||
label="精神抵抗力" | ||
type="number" | ||
value={data.spr_res} | ||
/> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col width={80}> | ||
<SheetField | ||
fullWidth | ||
readOnly | ||
label="HP" | ||
type="number" | ||
value={data.hp} | ||
/> | ||
</Col> | ||
<Col width={80}> | ||
<SheetField | ||
fullWidth | ||
readOnly | ||
label="MP" | ||
type="number" | ||
value={data.mp} | ||
/> | ||
</Col> | ||
</Row> | ||
</div> | ||
); | ||
BasicStandards.propTypes = { | ||
changeHandler: PropTypes.func.isRequired, | ||
data: PropTypes.object.isRequired, | ||
readOnly: PropTypes.bool.isRequired, | ||
}; |
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,114 @@ | ||
import React, {PropTypes} from 'react'; | ||
import {Col} from '../../col'; | ||
import {Row} from '../../row'; | ||
import {SheetField} from '../../sheet-field'; | ||
|
||
export const Basis = ({changeHandler, data, readOnly}) => ( | ||
<div style={{margin: '0 8px'}}> | ||
<Row> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
readOnly | ||
label="冒険者レベル" | ||
type="number" | ||
value={data.level} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="経験点" | ||
readOnly={readOnly} | ||
type="number" | ||
value={data.exp} | ||
onChange={changeHandler('exp')} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
readOnly | ||
label="累計経験点" | ||
type="number" | ||
value={data.total_exp} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="1ゾロ" | ||
readOnly={readOnly} | ||
type="number" | ||
value={data.fumble} | ||
onChange={changeHandler('fumble')} | ||
/> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="種族" | ||
readOnly={readOnly} | ||
value={data.race} | ||
onChange={changeHandler('race')} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="種族特徴" | ||
readOnly={readOnly} | ||
value={data.race_ability} | ||
onChange={changeHandler('race_ability')} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="生まれ" | ||
readOnly={readOnly} | ||
value={data.natinality} | ||
onChange={changeHandler('natinality')} | ||
/> | ||
</Col> | ||
</Row> | ||
<Row> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="年齢" | ||
readOnly={readOnly} | ||
type="number" | ||
value={data.age} | ||
onChange={changeHandler('age')} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="性別" | ||
readOnly={readOnly} | ||
value={data.sex} | ||
onChange={changeHandler('sex')} | ||
/> | ||
</Col> | ||
<Col style={{margin: '0 8px'}}> | ||
<SheetField | ||
fullWidth | ||
label="穢れ" | ||
readOnly={readOnly} | ||
type="number" | ||
value={data.foul} | ||
onChange={changeHandler('foul')} | ||
/> | ||
</Col> | ||
</Row> | ||
</div> | ||
); | ||
Basis.propTypes = { | ||
changeHandler: PropTypes.func.isRequired, | ||
data: PropTypes.object.isRequired, | ||
readOnly: PropTypes.bool.isRequired, | ||
}; |
Oops, something went wrong.