@nocobase/client 1.7.1 → 1.8.0-alpha.2
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/es/application/Application.d.ts +38 -0
- package/es/flag-provider/FlagProvider.d.ts +4 -0
- package/es/hooks/useParsedValue.d.ts +1 -0
- package/es/index.mjs +1158 -844
- package/es/plugin-manager/PinnedPluginListProvider.d.ts +3 -1
- package/es/schema-component/antd/page/usePopupContextInActionOrAssociationField.d.ts +2 -0
- package/es/schema-component/antd/password/Password.d.ts +1 -0
- package/es/schema-settings/LinkageRules/bindLinkageRulesToFiled.d.ts +3 -0
- package/es/schema-settings/VariableInput/VariableInput.d.ts +1 -1
- package/es/schema-settings/VariableInput/hooks/index.d.ts +1 -0
- package/es/schema-settings/VariableInput/hooks/useSystemSettingsVariable.d.ts +28 -0
- package/es/schema-settings/VariableInput/hooks/useVariableOptions.d.ts +1 -54
- package/es/variables/VariableScope.d.ts +17 -0
- package/es/variables/hooks/useLocalVariablesWithoutCustomVariable.d.ts +16 -0
- package/es/variables/index.d.ts +2 -0
- package/lib/index.js +73 -73
- package/lib/locale/de-DE.js +2 -1
- package/lib/locale/en-US.js +2 -1
- package/lib/locale/es-ES.js +2 -1
- package/lib/locale/fr-FR.js +2 -1
- package/lib/locale/it-IT.js +5 -1
- package/lib/locale/ja-JP.js +2 -1
- package/lib/locale/ko-KR.js +2 -1
- package/lib/locale/nl-NL.js +2 -1
- package/lib/locale/pt-BR.js +5 -1
- package/lib/locale/ru-RU.js +5 -1
- package/lib/locale/tr-TR.js +5 -1
- package/lib/locale/uk-UA.js +5 -1
- package/lib/locale/zh-CN.js +1 -0
- package/lib/locale/zh-TW.js +5 -1
- package/package.json +5 -5
|
@@ -54,6 +54,30 @@ export interface ApplicationOptions {
|
|
|
54
54
|
dataSourceManager?: DataSourceManagerOptions;
|
|
55
55
|
disableAcl?: boolean;
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Reference: https://ant.design/components/cascader-cn#option
|
|
59
|
+
*/
|
|
60
|
+
interface VariableOption {
|
|
61
|
+
/** Unique identifier of the variable */
|
|
62
|
+
value: string | number;
|
|
63
|
+
/** Variable name displayed in UI */
|
|
64
|
+
label?: React.ReactNode;
|
|
65
|
+
disabled?: boolean;
|
|
66
|
+
children?: VariableOption[];
|
|
67
|
+
}
|
|
68
|
+
interface Variable {
|
|
69
|
+
/** Unique identifier of the variable */
|
|
70
|
+
name: string;
|
|
71
|
+
/** Variable configuration options */
|
|
72
|
+
useOption: () => ({
|
|
73
|
+
option: VariableOption;
|
|
74
|
+
visible?: boolean;
|
|
75
|
+
});
|
|
76
|
+
/** Variable context */
|
|
77
|
+
useCtx: () => (any | ((param: {
|
|
78
|
+
variableName: string;
|
|
79
|
+
}) => Promise<any>));
|
|
80
|
+
}
|
|
57
81
|
export declare class Application {
|
|
58
82
|
protected options: ApplicationOptions;
|
|
59
83
|
eventBus: EventTarget;
|
|
@@ -83,6 +107,7 @@ export declare class Application {
|
|
|
83
107
|
error: any;
|
|
84
108
|
hasLoadError: boolean;
|
|
85
109
|
private wsAuthorized;
|
|
110
|
+
private variables;
|
|
86
111
|
get pm(): PluginManager;
|
|
87
112
|
get disableAcl(): boolean;
|
|
88
113
|
get isWsAuthorized(): boolean;
|
|
@@ -149,5 +174,18 @@ export declare class Application {
|
|
|
149
174
|
addUserCenterSettingsItem(item: SchemaSettingsItemType & {
|
|
150
175
|
aclSnippet?: string;
|
|
151
176
|
}): void;
|
|
177
|
+
/**
|
|
178
|
+
* Register a variable for use in the frontend
|
|
179
|
+
*
|
|
180
|
+
* Note: It is not recommended to register variables in components as it may cause rendering errors
|
|
181
|
+
* @param variable
|
|
182
|
+
* @returns
|
|
183
|
+
*/
|
|
184
|
+
registerVariable(variable: Variable): void;
|
|
185
|
+
/**
|
|
186
|
+
* Get all registered variables
|
|
187
|
+
* @returns
|
|
188
|
+
*/
|
|
189
|
+
getVariables(): Variable[];
|
|
152
190
|
}
|
|
153
191
|
export {};
|
|
@@ -35,6 +35,10 @@ export interface FlagProviderProps {
|
|
|
35
35
|
isVariableParsedInOtherContext?: boolean;
|
|
36
36
|
collectionField?: any;
|
|
37
37
|
children?: any;
|
|
38
|
+
/**
|
|
39
|
+
* 是否存在于变量选择器中
|
|
40
|
+
*/
|
|
41
|
+
isInXButton?: boolean;
|
|
38
42
|
}
|
|
39
43
|
export declare const FlagContext: React.Context<Omit<FlagProviderProps, "children">>;
|
|
40
44
|
export declare const FlagProvider: FC<FlagProviderProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useEvaluatedExpression: (expression: string) => string | number;
|