diff --git a/.jest.js b/.jest.js index 53c4b4b1f6..50517f9d0d 100644 --- a/.jest.js +++ b/.jest.js @@ -15,6 +15,7 @@ module.exports = { '\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor', '\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor', '\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor', + '\\.(jpg|png|gif|svg)$': './node_modules/antd-tools/lib/jest/imagePreprocessor', }, testRegex: `${libDir === 'dist' ? 'demo' : '.*'}\\.test\\.js$`, collectCoverageFrom: [ diff --git a/.jest.node.js b/.jest.node.js index b1697682a9..7ba89e4b0e 100644 --- a/.jest.node.js +++ b/.jest.node.js @@ -6,6 +6,7 @@ module.exports = { '\\.tsx?$': './node_modules/antd-tools/lib/jest/codePreprocessor', '\\.js$': './node_modules/antd-tools/lib/jest/codePreprocessor', '\\.md$': './node_modules/antd-tools/lib/jest/demoPreprocessor', + '\\.(jpg|png|gif|svg)$': './node_modules/antd-tools/lib/jest/imagePreprocessor', }, testRegex: 'demo\\.test\\.js$', testEnvironment: 'node', diff --git a/components/__tests__/__snapshots__/index.test.js.snap b/components/__tests__/__snapshots__/index.test.js.snap index abdb4384dd..6bfaa07821 100644 --- a/components/__tests__/__snapshots__/index.test.js.snap +++ b/components/__tests__/__snapshots__/index.test.js.snap @@ -24,6 +24,7 @@ Array [ "Divider", "Dropdown", "Drawer", + "Empty", "Form", "Icon", "Input", diff --git a/components/cascader/__tests__/__snapshots__/index.test.js.snap b/components/cascader/__tests__/__snapshots__/index.test.js.snap index 869fede59e..f414a6cea3 100644 --- a/components/cascader/__tests__/__snapshots__/index.test.js.snap +++ b/components/cascader/__tests__/__snapshots__/index.test.js.snap @@ -717,7 +717,6 @@ exports[`Cascader should highlight keyword and filter when search in Cascader 1` /> } - notFoundContent="Not Found" onChange={[Function]} onItemDoubleClick={[Function]} onPopupVisibleChange={[Function]} @@ -1119,7 +1118,6 @@ exports[`Cascader should render not found content 1`] = ` /> } - notFoundContent="Not Found" onChange={[Function]} onItemDoubleClick={[Function]} onPopupVisibleChange={[Function]} @@ -1128,7 +1126,9 @@ exports[`Cascader should render not found content 1`] = ` Array [ Object { "disabled": true, - "label": "Not Found", + "label": + [Function] + , "value": "ANT_CASCADER_NOT_FOUND", }, ] @@ -1163,9 +1163,38 @@ exports[`Cascader should render not found content 1`] = ` key="ANT_CASCADER_NOT_FOUND" onClick={[Function]} onDoubleClick={[Function]} - title="Not Found" + title="" > - Not Found + + + + +
+
+ No Data +
+

+ No Data +

+
+
+
+
+
diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index d3dc0ddb0e..12c6a900f1 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -7,7 +7,7 @@ import KeyCode from 'rc-util/lib/KeyCode'; import { polyfill } from 'react-lifecycles-compat'; import Input from '../input'; import Icon from '../icon'; -import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; +import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import warning from '../_util/warning'; @@ -212,7 +212,6 @@ class Cascader extends React.Component { options: [], disabled: false, allowClear: true, - notFoundContent: 'Not Found', }; static getDerivedStateFromProps(nextProps: CascaderProps, { prevProps }: CascaderState) { @@ -233,7 +232,7 @@ class Cascader extends React.Component { return newState; } - cachedOptions: CascaderOptionType[]; + cachedOptions: CascaderOptionType[] = []; private input: Input; @@ -338,7 +337,7 @@ class Cascader extends React.Component { } }; - generateFilteredOptions(prefixCls: string | undefined) { + generateFilteredOptions(prefixCls: string | undefined, renderEmpty: RenderEmptyHandler) { const { showSearch, notFoundContent } = this.props; const names: FilledFieldNamesType = getFilledFieldNames(this.props); const { @@ -386,7 +385,11 @@ class Cascader extends React.Component { }); } return [ - { [names.label]: notFoundContent, [names.value]: 'ANT_CASCADER_NOT_FOUND', disabled: true }, + { + [names.label]: notFoundContent || renderEmpty('Cascader'), + [names.value]: 'ANT_CASCADER_NOT_FOUND', + disabled: true, + }, ]; } @@ -403,7 +406,7 @@ class Cascader extends React.Component { }; renderCascader = ( - { getPopupContainer: getContextPopupContainer, getPrefixCls }: ConfigConsumerProps, + { getPopupContainer: getContextPopupContainer, getPrefixCls, renderEmpty }: ConfigConsumerProps, locale: CascaderLocale, ) => { const { props, state } = this; @@ -477,7 +480,7 @@ class Cascader extends React.Component { let options = props.options; if (state.inputValue) { - options = this.generateFilteredOptions(prefixCls); + options = this.generateFilteredOptions(prefixCls, renderEmpty); } // Dropdown menu should keep previous status until it is fully closed. if (!state.popupVisible) { diff --git a/components/config-provider/__tests__/__snapshots__/index.test.js.snap b/components/config-provider/__tests__/__snapshots__/index.test.js.snap index 0c6198017c..1380c4c779 100644 --- a/components/config-provider/__tests__/__snapshots__/index.test.js.snap +++ b/components/config-provider/__tests__/__snapshots__/index.test.js.snap @@ -11313,7 +11313,23 @@ exports[`ConfigProvider components Table configProvider 1`] = `
- No data +
+
+ No Data +
+

+ No Data +

+
@@ -11496,7 +11512,23 @@ exports[`ConfigProvider components Table normal 1`] = `
- No data +
+
+ No Data +
+

+ No Data +

+
@@ -11679,7 +11711,23 @@ exports[`ConfigProvider components Table prefixCls 1`] = `
- No data +
+
+ No Data +
+

+ No Data +

+
@@ -15213,7 +15261,23 @@ exports[`ConfigProvider components Transfer configProvider 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -15308,7 +15372,23 @@ exports[`ConfigProvider components Transfer configProvider 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -15360,7 +15440,23 @@ exports[`ConfigProvider components Transfer normal 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -15455,7 +15551,23 @@ exports[`ConfigProvider components Transfer normal 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -15507,7 +15619,23 @@ exports[`ConfigProvider components Transfer prefixCls 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -15602,7 +15730,23 @@ exports[`ConfigProvider components Transfer prefixCls 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
diff --git a/components/config-provider/empty.svg b/components/config-provider/empty.svg new file mode 100644 index 0000000000..9d496b4f53 --- /dev/null +++ b/components/config-provider/empty.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/config-provider/index.en-US.md b/components/config-provider/index.en-US.md index ab943e789d..dfb251e055 100644 --- a/components/config-provider/index.en-US.md +++ b/components/config-provider/index.en-US.md @@ -27,5 +27,6 @@ return ( | Property | Description | Type | Default | | -------- | ----------- | ---- | ------- | +| customizeRenderEmpty | set empty content of components. Ref [Empty](/components/empty/) | Function(componentName: string): ReactNode | - | | getPopupContainer | to set the container of the popup element. The default is to create a `div` element in `body`. | Function(triggerNode) | `() => document.body` | | prefixCls | set prefix class | string | ant | diff --git a/components/config-provider/index.tsx b/components/config-provider/index.tsx index fb43e91928..7d9f3266f6 100644 --- a/components/config-provider/index.tsx +++ b/components/config-provider/index.tsx @@ -1,24 +1,33 @@ import * as React from 'react'; import createReactContext, { Context } from 'create-react-context'; +import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty'; + +export { RenderEmptyHandler }; + export interface ConfigConsumerProps { getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; rootPrefixCls?: string; getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => string; + renderEmpty: RenderEmptyHandler; } interface ConfigProviderProps { getPopupContainer?: (triggerNode?: HTMLElement) => HTMLElement; prefixCls?: string; children?: React.ReactNode; + renderEmpty?: RenderEmptyHandler; } const ConfigContext: Context = createReactContext({ + // We provide a default function for Context without provider getPrefixCls: (suffixCls: string, customizePrefixCls?: string) => { if (customizePrefixCls) return customizePrefixCls; return `ant-${suffixCls}`; }, + + renderEmpty: defaultRenderEmpty, }); export const ConfigConsumer = ConfigContext.Consumer; @@ -33,14 +42,20 @@ class ConfigProvider extends React.Component { }; renderProvider = (context: ConfigConsumerProps) => { - const { getPopupContainer, children } = this.props; + const { children, getPopupContainer, renderEmpty } = this.props; const config: ConfigConsumerProps = { ...context, - getPopupContainer, getPrefixCls: this.getPrefixCls, }; + if (getPopupContainer) { + config.getPopupContainer = getPopupContainer; + } + if (renderEmpty) { + config.renderEmpty = renderEmpty; + } + return {children}; }; diff --git a/components/config-provider/index.zh-CN.md b/components/config-provider/index.zh-CN.md index 3069ccf009..a9c9a66f5e 100644 --- a/components/config-provider/index.zh-CN.md +++ b/components/config-provider/index.zh-CN.md @@ -28,5 +28,6 @@ return ( | 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | +| customizeRenderEmpty | 自定义组件空状态。参考 [空状态](/components/empty/) | Function(componentName: string): ReactNode | - | | getPopupContainer | 弹出框(Select, Tooltip, Menu 等等)渲染父节点,默认渲染到 body 上。 | Function(triggerNode) | () => document.body | | prefixCls | 设置统一样式前缀 | string | ant | diff --git a/components/config-provider/renderEmpty.tsx b/components/config-provider/renderEmpty.tsx new file mode 100644 index 0000000000..5de64234ed --- /dev/null +++ b/components/config-provider/renderEmpty.tsx @@ -0,0 +1,31 @@ +import * as React from 'react'; +import Empty from '../empty'; +import { ConfigConsumer, ConfigConsumerProps } from './'; +import emptyImg from './empty.svg'; + +const renderEmpty = (componentName?: string): React.ReactNode => ( + + {({ getPrefixCls }: ConfigConsumerProps) => { + const prefix = getPrefixCls('empty'); + + switch (componentName) { + case 'Table': + case 'List': + return ; + + case 'Select': + case 'TreeSelect': + case 'Cascader': + case 'Transfer': + return ; + + default: + return ; + } + }} + +); + +export type RenderEmptyHandler = typeof renderEmpty; + +export default renderEmpty; diff --git a/components/empty/__tests__/__snapshots__/demo.test.js.snap b/components/empty/__tests__/__snapshots__/demo.test.js.snap new file mode 100644 index 0000000000..8c559ae1d2 --- /dev/null +++ b/components/empty/__tests__/__snapshots__/demo.test.js.snap @@ -0,0 +1,504 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`renders ./components/empty/demo/basic.md correctly 1`] = ` +
+
+ No Data +
+

+ No Data +

+
+`; + +exports[`renders ./components/empty/demo/config-provider.md correctly 1`] = ` +
+ +
+
+

+ Select +

+
+ +

+ TreeSelect +

+ + + + + + + + + + + + +

+ Cascader +

+ + + + + + + +

+ Transfer +

+
+
+
+ + + + 0 item + + + +
+
+
    +
    +
    +
    + No Data +
    +

    + No Data +

    +
    +
    +
+
+
+ + +
+
+
+ + + + 0 item + + + +
+
+
    +
    +
    +
    + No Data +
    +

    + No Data +

    +
    +
    +
+
+
+

+ Table +

+
+
+
+
+
+
+ + + + + + + + + + + + +
+
+ Name +
+
+
+ Age +
+
+
+
+
+
+ No Data +
+

+ No Data +

+
+
+
+
+
+
+
+

+ List +

+
+
+
+
+
+
+ No Data +
+

+ No Data +

+
+
+
+
+
+
+
+`; + +exports[`renders ./components/empty/demo/customize.md correctly 1`] = ` +
+
+ empty +
+

+ + Customize + + Description + + +

+ +
+`; diff --git a/components/empty/__tests__/demo.test.js b/components/empty/__tests__/demo.test.js new file mode 100644 index 0000000000..81ab6e3b3f --- /dev/null +++ b/components/empty/__tests__/demo.test.js @@ -0,0 +1,3 @@ +import demoTest from '../../../tests/shared/demoTest'; + +demoTest('empty'); diff --git a/components/empty/demo/basic.md b/components/empty/demo/basic.md new file mode 100644 index 0000000000..d9c6c39d53 --- /dev/null +++ b/components/empty/demo/basic.md @@ -0,0 +1,23 @@ +--- +order: 0 +title: + zh-CN: 基本 + en-US: Basic +--- + +## zh-CN + +简单的展示。 + +## en-US + +Simplest Usage. + +```jsx +import { Empty } from 'antd'; + +ReactDOM.render( + , + mountNode +); +``` diff --git a/components/empty/demo/config-provider.md b/components/empty/demo/config-provider.md new file mode 100644 index 0000000000..10f3bd251f --- /dev/null +++ b/components/empty/demo/config-provider.md @@ -0,0 +1,101 @@ +--- +order: 3 +title: + zh-CN: 全局化配置 + en-US: ConfigProvider +--- + +## zh-CN + +自定义全局组件的 Empty 样式。 + +## en-US + +Use ConfigProvider set global Empty style. + +```jsx +import { + ConfigProvider, Switch, Divider, Icon, + TreeSelect, Select, Cascader, + Transfer, + Table, List, +} from 'antd'; + +const customizeRenderEmpty = () => ( +
+ +

Data Not Found

+
+); + +const style = { width: 200 }; + +class Demo extends React.Component { + state = { + customize: false, + }; + + render() { + const { customize } = this.state; + return ( +
+ { + this.setState({ customize: val }); + }} + /> + + + + +
+

Select

+ + + + + + + 0 item + + + +
+
@@ -143125,7 +144453,23 @@ exports[`Locale Provider should display the text as nl-be 1`] = `
- Geen gegevens +
+
+ Geen gegevens +
+

+ Geen gegevens +

+
@@ -146912,7 +148256,23 @@ exports[`Locale Provider should display the text as pl 1`] = `
- Nie znaleziono +
+
+ Brak danych +
+

+ Brak danych +

+
@@ -147041,7 +148401,23 @@ exports[`Locale Provider should display the text as pl 1`] = `
- Nie znaleziono +
+
+ Brak danych +
+

+ Brak danych +

+
@@ -148152,7 +149528,23 @@ exports[`Locale Provider should display the text as pl 1`] = `
- Brak danych +
+
+ Brak danych +
+

+ Brak danych +

+
@@ -151939,7 +153331,23 @@ exports[`Locale Provider should display the text as pt 1`] = `
- Sem resultados +
+
+ Sem resultados +
+

+ Sem resultados +

+
@@ -152068,7 +153476,23 @@ exports[`Locale Provider should display the text as pt 1`] = `
- Sem resultados +
+
+ Sem resultados +
+

+ Sem resultados +

+
@@ -153179,7 +154603,23 @@ exports[`Locale Provider should display the text as pt 1`] = `
- Sem resultados +
+
+ Sem resultados +
+

+ Sem resultados +

+
@@ -156966,7 +158406,23 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
- Não encontrado +
+
+ Não há dados +
+

+ Não há dados +

+
@@ -157095,7 +158551,23 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
- Não encontrado +
+
+ Não há dados +
+

+ Não há dados +

+
@@ -158206,7 +159678,23 @@ exports[`Locale Provider should display the text as pt-br 1`] = `
- Não há dados +
+
+ Não há dados +
+

+ Não há dados +

+
@@ -161993,7 +163481,23 @@ exports[`Locale Provider should display the text as ru 1`] = `
- Ничего не найдено +
+
+ Нет данных +
+

+ Нет данных +

+
@@ -162122,7 +163626,23 @@ exports[`Locale Provider should display the text as ru 1`] = `
- Ничего не найдено +
+
+ Нет данных +
+

+ Нет данных +

+
@@ -163233,7 +164753,23 @@ exports[`Locale Provider should display the text as ru 1`] = `
- Нет данных +
+
+ Нет данных +
+

+ Нет данных +

+
@@ -167020,7 +168556,23 @@ exports[`Locale Provider should display the text as sk 1`] = `
- Nenájdené +
+
+ Žiadne dáta +
+

+ Žiadne dáta +

+
@@ -167149,7 +168701,23 @@ exports[`Locale Provider should display the text as sk 1`] = `
- Nenájdené +
+
+ Žiadne dáta +
+

+ Žiadne dáta +

+
@@ -168260,7 +169828,23 @@ exports[`Locale Provider should display the text as sk 1`] = `
- Žiadne dáta +
+
+ Žiadne dáta +
+

+ Žiadne dáta +

+
@@ -172047,7 +173631,23 @@ exports[`Locale Provider should display the text as sl 1`] = `
- Ni rezultatov iskanja +
+
+ Ni podatkov +
+

+ Ni podatkov +

+
@@ -172176,7 +173776,23 @@ exports[`Locale Provider should display the text as sl 1`] = `
- Ni rezultatov iskanja +
+
+ Ni podatkov +
+

+ Ni podatkov +

+
@@ -173287,7 +174903,23 @@ exports[`Locale Provider should display the text as sl 1`] = `
- Ni podatkov +
+
+ Ni podatkov +
+

+ Ni podatkov +

+
@@ -177074,7 +178706,23 @@ exports[`Locale Provider should display the text as sr 1`] = `
- Nisu pronađeni rezultati pretrage +
+
+ Nema podataka +
+

+ Nema podataka +

+
@@ -177203,7 +178851,23 @@ exports[`Locale Provider should display the text as sr 1`] = `
- Nisu pronađeni rezultati pretrage +
+
+ Nema podataka +
+

+ Nema podataka +

+
@@ -178314,7 +179978,23 @@ exports[`Locale Provider should display the text as sr 1`] = `
- Nema podataka +
+
+ Nema podataka +
+

+ Nema podataka +

+
@@ -182101,7 +183781,23 @@ exports[`Locale Provider should display the text as sv 1`] = `
- Info saknas +
+
+ Ingen information +
+

+ Ingen information +

+
@@ -182230,7 +183926,23 @@ exports[`Locale Provider should display the text as sv 1`] = `
- Info saknas +
+
+ Ingen information +
+

+ Ingen information +

+
@@ -183341,7 +185053,23 @@ exports[`Locale Provider should display the text as sv 1`] = `
- Ingen information +
+
+ Ingen information +
+

+ Ingen information +

+
@@ -187128,7 +188856,23 @@ exports[`Locale Provider should display the text as th 1`] = `
- ไม่พบข้อมูล +
+
+ ไม่มีข้อมูล +
+

+ ไม่มีข้อมูล +

+
@@ -187257,7 +189001,23 @@ exports[`Locale Provider should display the text as th 1`] = `
- ไม่พบข้อมูล +
+
+ ไม่มีข้อมูล +
+

+ ไม่มีข้อมูล +

+
@@ -188368,7 +190128,23 @@ exports[`Locale Provider should display the text as th 1`] = `
- ไม่มีข้อมูล +
+
+ ไม่มีข้อมูล +
+

+ ไม่มีข้อมูล +

+
@@ -192155,7 +193931,23 @@ exports[`Locale Provider should display the text as tr 1`] = `
- Bulunamadı +
+
+ Veri Yok +
+

+ Veri Yok +

+
@@ -192284,7 +194076,23 @@ exports[`Locale Provider should display the text as tr 1`] = `
- Bulunamadı +
+
+ Veri Yok +
+

+ Veri Yok +

+
@@ -193395,7 +195203,23 @@ exports[`Locale Provider should display the text as tr 1`] = `
- Veri Yok +
+
+ Veri Yok +
+

+ Veri Yok +

+
@@ -197182,7 +199006,23 @@ exports[`Locale Provider should display the text as uk 1`] = `
- Нічого не знайдено +
+
+ Даних немає +
+

+ Даних немає +

+
@@ -197311,7 +199151,23 @@ exports[`Locale Provider should display the text as uk 1`] = `
- Нічого не знайдено +
+
+ Даних немає +
+

+ Даних немає +

+
@@ -198422,7 +200278,23 @@ exports[`Locale Provider should display the text as uk 1`] = `
- Даних немає +
+
+ Даних немає +
+

+ Даних немає +

+
@@ -202209,7 +204081,23 @@ exports[`Locale Provider should display the text as vi 1`] = `
- Không Tìm Thấy +
+
+ Trống +
+

+ Trống +

+
@@ -202338,7 +204226,23 @@ exports[`Locale Provider should display the text as vi 1`] = `
- Không Tìm Thấy +
+
+ Trống +
+

+ Trống +

+
@@ -203449,7 +205353,23 @@ exports[`Locale Provider should display the text as vi 1`] = `
- Trống +
+
+ Trống +
+

+ Trống +

+
@@ -207236,7 +209156,23 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
- 无匹配结果 +
+
+ 暂无数据 +
+

+ 暂无数据 +

+
@@ -207365,7 +209301,23 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
- 无匹配结果 +
+
+ 暂无数据 +
+

+ 暂无数据 +

+
@@ -208476,7 +210428,23 @@ exports[`Locale Provider should display the text as zh-cn 1`] = `
- 暂无数据 +
+
+ 暂无数据 +
+

+ 暂无数据 +

+
@@ -212263,7 +214231,23 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
- 查無此資料 +
+
+ 無此資料 +
+

+ 無此資料 +

+
@@ -212392,7 +214376,23 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
- 查無此資料 +
+
+ 無此資料 +
+

+ 無此資料 +

+
@@ -213503,7 +215503,23 @@ exports[`Locale Provider should display the text as zh-tw 1`] = `
- 目前尚無資料 +
+
+ 無此資料 +
+

+ 無此資料 +

+
diff --git a/components/locale-provider/ar_EG.tsx b/components/locale-provider/ar_EG.tsx index 612cef8b43..cda0de3d8b 100644 --- a/components/locale-provider/ar_EG.tsx +++ b/components/locale-provider/ar_EG.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'الفلاتر', filterConfirm: 'تأكيد', filterReset: 'إعادة ضبط', - emptyText: 'لا توجد بيانات', selectAll: 'اختيار الكل', selectInvert: 'إلغاء الاختيار', }, @@ -27,18 +26,17 @@ export default { cancelText: 'إلغاء', }, Transfer: { - notFoundContent: 'لا يوجد محتوى', searchPlaceholder: 'ابحث هنا', itemUnit: 'عنصر', itemsUnit: 'عناصر', }, - Select: { - notFoundContent: 'لايوجد محتوى', - }, Upload: { uploading: 'جاري الرفع...', removeFile: 'احذف الملف', uploadError: 'مشكلة فى الرفع', previewFile: 'استعرض الملف', }, + Empty: { + description: 'لا توجد بيانات', + }, }; diff --git a/components/locale-provider/bg_BG.tsx b/components/locale-provider/bg_BG.tsx index 29d6a83c21..da7b281532 100644 --- a/components/locale-provider/bg_BG.tsx +++ b/components/locale-provider/bg_BG.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Филтриране', filterConfirm: 'Добре', filterReset: 'Нулриане', - emptyText: 'Няма данни', selectAll: 'Избор на текуща страница', selectInvert: 'Обръщане', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Отказ', }, Transfer: { - notFoundContent: 'Няма намерени', searchPlaceholder: 'Търсене', itemUnit: 'избор', itemsUnit: 'избори', }, - Select: { - notFoundContent: 'Няма намерени', - }, Upload: { uploading: 'Качване...', removeFile: 'Премахване', uploadError: 'Грешка при качването', previewFile: 'Преглед', }, + Empty: { + description: 'Няма данни', + }, }; diff --git a/components/locale-provider/ca_ES.tsx b/components/locale-provider/ca_ES.tsx index dfb9bb5779..24f7897978 100644 --- a/components/locale-provider/ca_ES.tsx +++ b/components/locale-provider/ca_ES.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtrar Menu', filterConfirm: 'OK', filterReset: 'Restablir', - emptyText: 'Sense dades', }, Modal: { okText: 'OK', @@ -25,12 +24,11 @@ export default { cancelText: 'Cancel·lar', }, Transfer: { - notFoundContent: 'No trobat', searchPlaceholder: 'Cercar aquí', itemUnit: 'item', itemsUnit: 'items', }, - Select: { - notFoundContent: 'No trobat', + Empty: { + description: 'Sense dades', }, }; diff --git a/components/locale-provider/cs_CZ.tsx b/components/locale-provider/cs_CZ.tsx index 6cdbe6ac77..c9431a1073 100644 --- a/components/locale-provider/cs_CZ.tsx +++ b/components/locale-provider/cs_CZ.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtr', filterConfirm: 'Potvrdit', filterReset: 'Obnovit', - emptyText: 'Žádná data', }, Modal: { okText: 'Ok', @@ -25,18 +24,17 @@ export default { cancelText: 'Storno', }, Transfer: { - notFoundContent: 'Nenalezeno', searchPlaceholder: 'Vyhledávání', itemUnit: 'položka', itemsUnit: 'položek', }, - Select: { - notFoundContent: 'Nenalezeno', - }, Upload: { uploading: 'Nahrávání...', removeFile: 'Odstranit soubor', uploadError: 'Chyba při nahrávání', previewFile: 'Zobrazit soubor', }, + Empty: { + description: 'Žádná data', + }, }; diff --git a/components/locale-provider/da_DK.tsx b/components/locale-provider/da_DK.tsx index 1b3ac072a0..b27ad06034 100644 --- a/components/locale-provider/da_DK.tsx +++ b/components/locale-provider/da_DK.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtermenu', filterConfirm: 'OK', filterReset: 'Nulstil', - emptyText: 'Ingen data', selectAll: 'Vælg alle', selectInvert: 'Inverter valg', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Afbryd', }, Transfer: { - notFoundContent: 'Intet fundet', searchPlaceholder: 'Søg her', itemUnit: 'element', itemsUnit: 'elementer', }, - Select: { - notFoundContent: 'Intet fundet', - }, Upload: { uploading: 'Uploader...', removeFile: 'Fjern fil', uploadError: 'Fejl ved upload', previewFile: 'Forhåndsvisning', }, + Empty: { + description: 'Ingen data', + }, }; diff --git a/components/locale-provider/de_DE.tsx b/components/locale-provider/de_DE.tsx index b68b10be01..f0a72aed95 100644 --- a/components/locale-provider/de_DE.tsx +++ b/components/locale-provider/de_DE.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filter-Menü', filterConfirm: 'OK', filterReset: 'Zurücksetzen', - emptyText: 'Keine Daten', selectAll: 'Selektiere Alle', selectInvert: 'Selektion Invertieren', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Abbrechen', }, Transfer: { - notFoundContent: 'Nicht gefunden', searchPlaceholder: 'Suchen', itemUnit: 'Eintrag', itemsUnit: 'Einträge', }, - Select: { - notFoundContent: 'Nicht gefunden', - }, Upload: { uploading: 'Hochladen...', removeFile: 'Datei entfernen', uploadError: 'Fehler beim Hochladen', previewFile: 'Dateivorschau', }, + Empty: { + description: 'Keine Daten', + }, }; diff --git a/components/locale-provider/default.tsx b/components/locale-provider/default.tsx index e9c9925a67..25df62100b 100644 --- a/components/locale-provider/default.tsx +++ b/components/locale-provider/default.tsx @@ -9,7 +9,6 @@ export default { DatePicker, TimePicker, Calendar, - // locales for all comoponents global: { placeholder: 'Please select', }, @@ -17,7 +16,6 @@ export default { filterTitle: 'Filter menu', filterConfirm: 'OK', filterReset: 'Reset', - emptyText: 'No data', selectAll: 'Select current page', selectInvert: 'Invert current page', sortTitle: 'Sort', @@ -33,18 +31,17 @@ export default { }, Transfer: { titles: ['', ''], - notFoundContent: 'Not Found', searchPlaceholder: 'Search here', itemUnit: 'item', itemsUnit: 'items', }, - Select: { - notFoundContent: 'Not Found', - }, Upload: { uploading: 'Uploading...', removeFile: 'Remove file', uploadError: 'Upload error', previewFile: 'Preview file', }, + Empty: { + description: 'No Data', + }, }; diff --git a/components/locale-provider/el_GR.tsx b/components/locale-provider/el_GR.tsx index e4bcfea518..0f38eb337e 100644 --- a/components/locale-provider/el_GR.tsx +++ b/components/locale-provider/el_GR.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Μενού φίλτρων', filterConfirm: 'ΟΚ', filterReset: 'Επαναφορά', - emptyText: 'Δεν υπάρχουν δεδομένα', selectAll: 'Επιλογή τρέχουσας σελίδας', selectInvert: 'Αντιστροφή τρέχουσας σελίδας', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Άκυρο', }, Transfer: { - notFoundContent: 'Δεν βρέθηκε', searchPlaceholder: 'Αναζήτηση', itemUnit: 'αντικείμενο', itemsUnit: 'αντικείμενα', }, - Select: { - notFoundContent: 'Δεν βρέθηκε', - }, Upload: { uploading: 'Μεταφόρτωση...', removeFile: 'Αφαίρεση αρχείου', uploadError: 'Σφάλμα μεταφόρτωσης', previewFile: 'Προεπισκόπηση αρχείου', }, + Empty: { + description: 'Δεν υπάρχουν δεδομένα', + }, }; diff --git a/components/locale-provider/en_GB.tsx b/components/locale-provider/en_GB.tsx index e82375351b..8e490001e9 100644 --- a/components/locale-provider/en_GB.tsx +++ b/components/locale-provider/en_GB.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filter menu', filterConfirm: 'OK', filterReset: 'Reset', - emptyText: 'No data', selectAll: 'Select current page', selectInvert: 'Invert current page', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Cancel', }, Transfer: { - notFoundContent: 'Not Found', searchPlaceholder: 'Search here', itemUnit: 'item', itemsUnit: 'items', }, - Select: { - notFoundContent: 'Not Found', - }, Upload: { uploading: 'Uploading...', removeFile: 'Remove file', uploadError: 'Upload error', previewFile: 'Preview file', }, + Empty: { + description: 'No data', + }, }; diff --git a/components/locale-provider/es_ES.tsx b/components/locale-provider/es_ES.tsx index 260632857a..a82cb23597 100644 --- a/components/locale-provider/es_ES.tsx +++ b/components/locale-provider/es_ES.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtrar menú', filterConfirm: 'Aceptar', filterReset: 'Reiniciar', - emptyText: 'No hay datos', selectAll: 'Seleccionar todo', selectInvert: 'Invertir selección', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Cancelar', }, Transfer: { - notFoundContent: 'No encontrado', searchPlaceholder: 'Buscar aquí', itemUnit: 'elemento', itemsUnit: 'elementos', }, - Select: { - notFoundContent: 'No encontrado', - }, Upload: { uploading: 'Subiendo...', removeFile: 'Eliminar archivo', uploadError: 'Error al subir el archivo', previewFile: 'Vista previa', }, + Empty: { + description: 'No hay datos', + }, }; diff --git a/components/locale-provider/et_EE.tsx b/components/locale-provider/et_EE.tsx index 6e69889429..1e6da377e0 100644 --- a/components/locale-provider/et_EE.tsx +++ b/components/locale-provider/et_EE.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtri menüü', filterConfirm: 'OK', filterReset: 'Nulli', - emptyText: 'Andmed puuduvad', selectAll: 'Vali kõik', selectInvert: 'Inverteeri valik', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Tühista', }, Transfer: { - notFoundContent: 'Ei leitud', searchPlaceholder: 'Otsi siit', itemUnit: 'kogus', itemsUnit: 'kogus', }, - Select: { - notFoundContent: 'Ei leitud', - }, Upload: { uploading: 'Üleslaadimine...', removeFile: 'Eemalda fail', uploadError: 'Üleslaadimise tõrge', previewFile: 'Faili eelvaade', }, + Empty: { + description: 'Andmed puuduvad', + }, }; diff --git a/components/locale-provider/fa_IR.tsx b/components/locale-provider/fa_IR.tsx index 7de16c697c..f0a217ceed 100644 --- a/components/locale-provider/fa_IR.tsx +++ b/components/locale-provider/fa_IR.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'منوی فیلتر', filterConfirm: 'تایید', filterReset: 'پاک کردن', - emptyText: 'داده‌ای موجود نیست', selectAll: 'انتخاب صفحه‌ی کنونی', selectInvert: 'معکوس کردن انتخاب‌ها در صفحه ی کنونی', }, @@ -27,18 +26,17 @@ export default { cancelText: 'لغو', }, Transfer: { - notFoundContent: 'داده‌ای موجود نیست', searchPlaceholder: 'جستجو', itemUnit: '', itemsUnit: '', }, - Select: { - notFoundContent: 'داده‌ای موجود نیست', - }, Upload: { uploading: 'در حال آپلود...', removeFile: 'حذف فایل', uploadError: 'خطا در آپلود', previewFile: 'مشاهده‌ی فایل', }, + Empty: { + description: 'داده‌ای موجود نیست', + }, }; diff --git a/components/locale-provider/fi_FI.tsx b/components/locale-provider/fi_FI.tsx index 86e617b210..5202eac08e 100644 --- a/components/locale-provider/fi_FI.tsx +++ b/components/locale-provider/fi_FI.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Suodatus valikko', filterConfirm: 'OK', filterReset: 'Tyhjennä', - emptyText: 'Ei kohteita', selectAll: 'Valitse kaikki', selectInvert: 'Valitse päinvastoin', sortTitle: 'Lajittele', @@ -28,18 +27,17 @@ export default { cancelText: 'Peruuta', }, Transfer: { - notFoundContent: 'Ei löytynyt', searchPlaceholder: 'Etsi täältä', itemUnit: 'kohde', itemsUnit: 'kohdetta', }, - Select: { - notFoundContent: 'Ei löytynyt', - }, Upload: { uploading: 'Lähetetään...', removeFile: 'Poista tiedosto', uploadError: 'Virhe lähetyksessä', previewFile: 'Esikatsele tiedostoa', }, + Empty: { + description: 'Ei kohteita', + }, }; diff --git a/components/locale-provider/fr_BE.tsx b/components/locale-provider/fr_BE.tsx index dc28bf918d..c1c0166308 100644 --- a/components/locale-provider/fr_BE.tsx +++ b/components/locale-provider/fr_BE.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtrer', filterConfirm: 'OK', filterReset: 'Réinitialiser', - emptyText: 'Aucune donnée', }, Modal: { okText: 'OK', @@ -25,12 +24,11 @@ export default { cancelText: 'Annuler', }, Transfer: { - notFoundContent: 'Pas de résultat', searchPlaceholder: 'Recherche', itemUnit: 'élément', itemsUnit: 'éléments', }, - Select: { - notFoundContent: 'Pas de résultat', + Empty: { + description: 'Aucune donnée', }, }; diff --git a/components/locale-provider/fr_FR.tsx b/components/locale-provider/fr_FR.tsx index c3372b2f85..8ece10bdd8 100644 --- a/components/locale-provider/fr_FR.tsx +++ b/components/locale-provider/fr_FR.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtrer', filterConfirm: 'OK', filterReset: 'Réinitialiser', - emptyText: 'Aucune donnée', }, Modal: { okText: 'OK', @@ -25,12 +24,11 @@ export default { cancelText: 'Annuler', }, Transfer: { - notFoundContent: 'Pas de résultat', searchPlaceholder: 'Recherche', itemUnit: 'élément', itemsUnit: 'éléments', }, - Select: { - notFoundContent: 'Pas de résultat', + Empty: { + description: 'Aucune donnée', }, }; diff --git a/components/locale-provider/he_IL.tsx b/components/locale-provider/he_IL.tsx index e8c4fed7cb..53a6768d58 100644 --- a/components/locale-provider/he_IL.tsx +++ b/components/locale-provider/he_IL.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'תפריט סינון', filterConfirm: 'אישור', filterReset: 'איפוס', - emptyText: 'אין מידע', selectAll: 'בחר הכל', selectInvert: 'הפוך בחירה', }, @@ -27,18 +26,17 @@ export default { cancelText: 'ביטול', }, Transfer: { - notFoundContent: 'לא נמצא', searchPlaceholder: 'חפש כאן', itemUnit: 'פריט', itemsUnit: 'פריטים', }, - Select: { - notFoundContent: 'לא נמצא', - }, Upload: { uploading: 'מעלה...', removeFile: 'הסר קובץ', uploadError: 'שגיאת העלאה', previewFile: 'הצג קובץ', }, + Empty: { + description: 'אין מידע', + }, }; diff --git a/components/locale-provider/hu_HU.tsx b/components/locale-provider/hu_HU.tsx index 606561c2f6..5df42d9188 100644 --- a/components/locale-provider/hu_HU.tsx +++ b/components/locale-provider/hu_HU.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Szűrők', filterConfirm: 'Alkalmazás', filterReset: 'Visszaállítás', - emptyText: 'Nincs adat', selectAll: 'Jelenlegi oldal kiválasztása', selectInvert: 'Jelenlegi oldal inverze', sortTitle: 'Rendezés', @@ -28,18 +27,17 @@ export default { cancelText: 'Visszavonás', }, Transfer: { - notFoundContent: 'Nem található', searchPlaceholder: 'Keresés', itemUnit: 'elem', itemsUnit: 'elemek', }, - Select: { - notFoundContent: 'Nem található', - }, Upload: { uploading: 'Feltöltés...', removeFile: 'Fájl eltávolítása', uploadError: 'Feltöltési hiba', previewFile: 'Fájl előnézet', }, + Empty: { + description: 'Nincs adat', + }, }; diff --git a/components/locale-provider/id_ID.tsx b/components/locale-provider/id_ID.tsx index 93b5dd0a27..3ec0ba0f50 100644 --- a/components/locale-provider/id_ID.tsx +++ b/components/locale-provider/id_ID.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Menu filter', filterConfirm: 'baik', filterReset: 'Setel ulang', - emptyText: 'Tidak ada data', selectAll: 'Pilih halaman saat ini', selectInvert: 'Balikkan halaman saat ini', sortTitle: 'Menyortir', @@ -29,18 +28,17 @@ export default { }, Transfer: { titles: ['', ''], - notFoundContent: 'Tidak ditemukan', searchPlaceholder: 'Cari di sini', itemUnit: 'barang', itemsUnit: 'item', }, - Select: { - notFoundContent: 'Tidak ditemukan', - }, Upload: { uploading: 'Mengunggah...', removeFile: 'Hapus file', uploadError: 'Kesalahan pengunggahan', previewFile: 'File pratinjau', }, + Empty: { + description: 'Tidak ada data', + }, }; diff --git a/components/locale-provider/is_IS.tsx b/components/locale-provider/is_IS.tsx index ee72a3be18..cf839be4f1 100644 --- a/components/locale-provider/is_IS.tsx +++ b/components/locale-provider/is_IS.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Afmarkanir', filterConfirm: 'Staðfesta', filterReset: 'Núllstilla', - emptyText: 'Engin gögn', selectAll: 'Velja allt', selectInvert: 'Viðsnúa vali', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Hætta við', }, Transfer: { - notFoundContent: 'Engar færslur', searchPlaceholder: 'Leita hér', itemUnit: 'færsla', itemsUnit: 'færslur', }, - Select: { - notFoundContent: 'Ekkert finnst', - }, Upload: { uploading: 'Hleð upp...', removeFile: 'Fjarlægja skrá', uploadError: 'Villa við að hlaða upp', previewFile: 'Forskoða skrá', }, + Empty: { + description: 'Engin gögn', + }, }; diff --git a/components/locale-provider/it_IT.tsx b/components/locale-provider/it_IT.tsx index 36ca64b8b7..e4e4c83852 100644 --- a/components/locale-provider/it_IT.tsx +++ b/components/locale-provider/it_IT.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Menù Filtro', filterConfirm: 'OK', filterReset: 'Reset', - emptyText: 'Nessun dato', selectAll: 'Seleziona pagina corrente', selectInvert: 'Inverti selezione nella pagina corrente', sortTitle: 'Ordina', @@ -28,18 +27,17 @@ export default { cancelText: 'Annulla', }, Transfer: { - notFoundContent: 'Non trovato', searchPlaceholder: 'Cerca qui', itemUnit: 'articolo', itemsUnit: 'elementi', }, - Select: { - notFoundContent: 'Non trovato', - }, Upload: { uploading: 'Caricamento...', removeFile: 'Rimuovi il file', uploadError: 'Errore di caricamento', previewFile: 'Anteprima file', }, + Empty: { + description: 'Nessun dato', + }, }; diff --git a/components/locale-provider/ja_JP.tsx b/components/locale-provider/ja_JP.tsx index 3202ec0fe6..7083cdcb1f 100644 --- a/components/locale-provider/ja_JP.tsx +++ b/components/locale-provider/ja_JP.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'メニューをフィルター', filterConfirm: 'OK', filterReset: 'リセット', - emptyText: 'データがありません', selectAll: 'すべてを選択', selectInvert: '選択を反転', }, @@ -27,18 +26,17 @@ export default { cancelText: 'キャンセル', }, Transfer: { - notFoundContent: '結果はありません', searchPlaceholder: 'ここを検索', itemUnit: 'アイテム', itemsUnit: 'アイテム', }, - Select: { - notFoundContent: '結果はありません', - }, Upload: { uploading: 'アップロード中...', removeFile: 'ファイルを削除', uploadError: 'アップロードエラー', previewFile: 'ファイルをプレビュー', }, + Empty: { + description: 'データがありません', + }, }; diff --git a/components/locale-provider/ko_KR.tsx b/components/locale-provider/ko_KR.tsx index b0a26748db..3cfe680b49 100644 --- a/components/locale-provider/ko_KR.tsx +++ b/components/locale-provider/ko_KR.tsx @@ -13,7 +13,6 @@ export default { filterTitle: '필터 메뉴', filterConfirm: '확인', filterReset: '초기화', - emptyText: '데이터 없음', selectAll: '모두 선택', selectInvert: '선택 반전', }, @@ -27,18 +26,17 @@ export default { cancelText: '취소', }, Transfer: { - notFoundContent: '데이터 없음', searchPlaceholder: '여기에 검색하세요', itemUnit: '개', itemsUnit: '개', }, - Select: { - notFoundContent: '데이터 없음', - }, Upload: { uploading: '업로드 중...', removeFile: '파일 삭제', uploadError: '업로드 실패', previewFile: '파일 미리보기', }, + Empty: { + description: '데이터 없음', + }, }; diff --git a/components/locale-provider/ku_IQ.tsx b/components/locale-provider/ku_IQ.tsx index 52032ade43..e498f2b8d2 100755 --- a/components/locale-provider/ku_IQ.tsx +++ b/components/locale-provider/ku_IQ.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Menuê peldanka', filterConfirm: 'Temam', filterReset: 'Jê bibe', - emptyText: 'Agahî tune', selectAll: 'Hemî hilbijêre', selectInvert: 'Hilbijartinan veguhere', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Betal ke', }, Transfer: { - notFoundContent: 'Peyda Nebû', searchPlaceholder: 'Lêgerîn', itemUnit: 'tişt', itemsUnit: 'tişt', }, - Select: { - notFoundContent: 'Peyda Nebû', - }, Upload: { uploading: 'Bardike...', removeFile: 'Pelê rabike', uploadError: 'Xeta barkirine', previewFile: 'Pelê pêşbibîne', }, + Empty: { + description: 'Agahî tune', + }, }; diff --git a/components/locale-provider/mn_MN.tsx b/components/locale-provider/mn_MN.tsx index 670bca856b..3d848d00d8 100644 --- a/components/locale-provider/mn_MN.tsx +++ b/components/locale-provider/mn_MN.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Хайх цэс', filterConfirm: 'OK', filterReset: 'Цэвэрлэх', - emptyText: 'Мэдээлэл байхгүй байна', selectAll: 'Бүгдийг сонгох', selectInvert: 'Бусдыг сонгох', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Цуцлах', }, Transfer: { - notFoundContent: 'Олдсонгүй', searchPlaceholder: 'Хайх', itemUnit: 'Зүйл', itemsUnit: 'Зүйлүүд', }, - Select: { - notFoundContent: 'Олдсонгүй', - }, Upload: { uploading: 'Хуулж байна...', removeFile: 'Файл устгах', uploadError: 'Хуулахад алдаа гарлаа', previewFile: 'Файлыг түргэн үзэх', }, + Empty: { + description: 'Мэдээлэл байхгүй байна', + }, }; diff --git a/components/locale-provider/nb_NO.tsx b/components/locale-provider/nb_NO.tsx index 03ac165c28..f6129570f3 100644 --- a/components/locale-provider/nb_NO.tsx +++ b/components/locale-provider/nb_NO.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtermeny', filterConfirm: 'OK', filterReset: 'Nullstill', - emptyText: 'Ingen data', selectAll: 'Velg alle', selectInvert: 'Inverter valg', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Avbryt', }, Transfer: { - notFoundContent: 'Ingen treff', searchPlaceholder: 'Søk her', itemUnit: 'element', itemsUnit: 'elementer', }, - Select: { - notFoundContent: 'Ingen treff', - }, Upload: { uploading: 'Laster opp...', removeFile: 'Fjern fil', uploadError: 'Feil ved opplastning', previewFile: 'Forhåndsvisning', }, + Empty: { + description: 'Ingen data', + }, }; diff --git a/components/locale-provider/ne-NP.tsx b/components/locale-provider/ne-NP.tsx index dc43d781f7..1ce88dde06 100644 --- a/components/locale-provider/ne-NP.tsx +++ b/components/locale-provider/ne-NP.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'फिल्टर मेनु', filterConfirm: 'हो', filterReset: 'रीसेट', - emptyText: 'डाटा छैन', selectAll: 'सबै छान्नुुहोस्', selectInvert: 'छनौट उल्टाउनुहोस', }, @@ -28,18 +27,17 @@ export default { }, Transfer: { titles: ['', ''], - notFoundContent: 'भेट्टिएन', searchPlaceholder: 'यहाँ खोज्नुहोस्', itemUnit: 'वस्तु', itemsUnit: 'वस्तुहरू', }, - Select: { - notFoundContent: 'भेट्टिएन', - }, Upload: { uploading: 'अपलोड गर्दै...', removeFile: 'फाइल हटाउनुहोस्', uploadError: 'अप्लोडमा समस्या भयो', previewFile: 'फाइल पूर्वावलोकन गर्नुहोस्', }, + Empty: { + description: 'डाटा छैन', + }, }; diff --git a/components/locale-provider/nl_BE.tsx b/components/locale-provider/nl_BE.tsx index 2a91054671..07ee57387e 100644 --- a/components/locale-provider/nl_BE.tsx +++ b/components/locale-provider/nl_BE.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'FilterMenu', filterConfirm: 'OK', filterReset: 'Reset', - emptyText: 'Geen gegevens', selectAll: 'Selecteer huidige pagina', selectInvert: 'Selecteer huidige pagina', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Annuleer', }, Transfer: { - notFoundContent: 'Niet gevonden', searchPlaceholder: 'Zoek hier', itemUnit: 'item', itemsUnit: 'items', }, - Select: { - notFoundContent: 'Niet gevonden', - }, Upload: { uploading: 'Uploaden...', removeFile: 'Bestand verwijderen', uploadError: 'Upload fout', previewFile: 'Preview bestand', }, + Empty: { + description: 'Geen gegevens', + }, }; diff --git a/components/locale-provider/nl_NL.tsx b/components/locale-provider/nl_NL.tsx index a779683f6c..efd333d2b1 100644 --- a/components/locale-provider/nl_NL.tsx +++ b/components/locale-provider/nl_NL.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filteren', filterConfirm: 'OK', filterReset: 'Reset', - emptyText: 'Geen gegevens', selectAll: 'Selecteer huidige pagina', selectInvert: 'Deselecteer huidige pagina', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Annuleren', }, Transfer: { - notFoundContent: 'Niet gevonden', searchPlaceholder: 'Zoeken', itemUnit: 'item', itemsUnit: 'items', }, - Select: { - notFoundContent: 'Niet gevonden', - }, Upload: { uploading: 'Uploaden...', removeFile: 'Verwijder bestand', uploadError: 'Fout tijdens uploaden', previewFile: 'Bekijk bestand', }, + Empty: { + description: 'Geen gegevens', + }, }; diff --git a/components/locale-provider/pl_PL.tsx b/components/locale-provider/pl_PL.tsx index 88b44f8bd1..2e246f7d1f 100644 --- a/components/locale-provider/pl_PL.tsx +++ b/components/locale-provider/pl_PL.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Menu filtra', filterConfirm: 'OK', filterReset: 'Wyczyść', - emptyText: 'Brak danych', selectAll: 'Zaznacz bieżącą stronę', selectInvert: 'Odwróć zaznaczenie', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Anuluj', }, Transfer: { - notFoundContent: 'Nie znaleziono', searchPlaceholder: 'Szukaj', itemUnit: 'obiekt', itemsUnit: 'obiekty', }, - Select: { - notFoundContent: 'Nie znaleziono', - }, Upload: { uploading: 'Wysyłanie...', removeFile: 'Usuń plik', uploadError: 'Błąd wysyłania', previewFile: 'Podejrzyj plik', }, + Empty: { + description: 'Brak danych', + }, }; diff --git a/components/locale-provider/pt_BR.tsx b/components/locale-provider/pt_BR.tsx index b00ac6466e..b15762ed4c 100644 --- a/components/locale-provider/pt_BR.tsx +++ b/components/locale-provider/pt_BR.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtro', filterConfirm: 'OK', filterReset: 'Resetar', - emptyText: 'Não há dados', selectAll: 'Selecionar página atual', selectInvert: 'Inverter seleção', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Cancelar', }, Transfer: { - notFoundContent: 'Não encontrado', searchPlaceholder: 'Procurar', itemUnit: 'item', itemsUnit: 'items', }, - Select: { - notFoundContent: 'Não encontrado', - }, Upload: { uploading: 'Enviando...', removeFile: 'Remover arquivo', uploadError: 'Erro no envio', previewFile: 'Visualizar arquivo', }, + Empty: { + description: 'Não há dados', + }, }; diff --git a/components/locale-provider/pt_PT.tsx b/components/locale-provider/pt_PT.tsx index 2662996976..992070ff5f 100644 --- a/components/locale-provider/pt_PT.tsx +++ b/components/locale-provider/pt_PT.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtro', filterConfirm: 'Aplicar', filterReset: 'Reiniciar', - emptyText: 'Sem resultados', selectAll: 'Selecionar página atual', selectInvert: 'Inverter seleção', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Cancelar', }, Transfer: { - notFoundContent: 'Sem resultados', searchPlaceholder: 'Procurar...', itemUnit: 'item', itemsUnit: 'itens', }, - Select: { - notFoundContent: 'Sem resultados', - }, Upload: { uploading: 'A carregar...', removeFile: 'Remover', uploadError: 'Erro ao carregar', previewFile: 'Pré-visualizar', }, + Empty: { + description: 'Sem resultados', + }, }; diff --git a/components/locale-provider/ru_RU.tsx b/components/locale-provider/ru_RU.tsx index 1f3eb5dd2c..47973441a4 100644 --- a/components/locale-provider/ru_RU.tsx +++ b/components/locale-provider/ru_RU.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Фильтр', filterConfirm: 'OK', filterReset: 'Сбросить', - emptyText: 'Нет данных', selectAll: 'Выбрать всё', selectInvert: 'Инвертировать выбор', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Отмена', }, Transfer: { - notFoundContent: 'Ничего не найдено', searchPlaceholder: 'Поиск', itemUnit: 'элем.', itemsUnit: 'элем.', }, - Select: { - notFoundContent: 'Ничего не найдено', - }, Upload: { uploading: 'Загрузка...', removeFile: 'Удалить файл', uploadError: 'При загрузке произошла ошибка', previewFile: 'Предпросмотр файла', }, + Empty: { + description: 'Нет данных', + }, }; diff --git a/components/locale-provider/sk_SK.tsx b/components/locale-provider/sk_SK.tsx index 9bb2df7108..91144adb8b 100644 --- a/components/locale-provider/sk_SK.tsx +++ b/components/locale-provider/sk_SK.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filter', filterConfirm: 'OK', filterReset: 'Obnoviť', - emptyText: 'Žiadne dáta', selectAll: 'Vybrať všetko', selectInvert: 'Vybrať opačné', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Zrušiť', }, Transfer: { - notFoundContent: 'Nenájdené', searchPlaceholder: 'Vyhľadávanie', itemUnit: 'položka', itemsUnit: 'položiek', }, - Select: { - notFoundContent: 'Nenájdené', - }, Upload: { uploading: 'Nahrávanie...', removeFile: 'Odstrániť súbor', uploadError: 'Chyba pri nahrávaní', previewFile: 'Zobraziť súbor', }, + Empty: { + description: 'Žiadne dáta', + }, }; diff --git a/components/locale-provider/sl_SI.tsx b/components/locale-provider/sl_SI.tsx index 052462ed2d..afde3cb644 100644 --- a/components/locale-provider/sl_SI.tsx +++ b/components/locale-provider/sl_SI.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filter', filterConfirm: 'Filtriraj', filterReset: 'Pobriši filter', - emptyText: 'Ni podatkov', selectAll: 'Izberi vse na trenutni strani', selectInvert: 'Obrni izbor na trenutni strani', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Prekliči', }, Transfer: { - notFoundContent: 'Ni rezultatov iskanja', searchPlaceholder: 'Išči tukaj', itemUnit: 'Objekt', itemsUnit: 'Objektov', }, - Select: { - notFoundContent: 'Ni bilo mogoče najti', - }, Upload: { uploading: 'Nalaganje...', removeFile: 'Odstrani datoteko', uploadError: 'Napaka pri nalaganju', previewFile: 'Predogled datoteke', }, + Empty: { + description: 'Ni podatkov', + }, }; diff --git a/components/locale-provider/sr_RS.tsx b/components/locale-provider/sr_RS.tsx index 7794a20538..c78c47fc58 100644 --- a/components/locale-provider/sr_RS.tsx +++ b/components/locale-provider/sr_RS.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filter', filterConfirm: 'Primeni filter', filterReset: 'Resetuj filter', - emptyText: 'Nema podataka', selectAll: 'Obeleži sve na trenutnoj strani', selectInvert: 'Obrni selekciju na trenutnoj stranici', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Otkaži', }, Transfer: { - notFoundContent: 'Nisu pronađeni rezultati pretrage', searchPlaceholder: 'Pretražite ovde', itemUnit: 'stavka', itemsUnit: 'stavki', }, - Select: { - notFoundContent: 'Nije pronađeno', - }, Upload: { uploading: 'Slanje...', removeFile: 'Ukloni fajl', uploadError: 'Greška prilikom slanja', previewFile: 'Pogledaj fajl', }, + Empty: { + description: 'Nema podataka', + }, }; diff --git a/components/locale-provider/sv_SE.tsx b/components/locale-provider/sv_SE.tsx index ffbf6cb958..c5f4a54c9a 100644 --- a/components/locale-provider/sv_SE.tsx +++ b/components/locale-provider/sv_SE.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Filtermeny', filterConfirm: 'OK', filterReset: 'Rensa', - emptyText: 'Ingen information', }, Modal: { okText: 'OK', @@ -25,12 +24,11 @@ export default { cancelText: 'Avbryt', }, Transfer: { - notFoundContent: 'Info saknas', searchPlaceholder: 'Sök', itemUnit: 'element', itemsUnit: 'element', }, - Select: { - notFoundContent: 'Info saknas', + Empty: { + description: 'Ingen information', }, }; diff --git a/components/locale-provider/th_TH.tsx b/components/locale-provider/th_TH.tsx index 6d7d464bd7..acfd1f443c 100644 --- a/components/locale-provider/th_TH.tsx +++ b/components/locale-provider/th_TH.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'ตัวกรอง', filterConfirm: 'ยืนยัน', filterReset: 'รีเซ็ต', - emptyText: 'ไม่มีข้อมูล', selectAll: 'เลือกทั้งหมดในหน้านี้', selectInvert: 'เลือกสถานะตรงกันข้าม', }, @@ -27,18 +26,17 @@ export default { cancelText: 'ยกเลิก', }, Transfer: { - notFoundContent: 'ไม่พบข้อมูล', searchPlaceholder: 'ค้นหา', itemUnit: 'ชิ้น', itemsUnit: 'ชิ้น', }, - Select: { - notFoundContent: 'ไม่พบข้อมูล', - }, Upload: { uploading: 'กำลังอัปโหลด...', removeFile: 'ลบไฟล์', uploadError: 'เกิดข้อผิดพลาดในการอัปโหลด', previewFile: 'ดูตัวอย่างไฟล์', }, + Empty: { + description: 'ไม่มีข้อมูล', + }, }; diff --git a/components/locale-provider/tr_TR.tsx b/components/locale-provider/tr_TR.tsx index 535e4ca62a..cb73abeba2 100644 --- a/components/locale-provider/tr_TR.tsx +++ b/components/locale-provider/tr_TR.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Menü Filtrele', filterConfirm: 'Tamam', filterReset: 'Sıfırla', - emptyText: 'Veri Yok', selectAll: 'Hepsini Seç', selectInvert: 'Tersini Seç', }, @@ -27,18 +26,17 @@ export default { cancelText: 'İptal', }, Transfer: { - notFoundContent: 'Bulunamadı', searchPlaceholder: 'Arama', itemUnit: 'Öğe', itemsUnit: 'Öğeler', }, - Select: { - notFoundContent: 'Bulunamadı', - }, Upload: { uploading: 'Yükleniyor...', removeFile: `Dosyayı kaldır`, uploadError: 'Yükleme Hatası', previewFile: `Dosyayı Önizle`, }, + Empty: { + description: 'Veri Yok', + }, }; diff --git a/components/locale-provider/uk_UA.tsx b/components/locale-provider/uk_UA.tsx index 313e219de7..0b418ae6f5 100644 --- a/components/locale-provider/uk_UA.tsx +++ b/components/locale-provider/uk_UA.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Фільтрувати', filterConfirm: 'OK', filterReset: 'Скинути', - emptyText: 'Даних немає', selectAll: 'Обрати всі', selectInvert: 'Інвертувати вибір', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Скасувати', }, Transfer: { - notFoundContent: 'Нічого не знайдено', searchPlaceholder: 'Введіть текст для пошуку', itemUnit: 'item', itemsUnit: 'items', }, - Select: { - notFoundContent: 'Нічого не знайдено', - }, Upload: { uploading: 'Завантаження ...', removeFile: 'Видалити файл', uploadError: 'Помилка завантаження', previewFile: 'Попередній перегляд файлу', }, + Empty: { + description: 'Даних немає', + }, }; diff --git a/components/locale-provider/vi_VN.tsx b/components/locale-provider/vi_VN.tsx index 9c64e35555..8183af7f15 100644 --- a/components/locale-provider/vi_VN.tsx +++ b/components/locale-provider/vi_VN.tsx @@ -13,7 +13,6 @@ export default { filterTitle: 'Bộ ', filterConfirm: 'OK', filterReset: 'Tạo Lại', - emptyText: 'Trống', selectAll: 'Chọn Tất Cả', selectInvert: 'Chọn Ngược Lại', }, @@ -27,18 +26,17 @@ export default { cancelText: 'Huỷ', }, Transfer: { - notFoundContent: 'Không Tìm Thấy', searchPlaceholder: 'Tìm ở đây', itemUnit: 'mục', itemsUnit: 'mục', }, - Select: { - notFoundContent: 'Không Tìm Thấy', - }, Upload: { uploading: 'Đang tải lên...', removeFile: 'Gỡ bỏ tập tin', uploadError: 'Lỗi tải lên', previewFile: 'Xem thử tập tin', }, + Empty: { + description: 'Trống', + }, }; diff --git a/components/locale-provider/zh_CN.tsx b/components/locale-provider/zh_CN.tsx index de5d4dd8ad..7bde829d10 100644 --- a/components/locale-provider/zh_CN.tsx +++ b/components/locale-provider/zh_CN.tsx @@ -17,7 +17,6 @@ export default { filterTitle: '筛选', filterConfirm: '确定', filterReset: '重置', - emptyText: '暂无数据', selectAll: '全选当页', selectInvert: '反选当页', sortTitle: '排序', @@ -32,18 +31,17 @@ export default { okText: '确定', }, Transfer: { - notFoundContent: '无匹配结果', searchPlaceholder: '请输入搜索内容', itemUnit: '项', itemsUnit: '项', }, - Select: { - notFoundContent: '无匹配结果', - }, Upload: { uploading: '文件上传中', removeFile: '删除文件', uploadError: '上传错误', previewFile: '预览文件', }, + Empty: { + description: '暂无数据', + }, }; diff --git a/components/locale-provider/zh_TW.tsx b/components/locale-provider/zh_TW.tsx index db4e7cbcc1..377010ea77 100644 --- a/components/locale-provider/zh_TW.tsx +++ b/components/locale-provider/zh_TW.tsx @@ -13,7 +13,6 @@ export default { filterTitle: '篩選器', filterConfirm: '確 定', filterReset: '重 置', - emptyText: '目前尚無資料', selectAll: '全部選取', selectInvert: '反向選取', }, @@ -27,18 +26,17 @@ export default { cancelText: '取 消', }, Transfer: { - notFoundContent: '查無此資料', searchPlaceholder: '搜尋資料', itemUnit: '項目', itemsUnit: '項目', }, - Select: { - notFoundContent: '查無此資料', - }, Upload: { uploading: '正在上傳...', removeFile: '刪除檔案', uploadError: '上傳失敗', previewFile: '檔案預覽', }, + Empty: { + description: '無此資料', + }, }; diff --git a/components/select/__tests__/index.test.js b/components/select/__tests__/index.test.js index 0bd8197fbd..f29a298f5f 100644 --- a/components/select/__tests__/index.test.js +++ b/components/select/__tests__/index.test.js @@ -33,7 +33,7 @@ describe('Select', () => { .find('MenuItem') .at(0) .text(), - ).toBe('Not Found'); + ).toBe('No Data'); }); it('should support set notFoundContent to null', () => { diff --git a/components/select/index.tsx b/components/select/index.tsx index dc34995b80..29d7b7ae1a 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -2,9 +2,7 @@ import * as React from 'react'; import * as PropTypes from 'prop-types'; import RcSelect, { Option, OptGroup } from 'rc-select'; import classNames from 'classnames'; -import LocaleReceiver from '../locale-provider/LocaleReceiver'; -import defaultLocale from '../locale-provider/default'; -import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; +import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider'; import omit from 'omit.js'; import warning from 'warning'; import Icon from '../icon'; @@ -151,13 +149,25 @@ export default class Select extends React.Component extends React.Component; } - renderSelect = (locale: SelectLocale) => ( - - {({ getPopupContainer: getContextPopupContainer, getPrefixCls }: ConfigConsumerProps) => { - const { - prefixCls: customizePrefixCls, - className = '', - size, - mode, - getPopupContainer, - removeIcon, - clearIcon, - menuItemSelectedIcon, - ...restProps - } = this.props; - const rest = omit(restProps, ['inputIcon']); - - const prefixCls = getPrefixCls('select', customizePrefixCls); - const cls = classNames( - { - [`${prefixCls}-lg`]: size === 'large', - [`${prefixCls}-sm`]: size === 'small', - }, - className, - ); - - let { optionLabelProp } = this.props; - if (this.isCombobox()) { - // children 带 dom 结构时,无法填入输入框 - optionLabelProp = optionLabelProp || 'value'; - } - - const modeConfig = { - multiple: mode === 'multiple', - tags: mode === 'tags', - combobox: this.isCombobox(), - }; - - const finalRemoveIcon = (removeIcon && - (React.isValidElement<{ className?: string }>(removeIcon) - ? React.cloneElement(removeIcon, { - className: classNames(removeIcon.props.className, `${prefixCls}-remove-icon`), - }) - : removeIcon)) || ; - - const finalClearIcon = (clearIcon && - (React.isValidElement<{ className?: string }>(clearIcon) - ? React.cloneElement(clearIcon, { - className: classNames(clearIcon.props.className, `${prefixCls}-clear-icon`), - }) - : clearIcon)) || ( - - ); - - const finalMenuItemSelectedIcon = (menuItemSelectedIcon && - (React.isValidElement<{ className?: string }>(menuItemSelectedIcon) - ? React.cloneElement(menuItemSelectedIcon, { - className: classNames( - menuItemSelectedIcon.props.className, - `${prefixCls}-selected-icon`, - ), - }) - : menuItemSelectedIcon)) || ( - - ); - - return ( - - ); - }} - - ); + renderSelect = ({ + getPopupContainer: getContextPopupContainer, + getPrefixCls, + renderEmpty, + }: ConfigConsumerProps) => { + const { + prefixCls: customizePrefixCls, + className = '', + size, + mode, + getPopupContainer, + removeIcon, + clearIcon, + menuItemSelectedIcon, + ...restProps + } = this.props; + const rest = omit(restProps, ['inputIcon']); + + const prefixCls = getPrefixCls('select', customizePrefixCls); + const cls = classNames( + { + [`${prefixCls}-lg`]: size === 'large', + [`${prefixCls}-sm`]: size === 'small', + }, + className, + ); + + let { optionLabelProp } = this.props; + if (this.isCombobox()) { + // children 带 dom 结构时,无法填入输入框 + optionLabelProp = optionLabelProp || 'value'; + } + + const modeConfig = { + multiple: mode === 'multiple', + tags: mode === 'tags', + combobox: this.isCombobox(), + }; + + const finalRemoveIcon = (removeIcon && + (React.isValidElement<{ className?: string }>(removeIcon) + ? React.cloneElement(removeIcon, { + className: classNames(removeIcon.props.className, `${prefixCls}-remove-icon`), + }) + : removeIcon)) || ; + + const finalClearIcon = (clearIcon && + (React.isValidElement<{ className?: string }>(clearIcon) + ? React.cloneElement(clearIcon, { + className: classNames(clearIcon.props.className, `${prefixCls}-clear-icon`), + }) + : clearIcon)) || ( + + ); + + const finalMenuItemSelectedIcon = (menuItemSelectedIcon && + (React.isValidElement<{ className?: string }>(menuItemSelectedIcon) + ? React.cloneElement(menuItemSelectedIcon, { + className: classNames( + menuItemSelectedIcon.props.className, + `${prefixCls}-selected-icon`, + ), + }) + : menuItemSelectedIcon)) || ; - render() { return ( - - {this.renderSelect} - + ); + }; + + render() { + return {this.renderSelect}; } } diff --git a/components/style/themes/default.less b/components/style/themes/default.less index 11f8d96181..79d661b1ce 100644 --- a/components/style/themes/default.less +++ b/components/style/themes/default.less @@ -171,7 +171,7 @@ @checkbox-border-width : @border-width-base; // Empty -@empty-size: @font-size-base; +@empty-font-size: @font-size-base; // Radio @radio-size : 16px; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 850dd731c3..bf2c07f2a3 100755 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -43,7 +43,7 @@ import { RadioChangeEvent } from '../radio'; import { CheckboxChangeEvent } from '../checkbox'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import defaultLocale from '../locale-provider/default'; -import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; +import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider'; import warning from '../_util/warning'; function noop() {} @@ -1109,15 +1109,20 @@ export default class Table extends React.Component, TableState< renderTable = ( prefixCls: string, + renderEmpty: RenderEmptyHandler, dropdownPrefixCls: string, contextLocale: TableLocale, loading: SpinProps, ) => { - const locale = { ...contextLocale, ...this.props.locale }; - const { style, className, showHeader, ...restProps } = this.props; + const { style, className, showHeader, locale, ...restProps } = this.props; const data = this.getCurrentPageData(); const expandIconAsCell = this.props.expandedRowRender && this.props.expandIconAsCell !== false; + const mergedLocale = { ...contextLocale, ...locale }; + if (!locale || !locale.emptyText) { + mergedLocale.emptyText = renderEmpty('Table'); + } + const classString = classNames({ [`${prefixCls}-${this.props.size}`]: true, [`${prefixCls}-bordered`]: this.props.bordered, @@ -1125,8 +1130,8 @@ export default class Table extends React.Component, TableState< [`${prefixCls}-without-column-header`]: !showHeader, }); - let columns = this.renderRowSelection(prefixCls, locale); - columns = this.renderColumnsDropdown(prefixCls, dropdownPrefixCls, columns, locale); + let columns = this.renderRowSelection(prefixCls, mergedLocale); + columns = this.renderColumnsDropdown(prefixCls, dropdownPrefixCls, columns, mergedLocale); columns = columns.map((column, i) => { const newColumn = { ...column }; newColumn.key = this.getColumnKey(newColumn, i); @@ -1150,12 +1155,12 @@ export default class Table extends React.Component, TableState< className={classString} expandIconColumnIndex={expandIconColumnIndex} expandIconAsCell={expandIconAsCell} - emptyText={!loading.spinning && locale.emptyText} + emptyText={!loading.spinning && mergedLocale.emptyText} /> ); }; - renderComponent = ({ getPrefixCls }: ConfigConsumerProps) => { + renderComponent = ({ getPrefixCls, renderEmpty }: ConfigConsumerProps) => { const { prefixCls: customizePrefixCls, dropdownPrefixCls: customizeDropdownPrefixCls, @@ -1175,7 +1180,7 @@ export default class Table extends React.Component, TableState< const dropdownPrefixCls = getPrefixCls('dropdown', customizeDropdownPrefixCls); const table = ( - {locale => this.renderTable(prefixCls, dropdownPrefixCls, locale, loading)} + {locale => this.renderTable(prefixCls, renderEmpty, dropdownPrefixCls, locale, loading)} ); diff --git a/components/table/__tests__/__snapshots__/demo.test.js.snap b/components/table/__tests__/__snapshots__/demo.test.js.snap index 46100b2a56..8a5df56d8e 100755 --- a/components/table/__tests__/__snapshots__/demo.test.js.snap +++ b/components/table/__tests__/__snapshots__/demo.test.js.snap @@ -125,7 +125,23 @@ exports[`renders ./components/table/demo/ajax.md correctly 1`] = `
- No data +
+
+ No Data +
+

+ No Data +

+
diff --git a/components/table/__tests__/__snapshots__/empty.test.js.snap b/components/table/__tests__/__snapshots__/empty.test.js.snap index cf9fad22cd..0c89e5c207 100644 --- a/components/table/__tests__/__snapshots__/empty.test.js.snap +++ b/components/table/__tests__/__snapshots__/empty.test.js.snap @@ -102,7 +102,23 @@ exports[`Table renders empty table 1`] = `
- No data +
+
+ No Data +
+

+ No Data +

+
@@ -357,7 +373,23 @@ exports[`Table renders empty table with fixed columns 1`] = `
- No data +
+
+ No Data +
+

+ No Data +

+
{ sorter: SorterResult, ) => void; loading?: boolean | SpinProps; - locale?: Object; + locale?: { + filterConfirm?: string; + filterReset?: string; + emptyText?: string; + }; indentSize?: number; onRowClick?: (record: T, index: number, event: Event) => void; onRow?: (record: T, index: number) => any; diff --git a/components/tag/index.tsx b/components/tag/index.tsx index a8a88cc829..38951697ec 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -116,7 +116,8 @@ class Tag extends React.Component { return closable ? : null; } - renderTag = ({ getPrefixCls }: ConfigConsumerProps) => { + renderTag = (configProps: ConfigConsumerProps) => { + const { getPrefixCls } = configProps; const { prefixCls: customizePrefixCls, children, ...otherProps } = this.props; const { visible } = this.state; const prefixCls = getPrefixCls('tag', customizePrefixCls); @@ -131,7 +132,7 @@ class Tag extends React.Component { {children} diff --git a/components/transfer/__tests__/__snapshots__/demo.test.js.snap b/components/transfer/__tests__/__snapshots__/demo.test.js.snap index d2d2ccbde5..ef6b3b4dba 100644 --- a/components/transfer/__tests__/__snapshots__/demo.test.js.snap +++ b/components/transfer/__tests__/__snapshots__/demo.test.js.snap @@ -79,7 +79,23 @@ exports[`renders ./components/transfer/demo/advanced.md correctly 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
- Not Found +
+
+ No Data +
+

+ No Data +

+
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -627,7 +675,23 @@ exports[`renders ./components/transfer/demo/custom-item.md correctly 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -679,7 +743,23 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -774,7 +854,23 @@ exports[`renders ./components/transfer/demo/large-data.md correctly 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -859,7 +955,23 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
@@ -987,7 +1099,23 @@ exports[`renders ./components/transfer/demo/search.md correctly 1`] = `
- Not Found +
+
+ No Data +
+

+ No Data +

+
diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index cee8b2a8d1..d3afc3467d 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -7,7 +7,7 @@ import Search from './search'; import warning from '../_util/warning'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import defaultLocale from '../locale-provider/default'; -import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; +import { ConfigConsumer, ConfigConsumerProps, RenderEmptyHandler } from '../config-provider'; export { TransferListProps } from './list'; export { TransferOperationProps } from './operation'; @@ -350,9 +350,11 @@ export default class Transfer extends React.Component { return direction === 'left' ? 'sourceSelectedKeys' : 'targetSelectedKeys'; } - getLocale = (transferLocale: TransferLocale) => { + getLocale = (transferLocale: TransferLocale, renderEmpty: RenderEmptyHandler) => { // Keep old locale props still working. - const oldLocale: { notFoundContent?: any; searchPlaceholder?: string } = {}; + const oldLocale: { notFoundContent?: any; searchPlaceholder?: string } = { + notFoundContent: renderEmpty('Transfer'), + }; if ('notFoundContent' in this.props) { oldLocale.notFoundContent = this.props.notFoundContent; } @@ -365,7 +367,7 @@ export default class Transfer extends React.Component { renderTransfer = (transferLocale: TransferLocale) => ( - {({ getPrefixCls }: ConfigConsumerProps) => { + {({ getPrefixCls, renderEmpty }: ConfigConsumerProps) => { const { prefixCls: customizePrefixCls, className, @@ -382,7 +384,7 @@ export default class Transfer extends React.Component { lazy, } = this.props; const prefixCls = getPrefixCls('transfer', customizePrefixCls); - const locale = this.getLocale(transferLocale); + const locale = this.getLocale(transferLocale, renderEmpty); const { leftFilter, rightFilter, sourceSelectedKeys, targetSelectedKeys } = this.state; const { leftDataSource, rightDataSource } = this.separateDataSource(this.props); diff --git a/components/transfer/style/index.less b/components/transfer/style/index.less index b0f285afed..16a8af26e0 100644 --- a/components/transfer/style/index.less +++ b/components/transfer/style/index.less @@ -129,6 +129,7 @@ top: 50%; width: 100%; margin-top: -10px; + transform: translateY(-50%); } &-footer { diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index 5f642e4853..16564e39e6 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -2,8 +2,6 @@ import * as React from 'react'; import RcTreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from 'rc-tree-select'; import classNames from 'classnames'; import { TreeSelectProps } from './interface'; -import { SelectLocale } from '../select'; -import LocaleReceiver from '../locale-provider/LocaleReceiver'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; import warning from '../_util/warning'; import Icon from '../icon'; @@ -57,75 +55,71 @@ export default class TreeSelect extends React.Component { return ; }; - renderTreeSelect = (locale: SelectLocale) => ( - - {({ getPopupContainer: getContextPopupContainer, getPrefixCls }: ConfigConsumerProps) => { - const { - prefixCls: customizePrefixCls, - className, - size, - notFoundContent, - dropdownStyle, - dropdownClassName, - suffixIcon, - getPopupContainer, - ...restProps - } = this.props; - const rest = omit(restProps, ['inputIcon', 'removeIcon', 'clearIcon', 'switcherIcon']); - - const prefixCls = getPrefixCls('select', customizePrefixCls); - const cls = classNames( - { - [`${prefixCls}-lg`]: size === 'large', - [`${prefixCls}-sm`]: size === 'small', - }, - className, - ); - - let checkable = rest.treeCheckable; - if (checkable) { - checkable = ; - } + renderTreeSelect = ({ + getPopupContainer: getContextPopupContainer, + getPrefixCls, + renderEmpty, + }: ConfigConsumerProps) => { + const { + prefixCls: customizePrefixCls, + className, + size, + notFoundContent, + dropdownStyle, + dropdownClassName, + suffixIcon, + getPopupContainer, + ...restProps + } = this.props; + const rest = omit(restProps, ['inputIcon', 'removeIcon', 'clearIcon', 'switcherIcon']); + + const prefixCls = getPrefixCls('select', customizePrefixCls); + const cls = classNames( + { + [`${prefixCls}-lg`]: size === 'large', + [`${prefixCls}-sm`]: size === 'small', + }, + className, + ); + + let checkable = rest.treeCheckable; + if (checkable) { + checkable = ; + } - const inputIcon = (suffixIcon && - (React.isValidElement<{ className?: string }>(suffixIcon) - ? React.cloneElement(suffixIcon) - : suffixIcon)) || ; - - const removeIcon = ; - - const clearIcon = ( - - ); - - return ( - - this.renderSwitcherIcon(prefixCls, nodeProps) - } - inputIcon={inputIcon} - removeIcon={removeIcon} - clearIcon={clearIcon} - {...rest} - getPopupContainer={getPopupContainer || getContextPopupContainer} - dropdownClassName={classNames(dropdownClassName, `${prefixCls}-tree-dropdown`)} - prefixCls={prefixCls} - className={cls} - dropdownStyle={{ maxHeight: '100vh', overflow: 'auto', ...dropdownStyle }} - treeCheckable={checkable} - notFoundContent={notFoundContent || locale.notFoundContent} - ref={this.saveTreeSelect} - /> - ); - }} - - ); + const inputIcon = (suffixIcon && + (React.isValidElement<{ className?: string }>(suffixIcon) + ? React.cloneElement(suffixIcon) + : suffixIcon)) || ; + + const removeIcon = ; + + const clearIcon = ( + + ); - render() { return ( - - {this.renderTreeSelect} - + + this.renderSwitcherIcon(prefixCls, nodeProps) + } + inputIcon={inputIcon} + removeIcon={removeIcon} + clearIcon={clearIcon} + {...rest} + getPopupContainer={getPopupContainer || getContextPopupContainer} + dropdownClassName={classNames(dropdownClassName, `${prefixCls}-tree-dropdown`)} + prefixCls={prefixCls} + className={cls} + dropdownStyle={{ maxHeight: '100vh', overflow: 'auto', ...dropdownStyle }} + treeCheckable={checkable} + notFoundContent={notFoundContent || renderEmpty('Select')} + ref={this.saveTreeSelect} + /> ); + }; + + render() { + return {this.renderTreeSelect}; } } diff --git a/components/tree-select/interface.tsx b/components/tree-select/interface.tsx index 4c142bdd07..ef44e298bf 100644 --- a/components/tree-select/interface.tsx +++ b/components/tree-select/interface.tsx @@ -40,6 +40,7 @@ export interface TreeSelectProps extends AbstractSelectProps { maxTagCount?: number; maxTagPlaceholder?: React.ReactNode | ((omittedValues: any[]) => React.ReactNode); multiple?: boolean; + notFoundContent?: React.ReactNode; onChange?: (value: any, label: any, extra: any) => void; onSearch?: (value: any) => void; onSelect?: (value: any) => void; diff --git a/tests/__snapshots__/index.test.js.snap b/tests/__snapshots__/index.test.js.snap index f52684ac55..b0dc6f3b84 100644 --- a/tests/__snapshots__/index.test.js.snap +++ b/tests/__snapshots__/index.test.js.snap @@ -24,6 +24,7 @@ Array [ "Divider", "Dropdown", "Drawer", + "Empty", "Form", "Icon", "Input", diff --git a/typings/custom-typings.d.ts b/typings/custom-typings.d.ts index 66d3eebd07..d397e486ba 100644 --- a/typings/custom-typings.d.ts +++ b/typings/custom-typings.d.ts @@ -1,3 +1,5 @@ +declare module '*.svg'; + declare module 'classnames'; declare module 'rc-calendar*';