mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +08:00
Merge branch 'master' into #17329
This commit is contained in:
commit
f2954e6ca8
@ -141,4 +141,4 @@ moment.locale('zh-cn');
|
||||
|
||||
## FAQ
|
||||
|
||||
- [当我指定了 DatePicker/RangePicker 的 `mode` 属性后,点击后无法选择年份/月份?](https://ant.design/docs/react/faq-cn#当我指定了-DatePicker/RangePicker-的-mode-属性后,点击后无法选择年份/月份?)
|
||||
- [当我指定了 DatePicker/RangePicker 的 mode 属性后,点击后无法选择年份/月份?](/docs/react/faq-cn#当我指定了-DatePicker/RangePicker-的-mode-属性后,点击后无法选择年份/月份?)
|
@ -42,9 +42,11 @@ describe('Descriptions', () => {
|
||||
<Descriptions.Item label="Billing">Prepaid</Descriptions.Item>
|
||||
<Descriptions.Item label="time">18:00:00</Descriptions.Item>
|
||||
<Descriptions.Item label="Amount">$80.00</Descriptions.Item>
|
||||
<Descriptions.Item>No-Label</Descriptions.Item>
|
||||
</Descriptions>,
|
||||
);
|
||||
expect(wrapper.find('tr')).toHaveLength(4);
|
||||
expect(wrapper.find('tr')).toHaveLength(5);
|
||||
expect(wrapper.find('.ant-descriptions-item-no-label')).toHaveLength(1);
|
||||
|
||||
enquire.callunmatch();
|
||||
wrapper.unmount();
|
||||
|
@ -82,7 +82,12 @@ const renderCol = (child: React.ReactElement<DescriptionsItemProps>, bordered: b
|
||||
const { prefixCls, label, className, children, span = 1 } = child.props;
|
||||
if (bordered) {
|
||||
return [
|
||||
<th className={classNames(`${prefixCls}-item-label`, className)} key="label">
|
||||
<th
|
||||
className={classNames(`${prefixCls}-item-label`, className, {
|
||||
[`${prefixCls}-item-no-label`]: !label,
|
||||
})}
|
||||
key="label"
|
||||
>
|
||||
{label}
|
||||
</th>,
|
||||
<td
|
||||
@ -96,7 +101,12 @@ const renderCol = (child: React.ReactElement<DescriptionsItemProps>, bordered: b
|
||||
}
|
||||
return (
|
||||
<td colSpan={span} className={classNames(`${prefixCls}-item`, className)}>
|
||||
<span className={`${prefixCls}-item-label`} key="label">
|
||||
<span
|
||||
className={classNames(`${prefixCls}-item-label`, {
|
||||
[`${prefixCls}-item-no-label`]: !label,
|
||||
})}
|
||||
key="label"
|
||||
>
|
||||
{label}
|
||||
</span>
|
||||
<span className={`${prefixCls}-item-content`} key="content">
|
||||
|
@ -51,6 +51,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
&-item-no-label {
|
||||
&::after {
|
||||
content: '';
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-item-content {
|
||||
display: table-cell;
|
||||
color: @text-color;
|
||||
|
@ -7,14 +7,18 @@ import Wave from '../_util/wave';
|
||||
import Icon from '../icon';
|
||||
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
|
||||
|
||||
export type SwitchSize = 'small' | 'default';
|
||||
export type SwitchChangeEventHandler = (checked: boolean, event: MouseEvent) => void;
|
||||
export type SwitchClickEventHandler = SwitchChangeEventHandler;
|
||||
|
||||
export interface SwitchProps {
|
||||
prefixCls?: string;
|
||||
size?: 'small' | 'default';
|
||||
size?: SwitchSize;
|
||||
className?: string;
|
||||
checked?: boolean;
|
||||
defaultChecked?: boolean;
|
||||
onChange?: (checked: boolean, event: MouseEvent) => void;
|
||||
onClick?: (checked: boolean, event: MouseEvent) => void;
|
||||
onChange?: SwitchChangeEventHandler;
|
||||
onClick?: SwitchChangeEventHandler;
|
||||
checkedChildren?: React.ReactNode;
|
||||
unCheckedChildren?: React.ReactNode;
|
||||
disabled?: boolean;
|
||||
|
@ -2,10 +2,6 @@
|
||||
publish = "_site"
|
||||
command = "npm run site"
|
||||
|
||||
[context.production]
|
||||
command = "echo build"
|
||||
publish = "."
|
||||
|
||||
[[redirects]]
|
||||
from = "/docs/resource/download"
|
||||
to = "/docs/spec/download"
|
||||
|
Loading…
Reference in New Issue
Block a user