Merge branch 'feature' into master-to-merge-feature

This commit is contained in:
偏右 2020-03-13 11:52:28 +08:00 committed by GitHub
commit 71c8fac72f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
216 changed files with 5605 additions and 7227 deletions

View File

@ -0,0 +1,18 @@
import React from 'react';
export type RenderFunction = () => React.ReactNode;
export const getRenderPropValue = (
propValue?: React.ReactNode | RenderFunction,
): React.ReactNode => {
if (!propValue) {
return null;
}
const isRenderFunction = typeof propValue === 'function';
if (isRenderFunction) {
return (propValue as RenderFunction)();
}
return propValue;
};

View File

@ -10,6 +10,7 @@ export interface BreadcrumbItemProps {
separator?: React.ReactNode;
href?: string;
overlay?: DropDownProps['overlay'];
dropdownProps?: DropDownProps;
onClick?: React.MouseEventHandler<HTMLAnchorElement | HTMLSpanElement>;
}
@ -58,10 +59,10 @@ export default class BreadcrumbItem extends React.Component<BreadcrumbItemProps,
* Wrap a DropDown
*/
renderBreadcrumbNode = (breadcrumbItem: React.ReactNode, prefixCls: string) => {
const { overlay } = this.props;
const { overlay, dropdownProps } = this.props;
if (overlay) {
return (
<DropDown overlay={overlay} placement="bottomCenter">
<DropDown overlay={overlay} placement="bottomCenter" {...dropdownProps}>
<span className={`${prefixCls}-overlay-link`}>
{breadcrumbItem}
<DownOutlined />

View File

@ -30,6 +30,7 @@ A breadcrumb displays the current location within a hierarchy. It allows going b
| href | Target of hyperlink | string | - | |
| overlay | The dropdown menu | [Menu](/components/menu) \| () => Menu | - | |
| onClick | Set the handler to handle `click` event | (e:MouseEvent)=>void | - | |
| dropdownProps | The dropdown props | [Dropdown](/components/dropdown) | - | |
### Breadcrumb.Separator

View File

@ -26,11 +26,12 @@ title: Breadcrumb
### Breadcrumb.Item
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| ------- | -------------- | -------------------------------------- | ------ | ---- |
| href | 链接的目的地 | string | - | |
| overlay | 下拉菜单的内容 | [Menu](/components/menu) \| () => Menu | - | |
| onClick | 单击事件 | (e:MouseEvent)=>void | - | |
| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| href | 链接的目的地 | string | - | |
| overlay | 下拉菜单的内容 | [Menu](/components/menu) \| () => Menu | - | |
| onClick | 单击事件 | (e:MouseEvent)=>void | - | |
| dropdownProps | 弹出下拉菜单的自定义配置 | [Dropdown](/components/dropdown) | - | |
### Breadcrumb.Separator

View File

@ -204,9 +204,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-10-30"
@ -327,9 +325,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-06"
@ -450,9 +446,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-13"
@ -573,9 +567,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-20"
@ -696,9 +688,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-27"
@ -819,9 +809,7 @@ exports[`renders ./components/calendar/demo/basic.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-12-04"
@ -1157,9 +1145,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-10-30"
@ -1280,9 +1266,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-06"
@ -1403,9 +1387,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-13"
@ -1526,9 +1508,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-20"
@ -1649,9 +1629,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-27"
@ -1772,9 +1750,7 @@ exports[`renders ./components/calendar/demo/card.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-12-04"
@ -2136,9 +2112,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-10-30"
@ -2259,9 +2233,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-06"
@ -2382,9 +2354,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-13"
@ -2505,9 +2475,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-20"
@ -2628,9 +2596,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-27"
@ -2751,9 +2717,7 @@ exports[`renders ./components/calendar/demo/customize-header.md correctly 1`] =
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-12-04"
@ -3087,9 +3051,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-10-30"
@ -3238,9 +3200,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-06"
@ -3461,9 +3421,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-13"
@ -3697,9 +3655,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-20"
@ -3848,9 +3804,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-27"
@ -3999,9 +3953,7 @@ exports[`renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-12-04"
@ -4448,9 +4400,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2017-01-01"
@ -4571,9 +4521,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2017-01-08"
@ -4694,9 +4642,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2017-01-15"
@ -4817,9 +4763,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2017-01-22"
@ -4940,9 +4884,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2017-01-29"
@ -5063,9 +5005,7 @@ exports[`renders ./components/calendar/demo/select.md correctly 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2017-02-05"

View File

@ -206,9 +206,7 @@ exports[`Calendar Calendar should support locale 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2018-10-01"
@ -329,9 +327,7 @@ exports[`Calendar Calendar should support locale 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2018-10-08"
@ -452,9 +448,7 @@ exports[`Calendar Calendar should support locale 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2018-10-15"
@ -575,9 +569,7 @@ exports[`Calendar Calendar should support locale 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2018-10-22"
@ -698,9 +690,7 @@ exports[`Calendar Calendar should support locale 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2018-10-29"
@ -821,9 +811,7 @@ exports[`Calendar Calendar should support locale 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2018-11-05"
@ -1156,9 +1144,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2000-08-27"
@ -1279,9 +1265,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-09-03"
@ -1402,9 +1386,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-09-10"
@ -1525,9 +1507,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-09-17"
@ -1648,9 +1628,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-09-24"
@ -1771,9 +1749,7 @@ exports[`Calendar rtl render component should be rendered correctly in RTL direc
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2000-10-01"

View File

@ -126,4 +126,18 @@ describe('Carousel', () => {
).toBeTruthy();
});
});
describe('dots precise control by plain object', () => {
it('use dots to provide dotsClasse', () => {
const wrapper = mount(
<Carousel dots={{ className: 'customDots' }}>
<div>1</div>
<div>2</div>
<div>3</div>
</Carousel>,
);
wrapper.update();
expect(wrapper.find('.slick-dots').hasClass('customDots')).toBeTruthy();
});
});
});

View File

@ -20,7 +20,7 @@ A carousel component. Scales with its container.
| autoplay | Whether to scroll automatically | boolean | `false` | |
| beforeChange | Callback function called before the current index changes | function(from, to) | - | |
| dotPosition | The position of the dots, which can be one of `top` `bottom` `left` `right` | string | bottom | |
| dots | Whether to show the dots at the bottom of the gallery | boolean | `true` | |
| dots | Whether to show the dots at the bottom of the gallery, `object` for `dotsClass` and any others | boolean \| { className?:string } | `true` | |
| easing | Transition interpolation function name | string | `linear` | |
| effect | Transition effect | `scrollx` \| `fade` | `scrollx` | |

View File

@ -1,4 +1,5 @@
import * as React from 'react';
import isPlainObject from 'lodash/isPlainObject';
import debounce from 'lodash/debounce';
import { Settings } from '@ant-design/react-slick';
import classNames from 'classnames';
@ -14,13 +15,18 @@ export type CarouselEffect = 'scrollx' | 'fade';
export type DotPosition = 'top' | 'bottom' | 'left' | 'right';
// Carousel
export interface CarouselProps extends Settings {
export interface CarouselProps extends Omit<Settings, 'dots' | 'dotsClass'> {
effect?: CarouselEffect;
style?: React.CSSProperties;
prefixCls?: string;
slickGoTo?: number;
dotPosition?: DotPosition;
children?: React.ReactNode;
dots?:
| boolean
| {
className?: string;
};
}
export default class Carousel extends React.Component<CarouselProps, {}> {
@ -106,7 +112,13 @@ export default class Carousel extends React.Component<CarouselProps, {}> {
const dotsClass = 'slick-dots';
const dotPosition = this.getDotPosition();
props.vertical = dotPosition === 'left' || dotPosition === 'right';
props.dotsClass = `${dotsClass} ${dotsClass}-${dotPosition || 'bottom'}`;
const enableDots = props.dots === true || isPlainObject(props.dots);
const dsClass = classNames(
dotsClass,
`${dotsClass}-${dotPosition || 'bottom'}`,
typeof props.dots === 'boolean' ? false : props.dots?.className,
);
const className = classNames(prefixCls, {
[`${prefixCls}-rtl`]: direction === 'rtl',
@ -115,7 +127,7 @@ export default class Carousel extends React.Component<CarouselProps, {}> {
return (
<div className={className}>
<SlickCarousel ref={this.saveSlick} {...props} />
<SlickCarousel ref={this.saveSlick} {...props} dots={enableDots} dotsClass={dsClass} />
</div>
);
};

View File

@ -21,7 +21,7 @@ subtitle: 走马灯
| autoplay | 是否自动切换 | boolean | false | | |
| beforeChange | 切换面板的回调 | function(from, to) | 无 | | |
| dotPosition | 面板指示点位置,可选 `top` `bottom` `left` `right` | string | bottom | |
| dots | 是否显示面板指示点 | boolean | true | | |
| dots | 是否显示面板指示点,如果为 `object` 则同时可以指定 `dotsClass` 或者 | boolean \| { className?:string } | true | | |
| easing | 动画效果 | string | linear | | |
| effect | 动画效果函数,可取 scrollx, fade | string | scrollx | | |

View File

@ -1255,9 +1255,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="config-picker-cell"
title="2000-08-27"
@ -1378,9 +1376,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="config-picker-cell config-picker-cell-in-view config-picker-cell-selected"
title="2000-09-03"
@ -1501,9 +1497,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="config-picker-cell config-picker-cell-in-view"
title="2000-09-10"
@ -1624,9 +1618,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="config-picker-cell config-picker-cell-in-view"
title="2000-09-17"
@ -1747,9 +1739,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="config-picker-cell config-picker-cell-in-view"
title="2000-09-24"
@ -1870,9 +1860,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="config-picker-cell"
title="2000-10-01"
@ -2262,7 +2250,7 @@ exports[`ConfigProvider components Calendar configProvider 1`] = `
</div>
</td>
<td
class="config-picker-cell config-picker-cell-selected config-picker-cell-in-view"
class="config-picker-cell config-picker-cell-in-view config-picker-cell-selected"
title="2000-09"
>
<div
@ -2546,9 +2534,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2000-08-27"
@ -2669,9 +2655,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view ant-picker-cell-selected"
title="2000-09-03"
@ -2792,9 +2776,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-09-10"
@ -2915,9 +2897,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-09-17"
@ -3038,9 +3018,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-09-24"
@ -3161,9 +3139,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2000-10-01"
@ -3553,7 +3529,7 @@ exports[`ConfigProvider components Calendar normal 1`] = `
</div>
</td>
<td
class="ant-picker-cell ant-picker-cell-selected ant-picker-cell-in-view"
class="ant-picker-cell ant-picker-cell-in-view ant-picker-cell-selected"
title="2000-09"
>
<div
@ -3837,9 +3813,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="prefix-Calendar-cell"
title="2000-08-27"
@ -3960,9 +3934,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="prefix-Calendar-cell prefix-Calendar-cell-in-view prefix-Calendar-cell-selected"
title="2000-09-03"
@ -4083,9 +4055,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="prefix-Calendar-cell prefix-Calendar-cell-in-view"
title="2000-09-10"
@ -4206,9 +4176,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="prefix-Calendar-cell prefix-Calendar-cell-in-view"
title="2000-09-17"
@ -4329,9 +4297,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="prefix-Calendar-cell prefix-Calendar-cell-in-view"
title="2000-09-24"
@ -4452,9 +4418,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="prefix-Calendar-cell"
title="2000-10-01"
@ -4844,7 +4808,7 @@ exports[`ConfigProvider components Calendar prefixCls 1`] = `
</div>
</td>
<td
class="prefix-Calendar-cell prefix-Calendar-cell-selected prefix-Calendar-cell-in-view"
class="prefix-Calendar-cell prefix-Calendar-cell-in-view prefix-Calendar-cell-selected"
title="2000-09"
>
<div
@ -9271,57 +9235,55 @@ exports[`ConfigProvider components Popconfirm configProvider 1`] = `
class="config-popover-inner"
role="tooltip"
>
<div>
<div
class="config-popover-inner-content"
>
<div
class="config-popover-inner-content"
class="config-popover-message"
>
<div
class="config-popover-message"
<span
aria-label="exclamation-circle"
class="anticon anticon-exclamation-circle"
role="img"
>
<span
aria-label="exclamation-circle"
class="anticon anticon-exclamation-circle"
role="img"
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
/>
</svg>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
/>
</svg>
</span>
<div
class="config-popover-message-title"
/>
</div>
<div
class="config-popover-buttons"
>
<button
class="config-btn config-btn-sm"
type="button"
>
<span>
Cancel
</span>
<div
class="config-popover-message-title"
/>
</div>
<div
class="config-popover-buttons"
</button>
<button
class="config-btn config-btn-primary config-btn-sm"
type="button"
>
<button
class="config-btn config-btn-sm"
type="button"
>
<span>
Cancel
</span>
</button>
<button
class="config-btn config-btn-primary config-btn-sm"
type="button"
>
<span>
OK
</span>
</button>
</div>
<span>
OK
</span>
</button>
</div>
</div>
</div>
@ -9353,57 +9315,55 @@ exports[`ConfigProvider components Popconfirm normal 1`] = `
class="ant-popover-inner"
role="tooltip"
>
<div>
<div
class="ant-popover-inner-content"
>
<div
class="ant-popover-inner-content"
class="ant-popover-message"
>
<div
class="ant-popover-message"
<span
aria-label="exclamation-circle"
class="anticon anticon-exclamation-circle"
role="img"
>
<span
aria-label="exclamation-circle"
class="anticon anticon-exclamation-circle"
role="img"
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
/>
</svg>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
/>
</svg>
</span>
<div
class="ant-popover-message-title"
/>
</div>
<div
class="ant-popover-buttons"
>
<button
class="ant-btn ant-btn-sm"
type="button"
>
<span>
Cancel
</span>
<div
class="ant-popover-message-title"
/>
</div>
<div
class="ant-popover-buttons"
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm"
type="button"
>
<button
class="ant-btn ant-btn-sm"
type="button"
>
<span>
Cancel
</span>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm"
type="button"
>
<span>
OK
</span>
</button>
</div>
<span>
OK
</span>
</button>
</div>
</div>
</div>
@ -9435,57 +9395,55 @@ exports[`ConfigProvider components Popconfirm prefixCls 1`] = `
class="prefix-Popconfirm-inner"
role="tooltip"
>
<div>
<div
class="prefix-Popconfirm-inner-content"
>
<div
class="prefix-Popconfirm-inner-content"
class="prefix-Popconfirm-message"
>
<div
class="prefix-Popconfirm-message"
<span
aria-label="exclamation-circle"
class="anticon anticon-exclamation-circle"
role="img"
>
<span
aria-label="exclamation-circle"
class="anticon anticon-exclamation-circle"
role="img"
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<svg
aria-hidden="true"
class=""
data-icon="exclamation-circle"
fill="currentColor"
focusable="false"
height="1em"
viewBox="64 64 896 896"
width="1em"
>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
/>
</svg>
<path
d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z"
/>
</svg>
</span>
<div
class="prefix-Popconfirm-message-title"
/>
</div>
<div
class="prefix-Popconfirm-buttons"
>
<button
class="ant-btn ant-btn-sm"
type="button"
>
<span>
Cancel
</span>
<div
class="prefix-Popconfirm-message-title"
/>
</div>
<div
class="prefix-Popconfirm-buttons"
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm"
type="button"
>
<button
class="ant-btn ant-btn-sm"
type="button"
>
<span>
Cancel
</span>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm"
type="button"
>
<span>
OK
</span>
</button>
</div>
<span>
OK
</span>
</button>
</div>
</div>
</div>
@ -9517,11 +9475,9 @@ exports[`ConfigProvider components Popover configProvider 1`] = `
class="config-popover-inner"
role="tooltip"
>
<div>
<div
class="config-popover-inner-content"
/>
</div>
<div
class="config-popover-inner-content"
/>
</div>
</div>
</div>
@ -9551,11 +9507,9 @@ exports[`ConfigProvider components Popover normal 1`] = `
class="ant-popover-inner"
role="tooltip"
>
<div>
<div
class="ant-popover-inner-content"
/>
</div>
<div
class="ant-popover-inner-content"
/>
</div>
</div>
</div>
@ -9585,11 +9539,9 @@ exports[`ConfigProvider components Popover prefixCls 1`] = `
class="prefix-Popover-inner"
role="tooltip"
>
<div>
<div
class="prefix-Popover-inner-content"
/>
</div>
<div
class="prefix-Popover-inner-content"
/>
</div>
</div>
</div>
@ -11811,16 +11763,23 @@ exports[`ConfigProvider components Table configProvider 1`] = `
<div
class="config-table-filter-dropdown-btns"
>
<a
class="config-table-filter-dropdown-link confirm"
<button
class="config-btn config-btn-link config-btn-sm"
disabled=""
type="button"
>
OK
</a>
<a
class="config-table-filter-dropdown-link clear"
<span>
Reset
</span>
</button>
<button
class="config-btn config-btn-primary config-btn-sm"
type="button"
>
Reset
</a>
<span>
OK
</span>
</button>
</div>
</div>
</div>
@ -12150,16 +12109,23 @@ exports[`ConfigProvider components Table normal 1`] = `
<div
class="ant-table-filter-dropdown-btns"
>
<a
class="ant-table-filter-dropdown-link confirm"
<button
class="ant-btn ant-btn-link ant-btn-sm"
disabled=""
type="button"
>
OK
</a>
<a
class="ant-table-filter-dropdown-link clear"
<span>
Reset
</span>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm"
type="button"
>
Reset
</a>
<span>
OK
</span>
</button>
</div>
</div>
</div>
@ -12489,16 +12455,23 @@ exports[`ConfigProvider components Table prefixCls 1`] = `
<div
class="prefix-Table-filter-dropdown-btns"
>
<a
class="prefix-Table-filter-dropdown-link confirm"
<button
class="ant-btn ant-btn-link ant-btn-sm"
disabled=""
type="button"
>
OK
</a>
<a
class="prefix-Table-filter-dropdown-link clear"
<span>
Reset
</span>
</button>
<button
class="ant-btn ant-btn-primary ant-btn-sm"
type="button"
>
Reset
</a>
<span>
OK
</span>
</button>
</div>
</div>
</div>

View File

@ -146,9 +146,7 @@ Array [
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-disabled"
title="2016-10-30"
@ -220,9 +218,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-disabled ant-picker-cell-in-view"
title="2016-11-06"
@ -294,9 +290,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-disabled ant-picker-cell-in-view"
title="2016-11-13"
@ -368,9 +362,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-disabled ant-picker-cell-in-view"
title="2016-11-20"
@ -442,9 +434,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2016-11-27"
@ -516,9 +506,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="2016-12-04"
@ -780,9 +768,7 @@ Array [
</tr>
</thead>
<tbody>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell"
title="1999-12-27"
@ -854,9 +840,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-01-03"
@ -928,9 +912,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-01-10"
@ -1002,9 +984,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-01-17"
@ -1076,9 +1056,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-01-24"
@ -1150,9 +1128,7 @@ Array [
</div>
</td>
</tr>
<tr
class=""
>
<tr>
<td
class="ant-picker-cell ant-picker-cell-in-view"
title="2000-01-31"

View File

@ -53,7 +53,7 @@ exports[`MonthPicker and WeekPicker render MonthPicker 1`] = `
<tbody>
<tr>
<td
class="ant-picker-cell ant-picker-cell-selected ant-picker-cell-in-view"
class="ant-picker-cell ant-picker-cell-in-view ant-picker-cell-selected"
title="2000-01"
>
<div

View File

@ -13,7 +13,7 @@ import {
RangePickerDateProps as RCRangePickerDateProps,
RangePickerTimeProps as RCRangePickerTimeProps,
} from 'rc-picker/lib/RangePicker';
import { PickerMode } from 'rc-picker/lib/interface';
import { PickerMode, Locale as RcPickerLocale } from 'rc-picker/lib/interface';
import CalendarOutlined from '@ant-design/icons/CalendarOutlined';
import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined';
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
@ -24,6 +24,7 @@ import { getPlaceholder, getRangePlaceholder } from './util';
import PickerButton from './PickerButton';
import PickerTag from './PickerTag';
import SizeContext, { SizeType } from '../config-provider/SizeContext';
import { TimePickerLocale } from '../time-picker';
const Components = { button: PickerButton, rangeItem: PickerTag };
@ -78,11 +79,34 @@ type InjectDefaultProps<Props> = Omit<
| 'hideHeader'
| 'components'
> & {
locale?: typeof enUS;
locale?: PickerLocale;
size?: SizeType;
bordered?: boolean;
};
export type PickerLocale = {
lang: RcPickerLocale & AdditionalPickerLocaleLangProps;
timePickerLocale: TimePickerLocale;
} & AdditionalPickerLocaleProps;
export type AdditionalPickerLocaleProps = {
dateFormat?: string;
dateTimeFormat?: string;
weekFormat?: string;
monthFormat?: string;
};
export type AdditionalPickerLocaleLangProps = {
placeholder: string;
yearPlaceholder?: string;
monthPlaceholder?: string;
weekPlaceholder?: string;
rangeYearPlaceholder?: [string, string];
rangeMonthPlaceholder?: [string, string];
rangeWeekPlaceholder?: [string, string];
rangePlaceholder?: [string, string];
};
// Picker Props
export type PickerBaseProps<DateType> = InjectDefaultProps<RCPickerBaseProps<DateType>>;
export type PickerDateProps<DateType> = InjectDefaultProps<RCPickerDateProps<DateType>>;
@ -140,12 +164,12 @@ function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
};
result.lang = {
...result.lang,
...((locale || {}) as any).lang,
...((locale || {}) as PickerLocale).lang,
};
return result;
};
renderPicker = (locale: any) => {
renderPicker = (locale: PickerLocale) => {
const { getPrefixCls, direction } = this.context;
const {
prefixCls: customizePrefixCls,
@ -263,12 +287,12 @@ function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
};
result.lang = {
...result.lang,
...((locale || {}) as any).lang,
...((locale || {}) as PickerLocale).lang,
};
return result;
};
renderPicker = (locale: any) => {
renderPicker = (locale: PickerLocale) => {
const { getPrefixCls, direction } = this.context;
const {
prefixCls: customizePrefixCls,

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/ar_EG';
import TimePickerLocale from '../../time-picker/locale/ar_EG';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'اختيار التاريخ',
rangePlaceholder: ['البداية', 'النهاية'],

View File

@ -1,7 +1,8 @@
import CalendarLocale from 'rc-picker/lib/locale/az_AZ';
import TimePickerLocale from '../../time-picker/locale/az_AZ';
import { PickerLocale } from '../generatePicker';
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Tarix seçin',
rangePlaceholder: ['Başlama tarixi', 'Bitmə tarixi'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/bg_BG';
import TimePickerLocale from '../../time-picker/locale/bg_BG';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Избор на дата',
rangePlaceholder: ['Начална', 'Крайна'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/ca_ES';
import TimePickerLocale from '../../time-picker/locale/ca_ES';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Seleccionar data',
rangePlaceholder: ['Data inicial', 'Data final'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/cs_CZ';
import TimePickerLocale from '../../time-picker/locale/cs_CZ';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Vybrat datum',
rangePlaceholder: ['Od', 'Do'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/da_DK';
import TimePickerLocale from '../../time-picker/locale/da_DK';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Vælg dato',
rangePlaceholder: ['Startdato', 'Slutdato'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/de_DE';
import TimePickerLocale from '../../time-picker/locale/de_DE';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Datum auswählen',
rangePlaceholder: ['Startdatum', 'Enddatum'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/el_GR';
import TimePickerLocale from '../../time-picker/locale/el_GR';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Επιλέξτε ημερομηνία',
rangePlaceholder: ['Αρχική ημερομηνία', 'Τελική ημερομηνία'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/en_GB';
import TimePickerLocale from '../../time-picker/locale/en_GB';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Select date',
rangePlaceholder: ['Start date', 'End date'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/en_US';
import TimePickerLocale from '../../time-picker/locale/en_US';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Select date',
yearPlaceholder: 'Select year',

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/es_ES';
import TimePickerLocale from '../../time-picker/locale/es_ES';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Seleccionar fecha',
rangePlaceholder: ['Fecha inicial', 'Fecha final'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/et_EE';
import TimePickerLocale from '../../time-picker/locale/et_EE';
import { PickerLocale } from '../generatePicker';
// 统一合并为完整的 Locale
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Vali kuupäev',
rangePlaceholder: ['Algus kuupäev', 'Lõpu kuupäev'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/fa_IR';
import TimePickerLocale from '../../time-picker/locale/fa_IR';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'انتخاب تاریخ',
rangePlaceholder: ['تاریخ شروع', 'تاریخ پایان'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/fi_FI';
import TimePickerLocale from '../../time-picker/locale/fi_FI';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Valitse päivä',
rangePlaceholder: ['Alku päivä', 'Loppu päivä'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/fr_BE';
import TimePickerLocale from '../../time-picker/locale/fr_BE';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Sélectionner une date',
rangePlaceholder: ['Date de début', 'Date de fin'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/fr_FR';
import TimePickerLocale from '../../time-picker/locale/fr_FR';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Sélectionner une date',
yearPlaceholder: 'Sélectionner une année',

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/he_IL';
import TimePickerLocale from '../../time-picker/locale/he_IL';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'בחר תאריך',
rangePlaceholder: ['תאריך התחלה', 'תאריך סיום'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/hi_IN';
import TimePickerLocale from '../../time-picker/locale/hi_IN';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'तारीख़ चुनें',
rangePlaceholder: ['प्रारंभ तिथि', 'समाप्ति तिथि'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/hr_HR';
import TimePickerLocale from '../../time-picker/locale/hr_HR';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Odaberite datum',
rangePlaceholder: ['Početni datum', 'Završni datum'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/hu_HU';
import TimePickerLocale from '../../time-picker/locale/hu_HU';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Válasszon dátumot',
rangePlaceholder: ['Kezdő dátum', 'Befejezés dátuma'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/id_ID';
import TimePickerLocale from '../../time-picker/locale/id_ID';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Pilih tanggal',
rangePlaceholder: ['Mulai tanggal', 'Tanggal akhir'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/is_IS';
import TimePickerLocale from '../../time-picker/locale/is_IS';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Veldu dag',
rangePlaceholder: ['Upphafsdagur', 'Lokadagur'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/it_IT';
import TimePickerLocale from '../../time-picker/locale/it_IT';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Selezionare la data',
rangePlaceholder: ["Data d'inizio", 'Data di fine'],

View File

@ -1,7 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/ja_JP';
import TimePickerLocale from '../../time-picker/locale/ja_JP';
import { PickerLocale } from '../generatePicker';
const locale = {
// Merge into a locale object
const locale: PickerLocale = {
lang: {
placeholder: '日付を選択',
rangePlaceholder: ['開始日付', '終了日付'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/kn_IN';
import TimePickerLocale from '../../time-picker/locale/kn_IN';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'ದಿನಾಂಕ ಆಯ್ಕೆಮಾಡಿ',
rangePlaceholder: ['ಪ್ರಾರಂಭ ದಿನಾಂಕ', 'ಅಂತಿಮ ದಿನಾಂಕ'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/ko_KR';
import TimePickerLocale from '../../time-picker/locale/ko_KR';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: '날짜 선택',
rangePlaceholder: ['시작일', '종료일'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/ku_IQ';
import TimePickerLocale from '../../time-picker/locale/ku_IQ';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Dîrok hilbijêre',
rangePlaceholder: ['Dîroka destpêkê', 'Dîroka dawîn'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/lv_LV';
import TimePickerLocale from '../../time-picker/locale/lv_LV';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Izvēlieties datumu',
rangePlaceholder: ['Sākuma datums', 'Beigu datums'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/mk_MK';
import TimePickerLocale from '../../time-picker/locale/mk_MK';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Избери датум',
rangePlaceholder: ['Од датум', 'До датум'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/mn_MN';
import TimePickerLocale from '../../time-picker/locale/mn_MN';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Огноо сонгох',
rangePlaceholder: ['Эхлэх огноо', 'Дуусах огноо'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/ms_MY';
import TimePickerLocale from '../../time-picker/locale/ms_MY';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Pilih tarikh',
rangePlaceholder: ['Tarikh mula', 'Tarikh akhir'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/nb_NO';
import TimePickerLocale from '../../time-picker/locale/nb_NO';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Velg dato',
rangePlaceholder: ['Startdato', 'Sluttdato'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/nl_BE';
import TimePickerLocale from '../../time-picker/locale/nl_BE';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Selecteer datum',
rangePlaceholder: ['Begin datum', 'Eind datum'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/nl_NL';
import TimePickerLocale from '../../time-picker/locale/nl_NL';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Selecteer datum',
rangePlaceholder: ['Begin datum', 'Eind datum'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/pl_PL';
import TimePickerLocale from '../../time-picker/locale/pl_PL';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Wybierz datę',
rangePlaceholder: ['Data początkowa', 'Data końcowa'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/pt_BR';
import TimePickerLocale from '../../time-picker/locale/pt_BR';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Selecionar data',
rangePlaceholder: ['Data inicial', 'Data final'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/pt_PT';
import TimePickerLocale from '../../time-picker/locale/pt_PT';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
...CalendarLocale,
placeholder: 'Data',

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/ro_RO';
import TimePickerLocale from '../../time-picker/locale/ro_RO';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Selectează data',
rangePlaceholder: ['Data start', 'Data sfârșit'],

View File

@ -4,8 +4,10 @@
import CalendarLocale from 'rc-picker/lib/locale/ru_RU';
import TimePickerLocale from '../../time-picker/locale/ru_RU';
import { PickerLocale } from '../generatePicker';
const locale = {
// Merge into a locale object
const locale: PickerLocale = {
lang: {
placeholder: 'Выберите дату',
rangePlaceholder: ['Начальная дата', 'Конечная дата'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/sk_SK';
import TimePickerLocale from '../../time-picker/locale/sk_SK';
import { PickerLocale } from '../generatePicker';
// 统一合并为完整的 Locale
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Vybrať dátum',
rangePlaceholder: ['Od', 'Do'],

View File

@ -1,7 +1,8 @@
import TimePickerLocale from '../../time-picker/locale/sl_SI';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
locale: 'sl',
placeholder: 'Izberite datum',

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/sr_RS';
import TimePickerLocale from '../../time-picker/locale/sr_RS';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Izaberite datum',
rangePlaceholder: ['Početni datum', 'Krajnji datum'],

View File

@ -1,7 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/sv_SE';
import TimePickerLocale from '../../time-picker/locale/sv_SE';
import { PickerLocale } from '../generatePicker';
const locale = {
// Merge into a locale object
const locale: PickerLocale = {
lang: {
placeholder: 'Välj datum',
rangePlaceholder: ['Startdatum', 'Slutdatum'],

View File

@ -1,9 +1,10 @@
// Tamil Locale added to rc-calendar
import CalendarLocale from 'rc-picker/lib/locale/ta_IN';
import TimePickerLocale from '../../time-picker/locale/ta_IN';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'தேதியைத் தேர்ந்தெடுக்கவும்',
rangePlaceholder: ['தொடக்க தேதி', 'கடைசி தேதி'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/th_TH';
import TimePickerLocale from '../../time-picker/locale/th_TH';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'เลือกวันที่',
rangePlaceholder: ['วันเริ่มต้น', 'วันสิ้นสุด'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/tr_TR';
import TimePickerLocale from '../../time-picker/locale/tr_TR';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Tarih Seç',
rangePlaceholder: ['Başlangıç Tarihi', 'Bitiş Tarihi'],

View File

@ -1,7 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/uk_UA';
import TimePickerLocale from '../../time-picker/locale/uk_UA';
import { PickerLocale } from '../generatePicker';
const locale = {
// Merge into a locale object
const locale: PickerLocale = {
lang: {
placeholder: 'Оберіть дату',
rangePlaceholder: ['Початкова дата', 'Кінцева дата'],

View File

@ -1,8 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/vi_VN';
import TimePickerLocale from '../../time-picker/locale/vi_VN';
import { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale = {
const locale: PickerLocale = {
lang: {
placeholder: 'Chọn thời điểm',
rangePlaceholder: ['Ngày bắt đầu', 'Ngày kết thúc'],

View File

@ -1,7 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/zh_CN';
import TimePickerLocale from '../../time-picker/locale/zh_CN';
import { PickerLocale } from '../generatePicker';
const locale = {
// 统一合并为完整的 Locale
const locale: PickerLocale = {
lang: {
placeholder: '请选择日期',
yearPlaceholder: '请选择年份',

View File

@ -1,7 +1,9 @@
import CalendarLocale from 'rc-picker/lib/locale/zh_TW';
import TimePickerLocale from '../../time-picker/locale/zh_TW';
import { PickerLocale } from '../generatePicker';
const locale = {
// 统一合并为完整的 Locale
const locale: PickerLocale = {
lang: {
placeholder: '請選擇日期',
rangePlaceholder: ['開始日期', '結束日期'],

View File

@ -1,6 +1,7 @@
import { PickerMode } from 'rc-picker/lib/interface';
import { PickerLocale } from './generatePicker';
export function getPlaceholder(picker: PickerMode | undefined, locale: any): string {
export function getPlaceholder(picker: PickerMode | undefined, locale: PickerLocale): string {
if (picker === 'year' && locale.lang.yearPlaceholder) {
return locale.lang.yearPlaceholder;
}
@ -16,7 +17,7 @@ export function getPlaceholder(picker: PickerMode | undefined, locale: any): str
return locale.lang.placeholder;
}
export function getRangePlaceholder(picker: PickerMode | undefined, locale: any): [string, string] {
export function getRangePlaceholder(picker: PickerMode | undefined, locale: PickerLocale) {
if (picker === 'year' && locale.lang.yearPlaceholder) {
return locale.lang.rangeYearPlaceholder;
}

View File

@ -94,7 +94,7 @@
ul {
margin-right: 0.3em;
margin-left: 0.3em;
padding: 0;
padding: @dropdown-edge-child-vertical-padding 0;
}
}

View File

@ -77,6 +77,7 @@ function FormItem(props: FormItemProps): React.ReactElement {
validateStatus,
children,
required,
label,
trigger = 'onChange',
validateTrigger = 'onChange',
...restProps
@ -235,9 +236,15 @@ function FormItem(props: FormItemProps): React.ReactElement {
return renderLayout(children);
}
const variables: Record<string, string> = {};
if (typeof label === 'string') {
variables.label = label;
}
return (
<Field
{...props}
messageVariables={variables}
trigger={trigger}
validateTrigger={validateTrigger}
onReset={() => {

View File

@ -596,6 +596,28 @@ describe('Form', () => {
expect(errorSpy).not.toHaveBeenCalled();
});
it('`label` support template', async () => {
const wrapper = mount(
// eslint-disable-next-line no-template-curly-in-string
<Form validateMessages={{ required: '${label} is good!' }}>
<Form.Item name="test" label="Bamboo" rules={[{ required: true }]}>
<input />
</Form.Item>
</Form>,
);
wrapper.find('form').simulate('submit');
await delay(50);
wrapper.update();
expect(
wrapper
.find('.ant-form-item-explain')
.first()
.text(),
).toEqual('Bamboo is good!');
});
it('return same form instance', () => {
const instances = new Set();

View File

@ -22,13 +22,13 @@ const layout = {
};
const validateMessages = {
required: 'This field is required!',
required: '${label} is required!',
types: {
email: 'Not a validate email!',
number: 'Not a validate number!',
email: '${label} is not validate email!',
number: '${label} is not a validate number!',
},
number: {
range: 'Must be between ${min} and ${max}',
range: '${label} must be between ${min} and ${max}',
},
};

View File

@ -372,7 +372,7 @@ exports[`List.pagination should change page size work 2`] = `
<div>
<div
class="ant-select-dropdown"
style="width: 0px; opacity: 0;"
style="min-width: 0; opacity: 0;"
>
<div>
<div

View File

@ -1,22 +1,35 @@
import * as React from 'react';
import * as PropTypes from 'prop-types';
import { ModalLocale, changeConfirmLocale } from '../modal/locale';
import warning from '../_util/warning';
import { ModalLocale, changeConfirmLocale } from '../modal/locale';
import { TransferLocale as TransferLocaleForEmpty } from '../empty';
import { PaginationLocale } from '../pagination/Pagination';
import { TableLocale } from '../table/interface';
import { PopconfirmLocale } from '../popconfirm';
import { UploadLocale } from '../upload/interface';
import { TransferLocale } from '../transfer';
import { PickerLocale as DatePickerLocale } from '../date-picker/generatePicker';
export const ANT_MARK = 'internalMark';
export interface Locale {
locale: string;
Pagination?: Object;
DatePicker?: Object;
Pagination?: PaginationLocale;
DatePicker?: DatePickerLocale;
TimePicker?: Object;
Calendar?: Object;
Table?: Object;
Table?: TableLocale;
Modal?: ModalLocale;
Popconfirm?: Object;
Transfer?: Object;
Popconfirm?: PopconfirmLocale;
Transfer?: Partial<TransferLocale>;
Select?: Object;
Upload?: Object;
Upload?: UploadLocale;
Empty?: TransferLocaleForEmpty;
global?: Object;
PageHeader?: Object;
Icon?: Object;
Text?: Object;
}
export interface LocaleProviderProps {

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/ar_EG';
import DatePicker from '../date-picker/locale/ar_EG';
import TimePicker from '../time-picker/locale/ar_EG';
import Calendar from '../calendar/locale/ar_EG';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'ar',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'لا توجد بيانات',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/az_AZ';
import DatePicker from '../date-picker/locale/az_AZ';
import TimePicker from '../time-picker/locale/az_AZ';
import Calendar from '../calendar/locale/az_AZ';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'az',
Pagination,
DatePicker,
@ -43,3 +44,5 @@ export default {
previewFile: 'Fayla önbaxış',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/bg_BG';
import DatePicker from '../date-picker/locale/bg_BG';
import TimePicker from '../time-picker/locale/bg_BG';
import Calendar from '../calendar/locale/bg_BG';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'bg',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'Няма данни',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/ca_ES';
import DatePicker from '../date-picker/locale/ca_ES';
import TimePicker from '../time-picker/locale/ca_ES';
import Calendar from '../calendar/locale/ca_ES';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'ca',
Pagination,
DatePicker,
@ -39,3 +40,5 @@ export default {
description: 'Sense dades',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/cs_CZ';
import DatePicker from '../date-picker/locale/cs_CZ';
import TimePicker from '../time-picker/locale/cs_CZ';
import Calendar from '../calendar/locale/cs_CZ';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'cs',
Pagination,
DatePicker,
@ -39,3 +40,5 @@ export default {
description: 'Žádná data',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/da_DK';
import DatePicker from '../date-picker/locale/da_DK';
import TimePicker from '../time-picker/locale/da_DK';
import Calendar from '../calendar/locale/da_DK';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'da',
DatePicker,
TimePicker,
@ -41,3 +42,5 @@ export default {
description: 'Ingen data',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/de_DE';
import DatePicker from '../date-picker/locale/de_DE';
import TimePicker from '../time-picker/locale/de_DE';
import Calendar from '../calendar/locale/de_DE';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'de',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'Keine Daten',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/en_US';
import DatePicker from '../date-picker/locale/en_US';
import TimePicker from '../time-picker/locale/en_US';
import Calendar from '../calendar/locale/en_US';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'en',
Pagination,
DatePicker,
@ -22,6 +23,9 @@ export default {
sortTitle: 'Sort',
expand: 'Expand row',
collapse: 'Collapse row',
triggerDesc: 'Click sort by descend',
triggerAsc: 'Click sort by ascend',
cancelSort: 'Click to cancel sort',
},
Modal: {
okText: 'OK',
@ -61,3 +65,5 @@ export default {
back: 'Back',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/el_GR';
import DatePicker from '../date-picker/locale/el_GR';
import TimePicker from '../time-picker/locale/el_GR';
import Calendar from '../calendar/locale/el_GR';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'el',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'Δεν υπάρχουν δεδομένα',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/en_GB';
import DatePicker from '../date-picker/locale/en_GB';
import TimePicker from '../time-picker/locale/en_GB';
import Calendar from '../calendar/locale/en_GB';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'en-gb',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'No data',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/es_ES';
import DatePicker from '../date-picker/locale/es_ES';
import TimePicker from '../time-picker/locale/es_ES';
import Calendar from '../calendar/locale/es_ES';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'es',
Pagination,
DatePicker,
@ -57,3 +58,5 @@ export default {
back: 'volver',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/et_EE';
import DatePicker from '../date-picker/locale/et_EE';
import TimePicker from '../time-picker/locale/et_EE';
import Calendar from '../calendar/locale/et_EE';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'et',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'Andmed puuduvad',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/fa_IR';
import DatePicker from '../date-picker/locale/fa_IR';
import TimePicker from '../time-picker/locale/fa_IR';
import Calendar from '../calendar/locale/fa_IR';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'fa',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'داده‌ای موجود نیست',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/fi_FI';
import DatePicker from '../date-picker/locale/fi_FI';
import TimePicker from '../time-picker/locale/fi_FI';
import Calendar from '../calendar/locale/fi_FI';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'fi',
Pagination,
DatePicker,
@ -42,3 +43,5 @@ export default {
description: 'Ei kohteita',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/fr_BE';
import DatePicker from '../date-picker/locale/fr_BE';
import TimePicker from '../time-picker/locale/fr_BE';
import Calendar from '../calendar/locale/fr_BE';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'fr',
Pagination,
DatePicker,
@ -45,3 +46,5 @@ export default {
expand: 'développer',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/fr_FR';
import DatePicker from '../date-picker/locale/fr_FR';
import TimePicker from '../time-picker/locale/fr_FR';
import Calendar from '../calendar/locale/fr_FR';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'fr',
Pagination,
DatePicker,
@ -45,3 +46,5 @@ export default {
expand: 'développer',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/he_IL';
import DatePicker from '../date-picker/locale/he_IL';
import TimePicker from '../time-picker/locale/he_IL';
import Calendar from '../calendar/locale/he_IL';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'he',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'אין מידע',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/hi_IN';
import DatePicker from '../date-picker/locale/hi_IN';
import TimePicker from '../time-picker/locale/hi_IN';
import Calendar from '../calendar/locale/hi_IN';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'hi',
Pagination,
DatePicker,
@ -49,3 +50,5 @@ export default {
downloadFile: 'फ़ाइल डाउनलोड करें',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/hr_HR';
import DatePicker from '../date-picker/locale/hr_HR';
import TimePicker from '../time-picker/locale/hr_HR';
import Calendar from '../calendar/locale/hr_HR';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'hr',
Pagination,
DatePicker,
@ -55,3 +56,5 @@ export default {
expand: 'proširi',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/hu_HU';
import DatePicker from '../date-picker/locale/hu_HU';
import TimePicker from '../time-picker/locale/hu_HU';
import Calendar from '../calendar/locale/hu_HU';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'hu',
Pagination,
DatePicker,
@ -42,3 +43,5 @@ export default {
description: 'Nincs adat',
},
};
export default localeValues;

View File

@ -1,4 +1,7 @@
const datePickerLocale = {
import { Locale } from '../locale-provider';
import { PickerLocale } from '../date-picker/generatePicker';
const datePickerLocale: PickerLocale = {
lang: {
locale: 'hy-am',
placeholder: 'Ընտրեք ամսաթիվը',
@ -35,7 +38,7 @@ const datePickerLocale = {
},
};
export default {
const localeValues: Locale = {
locale: 'hy-am',
Pagination: {
// Options.jsx
@ -108,3 +111,5 @@ export default {
back: 'Հետ',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/id_ID';
import DatePicker from '../date-picker/locale/id_ID';
import TimePicker from '../time-picker/locale/id_ID';
import Calendar from '../calendar/locale/id_ID';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'id',
Pagination,
DatePicker,
@ -43,3 +44,5 @@ export default {
description: 'Tidak ada data',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/is_IS';
import DatePicker from '../date-picker/locale/is_IS';
import TimePicker from '../time-picker/locale/is_IS';
import Calendar from '../calendar/locale/is_IS';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'is',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'Engin gögn',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/it_IT';
import DatePicker from '../date-picker/locale/it_IT';
import TimePicker from '../time-picker/locale/it_IT';
import Calendar from '../calendar/locale/it_IT';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'it',
Pagination,
DatePicker,
@ -54,3 +55,5 @@ export default {
expand: 'espandi',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/ja_JP';
import DatePicker from '../date-picker/locale/ja_JP';
import TimePicker from '../time-picker/locale/ja_JP';
import Calendar from '../calendar/locale/ja_JP';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'ja',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'データがありません',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/kn_IN';
import DatePicker from '../date-picker/locale/kn_IN';
import TimePicker from '../time-picker/locale/kn_IN';
import Calendar from '../calendar/locale/kn_IN';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'kn',
Pagination,
DatePicker,
@ -49,3 +50,5 @@ export default {
downloadFile: 'ಫೈಲ್ ಡೌನ್‌ಲೋಡ್ ಮಾಡಿ',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/ko_KR';
import DatePicker from '../date-picker/locale/ko_KR';
import TimePicker from '../time-picker/locale/ko_KR';
import Calendar from '../calendar/locale/ko_KR';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'ko',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: '데이터 없음',
},
};
export default localeValues;

View File

@ -2,8 +2,9 @@ import Pagination from 'rc-pagination/lib/locale/ku_IQ';
import DatePicker from '../date-picker/locale/ku_IQ';
import TimePicker from '../time-picker/locale/ku_IQ';
import Calendar from '../calendar/locale/ku_IQ';
import { Locale } from '../locale-provider';
export default {
const localeValues: Locale = {
locale: 'ku-iq',
Pagination,
DatePicker,
@ -41,3 +42,5 @@ export default {
description: 'Agahî tune',
},
};
export default localeValues;

Some files were not shown because too many files have changed in this diff Show More