mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +08:00
commit
2f1538e731
@ -116,12 +116,21 @@ const ComponentMeta: React.FC<ComponentMetaProps> = (props) => {
|
||||
return [source, source];
|
||||
}, [component, source]);
|
||||
|
||||
const transformComponentName = (componentName: string) => {
|
||||
if (componentName === 'Notifiction' || componentName === 'Message') {
|
||||
return componentName.toLowerCase();
|
||||
}
|
||||
return componentName;
|
||||
};
|
||||
|
||||
// ======================== Render ========================
|
||||
const importList = [
|
||||
<span key="import" className={styles.import}>
|
||||
import
|
||||
</span>,
|
||||
<span key="component" className={styles.component}>{`{ ${component} }`}</span>,
|
||||
<span key="component" className={styles.component}>{`{ ${transformComponentName(
|
||||
component,
|
||||
)} }`}</span>,
|
||||
<span key="from" className={styles.from}>
|
||||
from
|
||||
</span>,
|
||||
|
11
.github/workflows/test.yml
vendored
11
.github/workflows/test.yml
vendored
@ -116,6 +116,7 @@ jobs:
|
||||
REACT: ${{ matrix.react }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: ${{ !(matrix.react == '16' || matrix.react == '17') || matrix.module != 'dist-min' }}
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v4
|
||||
@ -315,7 +316,7 @@ jobs:
|
||||
needs: build
|
||||
strategy:
|
||||
matrix:
|
||||
react: ['16', '17', '18']
|
||||
react: ['18']
|
||||
module: [lib, es]
|
||||
shard: ['1/2', '2/2']
|
||||
env:
|
||||
@ -354,14 +355,6 @@ jobs:
|
||||
path: ${{ matrix.module }}
|
||||
key: ${{ matrix.module }}-${{ github.sha }}
|
||||
|
||||
- name: install react 16
|
||||
if: ${{ matrix.react == '16' && (github.event_name != 'pull_request' || matrix.module != 'lib') }}
|
||||
run: npm run install-react-16
|
||||
|
||||
- name: install react 17
|
||||
if: ${{ matrix.react == '17' && (github.event_name != 'pull_request' || matrix.module != 'lib') }}
|
||||
run: npm run install-react-17
|
||||
|
||||
- name: install react 18
|
||||
if: ${{ matrix.react == '18' && (github.event_name != 'pull_request' || matrix.module != 'lib') }}
|
||||
run: npm run install-react-18
|
||||
|
@ -7,6 +7,14 @@ const locale: PickerLocale = {
|
||||
lang: {
|
||||
placeholder: 'Tarix seçin',
|
||||
rangePlaceholder: ['Başlama tarixi', 'Bitmə tarixi'],
|
||||
yearPlaceholder: 'İl seçin',
|
||||
quarterPlaceholder: 'Rüb seçin',
|
||||
monthPlaceholder: 'Ay seçin',
|
||||
weekPlaceholder: 'Həftə seçin',
|
||||
rangeYearPlaceholder: ['Başlama il', 'Bitmə il'],
|
||||
rangeQuarterPlaceholder: ['Başlama rüb', 'Bitmə rüb'],
|
||||
rangeMonthPlaceholder: ['Başlama ay', 'Bitmə ay'],
|
||||
rangeWeekPlaceholder: ['Başlama həftə', 'Bitmə həftə'],
|
||||
...CalendarLocale,
|
||||
},
|
||||
timePickerLocale: {
|
||||
|
@ -85,7 +85,7 @@ export type { LayoutProps, SiderProps } from './layout';
|
||||
export { default as List } from './list';
|
||||
export type { ListProps } from './list';
|
||||
export { default as Mentions } from './mentions';
|
||||
export type { MentionProps } from './mentions';
|
||||
export type { MentionProps, MentionsProps } from './mentions';
|
||||
export { default as Menu } from './menu';
|
||||
export type { MenuItemProps, MenuProps, MenuRef, MenuTheme, SubMenuProps } from './menu';
|
||||
export { default as message } from './message';
|
||||
|
@ -11034,7 +11034,7 @@ exports[`Locale Provider should display the text as az 1`] = `
|
||||
<div
|
||||
class="ant-empty-description"
|
||||
>
|
||||
No data
|
||||
Məlumat yoxdur
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -11268,7 +11268,7 @@ exports[`Locale Provider should display the text as az 1`] = `
|
||||
<div
|
||||
class="ant-empty-description"
|
||||
>
|
||||
No data
|
||||
Məlumat yoxdur
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -12341,7 +12341,7 @@ exports[`Locale Provider should display the text as az 1`] = `
|
||||
<div
|
||||
class="ant-empty-description"
|
||||
>
|
||||
No data
|
||||
Məlumat yoxdur
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
@ -14,13 +14,32 @@ const localeValues: Locale = {
|
||||
DatePicker,
|
||||
TimePicker,
|
||||
Calendar,
|
||||
global: {
|
||||
placeholder: 'Zəhmət olmasa seçin',
|
||||
},
|
||||
Table: {
|
||||
filterTitle: 'Filter menyu',
|
||||
filterConfirm: 'Axtar',
|
||||
filterReset: 'Sıfırla',
|
||||
emptyText: 'Məlumat yoxdur',
|
||||
selectAll: 'Cari səhifəni seç',
|
||||
selectInvert: 'Invert current page',
|
||||
selectInvert: 'Mövcud səhifənin elementlərinin sırasını tərs çevir',
|
||||
filterEmptyText: 'Filter yoxdur',
|
||||
filterCheckall: 'Bütün maddələri seç',
|
||||
filterSearchPlaceholder: 'Filterlərdə axtar',
|
||||
selectNone: 'Bütün məlumatı sil',
|
||||
selectionAll: 'Bütün məlumatı seç',
|
||||
sortTitle: 'Sırala',
|
||||
expand: 'Sıranı genişləndir',
|
||||
collapse: 'Sıranı qapadın',
|
||||
triggerDesc: 'Azalan sıralama üçün klik edin',
|
||||
triggerAsc: 'Artan sıralama üçün klik edin',
|
||||
cancelSort: 'Sıralamayı ləğv edin',
|
||||
},
|
||||
Tour: {
|
||||
Next: 'Növbəti',
|
||||
Previous: 'Əvvəlki',
|
||||
Finish: 'Bitir',
|
||||
},
|
||||
Modal: {
|
||||
okText: 'Bəli',
|
||||
@ -37,6 +56,13 @@ const localeValues: Locale = {
|
||||
searchPlaceholder: 'Burada axtar',
|
||||
itemUnit: 'item',
|
||||
itemsUnit: 'items',
|
||||
remove: 'Sil',
|
||||
selectCurrent: 'Cari səhifəni seç',
|
||||
removeCurrent: 'Cari səhifəni sil',
|
||||
selectAll: 'Bütün məlumatı seç',
|
||||
deselectAll: 'Bütün seçmə nişanlarını sil',
|
||||
removeAll: 'Bütün məlumatı sil',
|
||||
selectInvert: 'Mövcud səhifənin elementlərinin sırasını tərs çevir',
|
||||
},
|
||||
Select: {
|
||||
notFoundContent: 'Tapılmadı',
|
||||
@ -46,6 +72,20 @@ const localeValues: Locale = {
|
||||
removeFile: 'Faylı sil',
|
||||
uploadError: 'Yükləmə xətası',
|
||||
previewFile: 'Fayla önbaxış',
|
||||
downloadFile: 'Faylı yüklə',
|
||||
},
|
||||
Empty: {
|
||||
description: 'Məlumat yoxdur',
|
||||
},
|
||||
Icon: {
|
||||
icon: 'icon',
|
||||
},
|
||||
Text: {
|
||||
edit: 'Dəyişiklik et',
|
||||
copy: 'Kopyala',
|
||||
copied: 'Kopyalandı',
|
||||
expand: 'Genişləndir',
|
||||
collapse: 'Yığılma',
|
||||
},
|
||||
Form: {
|
||||
optional: '(Seçimli)',
|
||||
@ -97,6 +137,17 @@ const localeValues: Locale = {
|
||||
},
|
||||
},
|
||||
},
|
||||
Image: {
|
||||
preview: 'Önbaxış',
|
||||
},
|
||||
QRCode: {
|
||||
expired: 'QR kodunun müddəti bitmişdir',
|
||||
refresh: 'Yenilə',
|
||||
scanned: 'Gözətildi',
|
||||
},
|
||||
ColorPicker: {
|
||||
presetEmpty: 'Boşdur',
|
||||
},
|
||||
};
|
||||
|
||||
export default localeValues;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Mentions } from 'antd';
|
||||
import type { MentionsProps } from 'rc-mentions';
|
||||
import type { MentionsProps } from 'antd';
|
||||
|
||||
const MOCK_DATA = {
|
||||
'@': ['afc163', 'zombiej', 'yesmeck'],
|
||||
|
@ -52,6 +52,8 @@ export interface MentionProps extends Omit<RcMentionsProps, 'suffix'> {
|
||||
variant?: Variant;
|
||||
}
|
||||
|
||||
export interface MentionsProps extends MentionProps {}
|
||||
|
||||
export interface MentionsRef extends RcMentionsRef {}
|
||||
|
||||
interface MentionsConfig {
|
||||
@ -174,6 +176,7 @@ const InternalMentions = React.forwardRef<MentionsRef, MentionProps>((props, ref
|
||||
|
||||
const mentions = (
|
||||
<RcMentions
|
||||
silent={loading}
|
||||
prefixCls={prefixCls}
|
||||
notFoundContent={notFoundContentEle}
|
||||
className={mergedClassName}
|
||||
|
@ -5,7 +5,7 @@ import Modal from '..';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import { createEvent, fireEvent, render } from '../../../tests/utils';
|
||||
|
||||
jest.mock('rc-util/lib/Portal');
|
||||
|
||||
@ -86,7 +86,12 @@ describe('Modal', () => {
|
||||
);
|
||||
};
|
||||
const { container } = render(<Demo />);
|
||||
fireEvent.click(container.querySelectorAll('#trigger')[0]);
|
||||
const triggerEle = container.querySelectorAll('#trigger')[0];
|
||||
const clickEvent = createEvent.click(triggerEle) as any;
|
||||
clickEvent.pageX = 100;
|
||||
clickEvent.pageY = 100;
|
||||
fireEvent(triggerEle, clickEvent);
|
||||
|
||||
expect(
|
||||
(container.querySelectorAll('.ant-modal')[0] as HTMLDivElement).style.transformOrigin,
|
||||
).toBeTruthy();
|
||||
|
@ -22,7 +22,7 @@ Additionally, if you need to show a simple confirmation dialog, you can use [`Ap
|
||||
<code src="./demo/async.tsx">Asynchronously close</code>
|
||||
<code src="./demo/footer.tsx">Customized Footer</code>
|
||||
<code src="./demo/loading.tsx" version="5.18.0">Loading</code>
|
||||
<code src="./demo/footer-render.tsx">Customized Footer render function</code>
|
||||
<code src="./demo/footer-render.tsx" version="5.9.0">Customized Footer render function</code>
|
||||
<code src="./demo/hooks.tsx">Use hooks to get context</code>
|
||||
<code src="./demo/locale.tsx">Internationalization</code>
|
||||
<code src="./demo/manual.tsx">Manual to update destroy</code>
|
||||
@ -58,7 +58,7 @@ Common props ref:[Common props](/docs/react/common-props)
|
||||
| confirmLoading | Whether to apply loading visual effect for OK button or not | boolean | false | |
|
||||
| destroyOnClose | Whether to unmount child components on onClose | boolean | false | |
|
||||
| focusTriggerAfterClose | Whether need to focus trigger element after dialog is closed | boolean | true | 4.9.0 |
|
||||
| footer | Footer content, set as `footer={null}` when you don't need default buttons | (params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode \| React.ReactNode | (OK and Cancel buttons) | |
|
||||
| footer | Footer content, set as `footer={null}` when you don't need default buttons | React.ReactNode \| ((params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode) | (OK and Cancel buttons) | renderFunction: 5.9.0 |
|
||||
| forceRender | Force render Modal | boolean | false | |
|
||||
| getContainer | The mounted node for Modal but still display at fullscreen | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | |
|
||||
| keyboard | Whether support press esc to close | boolean | true | |
|
||||
@ -108,7 +108,7 @@ The items listed above are all functions, expecting a settings object as paramet
|
||||
| closable | Whether a close (x) button is visible on top right of the confirm dialog or not | boolean | false | 4.9.0 |
|
||||
| closeIcon | Custom close icon | ReactNode | undefined | 4.9.0 |
|
||||
| content | Content | ReactNode | - | |
|
||||
| footer | Footer content, set as `footer: null` when you don't need default buttons | (params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode \| React.ReactNode | - | 5.9.0 |
|
||||
| footer | Footer content, set as `footer: null` when you don't need default buttons | React.ReactNode \| ((params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode) | - | renderFunction: 5.9.0 |
|
||||
| getContainer | Return the mount node for Modal | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | |
|
||||
| icon | Custom icon | ReactNode | <ExclamationCircleFilled /> | |
|
||||
| keyboard | Whether support press esc to close | boolean | true | |
|
||||
@ -184,13 +184,13 @@ return <div>{contextHolder}</div>;
|
||||
const confirmed = await modal.confirm({ ... });
|
||||
```
|
||||
|
||||
## footerRenderParams
|
||||
#### footerRenderParams
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| Property | Description | Type | Default |
|
||||
| --- | --- | --- | --- |
|
||||
| originNode | default node | React.ReactNode | - |
|
||||
| extra | extended options | { OkBtn: FC; CancelBtn: FC } | - |
|
||||
| originNode | default node | React.ReactNode | - |
|
||||
| extra | extended options | { OkBtn: FC; CancelBtn: FC } | - |
|
||||
|
||||
### `styles` and `classNames` attribute
|
||||
|
||||
|
@ -23,7 +23,7 @@ demo:
|
||||
<code src="./demo/async.tsx">异步关闭</code>
|
||||
<code src="./demo/footer.tsx">自定义页脚</code>
|
||||
<code src="./demo/loading.tsx" version="5.18.0">加载中</code>
|
||||
<code src="./demo/footer-render.tsx">自定义页脚渲染函数</code>
|
||||
<code src="./demo/footer-render.tsx" version="5.9.0">自定义页脚渲染函数</code>
|
||||
<code src="./demo/hooks.tsx">使用 hooks 获得上下文</code>
|
||||
<code src="./demo/locale.tsx">国际化</code>
|
||||
<code src="./demo/manual.tsx">手动更新和移除</code>
|
||||
@ -59,7 +59,7 @@ demo:
|
||||
| confirmLoading | 确定按钮 loading | boolean | false | |
|
||||
| destroyOnClose | 关闭时销毁 Modal 里的子元素 | boolean | false | |
|
||||
| focusTriggerAfterClose | 对话框关闭后是否需要聚焦触发元素 | boolean | true | 4.9.0 |
|
||||
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | (params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode \| React.ReactNode | (确定取消按钮) | 5.9.0 |
|
||||
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer={null}` | React.ReactNode \| ((params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode) | (确定取消按钮) | renderFunction: 5.9.0 |
|
||||
| forceRender | 强制渲染 Modal | boolean | false | |
|
||||
| getContainer | 指定 Modal 挂载的节点,但依旧为全屏展示,`false` 为挂载在当前位置 | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | |
|
||||
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | |
|
||||
@ -109,7 +109,7 @@ demo:
|
||||
| closable | 是否显示右上角的关闭按钮 | boolean | false | 4.9.0 |
|
||||
| closeIcon | 自定义关闭图标 | ReactNode | undefined | 4.9.0 |
|
||||
| content | 内容 | ReactNode | - | |
|
||||
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer: null` | (params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode \| React.ReactNode | - | 5.9.0 |
|
||||
| footer | 底部内容,当不需要默认底部按钮时,可以设为 `footer: null` | React.ReactNode \| ((params:[footerRenderParams](/components/modal-cn#footerrenderparams))=> React.ReactNode) | - | renderFunction: 5.9.0 |
|
||||
| getContainer | 指定 Modal 挂载的 HTML 节点,false 为挂载在当前 dom | HTMLElement \| () => HTMLElement \| Selectors \| false | document.body | |
|
||||
| icon | 自定义图标 | ReactNode | <ExclamationCircleFilled /> | |
|
||||
| keyboard | 是否支持键盘 esc 关闭 | boolean | true | |
|
||||
@ -185,13 +185,13 @@ return <div>{contextHolder}</div>;
|
||||
const confirmed = await modal.confirm({ ... });
|
||||
```
|
||||
|
||||
## footerRenderParams
|
||||
#### footerRenderParams
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
| 参数 | 说明 | 类型 | 默认值 |
|
||||
| --- | --- | --- | --- |
|
||||
| originNode | 默认节点 | React.ReactNode | - |
|
||||
| extra | 扩展选项 | { OkBtn: FC; CancelBtn: FC } | - |
|
||||
| originNode | 默认节点 | React.ReactNode | - |
|
||||
| extra | 扩展选项 | { OkBtn: FC; CancelBtn: FC } | - |
|
||||
|
||||
### `styles` and `classNames` 属性
|
||||
|
||||
|
@ -2,6 +2,7 @@ import type { TimePickerLocale } from '../index';
|
||||
|
||||
const locale: TimePickerLocale = {
|
||||
placeholder: 'Vaxtı seç',
|
||||
rangePlaceholder: ['Başlama tarixi', 'Bitmə tarixi'],
|
||||
};
|
||||
|
||||
export default locale;
|
||||
|
10
package.json
10
package.json
@ -133,14 +133,14 @@
|
||||
"rc-cascader": "~3.26.0",
|
||||
"rc-checkbox": "~3.3.0",
|
||||
"rc-collapse": "~3.7.3",
|
||||
"rc-dialog": "~9.4.0",
|
||||
"rc-dialog": "~9.5.2",
|
||||
"rc-drawer": "~7.2.0",
|
||||
"rc-dropdown": "~4.2.0",
|
||||
"rc-field-form": "~2.2.0",
|
||||
"rc-image": "~7.8.1",
|
||||
"rc-field-form": "~2.2.1",
|
||||
"rc-image": "~7.9.0",
|
||||
"rc-input": "~1.5.1",
|
||||
"rc-input-number": "~9.1.0",
|
||||
"rc-mentions": "~2.13.1",
|
||||
"rc-mentions": "~2.14.0",
|
||||
"rc-menu": "~9.14.0",
|
||||
"rc-motion": "^2.9.1",
|
||||
"rc-notification": "~5.6.0",
|
||||
@ -338,7 +338,7 @@
|
||||
"tar": "^7.0.1",
|
||||
"tar-fs": "^3.0.6",
|
||||
"terser": "^5.31.0",
|
||||
"tsx": "^4.8.2",
|
||||
"tsx": "4.12.0",
|
||||
"typedoc": "^0.25.13",
|
||||
"typescript": "~5.4.5",
|
||||
"vanilla-jsoneditor": "^0.23.2",
|
||||
|
Loading…
Reference in New Issue
Block a user