@harbor-design/proform 1.4.19 → 1.4.21
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/dist/index.js +461 -381
- package/dist/types/src/services/Context/index.d.ts +15 -1
- package/dist/types/src/services/RuntimeCore/index.d.ts +1 -0
- package/dist/types/src/types/contextTypes.d.ts +19 -0
- package/dist/types/src/types/formCustomizerTypes.d.ts +1 -0
- package/package.json +1 -1
- package/CHANGELOG.md +0 -829
|
@@ -1,6 +1,20 @@
|
|
|
1
|
-
import { FormPresets, UIName } from "../../types";
|
|
1
|
+
import { FormPresets, ProFormLocalePack, UIName } from "../../types";
|
|
2
2
|
export default class Context {
|
|
3
3
|
static presets: FormPresets;
|
|
4
|
+
static localePackCache: Record<string, ProFormLocalePack>;
|
|
5
|
+
static localePackPromiseCache: Map<string, Promise<ProFormLocalePack | undefined>>;
|
|
6
|
+
static internalI18nVersion: import("vue").Ref<number>;
|
|
7
|
+
static setPresets(presets: FormPresets): void;
|
|
4
8
|
static getPreset(ui: UIName): import("../../types").FormPreset | undefined;
|
|
5
9
|
static getUI(ui: UIName): UIName;
|
|
10
|
+
static getI18nConfig(): any;
|
|
11
|
+
static getCurrentLocale(): any;
|
|
12
|
+
static getLocalePack(locale?: any): ProFormLocalePack | undefined;
|
|
13
|
+
static ensureLocalePackLoaded(locale?: any): Promise<any>;
|
|
14
|
+
static formatTemplate(template: string, values: Record<string, string | number | undefined>): string;
|
|
15
|
+
static translateMessage(message?: string): string;
|
|
16
|
+
static translateLabel(label?: string): any;
|
|
17
|
+
static buildRequiredMessage(label?: string): string;
|
|
18
|
+
static buildPlaceholder(componentName: string | undefined, label?: string, defaultPrefixMap?: Record<string, string>): string;
|
|
19
|
+
static applyPlaceholderTemplate(prefix: string, label: string): string;
|
|
6
20
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AdaptedInterface, DisplayOptions, NativeCustomizationOptions } from ".";
|
|
2
|
+
import type { Ref } from "vue";
|
|
2
3
|
import { AnyObject } from "./utilTypes";
|
|
3
4
|
export type DomType = new (...args: any) => AnyObject & {
|
|
4
5
|
$props: AnyObject;
|
|
@@ -17,9 +18,27 @@ export interface FormPreset {
|
|
|
17
18
|
native?: NativeCustomizationOptions;
|
|
18
19
|
display?: DisplayOptions;
|
|
19
20
|
}
|
|
21
|
+
export interface ProFormLocalePack {
|
|
22
|
+
messages?: Record<string, string>;
|
|
23
|
+
placeholderPrefixByComponentName?: Record<string, string>;
|
|
24
|
+
templates?: {
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
required?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface ProFormI18nOptions {
|
|
30
|
+
localeRef: Ref<string>;
|
|
31
|
+
versionRef?: Ref<number>;
|
|
32
|
+
loadLocalePack?: (locale: string) => Promise<ProFormLocalePack>;
|
|
33
|
+
translateLabel?: (label: string, context: {
|
|
34
|
+
locale: string;
|
|
35
|
+
pack?: ProFormLocalePack;
|
|
36
|
+
}) => string;
|
|
37
|
+
}
|
|
20
38
|
export type UIName = "ArcoVue" | "NutUI" | "NaiveUI" | (string & {});
|
|
21
39
|
export type AdaptedInterfacePreset = Record<UIName, AdaptedInterface>;
|
|
22
40
|
export type FormPresets = {
|
|
23
41
|
ui: UIName;
|
|
24
42
|
uiPresets: Partial<Record<UIName, FormPreset>>;
|
|
43
|
+
i18n?: any;
|
|
25
44
|
};
|