Browse Source

Merge branch 'next' into v5-site-upgrade

pull/38162/head
二货机器人 2 years ago
parent
commit
f9005d9158
  1. 1
      components/input-number/style/index.tsx
  2. 2
      components/mentions/style/index.tsx
  3. 40
      components/modal/PurePanel.tsx
  4. 5
      components/modal/__tests__/Modal.test.tsx
  5. 20
      components/modal/__tests__/__snapshots__/Modal.test.tsx.snap
  6. 2
      components/popconfirm/style/index.tsx
  7. 2
      package.json

1
components/input-number/style/index.tsx

@ -153,6 +153,7 @@ const genInputNumberStyles: GenerateStyle<InputNumberToken> = (token: InputNumbe
outline: 0,
transition: `all ${motionDurationFast} linear`,
appearance: 'textfield',
color: token.colorText,
...genPlaceholderStyle(token.colorTextPlaceholder),
'&[type="number"]::-webkit-inner-spin-button, &[type="number"]::-webkit-outer-spin-button':

2
components/mentions/style/index.tsx

@ -80,6 +80,8 @@ const genMentionsStyle: GenerateStyle<MentionsToken> = token => {
// ================= Input Area =================
[`> textarea, ${componentCls}-measure`]: {
color: colorText,
boxSizing: 'border-box',
minHeight: controlHeight - 2,
margin: 0,
padding: `${inputPaddingVertical}px ${inputPaddingHorizontal}px`,

40
components/modal/PurePanel.tsx

@ -54,26 +54,26 @@ export function renderFooter(
footer,
} = props;
return (
footer ?? (
<LocaleReceiver componentName="Modal" defaultLocale={getConfirmLocale()}>
{locale => (
<>
<Button onClick={onCancel} {...cancelButtonProps}>
{cancelText || locale!.cancelText}
</Button>
<Button
{...convertLegacyProps(okType)}
loading={confirmLoading}
onClick={onOk}
{...okButtonProps}
>
{okText || locale!.okText}
</Button>
</>
)}
</LocaleReceiver>
)
return footer === undefined ? (
<LocaleReceiver componentName="Modal" defaultLocale={getConfirmLocale()}>
{locale => (
<>
<Button onClick={onCancel} {...cancelButtonProps}>
{cancelText || locale!.cancelText}
</Button>
<Button
{...convertLegacyProps(okType)}
loading={confirmLoading}
onClick={onOk}
{...okButtonProps}
>
{okText || locale!.okText}
</Button>
</>
)}
</LocaleReceiver>
) : (
footer
);
}

5
components/modal/__tests__/Modal.test.tsx

@ -105,4 +105,9 @@ describe('Modal', () => {
errSpy.mockRestore();
});
it('should not render footer if null', () => {
const { container } = render(<Modal footer={null} />);
expect(container.querySelector('.ant-modal-footer')).toBeFalsy();
});
});

20
components/modal/__tests__/__snapshots__/Modal.test.tsx.snap

@ -155,26 +155,6 @@ exports[`Modal render without footer 1`] = `
>
Here is content of Modal
</div>
<div
class="ant-modal-footer"
>
<button
class="ant-btn ant-btn-default"
type="button"
>
<span>
Cancel
</span>
</button>
<button
class="ant-btn ant-btn-primary"
type="button"
>
<span>
OK
</span>
</button>
</div>
</div>
<div
aria-hidden="true"

2
components/popconfirm/style/index.tsx

@ -37,7 +37,7 @@ const genBaseStyle: GenerateStyle<PopconfirmToken> = token => {
flexWrap: 'nowrap',
alignItems: 'start',
[`> ${iconCls}`]: {
[`> ${componentCls}-message-icon ${iconCls}`]: {
color: colorWarning,
fontSize,
flex: 'none',

2
package.json

@ -1,6 +1,6 @@
{
"name": "antd",
"version": "5.0.0-alpha.3",
"version": "5.0.0-alpha.4",
"description": "An enterprise-class UI design language and React components implementation",
"title": "Ant Design",
"keywords": [

Loading…
Cancel
Save