mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
parent
6d685c7e8a
commit
fd8d71717b
@ -11,6 +11,7 @@ export type CheckboxValueType = string | number | boolean;
|
||||
export interface CheckboxOptionType {
|
||||
label: React.ReactNode;
|
||||
value: CheckboxValueType;
|
||||
style?: React.CSSProperties;
|
||||
disabled?: boolean;
|
||||
onChange?: (e: CheckboxChangeEvent) => void;
|
||||
}
|
||||
@ -152,6 +153,7 @@ class CheckboxGroup extends React.Component<CheckboxGroupProps, CheckboxGroupSta
|
||||
checked={state.value.indexOf(option.value) !== -1}
|
||||
onChange={option.onChange}
|
||||
className={`${groupPrefixCls}-item`}
|
||||
style={option.style}
|
||||
>
|
||||
{option.label}
|
||||
</Checkbox>
|
||||
|
@ -25,6 +25,7 @@ exports[`CheckboxGroup passes prefixCls down to checkbox 1`] = `
|
||||
</label>
|
||||
<label
|
||||
class="my-checkbox-group-item my-checkbox-wrapper"
|
||||
style="font-size:12px"
|
||||
>
|
||||
<span
|
||||
class="my-checkbox"
|
||||
|
@ -90,7 +90,7 @@ describe('CheckboxGroup', () => {
|
||||
it('passes prefixCls down to checkbox', () => {
|
||||
const options = [
|
||||
{ label: 'Apple', value: 'Apple' },
|
||||
{ label: 'Orange', value: 'Orange' },
|
||||
{ label: 'Orange', value: 'Orange', style: { fontSize: 12 } },
|
||||
];
|
||||
|
||||
const wrapper = render(<Checkbox.Group prefixCls="my-checkbox" options={options} />);
|
||||
|
@ -25,6 +25,7 @@ exports[`Radio Group passes prefixCls down to radio 1`] = `
|
||||
</label>
|
||||
<label
|
||||
class="my-radio-wrapper"
|
||||
style="font-size:12px"
|
||||
>
|
||||
<span
|
||||
class="my-radio"
|
||||
|
@ -170,7 +170,7 @@ describe('Radio Group', () => {
|
||||
});
|
||||
|
||||
it('passes prefixCls down to radio', () => {
|
||||
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange' }];
|
||||
const options = [{ label: 'Apple', value: 'Apple' }, { label: 'Orange', value: 'Orange', style: { fontSize: 12 } }];
|
||||
|
||||
const wrapper = render(<RadioGroup prefixCls="my-radio" options={options} />);
|
||||
|
||||
|
@ -133,6 +133,7 @@ class RadioGroup extends React.Component<RadioGroupProps, RadioGroupState> {
|
||||
disabled={option.disabled || this.props.disabled}
|
||||
value={option.value}
|
||||
checked={this.state.value === option.value}
|
||||
style={option.style}
|
||||
>
|
||||
{option.label}
|
||||
</Radio>
|
||||
|
Loading…
Reference in New Issue
Block a user