daisy
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
7 additions and
3 deletions
-
components/checkbox/Checkbox.tsx
-
components/checkbox/Group.tsx
-
components/radio/group.tsx
-
package.json
|
|
@ -2,11 +2,11 @@ import classNames from 'classnames'; |
|
|
|
import type { CheckboxRef } from 'rc-checkbox'; |
|
|
|
import RcCheckbox from 'rc-checkbox'; |
|
|
|
import * as React from 'react'; |
|
|
|
import warning from '../_util/warning'; |
|
|
|
import { ConfigContext } from '../config-provider'; |
|
|
|
import DisabledContext from '../config-provider/DisabledContext'; |
|
|
|
import { FormItemInputContext } from '../form/context'; |
|
|
|
import warning from '../_util/warning'; |
|
|
|
import { GroupContext } from './Group'; |
|
|
|
import DisabledContext from '../config-provider/DisabledContext'; |
|
|
|
|
|
|
|
import useStyle from './style'; |
|
|
|
|
|
|
@ -18,6 +18,7 @@ export interface AbstractCheckboxProps<T> { |
|
|
|
checked?: boolean; |
|
|
|
style?: React.CSSProperties; |
|
|
|
disabled?: boolean; |
|
|
|
title?: string; |
|
|
|
onChange?: (e: T) => void; |
|
|
|
onClick?: React.MouseEventHandler<HTMLElement>; |
|
|
|
onMouseEnter?: React.MouseEventHandler<HTMLElement>; |
|
|
|
|
|
@ -14,6 +14,7 @@ export interface CheckboxOptionType { |
|
|
|
value: CheckboxValueType; |
|
|
|
style?: React.CSSProperties; |
|
|
|
disabled?: boolean; |
|
|
|
title?: string; |
|
|
|
onChange?: (e: CheckboxChangeEvent) => void; |
|
|
|
} |
|
|
|
|
|
|
@ -132,6 +133,7 @@ const InternalCheckboxGroup: React.ForwardRefRenderFunction<HTMLDivElement, Chec |
|
|
|
onChange={option.onChange} |
|
|
|
className={`${groupPrefixCls}-item`} |
|
|
|
style={option.style} |
|
|
|
title={option.title} |
|
|
|
> |
|
|
|
{option.label} |
|
|
|
</Checkbox> |
|
|
|
|
|
@ -76,6 +76,7 @@ const RadioGroup = React.forwardRef<HTMLDivElement, RadioGroupProps>((props, ref |
|
|
|
disabled={option.disabled || disabled} |
|
|
|
value={option.value} |
|
|
|
checked={value === option.value} |
|
|
|
title={option.title} |
|
|
|
style={option.style} |
|
|
|
> |
|
|
|
{option.label} |
|
|
|
|
|
@ -123,7 +123,7 @@ |
|
|
|
"dayjs": "^1.11.1", |
|
|
|
"qrcode.react": "^3.1.0", |
|
|
|
"rc-cascader": "~3.12.0", |
|
|
|
"rc-checkbox": "~3.0.0", |
|
|
|
"rc-checkbox": "~3.1.0", |
|
|
|
"rc-collapse": "~3.7.0", |
|
|
|
"rc-dialog": "~9.1.0", |
|
|
|
"rc-drawer": "~6.2.0", |
|
|
|