> &
+ CommonPickerMethods;
+}
+
+// export interface PickerComponentFunc extends FunctionComponent
{
+// new (...args: ConstructorParameters>): InstanceType> &
+// CommonPickerMethods;
+// }
diff --git a/packages/components/src/DatePicker/locales/en_US.tsx b/packages/components/src/DatePicker/locales/en_US.tsx
new file mode 100644
index 00000000..45491ec0
--- /dev/null
+++ b/packages/components/src/DatePicker/locales/en_US.tsx
@@ -0,0 +1,23 @@
+import CalendarLocale from 'rc-picker/lib/locale/en_US';
+import { PickerLocale } from '../generatePicker';
+import TimePickerLocale from '../../TimePicker/locales/en_US';
+
+const locale: PickerLocale = {
+ lang: {
+ placeholder: 'Select date',
+ yearPlaceholder: 'Select year',
+ quarterPlaceholder: 'Select quarter',
+ monthPlaceholder: 'Select month',
+ weekPlaceholder: 'Select week',
+ rangePlaceholder: ['Start date', 'End date'],
+ rangeYearPlaceholder: ['Start year', 'End year'],
+ rangeMonthPlaceholder: ['Start month', 'End month'],
+ rangeWeekPlaceholder: ['Start week', 'End week'],
+ ...CalendarLocale,
+ },
+ timePickerLocale: {
+ ...TimePickerLocale,
+ },
+};
+
+export default locale;
diff --git a/packages/components/src/DatePicker/util.ts b/packages/components/src/DatePicker/util.ts
new file mode 100644
index 00000000..d8ae14af
--- /dev/null
+++ b/packages/components/src/DatePicker/util.ts
@@ -0,0 +1,53 @@
+import { PickerMode } from 'rc-picker/lib/interface';
+import { PickerLocale } from './generatePicker';
+
+export function getPlaceholder(
+ picker: PickerMode | undefined,
+ locale: PickerLocale,
+ customizePlaceholder?: string
+): string {
+ if (customizePlaceholder !== undefined) {
+ return customizePlaceholder;
+ }
+
+ if (picker === 'year' && locale.lang.yearPlaceholder) {
+ return locale.lang.yearPlaceholder;
+ }
+ if (picker === 'quarter' && locale.lang.quarterPlaceholder) {
+ return locale.lang.quarterPlaceholder;
+ }
+ if (picker === 'month' && locale.lang.monthPlaceholder) {
+ return locale.lang.monthPlaceholder;
+ }
+ if (picker === 'week' && locale.lang.weekPlaceholder) {
+ return locale.lang.weekPlaceholder;
+ }
+ if (picker === 'time' && locale.timePickerLocale.placeholder) {
+ return locale!.timePickerLocale.placeholder;
+ }
+ return locale.lang.placeholder;
+}
+
+export function getRangePlaceholder(
+ picker: PickerMode | undefined,
+ locale: PickerLocale,
+ customizePlaceholder?: [string, string]
+) {
+ if (customizePlaceholder !== undefined) {
+ return customizePlaceholder;
+ }
+
+ if (picker === 'year' && locale.lang.yearPlaceholder) {
+ return locale.lang.rangeYearPlaceholder;
+ }
+ if (picker === 'month' && locale.lang.monthPlaceholder) {
+ return locale.lang.rangeMonthPlaceholder;
+ }
+ if (picker === 'week' && locale.lang.weekPlaceholder) {
+ return locale.lang.rangeWeekPlaceholder;
+ }
+ if (picker === 'time' && locale.timePickerLocale.placeholder) {
+ return locale!.timePickerLocale.rangePlaceholder;
+ }
+ return locale.lang.rangePlaceholder;
+}
diff --git a/packages/components/src/Modal/index.tsx b/packages/components/src/Modal/index.tsx
index 408239d9..871cd14d 100644
--- a/packages/components/src/Modal/index.tsx
+++ b/packages/components/src/Modal/index.tsx
@@ -1,4 +1,4 @@
import Modal from './Modal';
-import { useModal, IModalContext } from './ModalProvider/ModalContext';
+import { useModal } from './ModalProvider/ModalContext';
-export { Modal, useModal, IModalContext };
+export { Modal, useModal };
diff --git a/packages/components/src/TimePicker/locales/en_US.tsx b/packages/components/src/TimePicker/locales/en_US.tsx
new file mode 100644
index 00000000..b13f40e2
--- /dev/null
+++ b/packages/components/src/TimePicker/locales/en_US.tsx
@@ -0,0 +1,8 @@
+import { TimePickerLocale } from '../TimePicker';
+
+const locale: TimePickerLocale = {
+ placeholder: 'Select time',
+ rangePlaceholder: ['Start time', 'End time'],
+};
+
+export default locale;
diff --git a/packages/components/src/TimePicker/locales/zh_CN.tsx b/packages/components/src/TimePicker/locales/zh_CN.tsx
new file mode 100644
index 00000000..b9e9ed32
--- /dev/null
+++ b/packages/components/src/TimePicker/locales/zh_CN.tsx
@@ -0,0 +1,8 @@
+import { TimePickerLocale } from '../TimePicker';
+
+const locale: TimePickerLocale = {
+ placeholder: '请选择时间',
+ rangePlaceholder: ['开始时间', '结束时间'],
+};
+
+export default locale;
diff --git a/packages/components/src/index.ts b/packages/components/src/index.ts
index fdb2c7d4..c0367249 100644
--- a/packages/components/src/index.ts
+++ b/packages/components/src/index.ts
@@ -25,7 +25,7 @@ export { Loading } from './Loading/Loading';
export { Input } from './Input/Input';
export { Form, FormItem, FormList, useForm } from './Form/Form';
export { default as Select } from './Select/Select';
-export { Modal, useModal, IModalContext } from './Modal';
+export { Modal, useModal } from './Modal';
export { CheckboxGroup, Checkbox } from './Checkbox/Checkbox';
export { RadioGroup, Radio } from './Radio/Radio';
export { Switch } from './Switch/Switch';
diff --git a/yarn.lock b/yarn.lock
index bbe7f6b6..f0bf64e3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5412,6 +5412,16 @@ dataloader@^1.4.0:
resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8"
integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw==
+date-fns@2.x:
+ version "2.23.0"
+ resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.23.0.tgz#4e886c941659af0cf7b30fafdd1eaa37e88788a9"
+ integrity sha512-5ycpauovVyAk0kXNZz6ZoB9AYMZB4DObse7P3BPWmyEjXNORTI8EJ6X0uaSAq4sCHzM1uajzrkr6HnsLQpxGXA==
+
+dayjs@1.x, dayjs@^1.10.7:
+ version "1.10.7"
+ resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
+ integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig==
+
dayjs@^1.10.5:
version "1.10.6"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63"
@@ -9669,6 +9679,11 @@ mkdirp@^1.0.3, mkdirp@^1.0.4:
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
+moment@^2.24.0:
+ version "2.29.1"
+ resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
+ integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
+
moo@^0.5.0:
version "0.5.1"
resolved "https://registry.yarnpkg.com/moo/-/moo-0.5.1.tgz#7aae7f384b9b09f620b6abf6f74ebbcd1b65dbc4"
@@ -11151,6 +11166,20 @@ rc-overflow@^1.0.0:
rc-resize-observer "^1.0.0"
rc-util "^5.5.1"
+rc-picker@^2.5.18:
+ version "2.5.18"
+ resolved "https://registry.yarnpkg.com/rc-picker/-/rc-picker-2.5.18.tgz#f84859815ef3f874ade689714a41151e709292c3"
+ integrity sha512-XyieTl8GOC5TeQFEvYbjx/Mtc0/CjruS7mKFT6Fy65FbGXmoFsWoWvIi+ylFx/BQHPGQi7a7vCNoZJ2TTqcZoA==
+ dependencies:
+ "@babel/runtime" "^7.10.1"
+ classnames "^2.2.1"
+ date-fns "2.x"
+ dayjs "1.x"
+ moment "^2.24.0"
+ rc-trigger "^5.0.4"
+ rc-util "^5.4.0"
+ shallowequal "^1.1.0"
+
rc-resize-observer@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/rc-resize-observer/-/rc-resize-observer-1.0.1.tgz#ccd0986543ff1bf49f8a581e8ac4bb714ed24dcd"
@@ -11194,6 +11223,15 @@ rc-util@^5.0.0, rc-util@^5.0.7, rc-util@^5.2.1, rc-util@^5.3.0, rc-util@^5.5.0,
react-is "^16.12.0"
shallowequal "^1.1.0"
+rc-util@^5.4.0:
+ version "5.14.0"
+ resolved "https://registry.yarnpkg.com/rc-util/-/rc-util-5.14.0.tgz#52c650e27570c2c47f7936c7d32eaec5212492a8"
+ integrity sha512-2vy6/Z1BJUcwLjm/UEJb/htjUTQPigITUIemCcFEo1fQevAumc9sA32x2z5qyWoa9uhrXbiAjSDpPIUqyg65sA==
+ dependencies:
+ "@babel/runtime" "^7.12.5"
+ react-is "^16.12.0"
+ shallowequal "^1.1.0"
+
rc-virtual-list@^3.2.0:
version "3.4.1"
resolved "https://registry.yarnpkg.com/rc-virtual-list/-/rc-virtual-list-3.4.1.tgz#1f3b41391acf033a6c7e84c2f4e8a4ee0dc72807"