| undefined>(undefined);
8 |
--------------------------------------------------------------------------------
/components/input/demo/borderless.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 20
3 | title:
4 | zh-CN: 无边框
5 | en-US: Borderless
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 没有边框。
11 |
12 | ## en-US
13 |
14 | No border.
15 |
16 | ```tsx
17 | import { Input } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/tests/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Amazing Antd
7 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/components/grid/index.tsx:
--------------------------------------------------------------------------------
1 | import Col from './col';
2 | import useInternalBreakpoint from './hooks/useBreakpoint';
3 | import Row from './row';
4 |
5 | // Do not export params
6 | function useBreakpoint() {
7 | return useInternalBreakpoint();
8 | }
9 |
10 | export { ColProps, ColSize } from './col';
11 | export { RowProps } from './row';
12 | export { Row, Col };
13 |
14 | export default { useBreakpoint };
15 |
--------------------------------------------------------------------------------
/components/dropdown/index.tsx:
--------------------------------------------------------------------------------
1 | import Dropdown from './dropdown';
2 |
3 | export type {
4 | DropdownProps,
5 | // typo, but we need to support it for backwards compatibility
6 | // https://github.com/ant-design/ant-design/pull/35161
7 | DropdownProps as DropDownProps,
8 | } from './dropdown';
9 | export type { DropdownButtonProps, DropdownButtonType } from './dropdown-button';
10 | export default Dropdown;
11 |
--------------------------------------------------------------------------------
/components/rate/demo/disabled.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 3
3 | title:
4 | zh-CN: 只读
5 | en-US: Read only
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 只读,无法进行鼠标交互。
11 |
12 | ## en-US
13 |
14 | Read only, can't use mouse to interact.
15 |
16 | ```tsx
17 | import { Rate } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/components/config-provider/__tests__/static.test.ts:
--------------------------------------------------------------------------------
1 | import ConfigProvider, { globalConfig } from '..';
2 |
3 | describe('ConfigProvider.config', () => {
4 | it('rootPrefixCls', () => {
5 | expect(globalConfig().getRootPrefixCls()).toEqual('ant');
6 |
7 | ConfigProvider.config({
8 | prefixCls: 'light',
9 | });
10 | expect(globalConfig().getRootPrefixCls()).toEqual('light');
11 | });
12 | });
13 |
--------------------------------------------------------------------------------
/components/rate/style/rtl.less:
--------------------------------------------------------------------------------
1 | .@{rate-prefix-cls} {
2 | &-rtl {
3 | direction: rtl;
4 | }
5 |
6 | &-star {
7 | &:not(:last-child) {
8 | .@{rate-prefix-cls}-rtl & {
9 | margin-right: 0;
10 | margin-left: 8px;
11 | }
12 | }
13 |
14 | &-first {
15 | .@{rate-prefix-cls}-rtl & {
16 | right: 0;
17 | left: auto;
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/components/avatar/style/rtl.less:
--------------------------------------------------------------------------------
1 | .@{avatar-prefix-cls}-group {
2 | &-rtl {
3 | .@{avatar-prefix-cls}:not(:first-child) {
4 | margin-right: @avatar-group-overlapping;
5 | margin-left: 0;
6 | }
7 | }
8 |
9 | &-popover.@{ant-prefix}-popover-rtl {
10 | .@{ant-prefix}-avatar + .@{ant-prefix}-avatar {
11 | margin-right: @avatar-group-space;
12 | margin-left: 0;
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/components/menu/style/light.less:
--------------------------------------------------------------------------------
1 | .@{menu-prefix-cls} {
2 | // light theme
3 | &-light {
4 | .@{menu-prefix-cls}-item:hover,
5 | .@{menu-prefix-cls}-item-active,
6 | .@{menu-prefix-cls}:not(.@{menu-prefix-cls}-inline) .@{menu-prefix-cls}-submenu-open,
7 | .@{menu-prefix-cls}-submenu-active,
8 | .@{menu-prefix-cls}-submenu-title:hover {
9 | color: @menu-highlight-color;
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/components/back-top/style/responsive.less:
--------------------------------------------------------------------------------
1 | @media screen and (max-width: @screen-md) {
2 | .@{backtop-prefix-cls} {
3 | right: 60px;
4 |
5 | &-rtl {
6 | right: auto;
7 | left: 60px;
8 | }
9 | }
10 | }
11 |
12 | @media screen and (max-width: @screen-xs) {
13 | .@{backtop-prefix-cls} {
14 | right: 20px;
15 |
16 | &-rtl {
17 | right: auto;
18 | left: 20px;
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/components/input-number/demo/borderless.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 6
3 | title:
4 | zh-CN: 无边框
5 | en-US: Borderless
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 没有边框。
11 |
12 | ## en-US
13 |
14 | No border.
15 |
16 | ```tsx
17 | import { InputNumber } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/jest-puppeteer.config.js:
--------------------------------------------------------------------------------
1 | // jest-puppeteer.config.js
2 | module.exports = {
3 | launch: {
4 | args: [
5 | // Required for Docker version of Puppeteer
6 | '--no-sandbox',
7 | '--disable-setuid-sandbox',
8 | // This will write shared memory files into /tmp instead of /dev/shm,
9 | // because Docker’s default for /dev/shm is 64MB
10 | '--disable-dev-shm-usage',
11 | ],
12 | },
13 | };
14 |
--------------------------------------------------------------------------------
/components/_util/__tests__/transButton.test.tsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import TransButton from '../transButton';
3 | import { render } from '../../../tests/utils';
4 |
5 | describe('transButton component', () => {
6 | it('disabled should update style', () => {
7 | const { container } = render();
8 | expect(container.querySelector('div')?.style.pointerEvents).toBe('none');
9 | });
10 | });
11 |
--------------------------------------------------------------------------------
/components/avatar/style/group.less:
--------------------------------------------------------------------------------
1 | .@{avatar-prefix-cls}-group {
2 | display: inline-flex;
3 |
4 | .@{avatar-prefix-cls} {
5 | border: 1px solid @avatar-group-border-color;
6 |
7 | &:not(:first-child) {
8 | margin-left: @avatar-group-overlapping;
9 | }
10 | }
11 |
12 | &-popover {
13 | .@{ant-prefix}-avatar + .@{ant-prefix}-avatar {
14 | margin-left: @avatar-group-space;
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/components/layout/style/light.less:
--------------------------------------------------------------------------------
1 | .@{layout-prefix-cls}-sider-light {
2 | background: @layout-sider-background-light;
3 | .@{layout-prefix-cls}-sider-trigger {
4 | color: @layout-trigger-color-light;
5 | background: @layout-trigger-background-light;
6 | }
7 | .@{layout-prefix-cls}-sider-zero-width-trigger {
8 | color: @layout-trigger-color-light;
9 | background: @layout-trigger-background-light;
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/components/style/mixins/clearfix.less:
--------------------------------------------------------------------------------
1 | // mixins for clearfix
2 | // ------------------------
3 | .clearfix() {
4 | // https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229
5 | &::before {
6 | display: table;
7 | content: '';
8 | }
9 |
10 | &::after {
11 | // https://github.com/ant-design/ant-design/issues/21864
12 | display: table;
13 | clear: both;
14 | content: '';
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/components/statistic/style/rtl.less:
--------------------------------------------------------------------------------
1 | .@{statistic-prefix-cls} {
2 | &-rtl {
3 | direction: rtl;
4 | }
5 |
6 | &-content {
7 | &-prefix {
8 | .@{statistic-prefix-cls}-rtl & {
9 | margin-right: 0;
10 | margin-left: 4px;
11 | }
12 | }
13 |
14 | &-suffix {
15 | .@{statistic-prefix-cls}-rtl & {
16 | margin-right: 4px;
17 | margin-left: 0;
18 | }
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/components/typography/hooks/useUpdatedEffect.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | /** Similar with `useEffect` but only trigger after mounted */
4 | export default (callback: () => void, conditions: any[]) => {
5 | const mountRef = React.useRef(false);
6 |
7 | React.useEffect(() => {
8 | if (mountRef.current) {
9 | callback();
10 | } else {
11 | mountRef.current = true;
12 | }
13 | }, conditions);
14 | };
15 |
--------------------------------------------------------------------------------
/tests/__mocks__/rc-trigger.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import Trigger from 'rc-trigger/lib/mock';
3 | import { TriggerMockContext } from '../shared/demoTestContext';
4 |
5 | export default React.forwardRef((props, ref) => {
6 | const mergedPopupVisible = React.useContext(TriggerMockContext) ?? props.popupVisible;
7 | global.triggerProps = props;
8 | return ;
9 | });
10 |
--------------------------------------------------------------------------------
/components/skeleton/demo/complex.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title:
4 | zh-CN: 复杂的组合
5 | en-US: Complex combination
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 更复杂的组合。
11 |
12 | ## en-US
13 |
14 | Complex combination with avatar and multiple paragraphs.
15 |
16 | ```tsx
17 | import { Skeleton } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/components/upload/__tests__/requests.ts:
--------------------------------------------------------------------------------
1 | import type { UploadProps } from '../interface';
2 |
3 | export const successRequest: UploadProps['customRequest'] = ({ onSuccess, file }) => {
4 | setTimeout(() => {
5 | // @ts-ignore
6 | onSuccess?.(null, file);
7 | });
8 | };
9 |
10 | export const errorRequest: UploadProps['customRequest'] = ({ onError }) => {
11 | setTimeout(() => {
12 | // @ts-ignore
13 | onError?.();
14 | });
15 | };
16 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: true
2 | contact_links:
3 | - name: 🆕 Create new issue
4 | url: http://new-issue.ant.design
5 | about: The issue which is not created via http://new-issue.ant.design will be closed immediately.
6 | - name: 🆕 创建一个新 Issue
7 | url: http://new-issue.ant.design
8 | about: 不是用 http://new-issue.ant.design 创建的 issue 会被机器人自动关闭。另外『如何使用...』类问题建议使用讨论区 https://github.com/ant-design/ant-design/discussions
9 |
--------------------------------------------------------------------------------
/components/segmented/demo/block.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title:
4 | zh-CN: Block 分段选择器
5 | en-US: Block Segmented
6 | ---
7 |
8 | ## zh-CN
9 |
10 | `block` 属性使其适合父元素宽度。
11 |
12 | ## en-US
13 |
14 | `block` property will make the `Segmented` fit to its parent width.
15 |
16 | ```jsx
17 | import { Segmented } from 'antd';
18 |
19 | export default () => (
20 |
21 | );
22 | ```
23 |
--------------------------------------------------------------------------------
/components/switch/__tests__/__snapshots__/index.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Switch rtl render component should be rendered correctly in RTL direction 1`] = `
4 |
17 | `;
18 |
--------------------------------------------------------------------------------
/tests/__mocks__/rc-util/lib/Portal.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 |
3 | export default class Portal extends React.Component {
4 | componentDidMount() {
5 | this.createContainer();
6 | }
7 |
8 | createContainer() {
9 | this.container = true;
10 | this.forceUpdate();
11 | }
12 |
13 | render() {
14 | const { children } = this.props;
15 | if (this.container) {
16 | return children;
17 | }
18 | return null;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/components/table/hooks/useFilter/FilterWrapper.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export interface FilterDropdownMenuWrapperProps {
4 | children?: React.ReactNode;
5 | className?: string;
6 | }
7 |
8 | const FilterDropdownMenuWrapper = (props: FilterDropdownMenuWrapperProps) => (
9 | e.stopPropagation()}>
10 | {props.children}
11 |
12 | );
13 |
14 | export default FilterDropdownMenuWrapper;
15 |
--------------------------------------------------------------------------------
/components/time-picker/demo/range-picker.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 13
3 | title:
4 | zh-CN: 范围选择器
5 | en-US: Time Range Picker
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 通过 `TimePicker.RangePicker` 使用时间范围选择器。
11 |
12 | ## en-US
13 |
14 | Use time range picker with `TimePicker.RangePicker`.
15 |
16 | ```tsx
17 | import { TimePicker } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/components/tooltip/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基本
5 | en-US: Basic
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 最简单的用法。
11 |
12 | ## en-US
13 |
14 | The simplest usage.
15 |
16 | ```tsx
17 | import { Tooltip } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => (
21 |
22 | Tooltip will show on mouse enter.
23 |
24 | );
25 |
26 | export default App;
27 | ```
28 |
--------------------------------------------------------------------------------
/components/table/Column.tsx:
--------------------------------------------------------------------------------
1 | import type { ColumnType } from './interface';
2 |
3 | export interface ColumnProps extends ColumnType {
4 | children?: null;
5 | }
6 |
7 | /* istanbul ignore next */
8 | /** This is a syntactic sugar for `columns` prop. So HOC will not work on this. */
9 | // eslint-disable-next-line no-unused-vars
10 | function Column(_: ColumnProps) {
11 | return null;
12 | }
13 |
14 | export default Column;
15 |
--------------------------------------------------------------------------------
/scripts/compact-vars.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs');
2 | const path = require('path');
3 | const lessToJs = require('less-vars-to-js');
4 |
5 | const stylePath = path.join(__dirname, '..', 'components', 'style');
6 | const compactLess = fs.readFileSync(path.join(stylePath, 'themes', 'compact.less'), 'utf8');
7 |
8 | const compactPaletteLess = lessToJs(compactLess, {
9 | stripPrefix: true,
10 | resolveVariables: false,
11 | });
12 |
13 | module.exports = compactPaletteLess;
14 |
--------------------------------------------------------------------------------
/components/alert/demo/close-text.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 5
3 | title:
4 | zh-CN: 自定义关闭
5 | en-US: Customized Close Text
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 可以自定义关闭,自定义的文字会替换原先的关闭 `Icon`。
11 |
12 | ## en-US
13 |
14 | Replace the default icon with customized text.
15 |
16 | ```tsx
17 | import { Alert } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/components/time-picker/demo/disabled.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 3
3 | title:
4 | zh-CN: 禁用
5 | en-US: disabled
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 禁用时间选择。
11 |
12 | ## en-US
13 |
14 | A disabled state of the `TimePicker`.
15 |
16 | ```tsx
17 | import { TimePicker } from 'antd';
18 | import moment from 'moment';
19 | import React from 'react';
20 |
21 | const App: React.FC = () => ;
22 |
23 | export default App;
24 | ```
25 |
--------------------------------------------------------------------------------
/components/tree/style/index.less:
--------------------------------------------------------------------------------
1 | @import '../../style/themes/index';
2 | @import '../../style/mixins/index';
3 | @import '../../checkbox/style/mixin';
4 | @import './mixin';
5 | @import './directory';
6 |
7 | @tree-prefix-cls: ~'@{ant-prefix}-tree';
8 | @tree-node-prefix-cls: ~'@{tree-prefix-cls}-treenode';
9 |
10 | .antCheckboxFn(@checkbox-prefix-cls: ~'@{ant-prefix}-tree-checkbox');
11 |
12 | .@{tree-prefix-cls} {
13 | .antTreeFn(@tree-prefix-cls);
14 | }
15 |
16 | @import './rtl';
17 |
--------------------------------------------------------------------------------
/components/anchor/index.tsx:
--------------------------------------------------------------------------------
1 | import InternalAnchor from './Anchor';
2 | import AnchorLink from './AnchorLink';
3 |
4 | export { AnchorProps } from './Anchor';
5 | export { AnchorLinkProps } from './AnchorLink';
6 |
7 | type InternalAnchorType = typeof InternalAnchor;
8 |
9 | interface AnchorInterface extends InternalAnchorType {
10 | Link: typeof AnchorLink;
11 | }
12 |
13 | const Anchor = InternalAnchor as AnchorInterface;
14 |
15 | Anchor.Link = AnchorLink;
16 | export default Anchor;
17 |
--------------------------------------------------------------------------------
/components/badge/__tests__/__snapshots__/ribbon.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`Ribbon rtl render component should be rendered correctly in RTL direction 1`] = `
4 |
18 | `;
19 |
--------------------------------------------------------------------------------
/components/input/style/IE11.less:
--------------------------------------------------------------------------------
1 | // Fix Input component height issue in IE11
2 | @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
3 | .@{ant-prefix}-input {
4 | height: @input-height-base;
5 |
6 | &-lg {
7 | height: @input-height-lg;
8 | }
9 |
10 | &-sm {
11 | height: @input-height-sm;
12 | }
13 |
14 | &-affix-wrapper {
15 | > input.@{ant-prefix}-input {
16 | height: auto;
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/components/typography/Paragraph.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import type { BlockProps } from './Base';
3 | import Base from './Base';
4 |
5 | export interface ParagraphProps
6 | extends BlockProps<'div'>,
7 | Omit, 'type' | keyof BlockProps<'div'>> {}
8 |
9 | const Paragraph = React.forwardRef((props, ref) => (
10 |
11 | ));
12 |
13 | export default Paragraph;
14 |
--------------------------------------------------------------------------------
/components/empty/demo/simple.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title:
4 | zh-CN: 选择图片
5 | en-US: Chose image
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 可以通过设置 `image` 为 `Empty.PRESENTED_IMAGE_SIMPLE` 选择另一种风格的图片。
11 |
12 | ## en-US
13 |
14 | You can choose another style of `image` by setting image to `Empty.PRESENTED_IMAGE_SIMPLE`.
15 |
16 | ```tsx
17 | import { Empty } from 'antd';
18 |
19 | const App: React.FC = () => ;
20 |
21 | export default App;
22 | ```
23 |
--------------------------------------------------------------------------------
/components/switch/demo/loading.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 4
3 | title:
4 | zh-CN: 加载中
5 | en-US: Loading
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 标识开关操作仍在执行中。
11 |
12 | ## en-US
13 |
14 | Mark a pending state of switch.
15 |
16 | ```tsx
17 | import { Switch } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => (
21 | <>
22 |
23 |
24 |
25 | >
26 | );
27 |
28 | export default App;
29 | ```
30 |
--------------------------------------------------------------------------------
/components/_util/getRenderPropValue.ts:
--------------------------------------------------------------------------------
1 | import type * as React from 'react';
2 |
3 | export type RenderFunction = () => React.ReactNode;
4 |
5 | export const getRenderPropValue = (
6 | propValue?: React.ReactNode | RenderFunction,
7 | ): React.ReactNode => {
8 | if (!propValue) {
9 | return null;
10 | }
11 |
12 | const isRenderFunction = typeof propValue === 'function';
13 | if (isRenderFunction) {
14 | return (propValue as RenderFunction)();
15 | }
16 |
17 | return propValue;
18 | };
19 |
--------------------------------------------------------------------------------
/components/form/hooks/useDebounce.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export default function useDebounce(value: T[]): T[] {
4 | const [cacheValue, setCacheValue] = React.useState(value);
5 | React.useEffect(() => {
6 | const timeout = setTimeout(
7 | () => {
8 | setCacheValue(value);
9 | },
10 | value.length ? 0 : 10,
11 | );
12 |
13 | return () => {
14 | clearTimeout(timeout);
15 | };
16 | }, [value]);
17 |
18 | return cacheValue;
19 | }
20 |
--------------------------------------------------------------------------------
/components/result/__tests__/type.test.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import Result from '..';
3 |
4 | describe('Result.typescript', () => {
5 | it('status', () => {
6 | const result = (
7 | <>
8 |
9 |
10 | >
11 | );
12 |
13 | expect(result).toBeTruthy();
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/components/tree/index.tsx:
--------------------------------------------------------------------------------
1 | import Tree from './Tree';
2 |
3 | export { DataNode, EventDataNode } from 'rc-tree/lib/interface';
4 | export { DirectoryTreeProps, ExpandAction as DirectoryTreeExpandAction } from './DirectoryTree';
5 | export {
6 | AntdTreeNodeAttribute,
7 | AntTreeNode,
8 | AntTreeNodeCheckedEvent,
9 | AntTreeNodeExpandedEvent,
10 | AntTreeNodeMouseEvent,
11 | AntTreeNodeProps,
12 | AntTreeNodeSelectedEvent,
13 | TreeProps,
14 | } from './Tree';
15 |
16 | export default Tree;
17 |
--------------------------------------------------------------------------------
/components/checkbox/demo/disabled.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title:
4 | zh-CN: 不可用
5 | en-US: Disabled
6 | ---
7 |
8 | ## zh-CN
9 |
10 | checkbox 不可用。
11 |
12 | ## en-US
13 |
14 | Disabled checkbox.
15 |
16 | ```tsx
17 | import { Checkbox } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => (
21 | <>
22 |
23 |
24 |
25 | >
26 | );
27 |
28 | export default App;
29 | ```
30 |
--------------------------------------------------------------------------------
/components/image/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基本用法
5 | en-US: Basic Usage
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 单击图像可以放大显示。
11 |
12 | ## en-US
13 |
14 | Click the image to zoom in.
15 |
16 | ```tsx
17 | import { Image } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => (
21 |
25 | );
26 |
27 | export default App;
28 | ```
29 |
--------------------------------------------------------------------------------
/components/slider/demo/dragableTrack.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 9
3 | title:
4 | zh-CN: 范围可拖拽
5 | en-US: Draggable track
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 可以设置 `range.draggableTrack`,使得范围刻度整体可拖拽。
11 |
12 | ## en-US
13 |
14 | Make range track draggable when set `range.draggableTrack`.
15 |
16 | ```tsx
17 | import { Slider } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/components/table/style/index.tsx:
--------------------------------------------------------------------------------
1 | import '../../style/index.less';
2 | import './index.less';
3 |
4 | // style dependencies
5 | // deps-lint-skip: menu
6 | // deps-lint-skip: grid
7 | import '../../button/style';
8 | import '../../checkbox/style';
9 | import '../../dropdown/style';
10 | import '../../empty/style';
11 | import '../../input/style';
12 | import '../../pagination/style';
13 | import '../../radio/style';
14 | import '../../spin/style';
15 | import '../../tooltip/style';
16 | import '../../tree/style';
17 |
--------------------------------------------------------------------------------
/components/typography/hooks/useMergedConfig.ts:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | export default function useMergedConfig(
4 | propConfig: any,
5 | templateConfig?: Target,
6 | ): [boolean, Target] {
7 | return React.useMemo(() => {
8 | const support = !!propConfig;
9 |
10 | return [
11 | support,
12 | {
13 | ...templateConfig,
14 | ...(support && typeof propConfig === 'object' ? propConfig : null),
15 | },
16 | ];
17 | }, [propConfig]);
18 | }
19 |
--------------------------------------------------------------------------------
/site/theme/index-css-only.js:
--------------------------------------------------------------------------------
1 | /**
2 | * ZombieJ: This file is used for generate site theme css only. Which only provides dark.css and
3 | * compact.css for theme switcher.
4 | */
5 | const config = require('./index');
6 |
7 | const homeTmpl = './template/Home/index';
8 |
9 | const cloneConfig = {
10 | ...config,
11 | };
12 |
13 | cloneConfig.routes = {
14 | path: '/',
15 | component: './template/Layout/index',
16 | indexRoute: { component: homeTmpl },
17 | };
18 |
19 | module.exports = cloneConfig;
20 |
--------------------------------------------------------------------------------
/components/date-picker/locale/az_AZ.tsx:
--------------------------------------------------------------------------------
1 | import CalendarLocale from 'rc-picker/lib/locale/az_AZ';
2 | import TimePickerLocale from '../../time-picker/locale/az_AZ';
3 | import type { PickerLocale } from '../generatePicker';
4 |
5 | const locale: PickerLocale = {
6 | lang: {
7 | placeholder: 'Tarix seçin',
8 | rangePlaceholder: ['Başlama tarixi', 'Bitmə tarixi'],
9 | ...CalendarLocale,
10 | },
11 | timePickerLocale: {
12 | ...TimePickerLocale,
13 | },
14 | };
15 |
16 | export default locale;
17 |
--------------------------------------------------------------------------------
/components/time-picker/demo/interval-options.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 5
3 | title:
4 | zh-CN: 步长选项
5 | en-US: interval option
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 可以使用 `hourStep` `minuteStep` `secondStep` 按步长展示可选的时分秒。
11 |
12 | ## en-US
13 |
14 | Show stepped options by `hourStep` `minuteStep` `secondStep`.
15 |
16 | ```tsx
17 | import { TimePicker } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | **/*.png
2 | **/*.svg
3 | CODEOWNERS
4 | .dockerignore
5 | Dockerfile.ui-test
6 | package.json
7 | .umi
8 | .umi-production
9 | AUTHORS.txt
10 | lib/
11 | es/
12 | dist/
13 | _site/
14 | coverage/
15 | CNAME
16 | LICENSE
17 | yarn.lock
18 | netlify.toml
19 | yarn-error.log
20 | *.sh
21 | *.snap
22 | components/*/*.js
23 | components/*/*.jsx
24 | .gitignore
25 | .npmignore
26 | .prettierignore
27 | .DS_Store
28 | .editorconfig
29 | .eslintignore
30 | .history
31 | **/*.yml
32 | components/style/color/*.less
33 |
--------------------------------------------------------------------------------
/scripts/check-demo.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const yfm = require('yaml-front-matter');
3 | const glob = require('glob');
4 | const fs = require('fs');
5 |
6 | const demoFiles = glob.sync(path.join(process.cwd(), 'components/**/demo/*.md'));
7 | // eslint-disable-next-line no-restricted-syntax
8 | for (const url of demoFiles) {
9 | const demoContent = fs.readFileSync(url);
10 | const meta = yfm.loadFront(demoContent);
11 | if (meta.only) {
12 | throw Error(`there is a 'only': ${url}`);
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/site/theme/template/Color/ColorPatterns.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { generate } from '@ant-design/colors';
3 | import uniq from 'lodash/uniq';
4 | import ColorBlock from './ColorBlock';
5 |
6 | export default function ColorPatterns({ color, dark, backgroundColor }) {
7 | const colors = generate(color, dark ? { theme: 'dark', backgroundColor } : {});
8 | return uniq(colors).map((colorString, i) => (
9 |
10 | ));
11 | }
12 |
--------------------------------------------------------------------------------
/components/affix/demo/on-change.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 1
3 | title:
4 | zh-CN: 固定状态改变的回调
5 | en-US: Callback
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 可以获得是否固定的状态。
11 |
12 | ## en-US
13 |
14 | Callback with affixed state.
15 |
16 | ```tsx
17 | import { Affix, Button } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => (
21 | console.log(affixed)}>
22 |
23 |
24 | );
25 |
26 | export default App;
27 | ```
28 |
--------------------------------------------------------------------------------
/components/alert/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基本
5 | en-US: Basic
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 最简单的用法,适用于简短的警告提示。
11 |
12 | ## en-US
13 |
14 | The simplest usage for short messages.
15 |
16 | ```tsx
17 | import { Alert } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => ;
21 |
22 | export default App;
23 | ```
24 |
25 |
30 |
--------------------------------------------------------------------------------
/components/input-number/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基本
5 | en-US: Basic
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 数字输入框。
11 |
12 | ## en-US
13 |
14 | Numeric-only input box.
15 |
16 | ```tsx
17 | import { InputNumber } from 'antd';
18 | import React from 'react';
19 |
20 | const onChange = (value: number) => {
21 | console.log('changed', value);
22 | };
23 |
24 | const App: React.FC = () => ;
25 |
26 | export default App;
27 | ```
28 |
--------------------------------------------------------------------------------
/components/segmented/demo/basic.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 0
3 | title:
4 | zh-CN: 基本
5 | en-US: Basic
6 | ---
7 |
8 | ## zh-CN
9 |
10 | 最简单的用法。
11 |
12 | ## en-US
13 |
14 | The most basic usage.
15 |
16 | ```jsx
17 | import { Segmented } from 'antd';
18 |
19 | export default () => ;
20 | ```
21 |
22 | ```css
23 | .code-box-demo {
24 | overflow-x: auto;
25 | }
26 |
27 | .code-box-demo .ant-segmented {
28 | margin-bottom: 10px;
29 | }
30 | ```
31 |
--------------------------------------------------------------------------------
/components/switch/demo/size.md:
--------------------------------------------------------------------------------
1 | ---
2 | order: 3
3 | title:
4 | zh-CN: 两种大小
5 | en-US: Two sizes
6 | ---
7 |
8 | ## zh-CN
9 |
10 | `size="small"` 表示小号开关。
11 |
12 | ## en-US
13 |
14 | `size="small"` represents a small sized switch.
15 |
16 | ```tsx
17 | import { Switch } from 'antd';
18 | import React from 'react';
19 |
20 | const App: React.FC = () => (
21 | <>
22 |
23 |
24 |
25 | >
26 | );
27 |
28 | export default App;
29 | ```
30 |
--------------------------------------------------------------------------------