diff --git a/src/radio/Radio.tsx b/src/radio/Radio.tsx index c222abb1..fb379498 100644 --- a/src/radio/Radio.tsx +++ b/src/radio/Radio.tsx @@ -2,8 +2,8 @@ import React, { createContext, forwardRef, useContext, useRef } from 'react'; import type { CSSProperties, Ref } from 'react'; import classNames from 'classnames'; import { CheckIcon, CheckCircleFilledIcon } from 'tdesign-icons-react'; +import { usePrefixClass } from 'tdesign-mobile-react/hooks/useClass'; import forwardRefWithStatics from '../_util/forwardRefWithStatics'; -import useConfig from '../_util/useConfig'; import useDefault from '../_util/useDefault'; import type { TdRadioProps } from './type'; import RadioGroup from './RadioGroup'; @@ -27,8 +27,7 @@ const getLimitRow = (row: number): CSSProperties => ({ }); const Radio = forwardRef((_props: RadioProps, ref: Ref) => { - const { classPrefix: prefix } = useConfig(); - const classPrefix = `${prefix}-radio`; + const radioClass = usePrefixClass('radio'); const inputRef = useRef(); const context = useContext(RadioContext); const props = context ? context.inject(_props) : _props; @@ -50,12 +49,14 @@ const Radio = forwardRef((_props: RadioProps, ref: Ref) => { value, borderless, onChange, + readonly, + children, } = useDefaultProps(props, radioDefaultProps); const [radioChecked, setRadioChecked] = useDefault(checked, defaultChecked, onChange); const switchRadioChecked = (area?: string) => { - if (disabled) { + if (disabled || readonly) { return; } if (area === 'content' && contentDisabled) { @@ -73,20 +74,20 @@ const Radio = forwardRef((_props: RadioProps, ref: Ref) => { } if (radioChecked) { if (icon === 'circle') { - return ; + return ; } if (icon === 'line') { - return ; + return ; } if (icon === 'dot') { - let dotIconClassName = `${classPrefix}__icon-${icon}`; - disabled && (dotIconClassName += ` ${classPrefix}__icon-${icon}--disabled`); + let dotIconClassName = `${radioClass}__icon-${icon}`; + disabled && (dotIconClassName += ` ${radioClass}__icon-${icon}--disabled`); return
; } } else { if (icon === 'circle' || icon === 'dot') { - let circleIconClassName = `${classPrefix}__icon-circle`; - disabled && (circleIconClassName += ` ${classPrefix}__icon-circle--disabled`); + let circleIconClassName = `${radioClass}__icon-circle`; + disabled && (circleIconClassName += ` ${radioClass}__icon-circle--disabled`); return
; } if (icon === 'line') { @@ -95,27 +96,22 @@ const Radio = forwardRef((_props: RadioProps, ref: Ref) => { } }; - const labelStyle = { - ...getLimitRow(maxLabelRow), - color: disabled ? '#dcdcdc' : 'inherit', - }; - - const radioClassName = classNames(`${classPrefix}`, `${classPrefix}--${placement}`, { - [`${classPrefix}--block`]: block, + const radioClassName = classNames(`${radioClass}`, `${radioClass}--${placement}`, { + [`${radioClass}--block`]: block, }); - const titleClassName = classNames(`${classPrefix}__title`, { [`${classPrefix}__title--disabled`]: disabled }); + const titleClassName = classNames(`${radioClass}__title`, { [`${radioClass}__title--disabled`]: disabled }); const input = ( { e.stopPropagation(); @@ -127,23 +123,23 @@ const Radio = forwardRef((_props: RadioProps, ref: Ref) => { /> ); - const iconClass = classNames(`${classPrefix}__icon`, `${classPrefix}__icon--${placement}`, { - [`${classPrefix}__icon--checked`]: radioChecked, - [`${classPrefix}__icon--disabled`]: disabled, + const iconClass = classNames(`${radioClass}__icon`, `${radioClass}__icon--${placement}`, { + [`${radioClass}__icon--checked`]: radioChecked, + [`${radioClass}__icon--disabled`]: disabled, }); return (
switchRadioChecked()}> {input}
{renderIcon()}
-
- {label && ( - - {label} +
+ {(label || children) && ( + + {label || children} )} {content && (
{content} @@ -151,7 +147,7 @@ const Radio = forwardRef((_props: RadioProps, ref: Ref) => { )}
- {!borderless && block &&
} + {!borderless && block &&
}
); }); diff --git a/src/radio/RadioGroup.tsx b/src/radio/RadioGroup.tsx index 059b3523..d03a7ee3 100644 --- a/src/radio/RadioGroup.tsx +++ b/src/radio/RadioGroup.tsx @@ -7,11 +7,12 @@ import type { TdRadioGroupProps } from './type'; export interface RadioGroupProps extends TdRadioGroupProps { children?: ReactNode; + className: string; } const RadioGroup: FC = (props) => { const { classPrefix } = useConfig(); - const { disabled, options, value, defaultValue, children, onChange } = props; + const { disabled, options, value, defaultValue, children, onChange, allowUncheck, borderless, className } = props; const groupRef = useRef(null); const [internalValue, setInternalValue] = useDefault(value, defaultValue, onChange); @@ -27,6 +28,8 @@ const RadioGroup: FC = (props) => { typeof radioProps.value !== 'undefined' && internalValue === radioProps.value, disabled: radioProps.disabled || disabled, + allowUncheck: radioProps.allowUncheck || allowUncheck, + borderless: radioProps.borderless || borderless, onChange: (checked, { e }) => { if (typeof radioProps.onChange === 'function') { radioProps.onChange(checked, { e }); @@ -39,7 +42,7 @@ const RadioGroup: FC = (props) => { }; const renderOptions = () => - options.map((option) => { + options.map((option, index) => { if (typeof option === 'number' || typeof option === 'string') { return ( @@ -48,13 +51,13 @@ const RadioGroup: FC = (props) => { ); } return ( - + {option.label} ); }); return ( -
+
{options?.length ? renderOptions() : children}
); diff --git a/src/radio/defaultProps.ts b/src/radio/defaultProps.ts index 781f4fa0..8beff2f0 100644 --- a/src/radio/defaultProps.ts +++ b/src/radio/defaultProps.ts @@ -16,6 +16,7 @@ export const radioDefaultProps: TdRadioProps = { maxContentRow: 5, maxLabelRow: 3, placement: 'left', + readonly: false, value: undefined, }; diff --git a/src/radio/radio.en-US.md b/src/radio/radio.en-US.md index 92810c64..c2911e20 100644 --- a/src/radio/radio.en-US.md +++ b/src/radio/radio.en-US.md @@ -24,7 +24,8 @@ maxContentRow | Number | 5 | \- | N maxLabelRow | Number | 3 | \- | N name | String | - | \- | N placement | String | left | options: left/right | N -value | String / Number / Boolean | undefined | Typescript:`string \| number \| boolean` | N +readonly | Boolean | false | \- | N +value | String / Number / Boolean | undefined | Typescript:`T` | N onChange | Function | | Typescript:`(checked: boolean, context: { e: ChangeEvent }) => void`
| N @@ -44,4 +45,4 @@ options | Array | - | Typescript:`Array` `type RadioOption = stri placement | String | left | options: left/right | N value | String / Number / Boolean | - | Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/radio/type.ts) | N defaultValue | String / Number / Boolean | - | uncontrolled property。Typescript:`T` `type RadioValue = string \| number \| boolean`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/radio/type.ts) | N -onChange | Function | | Typescript:`(value: T, context: { e: ChangeEvent }) => void`
| N +onChange | Function | | Typescript:`(value: T, context: { e: ChangeEvent; name?: string }) => void`
| N diff --git a/src/radio/radio.md b/src/radio/radio.md index 6bbe974c..832c1a20 100644 --- a/src/radio/radio.md +++ b/src/radio/radio.md @@ -24,7 +24,8 @@ maxContentRow | Number | 5 | 内容最大行数限制 | N maxLabelRow | Number | 3 | 主文案最大行数限制 | N name | String | - | HTML 元素原生属性 | N placement | String | left | 复选框和内容相对位置。可选项:left/right | N -value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`string \| number \| boolean` | N +readonly | Boolean | false | 只读状态 | N +value | String / Number / Boolean | undefined | 单选按钮的值。TS 类型:`T` | N onChange | Function | | TS 类型:`(checked: boolean, context: { e: ChangeEvent }) => void`
选中状态变化时触发 | N @@ -44,4 +45,4 @@ options | Array | - | 单选组件按钮形式。RadioOption 数据类型为 str placement | String | left | 复选框和内容相对位置。可选项:left/right | N value | String / Number / Boolean | - | 选中的值。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/radio/type.ts) | N defaultValue | String / Number / Boolean | - | 选中的值。非受控属性。TS 类型:`T` `type RadioValue = string \| number \| boolean`。[详细类型定义](https://github.com/Tencent/tdesign-mobile-react/tree/develop/src/radio/type.ts) | N -onChange | Function | | TS 类型:`(value: T, context: { e: ChangeEvent }) => void`
选中值发生变化时触发 | N +onChange | Function | | TS 类型:`(value: T, context: { e: ChangeEvent; name?: string }) => void`
选中值发生变化时触发, `context.name` 指 RadioGroup 的 name 属性 | N diff --git a/src/radio/style/index.js b/src/radio/style/index.js index 1b755a93..dab3f1cc 100644 --- a/src/radio/style/index.js +++ b/src/radio/style/index.js @@ -1,2 +1 @@ import '../../_common/style/mobile/components/radio/v2/_index.less'; -import '../../_common/style/mobile/components/radio-group/_index.less'; diff --git a/src/radio/type.ts b/src/radio/type.ts index cfc5954d..0972209c 100644 --- a/src/radio/type.ts +++ b/src/radio/type.ts @@ -7,7 +7,7 @@ import { TNode, KeysType } from '../common'; import { ChangeEvent } from 'react'; -export interface TdRadioProps { +export interface TdRadioProps { /** * 已废弃。复选框和内容相对位置 * @default left @@ -83,10 +83,15 @@ export interface TdRadioProps { * @default left */ placement?: 'left' | 'right'; + /** + * 只读状态 + * @default false + */ + readonly?: boolean; /** * 单选按钮的值 */ - value?: string | number | boolean; + value?: T; /** * 选中状态变化时触发 */ @@ -140,9 +145,9 @@ export interface TdRadioGroupProps { */ defaultValue?: T; /** - * 选中值发生变化时触发 + * 选中值发生变化时触发, `context.name` 指 RadioGroup 的 name 属性 */ - onChange?: (value: T, context: { e: ChangeEvent }) => void; + onChange?: (value: T, context: { e: ChangeEvent; name?: string }) => void; } export type RadioOption = string | number | RadioOptionObj; diff --git a/test/snap/__snapshots__/csr.test.jsx.snap b/test/snap/__snapshots__/csr.test.jsx.snap index a33fd5ff..b3647135 100644 --- a/test/snap/__snapshots__/csr.test.jsx.snap +++ b/test/snap/__snapshots__/csr.test.jsx.snap @@ -2987,8 +2987,10 @@ exports[`csr snapshot test > csr test src/cell/_example/base.tsx 1`] = ` width="1em" >
@@ -3270,8 +3272,10 @@ exports[`csr snapshot test > csr test src/cell/_example/base.tsx 1`] = ` width="1em" >
@@ -3462,8 +3466,10 @@ exports[`csr snapshot test > csr test src/cell/_example/base.tsx 1`] = ` width="1em" >
@@ -3623,8 +3629,10 @@ exports[`csr snapshot test > csr test src/cell/_example/group.tsx 1`] = ` width="1em" >
@@ -3986,8 +3994,10 @@ exports[`csr snapshot test > csr test src/cell/_example/multiple.tsx 1`] = ` width="1em" >
@@ -4344,8 +4354,10 @@ exports[`csr snapshot test > csr test src/cell/_example/single.tsx 1`] = ` width="1em" > @@ -31972,7 +31984,6 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` @@ -31997,7 +32008,7 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` > 单选 @@ -32011,7 +32022,6 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` > @@ -32027,7 +32037,7 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` > 单选 @@ -32041,7 +32051,6 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` > @@ -32057,7 +32066,7 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` > 单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选 @@ -32071,7 +32080,6 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` > @@ -32087,7 +32095,7 @@ exports[`csr snapshot test > csr test src/radio/_example/base.tsx 1`] = ` > 单选 @@ -32117,7 +32125,6 @@ exports[`csr snapshot test > csr test src/radio/_example/card.tsx 1`] = ` @@ -32142,7 +32149,7 @@ exports[`csr snapshot test > csr test src/radio/_example/card.tsx 1`] = ` > 单选 @@ -32156,7 +32163,6 @@ exports[`csr snapshot test > csr test src/radio/_example/card.tsx 1`] = ` > @@ -32172,7 +32178,7 @@ exports[`csr snapshot test > csr test src/radio/_example/card.tsx 1`] = ` > 单选 @@ -32186,7 +32192,6 @@ exports[`csr snapshot test > csr test src/radio/_example/card.tsx 1`] = ` > @@ -32202,7 +32207,7 @@ exports[`csr snapshot test > csr test src/radio/_example/card.tsx 1`] = ` > 单选标题多行单选标题多行单选标题多行单选标题多行单选标题多行 @@ -32252,7 +32257,6 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` @@ -32264,7 +32268,7 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > 单选 @@ -32285,7 +32289,6 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > @@ -32297,7 +32300,7 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > 单选 @@ -32318,7 +32321,6 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > @@ -32330,7 +32332,7 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > 单选 @@ -32381,7 +32383,6 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` @@ -32393,7 +32394,7 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > 单选 @@ -32408,7 +32409,6 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > @@ -32420,7 +32420,7 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > 单选 @@ -32435,7 +32435,6 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > @@ -32447,7 +32446,7 @@ exports[`csr snapshot test > csr test src/radio/_example/custom.tsx 1`] = ` > 单选 @@ -32471,7 +32470,6 @@ exports[`csr snapshot test > csr test src/radio/_example/horizontal.tsx 1`] = ` @@ -32496,7 +32494,7 @@ exports[`csr snapshot test > csr test src/radio/_example/horizontal.tsx 1`] = ` > 单选标题 @@ -32507,7 +32505,6 @@ exports[`csr snapshot test > csr test src/radio/_example/horizontal.tsx 1`] = ` > @@ -32523,7 +32520,7 @@ exports[`csr snapshot test > csr test src/radio/_example/horizontal.tsx 1`] = ` > 单选标题 @@ -32534,7 +32531,6 @@ exports[`csr snapshot test > csr test src/radio/_example/horizontal.tsx 1`] = ` > @@ -32550,7 +32546,7 @@ exports[`csr snapshot test > csr test src/radio/_example/horizontal.tsx 1`] = ` > 单选标题 @@ -32568,7 +32564,6 @@ exports[`csr snapshot test > csr test src/radio/_example/icon.tsx 1`] = ` @@ -32593,7 +32588,7 @@ exports[`csr snapshot test > csr test src/radio/_example/icon.tsx 1`] = ` > 单选 @@ -32608,7 +32603,6 @@ exports[`csr snapshot test > csr test src/radio/_example/icon.tsx 1`] = ` @@ -32624,7 +32618,7 @@ exports[`csr snapshot test > csr test src/radio/_example/icon.tsx 1`] = ` > 单选 @@ -32687,7 +32681,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -32712,7 +32705,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -32726,7 +32719,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -32742,7 +32734,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -32756,7 +32748,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -32772,7 +32763,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选 @@ -32786,7 +32777,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -32802,7 +32792,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -32848,7 +32838,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -32873,7 +32862,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选标题 @@ -32884,7 +32873,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -32900,7 +32888,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选标题 @@ -32911,7 +32899,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -32927,7 +32914,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选标题 @@ -32970,7 +32957,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` checked="" class="t-radio__original" disabled="" - readonly="" type="radio" value="1" /> @@ -32995,7 +32981,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 选项禁用-已选 @@ -33010,7 +32996,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33026,7 +33011,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 选项禁用-默认 @@ -33068,7 +33053,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33093,7 +33077,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33108,7 +33092,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33124,7 +33107,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33160,7 +33143,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33185,7 +33167,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33200,7 +33182,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33225,7 +33206,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33264,7 +33245,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33289,7 +33269,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33303,7 +33283,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -33319,7 +33298,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33333,7 +33312,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -33349,7 +33327,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选标题多行单选标题多行单选标题多行单选标题多行单选标题多行 @@ -33415,7 +33393,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33427,7 +33404,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33448,7 +33425,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -33460,7 +33436,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33481,7 +33457,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -33493,7 +33468,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33544,7 +33519,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` @@ -33556,7 +33530,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33571,7 +33545,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -33583,7 +33556,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33598,7 +33571,6 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > @@ -33610,7 +33582,7 @@ exports[`csr snapshot test > csr test src/radio/_example/index.tsx 1`] = ` > 单选 @@ -33635,7 +33607,6 @@ exports[`csr snapshot test > csr test src/radio/_example/placement.tsx 1`] = ` @@ -33660,7 +33631,7 @@ exports[`csr snapshot test > csr test src/radio/_example/placement.tsx 1`] = ` > 单选 @@ -33675,7 +33646,6 @@ exports[`csr snapshot test > csr test src/radio/_example/placement.tsx 1`] = ` @@ -33700,7 +33670,7 @@ exports[`csr snapshot test > csr test src/radio/_example/placement.tsx 1`] = ` > 单选 @@ -33724,7 +33694,6 @@ exports[`csr snapshot test > csr test src/radio/_example/status.tsx 1`] = ` checked="" class="t-radio__original" disabled="" - readonly="" type="radio" value="1" /> @@ -33749,7 +33718,7 @@ exports[`csr snapshot test > csr test src/radio/_example/status.tsx 1`] = ` > 选项禁用-已选 @@ -33764,7 +33733,6 @@ exports[`csr snapshot test > csr test src/radio/_example/status.tsx 1`] = ` @@ -33780,7 +33748,7 @@ exports[`csr snapshot test > csr test src/radio/_example/status.tsx 1`] = ` > 选项禁用-默认 @@ -55164,13 +55132,13 @@ exports[`ssr snapshot test > ssr test src/button/_example/test.tsx 1`] = `"
exports[`ssr snapshot test > ssr test src/button/_example/theme.tsx 1`] = `"
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/base.tsx 1`] = `"

Cell 单元格

一行内容/功能的垂直排列方式。一行项目左侧为主要内容展示区域,右侧可增加更多操作内容

01 类型

单行单元格

单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题

02

多行单元格

单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字

03 组件样式

卡片单元格

单行标题
单行标题
单行标题
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/base.tsx 1`] = `"

Cell 单元格

一行内容/功能的垂直排列方式。一行项目左侧为主要内容展示区域,右侧可增加更多操作内容

01 类型

单行单元格

单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题

02

多行单元格

单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字

03 组件样式

卡片单元格

单行标题
单行标题
单行标题
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/group.tsx 1`] = `"
单行标题
单行标题
单行标题
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/group.tsx 1`] = `"
单行标题
单行标题
单行标题
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/multiple.tsx 1`] = `"
单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/multiple.tsx 1`] = `"
单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/single.tsx 1`] = `"
单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/single.tsx 1`] = `"
单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题
"`; exports[`ssr snapshot test > ssr test src/checkbox/_example/all.tsx 1`] = `"
全选
多选
多选
多选
单选描述信息单选描述信息单选描述信息单选描述信息单选描述信息单选描述信息单选描述信息
"`; @@ -55412,6 +55380,22 @@ exports[`ssr snapshot test > ssr test src/progress/_example/plump.tsx 1`] = `" ssr test src/progress/_example/transition.tsx 1`] = `"
88%
"`; +exports[`ssr snapshot test > ssr test src/radio/_example/base.tsx 1`] = `"
单选
单选
单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选
单选
描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/card.tsx 1`] = `"
单选
单选
单选标题多行单选标题多行单选标题多行单选标题多行单选标题多行
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/custom.tsx 1`] = `"

单选框尺寸规格

单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息

横向卡片单选框

单选
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/horizontal.tsx 1`] = `"
单选标题
单选标题
单选标题
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/icon.tsx 1`] = `"
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/index.tsx 1`] = `"

Radio 单选框

用于在预设的一组选项中执行单项选择,并呈现选择结果。

01 组件类型

纵向单选框

单选
单选
单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选
单选
描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息

横向单选框

单选标题
单选标题
单选标题

02 组件状态

单选框禁用状态

选项禁用-已选
选项禁用-默认

03 组件样式

勾选样式

单选
单选

勾选显示位置

单选
单选

非通栏单选样式

单选
单选
单选标题多行单选标题多行单选标题多行单选标题多行单选标题多行

04 特殊样式

单选框尺寸规格

单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息

横向卡片单选框

单选
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/placement.tsx 1`] = `"
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/status.tsx 1`] = `"
选项禁用-已选
选项禁用-默认
"`; + exports[`ssr snapshot test > ssr test src/result/_example/custom.tsx 1`] = `"
自定义结果
描述文字
"`; exports[`ssr snapshot test > ssr test src/result/_example/index.tsx 1`] = `"

Result 结果

结果反馈

01类型

不同结果反馈

成功状态
描述文字
失败状态
描述文字
警示状态
描述文字
默认状态
描述文字

自定义结果

自定义结果
描述文字

页面位置展示

"`; diff --git a/test/snap/__snapshots__/ssr.test.jsx.snap b/test/snap/__snapshots__/ssr.test.jsx.snap index b3964200..5a7685f8 100644 --- a/test/snap/__snapshots__/ssr.test.jsx.snap +++ b/test/snap/__snapshots__/ssr.test.jsx.snap @@ -34,13 +34,13 @@ exports[`ssr snapshot test > ssr test src/button/_example/test.tsx 1`] = `"
exports[`ssr snapshot test > ssr test src/button/_example/theme.tsx 1`] = `"
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/base.tsx 1`] = `"

Cell 单元格

一行内容/功能的垂直排列方式。一行项目左侧为主要内容展示区域,右侧可增加更多操作内容

01 类型

单行单元格

单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题

02

多行单元格

单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字

03 组件样式

卡片单元格

单行标题
单行标题
单行标题
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/base.tsx 1`] = `"

Cell 单元格

一行内容/功能的垂直排列方式。一行项目左侧为主要内容展示区域,右侧可增加更多操作内容

01 类型

单行单元格

单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题

02

多行单元格

单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字

03 组件样式

卡片单元格

单行标题
单行标题
单行标题
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/group.tsx 1`] = `"
单行标题
单行标题
单行标题
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/group.tsx 1`] = `"
单行标题
单行标题
单行标题
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/multiple.tsx 1`] = `"
单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/multiple.tsx 1`] = `"
单行标题
一段很长很长的内容文字
单行标题 *
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
16
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字
辅助信息
单行标题
一段很长很长的内容文字
单行标题
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行高度不定,长文本自动换行,该选项的描述是一段很长的内容
一段很长很长的内容文字,长文本自动换行,该选项的描述是一段很长的内容
多行带头像
一段很长很长的内容文字
多行带图片
一段很长很长的内容文字
"`; -exports[`ssr snapshot test > ssr test src/cell/_example/single.tsx 1`] = `"
单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题
"`; +exports[`ssr snapshot test > ssr test src/cell/_example/single.tsx 1`] = `"
单行标题
单行标题 *
单行标题
16
单行标题
单行标题
辅助信息
单行标题
"`; exports[`ssr snapshot test > ssr test src/checkbox/_example/all.tsx 1`] = `"
全选
多选
多选
多选
单选描述信息单选描述信息单选描述信息单选描述信息单选描述信息单选描述信息单选描述信息
"`; @@ -282,6 +282,22 @@ exports[`ssr snapshot test > ssr test src/progress/_example/plump.tsx 1`] = `" ssr test src/progress/_example/transition.tsx 1`] = `"
88%
"`; +exports[`ssr snapshot test > ssr test src/radio/_example/base.tsx 1`] = `"
单选
单选
单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选
单选
描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/card.tsx 1`] = `"
单选
单选
单选标题多行单选标题多行单选标题多行单选标题多行单选标题多行
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/custom.tsx 1`] = `"

单选框尺寸规格

单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息

横向卡片单选框

单选
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/horizontal.tsx 1`] = `"
单选标题
单选标题
单选标题
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/icon.tsx 1`] = `"
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/index.tsx 1`] = `"

Radio 单选框

用于在预设的一组选项中执行单项选择,并呈现选择结果。

01 组件类型

纵向单选框

单选
单选
单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选单选
单选
描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息描述信息

横向单选框

单选标题
单选标题
单选标题

02 组件状态

单选框禁用状态

选项禁用-已选
选项禁用-默认

03 组件样式

勾选样式

单选
单选

勾选显示位置

单选
单选

非通栏单选样式

单选
单选
单选标题多行单选标题多行单选标题多行单选标题多行单选标题多行

04 特殊样式

单选框尺寸规格

单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息
单选
描述信息描述信息描述信息描述信息描述信息

横向卡片单选框

单选
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/placement.tsx 1`] = `"
单选
单选
"`; + +exports[`ssr snapshot test > ssr test src/radio/_example/status.tsx 1`] = `"
选项禁用-已选
选项禁用-默认
"`; + exports[`ssr snapshot test > ssr test src/result/_example/custom.tsx 1`] = `"
自定义结果
描述文字
"`; exports[`ssr snapshot test > ssr test src/result/_example/index.tsx 1`] = `"

Result 结果

结果反馈

01类型

不同结果反馈

成功状态
描述文字
失败状态
描述文字
警示状态
描述文字
默认状态
描述文字

自定义结果

自定义结果
描述文字

页面位置展示

"`;