You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.5 KiB

import type { ValidateMessages } from 'rc-field-form/lib/interface';
import * as React from 'react';
import warning from '../_util/warning';
import type { PickerLocale as DatePickerLocale } from '../date-picker/generatePicker';
import type { TransferLocale as TransferLocaleForEmpty } from '../empty';
import type { ModalLocale } from '../modal/locale';
[new component] Next tour (#37867) * feat: init * feat: update * feat: upate * feat: update * feat: update * feat: init * feat: init * feat: init * feat: update * feat: update * feat: update * feat: update rc-tour * feat: init component * feat: init component * chore: update pck * doc: update doc * doc: update reviewer * doc: update reviewer * doc: update reviewer * feat: update reviewer * feat: update reviewer * feat: update doc * feat: update deme * feat: update demo doc * feat: update demo * feat: update demo * feat: update style * feat: update dom & style * feat: update dome * feat: update dome * docs: update demo * feat: update doc * feat: update dome * feat: add locale * doc: update locale * doc: add test * feat: add test case * feat: add test case * feat: update package * feat: update ts * feat: update ts * feat: update snapshots * feat: update demo * feat: update demo * feat: update demo * feat: edit maxSize * feat: edit maxSize * feat: update lint * feat: update lint * feat: update style reviewer * feat: update style * feat: merge next * feat: add locale * feat: reset bundleSize * feat: change maxSize * feat: update test coverage * feat: update test coverage * feat: add type * chore: simplify en locale * feat: update * feat: update test snap * docs: demo update * chore: adjust style * chore: adjust style * chore: bump rc-tour * Update package.json * feat: update package * feat: update package * feat: update cover * docs: update api * docs: update overview snap * feat: update token * feat: delete repeat ts * feat: remove finishButtonProps * chore: update demo * feat: tour style * test: fix lint * chore: code clean Co-authored-by: lijianan <574980606@qq.com> Co-authored-by: 二货机器人 <smith3816@gmail.com> Co-authored-by: MadCcc <1075746765@qq.com>
2 years ago
import type { TourLocale } from '../tour/interface';
import { changeConfirmLocale } from '../modal/locale';
import type { PaginationLocale } from '../pagination/Pagination';
import type { PopconfirmLocale } from '../popconfirm/PurePanel';
import type { TableLocale } from '../table/interface';
import type { TransferLocale } from '../transfer';
import type { UploadLocale } from '../upload/interface';
import type { LocaleContextProps } from './context';
import LocaleContext from './context';
export const ANT_MARK = 'internalMark';
export interface Locale {
locale: string;
Pagination?: PaginationLocale;
DatePicker?: DatePickerLocale;
TimePicker?: Record<string, any>;
Calendar?: Record<string, any>;
Table?: TableLocale;
Modal?: ModalLocale;
[new component] Next tour (#37867) * feat: init * feat: update * feat: upate * feat: update * feat: update * feat: init * feat: init * feat: init * feat: update * feat: update * feat: update * feat: update rc-tour * feat: init component * feat: init component * chore: update pck * doc: update doc * doc: update reviewer * doc: update reviewer * doc: update reviewer * feat: update reviewer * feat: update reviewer * feat: update doc * feat: update deme * feat: update demo doc * feat: update demo * feat: update demo * feat: update style * feat: update dom &amp; style * feat: update dome * feat: update dome * docs: update demo * feat: update doc * feat: update dome * feat: add locale * doc: update locale * doc: add test * feat: add test case * feat: add test case * feat: update package * feat: update ts * feat: update ts * feat: update snapshots * feat: update demo * feat: update demo * feat: update demo * feat: edit maxSize * feat: edit maxSize * feat: update lint * feat: update lint * feat: update style reviewer * feat: update style * feat: merge next * feat: add locale * feat: reset bundleSize * feat: change maxSize * feat: update test coverage * feat: update test coverage * feat: add type * chore: simplify en locale * feat: update * feat: update test snap * docs: demo update * chore: adjust style * chore: adjust style * chore: bump rc-tour * Update package.json * feat: update package * feat: update package * feat: update cover * docs: update api * docs: update overview snap * feat: update token * feat: delete repeat ts * feat: remove finishButtonProps * chore: update demo * feat: tour style * test: fix lint * chore: code clean Co-authored-by: lijianan &lt;574980606@qq.com&gt; Co-authored-by: 二货机器人 &lt;smith3816@gmail.com&gt; Co-authored-by: MadCcc &lt;1075746765@qq.com&gt;
2 years ago
Tour?: TourLocale;
Popconfirm?: PopconfirmLocale;
Transfer?: TransferLocale;
Select?: Record<string, any>;
Upload?: UploadLocale;
Empty?: TransferLocaleForEmpty;
global?: Record<string, any>;
PageHeader?: { back: string };
Icon?: Record<string, any>;
Text?: {
edit?: any;
copy?: any;
copied?: any;
expand?: any;
};
Form?: {
optional?: string;
defaultValidateMessages: ValidateMessages;
};
Image?: {
preview: string;
};
feat: New Component QRCode (#38948) * feat: qrcode * chore: code clean * feat: New Component Qr-Code (#38891) * feat: QrCode * fix * fix * fix: fix bug * fix: fix bug * fix * fix * fix * delete * delete * test case * fix lint * bundlesize * demo * fix: fix test * remove dep * update snap * en docs * refactor: rename tests dir * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/base.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/download.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qr-code/demo/logo.md Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * rename * fix * adjust text * rename * fix title * rename * rename * fix: snap * fix * bundlesize * update demo * update docs * add demo * add docs * add docs * test: add warning * update demo * bundlesize * update test case * update demo * feat: add onRefresh、add status * fix: fix demo * fix: fix demo * add locale * add locale * add test case * update snap * fix demo * update demo * update demo * update demo * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/interface.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * Update components/qrcode/style/index.ts Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * Update components/qrcode/index.tsx Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; * fix * fix * fix * add decs * fix * fix * fix type * fix * fix demo * fix lint * fix lint * add test case for bordered * prettier-ignore Co-authored-by: MadCcc &lt;1075746765@qq.com&gt; Co-authored-by: 栗嘉男 &lt;lijianan@lijianandeMacBook-Pro.local&gt;
2 years ago
QRCode?: {
expired: string;
refresh: string;
};
}
export interface LocaleProviderProps {
locale: Locale;
6 years ago
children?: React.ReactNode;
/** @internal */
_ANT_MARK__?: string;
}
const LocaleProvider: React.FC<LocaleProviderProps> = (props) => {
const { locale = {} as Locale, children, _ANT_MARK__ } = props;
if (process.env.NODE_ENV !== 'production') {
warning(
_ANT_MARK__ === ANT_MARK,
'LocaleProvider',
'`LocaleProvider` is deprecated. Please use `locale` with `ConfigProvider` instead: http://u.ant.design/locale',
);
}
React.useEffect(() => {
changeConfirmLocale(locale && locale.Modal);
return () => {
changeConfirmLocale();
};
}, [locale]);
const getMemoizedContextValue = React.useMemo<LocaleContextProps>(
() => ({ ...locale, exist: true }),
[locale],
);
return (
<LocaleContext.Provider value={getMemoizedContextValue}>{children}</LocaleContext.Provider>
);
};
export default LocaleProvider;