Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(radio): 重构radio dom接口,补充对应文档和适配样式 #468

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

byq1213
Copy link
Contributor

@byq1213 byq1213 commented Aug 18, 2024

fix #461

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

fix #461

💡 需求背景和解决方案

📝 更新日志

  • fix(组件名称): 处理问题或特性描述 ...

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • Changelog 已提供或无须提供

Copy link
Contributor

失败

src/common.ts Outdated Show resolved Hide resolved
src/radio/Radio.tsx Outdated Show resolved Hide resolved
src/radio/Radio.tsx Outdated Show resolved Hide resolved
src/radio/Radio.tsx Outdated Show resolved Hide resolved
@byq1213 byq1213 force-pushed the feat/radio_0817 branch 2 times, most recently from 382d560 to fa6d0ab Compare August 23, 2024 02:26
@@ -1,4 +1,2 @@
import '../../_common/style/mobile/components/radio/_index.less';
import '../../_common/style/mobile/components/radio/v2/_index.less';
import '../../_common/style/mobile/components/radio-group/_index.less';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

radio-group 的样式没有实际意义了,可移除

allowUncheck = false,
checked = false,
defaultChecked = false,
children,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

children 需要保留。 type.ts文件缺少了该属性,辛苦重新从api平台生成

import classNames from 'classnames';
import { CheckIcon } from 'tdesign-icons-react';
import { CheckIcon, CheckCircleFilledIcon } from 'tdesign-icons-react';
import forwardRefWithStatics from '../_util/forwardRefWithStatics';
import useConfig from '../_util/useConfig';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改用 usePrefixClass() 计算组件类名前缀

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const radioClass = usePrefixClass('radio');

{content && (
<div
className={`${classPrefix}__description ${disabled && `${classPrefix}__description--disabled`}`}
style={getLimitRow(maxContentRow)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

<div className={iconClass}>{renderIcon()}</div>
<div className={`${classPrefix}__content`}>
{label && (
<span className={titleClassName} style={labelStyle}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style={{ WebkitLineClamp: maxLabelRow }} 就好, 其他的在样式文件里面处理了

>
<CheckIcon size={16} />
</div>
);
};

const labelStyle = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

实际未使用代码记得移除

@@ -18,12 +18,23 @@ export interface TdRadioProps {
* @default false
*/
allowUncheck?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

allowUncheck 属性功能未实现,需要补充实现

* 是否允许取消选中
* @default false
*/
allowUncheck?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

radio-group的allowUncheck属性功能也未实现,需要补齐

@anlyyao
Copy link
Collaborator

anlyyao commented Sep 18, 2024

@byq1213 API文档需要从tdesign-api平台重新生成,补充了 readonly 属性

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

【Radio组件升级】任务单
3 participants