ith-ui-react-antd 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/dist/IthUiClient.d.ts +2 -4
- package/dist/IthUiProvider.d.ts +7 -0
- package/dist/components/BusinessUploadAdapter.d.ts +3 -0
- package/dist/components/SearchScheme.d.ts +4 -3
- package/dist/{exceljs.min-z2QEC94Y.js → exceljs.min-DQS92vbM.js} +1 -1
- package/dist/{index-DLMx9dS9.js → index-BL6Gxhoc.js} +5177 -4888
- package/dist/index.d.ts +1 -0
- package/dist/index.js +20 -16
- package/dist/locale.d.ts +6 -0
- package/dist/runtimeId.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -19,3 +19,15 @@ ITH 新一代 React + Ant Design + TypeScript 业务组件库。
|
|
|
19
19
|
## 应用统一配置
|
|
20
20
|
|
|
21
21
|
旧组件库使用可变的 `IthUI.config` 单例。React 版本改为 Provider:应用只传一次 Token、请求头、接口基址和默认端点,组件 Props 仍可覆盖全局设置。
|
|
22
|
+
|
|
23
|
+
## 国际化
|
|
24
|
+
|
|
25
|
+
国际化沿用旧组件库 `$langTh(key, 中文回退文案, params)` 的规则。目前内置英文 `en_US`,默认语言仍是 `zh_CN`。组件固定文案会翻译,业务传入的标题、选项和接口数据保持原值;英文词条缺失时显示组件原有中文文案。
|
|
26
|
+
|
|
27
|
+
```tsx
|
|
28
|
+
<IthUiProvider config={{ ...config, locale: 'en_US' }}>
|
|
29
|
+
<App />
|
|
30
|
+
</IthUiProvider>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
需要校正英文时,直接修改 `src/locale.ts` 中导出的 `ithUiEnUS` 词条。语言支持 `en`、`en-US`、`en_US`,其余值回退为 `zh_CN`。
|
package/dist/IthUiClient.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import { LegacyAreaRequestOptions } from './components/AreaPickerAdapter';
|
|
2
2
|
import { LegacyEntityRequestOptions } from './components/EntityPickerAdapter';
|
|
3
|
+
import { LegacyUploadAdapterOptions } from './components/BusinessUploadAdapter';
|
|
3
4
|
import { LegacyRichTextUploadOptions } from './components/RichTextUploadAdapter';
|
|
4
5
|
import { EntityRecord } from './components/EntityPicker';
|
|
5
6
|
export declare function useIthUiClient(): {
|
|
6
7
|
config: import('./IthUiProvider').IthUiConfig;
|
|
7
8
|
createAreaRequest: (options?: LegacyAreaRequestOptions) => (parentValue: import('.').AreaValue | null, context: import('.').AreaLoadContext) => Promise<import('.').AreaOption[]>;
|
|
8
9
|
createEntityRequest: <T extends EntityRecord>(options: LegacyEntityRequestOptions<T>) => ({ keyword, page, pageSize, query, filters, signal }: import('.').EntityPickerRequestParams) => Promise<import('.').EntityPickerRequestResult<T>>;
|
|
9
|
-
createUploadAdapter: (options?:
|
|
10
|
-
url?: string;
|
|
11
|
-
headers?: HeadersInit;
|
|
12
|
-
}) => (file: File, signal: AbortSignal, data: Record<string, unknown>) => Promise<import('.').LegacyUploadResponse>;
|
|
10
|
+
createUploadAdapter: (options?: LegacyUploadAdapterOptions) => (file: File, signal: AbortSignal, data: Record<string, unknown>) => Promise<import('.').LegacyUploadResponse>;
|
|
13
11
|
createMultipartUploadAdapter: () => import('.').MultipartUploadAdapter;
|
|
14
12
|
createRichTextUploadAdapters: (options?: LegacyRichTextUploadOptions) => {
|
|
15
13
|
uploadImage: (file: File, signal: AbortSignal) => Promise<import('.').RichTextUploadResult>;
|
package/dist/IthUiProvider.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ export interface IthUiEndpoints {
|
|
|
10
10
|
multipartChunk?: string;
|
|
11
11
|
multipartMerge?: string;
|
|
12
12
|
richTextUpload?: string;
|
|
13
|
+
searchSchemeList?: string;
|
|
14
|
+
searchSchemeSave?: string;
|
|
15
|
+
searchSchemeRemove?: string;
|
|
13
16
|
}
|
|
14
17
|
export interface IthUiPreviewConfig {
|
|
15
18
|
enabled?: boolean;
|
|
@@ -46,6 +49,10 @@ export interface IthUiProviderProps {
|
|
|
46
49
|
}
|
|
47
50
|
export declare function IthUiProvider({ config, children }: IthUiProviderProps): import("react").JSX.Element;
|
|
48
51
|
export declare function useIthUiConfig(): IthUiConfig;
|
|
52
|
+
export declare function useIthUiLocale(): {
|
|
53
|
+
locale: import('./locale').IthUiLocale;
|
|
54
|
+
t: (key: string, fallback?: string, params?: Record<string, string | number | null | undefined>, empty?: string) => string;
|
|
55
|
+
};
|
|
49
56
|
export declare function resolveIthToken(config: IthUiConfig): Promise<string | null | undefined>;
|
|
50
57
|
export declare function resolveIthHeaders(config: IthUiConfig): Promise<Headers>;
|
|
51
58
|
export declare function resolveIthUrl(config: IthUiConfig, path: string): string;
|
|
@@ -4,6 +4,9 @@ export interface LegacyUploadAdapterOptions {
|
|
|
4
4
|
url?: string;
|
|
5
5
|
getToken?: () => string | null | undefined | Promise<string | null | undefined>;
|
|
6
6
|
headers?: HeadersInit | (() => HeadersInit | Promise<HeadersInit>);
|
|
7
|
+
tokenHeader?: string;
|
|
8
|
+
credentials?: RequestCredentials;
|
|
9
|
+
fetcher?: typeof fetch;
|
|
7
10
|
}
|
|
8
11
|
export declare function createLegacyUploadAdapter(options?: LegacyUploadAdapterOptions): (file: File, signal: AbortSignal, data: Record<string, unknown>) => Promise<LegacyUploadResponse>;
|
|
9
12
|
export interface LegacyPreviewOptions {
|
|
@@ -40,10 +40,11 @@ export interface SearchSchemeProps {
|
|
|
40
40
|
queryBizCode: string;
|
|
41
41
|
mode?: 'more' | 'scheme';
|
|
42
42
|
schemes?: SearchSchemeValue[];
|
|
43
|
+
remoteSchemes?: boolean;
|
|
43
44
|
defaultExpanded?: boolean;
|
|
44
45
|
onSearch?: (payload: SearchPayload) => void;
|
|
45
|
-
onSaveScheme?: (scheme: SearchSchemeValue) => void;
|
|
46
|
-
onDeleteScheme?: (schemeId: string) => void;
|
|
46
|
+
onSaveScheme?: (scheme: SearchSchemeValue) => Promise<void> | void;
|
|
47
|
+
onDeleteScheme?: (schemeId: string) => Promise<void> | void;
|
|
47
48
|
renderField?: (term: SearchTerm, value: SearchValue, onChange: (value: SearchValue) => void) => ReactNode;
|
|
48
49
|
}
|
|
49
|
-
export declare function SearchScheme({ terms, queryBizCode, mode, schemes, defaultExpanded, onSearch, onSaveScheme, onDeleteScheme, renderField, }: SearchSchemeProps): import("react").JSX.Element;
|
|
50
|
+
export declare function SearchScheme({ terms, queryBizCode, mode, schemes, remoteSchemes, defaultExpanded, onSearch, onSaveScheme, onDeleteScheme, renderField, }: SearchSchemeProps): import("react").JSX.Element;
|