-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
22 changed files
with
487 additions
and
343 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 |
---|---|---|
@@ -1,37 +1,63 @@ | ||
import React from 'react'; | ||
import {Checkbox} from '@lugia/lugia-web'; | ||
import React from "react"; | ||
import { Checkbox, Theme } from "@lugia/lugia-web"; | ||
import Widget from "@lugia/lugia-web/dist/consts"; | ||
|
||
const CheckboxGroup = Checkbox.Group; | ||
const options = [ | ||
{ label: 'check1', value: '11', name: '1' }, | ||
{ label: 'check2', value: '22', name: '2' }, | ||
{ label: 'check3', value: '33', name: '3' }, | ||
{ label: "check1", value: "11", name: "1" }, | ||
{ label: "check2", value: "22", name: "2" }, | ||
{ label: "check3", value: "33", name: "3" } | ||
]; | ||
|
||
export default class CheckBoxDemo extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
newValue: ['11', '44'], | ||
newDisplayValue: ['check4', 'check5'], | ||
}; | ||
const checkboxView = { | ||
[Widget.CheckboxGroup]: { | ||
CheckButton: { | ||
CheckButtonChecked: { | ||
normal: { | ||
width: 80, | ||
padding: { left: 10, right: 10 } | ||
} | ||
}, | ||
CheckboxEdgeCancel: { | ||
normal: { | ||
width: 80, | ||
padding: { left: 10, right: 10 } | ||
} | ||
}, | ||
CheckButtonUnChecked: { | ||
normal: { | ||
width: 80, | ||
padding: { left: 10, right: 10 } | ||
} | ||
} | ||
} | ||
handleChange = ({ newValue, newDisplayValue }: any): any => { | ||
console.info(newValue, newDisplayValue); | ||
this.setState({ newValue, newDisplayValue }); | ||
} | ||
}; | ||
|
||
export default class CheckBoxDemo extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
newValue: ["11", "44"], | ||
newDisplayValue: ["check4", "check5"] | ||
}; | ||
render() { | ||
return ( | ||
<div> | ||
<CheckboxGroup | ||
onChange={this.handleChange} | ||
data={options} | ||
value={this.state.newValue} | ||
displayValue={['check4', 'check5']} | ||
displayField="label" | ||
childType="button" | ||
/> | ||
</div> | ||
); | ||
} | ||
} | ||
handleChange = ({ newValue, newDisplayValue }: any): any => { | ||
console.info(newValue, newDisplayValue); | ||
this.setState({ newValue, newDisplayValue }); | ||
}; | ||
render() { | ||
return ( | ||
<Theme config={checkboxView}> | ||
<CheckboxGroup | ||
onChange={this.handleChange} | ||
data={options} | ||
value={this.state.newValue} | ||
displayValue={["check4", "check5"]} | ||
displayField="label" | ||
childType="button" | ||
/> | ||
</Theme> | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,29 +1,53 @@ | ||
import React from 'react'; | ||
import {Checkbox} from '@lugia/lugia-web'; | ||
import React from "react"; | ||
import { Checkbox, Theme } from "@lugia/lugia-web"; | ||
import Widget from "@lugia/lugia-web/dist/consts"; | ||
|
||
const CheckboxGroup = Checkbox.Group; | ||
const CheckBoxButton = Checkbox.Button; | ||
|
||
export default class CheckBoxDemo extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
newValue: ['11', '44'], | ||
newDisplayValue: ['check4', 'check5'], | ||
}; | ||
const checkboxView = { | ||
[Widget.CheckboxGroup]: { | ||
CheckButton: { | ||
CheckButtonChecked: { | ||
normal: { | ||
width: 100, | ||
padding: { left: 10, right: 10 } | ||
} | ||
}, | ||
CheckButtonUnChecked: { | ||
normal: { | ||
width: 100, | ||
padding: { left: 10, right: 10 } | ||
} | ||
} | ||
} | ||
handleChange = obj => { | ||
console.info(obj); | ||
} | ||
}; | ||
|
||
export default class CheckBoxDemo extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
newValue: ["11", "44"], | ||
newDisplayValue: ["check4", "check5"] | ||
}; | ||
render() { | ||
return ( | ||
<div> | ||
<CheckboxGroup childType="button" onChange={this.handleChange} defaultValue={['1', '2']}> | ||
<CheckBoxButton value="1">CheckBox1</CheckBoxButton> | ||
<CheckBoxButton value="2">CheckBox2</CheckBoxButton> | ||
<CheckBoxButton value="3">CheckBox3</CheckBoxButton> | ||
</CheckboxGroup> | ||
</div> | ||
); | ||
} | ||
} | ||
handleChange = obj => { | ||
console.info(obj); | ||
}; | ||
render() { | ||
return ( | ||
<Theme config={checkboxView}> | ||
<CheckboxGroup | ||
childType="button" | ||
onChange={this.handleChange} | ||
defaultValue={["1", "2"]} | ||
> | ||
<CheckBoxButton value="1">CheckBox1</CheckBoxButton> | ||
<CheckBoxButton value="2">CheckBox2</CheckBoxButton> | ||
<CheckBoxButton value="3">CheckBox3</CheckBoxButton> | ||
</CheckboxGroup> | ||
</Theme> | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,26 +1,50 @@ | ||
import React from 'react'; | ||
import {Checkbox} from '@lugia/lugia-web'; | ||
import React from "react"; | ||
import { Checkbox, Theme } from "@lugia/lugia-web"; | ||
import Widget from "@lugia/lugia-web/dist/consts"; | ||
|
||
const CheckboxGroup = Checkbox.Group; | ||
const options = [ | ||
{ label: 'check1', value: '11', name: '1' }, | ||
{ label: 'check2', value: '22', name: '2' }, | ||
{ label: 'check3', value: '33', name: '3' }, | ||
{ label: "check1", value: "11", name: "1" }, | ||
{ label: "check2", value: "22", name: "2" }, | ||
{ label: "check3", value: "33", name: "3" } | ||
]; | ||
const checkboxView = { | ||
[Widget.CheckboxGroup]: { | ||
CheckButton: { | ||
CheckButtonChecked: { | ||
normal: { | ||
width: 80, | ||
padding: { left: 10, right: 10 } | ||
} | ||
}, | ||
CheckboxEdgeCancel: { | ||
normal: { | ||
width: 80, | ||
padding: { left: 10, right: 10 } | ||
} | ||
}, | ||
CheckButtonUnChecked: { | ||
normal: { | ||
width: 80, | ||
padding: { left: 10, right: 10 } | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
|
||
export default class CheckBoxDemo extends React.Component { | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<CheckboxGroup | ||
data={options} | ||
childType={'button'} | ||
defaultValue={['11', '44']} | ||
defaultDisplayValue={['check4', 'check5']} | ||
displayField="label" | ||
/> | ||
</div> | ||
); | ||
} | ||
render() { | ||
return ( | ||
<Theme config={checkboxView}> | ||
<CheckboxGroup | ||
data={options} | ||
childType={"button"} | ||
defaultValue={["11", "44"]} | ||
defaultDisplayValue={["check4", "check5"]} | ||
displayField="label" | ||
/> | ||
</Theme> | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,22 +1,50 @@ | ||
import React from 'react'; | ||
import {Radio} from '@lugia/lugia-web'; | ||
import React from "react"; | ||
import { Radio, Theme } from "@lugia/lugia-web"; | ||
import Widget from "@lugia/lugia-web/dist/consts"; | ||
|
||
const RadioButton = Radio.Button; | ||
const RadioGroup = Radio.Group; | ||
|
||
export default class RadioDemo extends React.Component { | ||
onChange = obj => { | ||
console.info('obj-demo', obj); | ||
}; | ||
render() { | ||
return ( | ||
<div> | ||
<RadioGroup childType="button" onChange={this.onChange} defaultValue="1"> | ||
<RadioButton value="1">Radio1</RadioButton> | ||
<RadioButton value="2">Radio2</RadioButton> | ||
<RadioButton value="3">Radio3</RadioButton> | ||
</RadioGroup> | ||
</div> | ||
); | ||
const view = { | ||
[Widget.RadioGroup]: { | ||
CheckButton: { | ||
CheckButtonChecked: { | ||
normal: { | ||
width: 100, | ||
padding: { left: 10, right: 10 } | ||
} | ||
}, | ||
CheckButtonCancel: { | ||
normal: { | ||
width: 100, | ||
padding: { left: 10, right: 10 } | ||
} | ||
}, | ||
CheckButtonUnChecked: { | ||
normal: { | ||
width: 100, | ||
padding: { left: 10, right: 10 } | ||
} | ||
} | ||
} | ||
} | ||
}; | ||
export default class RadioDemo extends React.Component { | ||
onChange = obj => { | ||
console.info("obj-demo", obj); | ||
}; | ||
render() { | ||
return ( | ||
<Theme config={view}> | ||
<RadioGroup | ||
childType="button" | ||
onChange={this.onChange} | ||
defaultValue="1" | ||
> | ||
<RadioButton value="1">Radio1</RadioButton> | ||
<RadioButton value="2">Radio2</RadioButton> | ||
<RadioButton value="3">Radio3</RadioButton> | ||
</RadioGroup> | ||
</Theme> | ||
); | ||
} | ||
} |
Oops, something went wrong.