diff --git a/components/_util/BaseMixin.js b/components/_util/BaseMixin.ts similarity index 100% rename from components/_util/BaseMixin.js rename to components/_util/BaseMixin.ts diff --git a/components/_util/BaseMixin2.js b/components/_util/BaseMixin2.ts similarity index 100% rename from components/_util/BaseMixin2.js rename to components/_util/BaseMixin2.ts diff --git a/components/_util/ContainerRender.jsx b/components/_util/ContainerRender.jsx.tsx similarity index 100% rename from components/_util/ContainerRender.jsx rename to components/_util/ContainerRender.jsx.tsx diff --git a/components/_util/FormDecoratorDirective.js b/components/_util/FormDecoratorDirective.ts similarity index 100% rename from components/_util/FormDecoratorDirective.js rename to components/_util/FormDecoratorDirective.ts diff --git a/components/_util/KeyCode.js b/components/_util/KeyCode.ts similarity index 100% rename from components/_util/KeyCode.js rename to components/_util/KeyCode.ts diff --git a/components/_util/Portal.js b/components/_util/Portal.ts similarity index 100% rename from components/_util/Portal.js rename to components/_util/Portal.ts diff --git a/components/_util/PortalWrapper.js b/components/_util/PortalWrapper.ts similarity index 100% rename from components/_util/PortalWrapper.js rename to components/_util/PortalWrapper.ts diff --git a/components/_util/StateMixin.js b/components/_util/StateMixin.ts similarity index 100% rename from components/_util/StateMixin.js rename to components/_util/StateMixin.ts diff --git a/components/_util/ant-ref.js b/components/_util/ant-ref.ts similarity index 100% rename from components/_util/ant-ref.js rename to components/_util/ant-ref.ts diff --git a/components/_util/antDirective.js b/components/_util/antDirective.ts similarity index 100% rename from components/_util/antDirective.js rename to components/_util/antDirective.ts diff --git a/components/_util/antInputDirective.js b/components/_util/antInputDirective.ts similarity index 100% rename from components/_util/antInputDirective.js rename to components/_util/antInputDirective.ts diff --git a/components/_util/callMoment.js b/components/_util/callMoment.ts similarity index 100% rename from components/_util/callMoment.js rename to components/_util/callMoment.ts diff --git a/components/_util/colors.js b/components/_util/colors.ts similarity index 100% rename from components/_util/colors.js rename to components/_util/colors.ts diff --git a/components/_util/createChainedFunction.js b/components/_util/createChainedFunction.ts similarity index 100% rename from components/_util/createChainedFunction.js rename to components/_util/createChainedFunction.ts diff --git a/components/_util/easings.js b/components/_util/easings.ts similarity index 100% rename from components/_util/easings.js rename to components/_util/easings.ts diff --git a/components/_util/env.js b/components/_util/env.ts similarity index 100% rename from components/_util/env.js rename to components/_util/env.ts diff --git a/components/_util/getLocale.js b/components/_util/getLocale.ts similarity index 100% rename from components/_util/getLocale.js rename to components/_util/getLocale.ts diff --git a/components/_util/getRequestAnimationFrame.js b/components/_util/getRequestAnimationFrame.ts similarity index 100% rename from components/_util/getRequestAnimationFrame.js rename to components/_util/getRequestAnimationFrame.ts diff --git a/components/_util/getScroll.js b/components/_util/getScroll.ts similarity index 100% rename from components/_util/getScroll.js rename to components/_util/getScroll.ts diff --git a/components/_util/getScrollBarSize.js b/components/_util/getScrollBarSize.ts similarity index 100% rename from components/_util/getScrollBarSize.js rename to components/_util/getScrollBarSize.ts diff --git a/components/_util/getTransitionProps.js b/components/_util/getTransitionProps.ts similarity index 100% rename from components/_util/getTransitionProps.js rename to components/_util/getTransitionProps.ts diff --git a/components/_util/interopDefault.js b/components/_util/interopDefault.ts similarity index 100% rename from components/_util/interopDefault.js rename to components/_util/interopDefault.ts diff --git a/components/_util/isCssAnimationSupported.js b/components/_util/isCssAnimationSupported.ts similarity index 100% rename from components/_util/isCssAnimationSupported.js rename to components/_util/isCssAnimationSupported.ts diff --git a/components/_util/isFlexSupported.js b/components/_util/isFlexSupported.ts similarity index 100% rename from components/_util/isFlexSupported.js rename to components/_util/isFlexSupported.ts diff --git a/components/_util/isNumeric.js b/components/_util/isNumeric.ts similarity index 100% rename from components/_util/isNumeric.js rename to components/_util/isNumeric.ts diff --git a/components/_util/isValid.js b/components/_util/isValid.ts similarity index 100% rename from components/_util/isValid.js rename to components/_util/isValid.ts diff --git a/components/_util/moment-util.js b/components/_util/moment-util.ts similarity index 100% rename from components/_util/moment-util.js rename to components/_util/moment-util.ts diff --git a/components/_util/openAnimation.js b/components/_util/openAnimation.ts similarity index 100% rename from components/_util/openAnimation.js rename to components/_util/openAnimation.ts diff --git a/components/_util/portalDirective.js b/components/_util/portalDirective.ts similarity index 100% rename from components/_util/portalDirective.js rename to components/_util/portalDirective.ts diff --git a/components/_util/proxyComponent.jsx b/components/_util/proxyComponent.jsx.tsx similarity index 100% rename from components/_util/proxyComponent.jsx rename to components/_util/proxyComponent.jsx.tsx diff --git a/components/_util/raf.js b/components/_util/raf.ts similarity index 100% rename from components/_util/raf.js rename to components/_util/raf.ts diff --git a/components/_util/requestAnimationTimeout.js b/components/_util/requestAnimationTimeout.ts similarity index 100% rename from components/_util/requestAnimationTimeout.js rename to components/_util/requestAnimationTimeout.ts diff --git a/components/_util/responsiveObserve.js b/components/_util/responsiveObserve.ts similarity index 100% rename from components/_util/responsiveObserve.js rename to components/_util/responsiveObserve.ts diff --git a/components/_util/scrollTo.js b/components/_util/scrollTo.ts similarity index 100% rename from components/_util/scrollTo.js rename to components/_util/scrollTo.ts diff --git a/components/_util/setStyle.js b/components/_util/setStyle.ts similarity index 100% rename from components/_util/setStyle.js rename to components/_util/setStyle.ts diff --git a/components/_util/shallowequal.js b/components/_util/shallowequal.ts similarity index 100% rename from components/_util/shallowequal.js rename to components/_util/shallowequal.ts diff --git a/components/_util/store/PropTypes.js b/components/_util/store/PropTypes.ts similarity index 100% rename from components/_util/store/PropTypes.js rename to components/_util/store/PropTypes.ts diff --git a/components/_util/store/Provider.jsx b/components/_util/store/Provider.jsx.tsx similarity index 100% rename from components/_util/store/Provider.jsx rename to components/_util/store/Provider.jsx.tsx diff --git a/components/_util/store/connect.jsx b/components/_util/store/connect.jsx.tsx similarity index 100% rename from components/_util/store/connect.jsx rename to components/_util/store/connect.jsx.tsx diff --git a/components/_util/store/create.js b/components/_util/store/create.ts similarity index 100% rename from components/_util/store/create.js rename to components/_util/store/create.ts diff --git a/components/_util/store/index.js b/components/_util/store/index.ts similarity index 100% rename from components/_util/store/index.js rename to components/_util/store/index.ts diff --git a/components/_util/styleChecker.js b/components/_util/styleChecker.ts similarity index 100% rename from components/_util/styleChecker.js rename to components/_util/styleChecker.ts diff --git a/components/_util/switchScrollingEffect.js b/components/_util/switchScrollingEffect.ts similarity index 100% rename from components/_util/switchScrollingEffect.js rename to components/_util/switchScrollingEffect.ts diff --git a/components/_util/syncWatch.js b/components/_util/syncWatch.ts similarity index 100% rename from components/_util/syncWatch.js rename to components/_util/syncWatch.ts diff --git a/components/_util/throttleByAnimationFrame.js b/components/_util/throttleByAnimationFrame.ts similarity index 100% rename from components/_util/throttleByAnimationFrame.js rename to components/_util/throttleByAnimationFrame.ts diff --git a/components/_util/transButton.jsx b/components/_util/transButton.jsx.tsx similarity index 100% rename from components/_util/transButton.jsx rename to components/_util/transButton.jsx.tsx diff --git a/components/_util/triggerEvent.js b/components/_util/triggerEvent.ts similarity index 100% rename from components/_util/triggerEvent.js rename to components/_util/triggerEvent.ts diff --git a/components/_util/type.js b/components/_util/type.ts similarity index 100% rename from components/_util/type.js rename to components/_util/type.ts diff --git a/components/_util/util.js b/components/_util/util.ts similarity index 100% rename from components/_util/util.js rename to components/_util/util.ts diff --git a/components/_util/vnode.js b/components/_util/vnode.ts similarity index 100% rename from components/_util/vnode.js rename to components/_util/vnode.ts diff --git a/components/_util/warning.js b/components/_util/warning.ts similarity index 100% rename from components/_util/warning.js rename to components/_util/warning.ts diff --git a/components/_util/wave.jsx b/components/_util/wave.jsx.tsx similarity index 100% rename from components/_util/wave.jsx rename to components/_util/wave.jsx.tsx diff --git a/components/affix/index.jsx b/components/affix/index.tsx similarity index 100% rename from components/affix/index.jsx rename to components/affix/index.tsx diff --git a/components/alert/index.jsx b/components/alert/index.tsx similarity index 100% rename from components/alert/index.jsx rename to components/alert/index.tsx diff --git a/components/empty/index.tsx b/components/empty/index.tsx index 52551959a..390ec8e90 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -1,71 +1,90 @@ -import PropTypes from '../_util/vue-types'; +import { defineComponent, CSSProperties, VNodeChild, inject, App } from 'vue'; +import classNames from 'classnames'; import { ConfigConsumerProps } from '../config-provider'; -import { getComponent } from '../_util/props-util'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; import DefaultEmptyImg from './empty'; import SimpleEmptyImg from './simple'; -export const TransferLocale = () => { - return { - description: PropTypes.string, - }; -}; +const defaultEmptyImg = ; +const simpleEmptyImg = ; -export const EmptyProps = () => { - return { - prefixCls: PropTypes.string, - image: PropTypes.any, - description: PropTypes.any, - imageStyle: PropTypes.object, - }; -}; +export interface TransferLocale { + description: string; +} -const Empty = { +export interface EmptyProps { + prefixCls?: string; + class?: string; + style?: CSSProperties; + imageStyle?: CSSProperties; + image?: VNodeChild; + description?: VNodeChild; + children?: VNodeChild; +} + +const Empty = defineComponent({ name: 'AEmpty', - props: { - ...EmptyProps(), - }, - methods: { - renderEmpty(contentLocale) { - const { prefixCls: customizePrefixCls, imageStyle } = this.$props; - const prefixCls = ConfigConsumerProps.getPrefixCls('empty', customizePrefixCls); - const image = getComponent(this, 'image') || ; - const description = getComponent(this, 'description'); + setup(props) { + const configProvider = inject('configProvider', ConfigConsumerProps); + const { getPrefixCls } = configProvider; + const { + class: className, + prefixCls: customizePrefixCls, + image = defaultEmptyImg, + description, + children, + imageStyle, + ...restProps + } = props; - const des = typeof description !== 'undefined' ? description : contentLocale.description; - const alt = typeof des === 'string' ? des : 'empty'; - const cls = { [prefixCls]: true }; - let imageNode = null; - if (typeof image === 'string') { - imageNode = ; - } else if (typeof image === 'object' && image.type?.PRESENTED_IMAGE_SIMPLE) { - const Image = image; - imageNode = ; - cls[`${prefixCls}-normal`] = true; - } else { - imageNode = image; - } - return ( - - - {imageNode} - - {des && {des}} - {this.$slots.default && } - - ); - }, + return () => ( + { + const prefixCls = getPrefixCls('empty', customizePrefixCls); + const des = typeof description !== 'undefined' ? description : locale.description; + const alt = typeof des === 'string' ? des : 'empty'; + + let imageNode: any = null; + + if (typeof image === 'string') { + imageNode = ; + } else { + imageNode = image; + } + + return ( + + + {imageNode} + + {des && {des}} + {children && } + + ) as VNodeChild; + }} + /> + ); }, render() { return ; }, -}; +}); -Empty.PRESENTED_IMAGE_DEFAULT = DefaultEmptyImg; -Empty.PRESENTED_IMAGE_SIMPLE = SimpleEmptyImg; +Empty.PRESENTED_IMAGE_DEFAULT = defaultEmptyImg; +Empty.PRESENTED_IMAGE_SIMPLE = simpleEmptyImg; /* istanbul ignore next */ -Empty.install = function(app) { +Empty.install = function(app: App) { app.component(Empty.name, Empty); }; diff --git a/components/index.js b/components/index.ts similarity index 100% rename from components/index.js rename to components/index.ts diff --git a/components/locale-provider/LocaleReceiver.tsx b/components/locale-provider/LocaleReceiver.tsx index 843417348..41261d20d 100644 --- a/components/locale-provider/LocaleReceiver.tsx +++ b/components/locale-provider/LocaleReceiver.tsx @@ -1,14 +1,18 @@ -import { inject } from 'vue'; -import PropTypes from '../_util/vue-types'; +import { inject, defineComponent, VNode, VNodeChild } from 'vue'; import defaultLocaleData from './default'; -export default { +export interface LocaleReceiverProps { + componentName?: string; + defaultLocale?: object | Function; + children: (locale: object, localeCode?: string, fullLocale?: object) => VNodeChild; +} + +interface LocaleInterface { + [key: string]: any; +} + +export default defineComponent({ name: 'LocaleReceiver', - props: { - componentName: PropTypes.string.def('global'), - defaultLocale: PropTypes.oneOfType([PropTypes.object, PropTypes.func]), - children: PropTypes.func, - }, setup() { return { localeData: inject('localeData', {}), @@ -16,8 +20,9 @@ export default { }, methods: { getLocale() { - const { componentName, defaultLocale } = this; - const locale = defaultLocale || defaultLocaleData[componentName || 'global']; + const { componentName = 'global', defaultLocale } = this; + const locale = + defaultLocale || (defaultLocaleData as LocaleInterface)[componentName || 'global']; const { antLocale } = this.localeData; const localeFromContext = componentName && antLocale ? antLocale[componentName] : {}; @@ -43,4 +48,4 @@ export default { const { antLocale } = this.localeData; return children?.(this.getLocale(), this.getLocaleCode(), antLocale); }, -}; +}); diff --git a/components/locale-provider/ar_EG.js b/components/locale-provider/ar_EG.ts similarity index 100% rename from components/locale-provider/ar_EG.js rename to components/locale-provider/ar_EG.ts diff --git a/components/locale-provider/bg_BG.js b/components/locale-provider/bg_BG.ts similarity index 100% rename from components/locale-provider/bg_BG.js rename to components/locale-provider/bg_BG.ts diff --git a/components/locale-provider/ca_ES.js b/components/locale-provider/ca_ES.ts similarity index 100% rename from components/locale-provider/ca_ES.js rename to components/locale-provider/ca_ES.ts diff --git a/components/locale-provider/cs_CZ.js b/components/locale-provider/cs_CZ.ts similarity index 100% rename from components/locale-provider/cs_CZ.js rename to components/locale-provider/cs_CZ.ts diff --git a/components/locale-provider/da_DK.js b/components/locale-provider/da_DK.ts similarity index 100% rename from components/locale-provider/da_DK.js rename to components/locale-provider/da_DK.ts diff --git a/components/locale-provider/de_DE.js b/components/locale-provider/de_DE.ts similarity index 100% rename from components/locale-provider/de_DE.js rename to components/locale-provider/de_DE.ts diff --git a/components/locale-provider/el_GR.js b/components/locale-provider/el_GR.ts similarity index 100% rename from components/locale-provider/el_GR.js rename to components/locale-provider/el_GR.ts diff --git a/components/locale-provider/en_GB.js b/components/locale-provider/en_GB.ts similarity index 100% rename from components/locale-provider/en_GB.js rename to components/locale-provider/en_GB.ts diff --git a/components/locale-provider/en_US.js b/components/locale-provider/en_US.ts similarity index 100% rename from components/locale-provider/en_US.js rename to components/locale-provider/en_US.ts diff --git a/components/locale-provider/es_ES.js b/components/locale-provider/es_ES.ts similarity index 100% rename from components/locale-provider/es_ES.js rename to components/locale-provider/es_ES.ts diff --git a/components/locale-provider/et_EE.js b/components/locale-provider/et_EE.ts similarity index 100% rename from components/locale-provider/et_EE.js rename to components/locale-provider/et_EE.ts diff --git a/components/locale-provider/fa_IR.js b/components/locale-provider/fa_IR.ts similarity index 100% rename from components/locale-provider/fa_IR.js rename to components/locale-provider/fa_IR.ts diff --git a/components/locale-provider/fi_FI.js b/components/locale-provider/fi_FI.ts similarity index 100% rename from components/locale-provider/fi_FI.js rename to components/locale-provider/fi_FI.ts diff --git a/components/locale-provider/fr_BE.js b/components/locale-provider/fr_BE.ts similarity index 100% rename from components/locale-provider/fr_BE.js rename to components/locale-provider/fr_BE.ts diff --git a/components/locale-provider/fr_FR.js b/components/locale-provider/fr_FR.ts similarity index 100% rename from components/locale-provider/fr_FR.js rename to components/locale-provider/fr_FR.ts diff --git a/components/locale-provider/he_IL.js b/components/locale-provider/he_IL.ts similarity index 100% rename from components/locale-provider/he_IL.js rename to components/locale-provider/he_IL.ts diff --git a/components/locale-provider/hi_IN.js b/components/locale-provider/hi_IN.ts similarity index 100% rename from components/locale-provider/hi_IN.js rename to components/locale-provider/hi_IN.ts diff --git a/components/locale-provider/hr_HR.js b/components/locale-provider/hr_HR.ts similarity index 100% rename from components/locale-provider/hr_HR.js rename to components/locale-provider/hr_HR.ts diff --git a/components/locale-provider/hu_HU.js b/components/locale-provider/hu_HU.ts similarity index 100% rename from components/locale-provider/hu_HU.js rename to components/locale-provider/hu_HU.ts diff --git a/components/locale-provider/hy_AM.js b/components/locale-provider/hy_AM.ts similarity index 100% rename from components/locale-provider/hy_AM.js rename to components/locale-provider/hy_AM.ts diff --git a/components/locale-provider/id_ID.js b/components/locale-provider/id_ID.ts similarity index 100% rename from components/locale-provider/id_ID.js rename to components/locale-provider/id_ID.ts diff --git a/components/locale-provider/index.jsx b/components/locale-provider/index.tsx similarity index 68% rename from components/locale-provider/index.jsx rename to components/locale-provider/index.tsx index fa7787aca..48c3a68e7 100644 --- a/components/locale-provider/index.jsx +++ b/components/locale-provider/index.tsx @@ -1,25 +1,33 @@ -import { provide } from 'vue'; +import { provide, App, defineComponent, VNode } from 'vue'; import PropTypes from '../_util/vue-types'; import * as moment from 'moment'; import interopDefault from '../_util/interopDefault'; -import { changeConfirmLocale } from '../modal/locale'; +import { ModalLocale, changeConfirmLocale } from '../modal/locale'; import warning from '../_util/warning'; import { getSlot } from '../_util/props-util'; -// export interface Locale { -// locale: string; -// Pagination?: Object; -// DatePicker?: Object; -// TimePicker?: Object; -// Calendar?: Object; -// Table?: Object; -// Modal?: ModalLocale; -// Popconfirm?: Object; -// Transfer?: Object; -// Select?: Object; -// Upload?: Object; -// } +export interface Locale { + locale: string; + Pagination?: Object; + DatePicker?: Object; + TimePicker?: Object; + Calendar?: Object; + Table?: Object; + Modal?: ModalLocale; + Popconfirm?: Object; + Transfer?: Object; + Select?: Object; + Upload?: Object; +} + +export interface LocaleProviderProps { + locale: Locale; + children?: VNode | VNode[]; + _ANT_MARK__?: string; +} + export const ANT_MARK = 'internalMark'; -function setMomentLocale(locale) { + +function setMomentLocale(locale?: Locale) { if (locale && locale.locale) { interopDefault(moment).locale(locale.locale); } else { @@ -27,7 +35,7 @@ function setMomentLocale(locale) { } } -const LocaleProvider = { +const LocaleProvider = defineComponent({ name: 'ALocaleProvider', props: { locale: PropTypes.object.def(() => ({})), @@ -68,10 +76,10 @@ const LocaleProvider = { render() { return getSlot(this); }, -}; +}); /* istanbul ignore next */ -LocaleProvider.install = function(app) { +LocaleProvider.install = function(app: App) { app.component(LocaleProvider.name, LocaleProvider); }; diff --git a/components/locale-provider/is_IS.js b/components/locale-provider/is_IS.ts similarity index 100% rename from components/locale-provider/is_IS.js rename to components/locale-provider/is_IS.ts diff --git a/components/locale-provider/it_IT.js b/components/locale-provider/it_IT.ts similarity index 100% rename from components/locale-provider/it_IT.js rename to components/locale-provider/it_IT.ts diff --git a/components/locale-provider/ja_JP.js b/components/locale-provider/ja_JP.ts similarity index 100% rename from components/locale-provider/ja_JP.js rename to components/locale-provider/ja_JP.ts diff --git a/components/locale-provider/kn_IN.js b/components/locale-provider/kn_IN.ts similarity index 100% rename from components/locale-provider/kn_IN.js rename to components/locale-provider/kn_IN.ts diff --git a/components/locale-provider/ko_KR.js b/components/locale-provider/ko_KR.ts similarity index 100% rename from components/locale-provider/ko_KR.js rename to components/locale-provider/ko_KR.ts diff --git a/components/locale-provider/ku_IQ.js b/components/locale-provider/ku_IQ.ts similarity index 100% rename from components/locale-provider/ku_IQ.js rename to components/locale-provider/ku_IQ.ts diff --git a/components/locale-provider/lv_LV.js b/components/locale-provider/lv_LV.ts similarity index 100% rename from components/locale-provider/lv_LV.js rename to components/locale-provider/lv_LV.ts diff --git a/components/locale-provider/mk_MK.js b/components/locale-provider/mk_MK.ts similarity index 100% rename from components/locale-provider/mk_MK.js rename to components/locale-provider/mk_MK.ts diff --git a/components/locale-provider/mn_MN.js b/components/locale-provider/mn_MN.ts similarity index 100% rename from components/locale-provider/mn_MN.js rename to components/locale-provider/mn_MN.ts diff --git a/components/locale-provider/ms_MY.js b/components/locale-provider/ms_MY.ts similarity index 100% rename from components/locale-provider/ms_MY.js rename to components/locale-provider/ms_MY.ts diff --git a/components/locale-provider/nb_NO.js b/components/locale-provider/nb_NO.ts similarity index 100% rename from components/locale-provider/nb_NO.js rename to components/locale-provider/nb_NO.ts diff --git a/components/locale-provider/ne-NP.js b/components/locale-provider/ne-NP.ts similarity index 100% rename from components/locale-provider/ne-NP.js rename to components/locale-provider/ne-NP.ts diff --git a/components/locale-provider/ne_NP.js b/components/locale-provider/ne_NP.ts similarity index 100% rename from components/locale-provider/ne_NP.js rename to components/locale-provider/ne_NP.ts diff --git a/components/locale-provider/nl_BE.js b/components/locale-provider/nl_BE.ts similarity index 100% rename from components/locale-provider/nl_BE.js rename to components/locale-provider/nl_BE.ts diff --git a/components/locale-provider/nl_NL.js b/components/locale-provider/nl_NL.ts similarity index 100% rename from components/locale-provider/nl_NL.js rename to components/locale-provider/nl_NL.ts diff --git a/components/locale-provider/pl_PL.js b/components/locale-provider/pl_PL.ts similarity index 100% rename from components/locale-provider/pl_PL.js rename to components/locale-provider/pl_PL.ts diff --git a/components/locale-provider/pt_BR.js b/components/locale-provider/pt_BR.ts similarity index 100% rename from components/locale-provider/pt_BR.js rename to components/locale-provider/pt_BR.ts diff --git a/components/locale-provider/pt_PT.js b/components/locale-provider/pt_PT.ts similarity index 100% rename from components/locale-provider/pt_PT.js rename to components/locale-provider/pt_PT.ts diff --git a/components/locale-provider/ro_RO.js b/components/locale-provider/ro_RO.ts similarity index 100% rename from components/locale-provider/ro_RO.js rename to components/locale-provider/ro_RO.ts diff --git a/components/locale-provider/ru_RU.js b/components/locale-provider/ru_RU.ts similarity index 100% rename from components/locale-provider/ru_RU.js rename to components/locale-provider/ru_RU.ts diff --git a/components/locale-provider/sk_SK.js b/components/locale-provider/sk_SK.ts similarity index 100% rename from components/locale-provider/sk_SK.js rename to components/locale-provider/sk_SK.ts diff --git a/components/locale-provider/sl_SI.js b/components/locale-provider/sl_SI.ts similarity index 100% rename from components/locale-provider/sl_SI.js rename to components/locale-provider/sl_SI.ts diff --git a/components/locale-provider/sr_RS.js b/components/locale-provider/sr_RS.ts similarity index 100% rename from components/locale-provider/sr_RS.js rename to components/locale-provider/sr_RS.ts diff --git a/components/locale-provider/sv_SE.js b/components/locale-provider/sv_SE.ts similarity index 100% rename from components/locale-provider/sv_SE.js rename to components/locale-provider/sv_SE.ts diff --git a/components/locale-provider/ta_IN.js b/components/locale-provider/ta_IN.ts similarity index 100% rename from components/locale-provider/ta_IN.js rename to components/locale-provider/ta_IN.ts diff --git a/components/locale-provider/th_TH.js b/components/locale-provider/th_TH.ts similarity index 100% rename from components/locale-provider/th_TH.js rename to components/locale-provider/th_TH.ts diff --git a/components/locale-provider/tr_TR.js b/components/locale-provider/tr_TR.ts similarity index 100% rename from components/locale-provider/tr_TR.js rename to components/locale-provider/tr_TR.ts diff --git a/components/locale-provider/uk_UA.js b/components/locale-provider/uk_UA.ts similarity index 100% rename from components/locale-provider/uk_UA.js rename to components/locale-provider/uk_UA.ts diff --git a/components/locale-provider/vi_VN.js b/components/locale-provider/vi_VN.ts similarity index 100% rename from components/locale-provider/vi_VN.js rename to components/locale-provider/vi_VN.ts diff --git a/components/locale-provider/zh_CN.js b/components/locale-provider/zh_CN.ts similarity index 100% rename from components/locale-provider/zh_CN.js rename to components/locale-provider/zh_CN.ts diff --git a/components/locale-provider/zh_TW.js b/components/locale-provider/zh_TW.ts similarity index 100% rename from components/locale-provider/zh_TW.js rename to components/locale-provider/zh_TW.ts diff --git a/components/locale/default.ts b/components/locale/default.ts index 1d9655ef4..fb35a9563 100644 --- a/components/locale/default.ts +++ b/components/locale/default.ts @@ -2,7 +2,7 @@ import Pagination from '../vc-pagination/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 ColorPicker from '../color-picker/locale/en_US'; +// import ColorPicker from '../color-picker/locale/en_US'; export default { locale: 'en', @@ -10,7 +10,7 @@ export default { DatePicker, TimePicker, Calendar, - ColorPicker, + // ColorPicker, global: { placeholder: 'Please select', }, diff --git a/components/modal/ActionButton.jsx b/components/modal/ActionButton.tsx similarity index 100% rename from components/modal/ActionButton.jsx rename to components/modal/ActionButton.tsx diff --git a/components/modal/ConfirmDialog.jsx b/components/modal/ConfirmDialog.tsx similarity index 100% rename from components/modal/ConfirmDialog.jsx rename to components/modal/ConfirmDialog.tsx diff --git a/components/modal/Modal.jsx b/components/modal/Modal.tsx similarity index 100% rename from components/modal/Modal.jsx rename to components/modal/Modal.tsx diff --git a/components/modal/confirm.js b/components/modal/confirm.ts similarity index 100% rename from components/modal/confirm.js rename to components/modal/confirm.ts diff --git a/components/modal/index.js b/components/modal/index.ts similarity index 100% rename from components/modal/index.js rename to components/modal/index.ts diff --git a/components/modal/locale.js b/components/modal/locale.ts similarity index 67% rename from components/modal/locale.js rename to components/modal/locale.ts index 8eb9d0e90..da0ef17d1 100644 --- a/components/modal/locale.js +++ b/components/modal/locale.ts @@ -1,16 +1,16 @@ import defaultLocale from '../locale/default'; -// export interface ModalLocale { -// okText: string; -// cancelText: string; -// justOkText: string; -// } +export interface ModalLocale { + okText: string; + cancelText: string; + justOkText: string; +} let runtimeLocale = { ...defaultLocale.Modal, }; -export function changeConfirmLocale(newLocale) { +export function changeConfirmLocale(newLocale?: any) { if (newLocale) { runtimeLocale = { ...runtimeLocale,
{des}