@nocobase/client-v2 3.0.0-alpha.1 → 3.0.0-alpha.12
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/APIClient.d.ts +12 -0
- package/es/acl/aclCheckReadiness.d.ts +11 -0
- package/es/authRedirect.d.ts +6 -2
- package/es/flow/actions/linkageRules.d.ts +24 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +4 -30
- package/es/flow/components/field-value-variable/DateVariableEditor.d.ts +24 -0
- package/es/flow/components/field-value-variable/FieldValueVariableInput.d.ts +31 -0
- package/es/flow/components/field-value-variable/dateValue.d.ts +36 -0
- package/es/flow/components/field-value-variable/index.d.ts +11 -0
- package/es/flow/components/placeholders/BlockPlaceholder.d.ts +1 -0
- package/es/flow/internal/utils/operatorSchemaHelper.d.ts +2 -2
- package/es/flow/models/actions/UpdateRecordActionUtils.d.ts +8 -2
- package/es/flow/models/base/CollectionBlockModel.d.ts +3 -0
- package/es/flow/models/blocks/details/DetailsBlockModel.d.ts +3 -0
- package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +1 -0
- package/es/flow/models/blocks/filter-form/FilterFormSubmitActionModel.d.ts +3 -1
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +7 -0
- package/es/flow/models/blocks/form/FormGridModel.d.ts +6 -0
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +1 -0
- package/es/flow/models/blocks/table/JSColumnModel.d.ts +2 -0
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -0
- package/es/flow/models/blocks/table/TableColumnModel.d.ts +11 -0
- package/es/flow/models/blocks/table/utils.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.d.ts +2 -1
- package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +0 -17
- package/es/flow/models/fields/AssociationFieldModel/recordSelectShared.d.ts +41 -0
- package/es/flow-compat/passwordUtils.d.ts +1 -1
- package/es/index.d.ts +2 -1
- package/es/index.mjs +140 -140
- package/es/nocobase-buildin-plugin/index.d.ts +1 -0
- package/es/settings-app/SettingsGroupNav.d.ts +3 -2
- package/es/settings-app/SettingsSearch.d.ts +1 -1
- package/es/ui-operation/index.d.ts +15 -0
- package/es/ui-operation/ui-operation-codec.d.ts +10 -0
- package/lib/index.js +145 -145
- package/package.json +7 -7
- package/src/APIClient.ts +92 -0
- package/src/Application.tsx +3 -1
- package/src/__tests__/APIClient.test.tsx +58 -0
- package/src/__tests__/app.test.tsx +122 -3
- package/src/__tests__/authRedirect.test.ts +17 -0
- package/src/__tests__/browserChecker.test.ts +81 -33
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +37 -0
- package/src/__tests__/settings-center.test.tsx +312 -11
- package/src/__tests__/settings-layout-root.test.tsx +346 -6
- package/src/__tests__/settings-runtime-paths.test.ts +1 -1
- package/src/__tests__/settings-search-shortcut.test.tsx +321 -0
- package/src/__tests__/settings-shell.test.tsx +62 -1
- package/src/acl/ACLProvider.tsx +34 -3
- package/src/acl/__tests__/ACLProvider.test.tsx +92 -0
- package/src/acl/aclCheckReadiness.ts +44 -0
- package/src/authRedirect.ts +13 -5
- package/src/components/AppComponents.tsx +16 -7
- package/src/components/form/filter/CollectionFilterItem.tsx +4 -2
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +17 -0
- package/src/components/form/table/Table.tsx +81 -6
- package/src/components/form/table/__tests__/Table.columnWidth.test.tsx +433 -0
- package/src/flow/actions/__tests__/linkageRules.actionStates.test.ts +33 -0
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +72 -0
- package/src/flow/actions/linkageRules.tsx +33 -10
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +78 -59
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +228 -0
- package/src/flow/components/FieldAssignValueInput.tsx +38 -621
- package/src/flow/components/field-value-variable/DateVariableEditor.tsx +181 -0
- package/src/flow/components/field-value-variable/FieldValueVariableInput.tsx +326 -0
- package/src/flow/components/field-value-variable/__tests__/FieldValueVariableInput.test.tsx +380 -0
- package/src/flow/components/field-value-variable/dateValue.ts +223 -0
- package/src/flow/components/field-value-variable/index.ts +12 -0
- package/src/flow/components/filter/VariableFilterItem.tsx +12 -3
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +125 -0
- package/src/flow/components/placeholders/BlockPlaceholder.tsx +70 -23
- package/src/flow/components/placeholders/__tests__/BlockPlaceholder.test.tsx +57 -7
- package/src/flow/internal/utils/operatorSchemaHelper.ts +3 -2
- package/src/flow/models/actions/UpdateRecordActionModel.tsx +18 -1
- package/src/flow/models/actions/UpdateRecordActionUtils.ts +18 -6
- package/src/flow/models/actions/__tests__/UpdateRecordActionModel.test.ts +76 -4
- package/src/flow/models/base/CollectionBlockModel.tsx +32 -1
- package/src/flow/models/base/__tests__/CollectionBlockModel.initialBeforeRenderRefresh.test.ts +125 -9
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +28 -53
- package/src/flow/models/blocks/details/DetailsBlockModel.tsx +8 -3
- package/src/flow/models/blocks/details/__tests__/DetailsBlockModel.initialPaginationChangeRefresh.test.ts +32 -1
- package/src/flow/models/blocks/filter-form/FilterFormGridModel.tsx +36 -5
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +129 -14
- package/src/flow/models/blocks/filter-form/FilterFormSubmitActionModel.tsx +57 -4
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormGridModel.onModelCreated.test.ts +174 -1
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.defineChildren.test.ts +359 -1
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.getFilterValue.test.ts +72 -0
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormSubmitActionModel.lifecycle.test.ts +90 -0
- package/src/flow/models/blocks/filter-manager/FilterManager.ts +5 -0
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.test.ts +40 -0
- package/src/flow/models/blocks/form/FormBlockModel.tsx +47 -0
- package/src/flow/models/blocks/form/FormGridModel.tsx +4 -0
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +8 -2
- package/src/flow/models/blocks/form/__tests__/runJsFormSubmit.test.ts +131 -0
- package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +435 -0
- package/src/flow/models/blocks/form/value-runtime/rules.ts +67 -14
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +43 -19
- package/src/flow/models/blocks/table/JSColumnModel.tsx +10 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +25 -1
- package/src/flow/models/blocks/table/TableColumnModel.tsx +18 -8
- package/src/flow/models/blocks/table/__tests__/JSColumnModel.test.tsx +52 -5
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.filterReset.test.ts +78 -0
- package/src/flow/models/blocks/table/utils.ts +7 -0
- package/src/flow/models/fields/AssociationFieldModel/CascadeSelectFieldModel.tsx +33 -1
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +8 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/__tests__/popupContext.test.ts +120 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/actions/PopupSubTableEditActionModel.tsx +10 -2
- package/src/flow/models/fields/AssociationFieldModel/RecordPickerFieldModel.tsx +24 -1
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +9 -136
- package/src/flow/models/fields/AssociationFieldModel/__tests__/RecordPickerFieldModel.itemContext.test.ts +167 -3
- package/src/flow/models/fields/AssociationFieldModel/recordSelectShared.tsx +156 -0
- package/src/flow/models/fields/DisplayNumberFieldModel.tsx +1 -1
- package/src/flow/models/fields/NumberFieldModel.tsx +1 -1
- package/src/flow/models/fields/__tests__/DisplayNumberFieldModel.test.ts +33 -0
- package/src/flow/models/fields/__tests__/NumberFieldModel.test.tsx +47 -0
- package/src/flow/models/fields/mobile-components/MobileLazySelect.tsx +6 -0
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +27 -2
- package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +139 -13
- package/src/index.ts +2 -0
- package/src/layout-manager/LayoutContentRoute.tsx +2 -1
- package/src/layout-manager/LayoutRoute.tsx +2 -1
- package/src/layout-manager/__tests__/LayoutRoute.test.tsx +87 -1
- package/src/nocobase-buildin-plugin/index.tsx +14 -1
- package/src/settings-app/SettingsGroupNav.tsx +11 -11
- package/src/settings-app/SettingsSearch.tsx +115 -10
- package/src/settings-app/SettingsShell.tsx +23 -6
- package/src/settings-app/runtimePaths.ts +0 -1
- package/src/settings-app/settingsTheme.ts +82 -14
- package/src/settings-center/AdminSettingsLayout.tsx +132 -107
- package/src/settings-center/__tests__/groups.test.ts +25 -0
- package/src/settings-center/groups.ts +1 -1
- package/src/ui-operation/index.ts +33 -0
- package/src/ui-operation/ui-operation-codec.ts +54 -0
package/es/APIClient.d.ts
CHANGED
|
@@ -7,8 +7,20 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { APIClient as APIClientSDK } from '@nocobase/sdk';
|
|
10
|
+
import type { NotificationInstance } from 'antd/es/notification/interface';
|
|
11
|
+
interface APIClientApplication {
|
|
12
|
+
getName?: () => string | undefined;
|
|
13
|
+
context?: {
|
|
14
|
+
notification?: NotificationInstance;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
10
17
|
export declare class APIClient extends APIClientSDK {
|
|
18
|
+
app?: APIClientApplication;
|
|
19
|
+
get notification(): NotificationInstance;
|
|
11
20
|
getHostname(): string;
|
|
12
21
|
getHeaders(): {};
|
|
13
22
|
interceptors(): void;
|
|
23
|
+
handleNotificationError(error: unknown): void;
|
|
24
|
+
useNotificationMiddleware(): void;
|
|
14
25
|
}
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function getACLCheckReady(app: object): boolean;
|
|
10
|
+
export declare function setACLCheckReady(app: object, ready: boolean): void;
|
|
11
|
+
export declare function useACLCheckReady(app: object): boolean;
|
package/es/authRedirect.d.ts
CHANGED
|
@@ -50,18 +50,22 @@ export declare function getCurrentV2RedirectPath(app: AppLike, locationLike: Loc
|
|
|
50
50
|
*
|
|
51
51
|
* @param app 当前 v2 应用实例
|
|
52
52
|
* @param targetPath 登录后回跳地址
|
|
53
|
+
* @param options 可选的登录路由配置
|
|
53
54
|
* @returns 指向 v2 登录页的 href
|
|
54
55
|
*/
|
|
55
|
-
export declare function buildV2SigninHref(app: AppLike, targetPath: string
|
|
56
|
+
export declare function buildV2SigninHref(app: AppLike, targetPath: string, options?: {
|
|
57
|
+
signInRoutePath?: string;
|
|
58
|
+
}): string;
|
|
56
59
|
/**
|
|
57
60
|
* 通过整页跳转进入 v2 登录页。
|
|
58
61
|
*
|
|
59
62
|
* @param app 当前 v2 应用实例
|
|
60
63
|
* @param targetPath 登录后回跳地址
|
|
61
|
-
* @param options
|
|
64
|
+
* @param options 跳转和登录路由选项
|
|
62
65
|
*/
|
|
63
66
|
export declare function redirectToV2Signin(app: AppLike, targetPath: string, options?: {
|
|
64
67
|
replace?: boolean;
|
|
68
|
+
signInRoutePath?: string;
|
|
65
69
|
}): void;
|
|
66
70
|
/**
|
|
67
71
|
* 解析并校验服务端返回的 v2 登录页地址。
|
|
@@ -9,6 +9,29 @@
|
|
|
9
9
|
import { FlowContext, FlowModel } from '@nocobase/flow-engine';
|
|
10
10
|
export declare function updateLinkageRules<T>(rules: T[], updater: (nextRules: T[]) => void): T[];
|
|
11
11
|
export declare const linkageSetBlockProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
12
|
+
declare const ACTION_LINKAGE_STATE_OPTIONS: readonly [{
|
|
13
|
+
readonly label: "Visible";
|
|
14
|
+
readonly value: "visible";
|
|
15
|
+
}, {
|
|
16
|
+
readonly label: "Hidden";
|
|
17
|
+
readonly value: "hidden";
|
|
18
|
+
}, {
|
|
19
|
+
readonly label: "Hidden text";
|
|
20
|
+
readonly value: "hiddenText";
|
|
21
|
+
}, {
|
|
22
|
+
readonly label: "Enabled";
|
|
23
|
+
readonly value: "enabled";
|
|
24
|
+
}, {
|
|
25
|
+
readonly label: "Disabled";
|
|
26
|
+
readonly value: "disabled";
|
|
27
|
+
}];
|
|
28
|
+
type ActionLinkageState = (typeof ACTION_LINKAGE_STATE_OPTIONS)[number]['value'];
|
|
29
|
+
export declare function getActionLinkageStateOptions(model: {
|
|
30
|
+
supportedActionLinkageStates?: readonly ActionLinkageState[];
|
|
31
|
+
}, t: (key: string) => string): {
|
|
32
|
+
label: string;
|
|
33
|
+
value: "hidden" | "visible" | "disabled" | "enabled" | "hiddenText";
|
|
34
|
+
}[];
|
|
12
35
|
export declare const linkageSetActionProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
13
36
|
export declare const linkageSetMenuItemProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
14
37
|
export declare const linkageSetTabProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
@@ -26,3 +49,4 @@ export declare const tabLinkageRules: import("@nocobase/flow-engine").ActionDefi
|
|
|
26
49
|
export declare const fieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
27
50
|
export declare const subFormFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
28
51
|
export declare const detailsFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
52
|
+
export {};
|
|
@@ -7,32 +7,8 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { type ExactDatePickerMode } from './FieldAssignExactDatePicker';
|
|
13
|
-
type VariableInputConverters = {
|
|
14
|
-
renderInputComponent?: (metaTreeNode: MetaTreeNode | null) => React.ComponentType<any> | null;
|
|
15
|
-
resolvePathFromValue?: (value: any) => string[] | undefined;
|
|
16
|
-
resolveValueFromPath?: (metaTreeNode: MetaTreeNode) => any;
|
|
17
|
-
};
|
|
18
|
-
export type DateVariableExactNormalizeMode = 'none' | 'date' | 'datetimeNoTz' | 'iso';
|
|
19
|
-
export declare function toExactPickerDisplayValue(rawValue: unknown, options: {
|
|
20
|
-
format: string;
|
|
21
|
-
isRange: boolean;
|
|
22
|
-
}): dayjs.Dayjs | [dayjs.Dayjs, dayjs.Dayjs] | null;
|
|
23
|
-
export declare function normalizeDateVariableExactValue(rawValue: any, options: {
|
|
24
|
-
exactNormalizeMode: DateVariableExactNormalizeMode;
|
|
25
|
-
format: string;
|
|
26
|
-
showTime: boolean;
|
|
27
|
-
}): any;
|
|
28
|
-
type DateVariableComponentProps = {
|
|
29
|
-
picker: ExactDatePickerMode;
|
|
30
|
-
showTime: boolean;
|
|
31
|
-
timeFormat: string;
|
|
32
|
-
format: string;
|
|
33
|
-
exactNormalizeMode: DateVariableExactNormalizeMode;
|
|
34
|
-
};
|
|
35
|
-
export declare function normalizeDateVariableOutput(rawValue: any, options: DateVariableComponentProps): any;
|
|
10
|
+
import { type CollectionField, type MetaTreeNode, type VariableInputProps } from '@nocobase/flow-engine';
|
|
11
|
+
export { normalizeDateVariableExactValue, normalizeDateVariableOutput, toExactPickerDisplayValue, type DateVariableExactNormalizeMode, } from './field-value-variable';
|
|
36
12
|
interface Props {
|
|
37
13
|
/** 赋值目标路径,例如 `title` / `users.nickname` / `user.name` */
|
|
38
14
|
targetPath: string;
|
|
@@ -53,15 +29,14 @@ interface Props {
|
|
|
53
29
|
value?: string;
|
|
54
30
|
};
|
|
55
31
|
/**
|
|
56
|
-
*
|
|
57
|
-
* 默认 false,保持历史行为。
|
|
32
|
+
* @deprecated Date 已作为独立一级变量提供,此参数仅为调用兼容保留。
|
|
58
33
|
*/
|
|
59
34
|
enableDateVariableAsConstant?: boolean;
|
|
60
35
|
/** 是否允许在变量选择器中使用 RunJS。默认 true,保持历史行为。 */
|
|
61
36
|
allowRunJS?: boolean;
|
|
62
37
|
maxAssociationFieldDepth?: number;
|
|
63
38
|
disabled?: boolean;
|
|
64
|
-
variableConverters?:
|
|
39
|
+
variableConverters?: VariableInputProps['converters'];
|
|
65
40
|
}
|
|
66
41
|
export declare function mergeItemMetaTreeForAssignValue(baseTree: MetaTreeNode[], extraTree: MetaTreeNode[]): MetaTreeNode[];
|
|
67
42
|
export declare function resolveAssignValueFieldPath(itemModel: any): string | undefined;
|
|
@@ -95,4 +70,3 @@ export declare function resolveAssignValueFieldModelConfig(options: {
|
|
|
95
70
|
* - 支持变量引用,并提供 Constant / Null 两种快捷项
|
|
96
71
|
*/
|
|
97
72
|
export declare const FieldAssignValueInput: React.FC<Props>;
|
|
98
|
-
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type CtxDateExpressionConfig } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { type ExactDatePickerValue } from '../FieldAssignExactDatePicker';
|
|
12
|
+
import { type DateVariableComponentProps } from './dateValue';
|
|
13
|
+
export declare function getDefaultDateVariableFormat(config: CtxDateExpressionConfig): string;
|
|
14
|
+
export declare function serializeExactDatePickerValue(value: ExactDatePickerValue, showTime: boolean): string | [string, string];
|
|
15
|
+
type DateVariableEditorProps = {
|
|
16
|
+
value?: CtxDateExpressionConfig;
|
|
17
|
+
onChange?: (value: CtxDateExpressionConfig) => void;
|
|
18
|
+
isDateLikeField: boolean;
|
|
19
|
+
dateComponentProps: DateVariableComponentProps;
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const DateVariableEditor: React.FC<DateVariableEditorProps>;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { type MetaTreeNode, type VariableInputProps } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import { type DateVariableComponentProps } from './dateValue';
|
|
12
|
+
type ValueEditorComponent = React.ComponentType<{
|
|
13
|
+
value?: unknown;
|
|
14
|
+
onChange?: (value: unknown) => void;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
export type FieldValueVariableInputProps = Omit<VariableInputProps, 'value' | 'onChange' | 'metaTree' | 'converters'> & {
|
|
19
|
+
value?: unknown;
|
|
20
|
+
onChange: (value: unknown) => void;
|
|
21
|
+
baseMetaTree: MetaTreeNode[] | (() => MetaTreeNode[] | Promise<MetaTreeNode[]>);
|
|
22
|
+
constantComponent: ValueEditorComponent;
|
|
23
|
+
nullComponent: ValueEditorComponent;
|
|
24
|
+
runJSComponent: ValueEditorComponent;
|
|
25
|
+
isDateLikeField: boolean;
|
|
26
|
+
dateComponentProps: DateVariableComponentProps;
|
|
27
|
+
allowRunJS?: boolean;
|
|
28
|
+
converters?: VariableInputProps['converters'];
|
|
29
|
+
};
|
|
30
|
+
export declare const FieldValueVariableInput: React.FC<FieldValueVariableInputProps>;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
import { dayjs } from '@nocobase/utils/client';
|
|
10
|
+
import type { ExactDatePickerMode } from '../FieldAssignExactDatePicker';
|
|
11
|
+
type DateFieldLike = {
|
|
12
|
+
interface?: unknown;
|
|
13
|
+
type?: unknown;
|
|
14
|
+
getComponentProps?: () => unknown;
|
|
15
|
+
uiSchema?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
export type DateVariableExactNormalizeMode = 'none' | 'date' | 'datetimeNoTz' | 'iso';
|
|
18
|
+
export type DateVariableComponentProps = {
|
|
19
|
+
picker: ExactDatePickerMode;
|
|
20
|
+
showTime: boolean;
|
|
21
|
+
timeFormat: string;
|
|
22
|
+
format: string;
|
|
23
|
+
exactNormalizeMode: DateVariableExactNormalizeMode;
|
|
24
|
+
};
|
|
25
|
+
export declare const DEFAULT_DATE_VARIABLE_COMPONENT_PROPS: DateVariableComponentProps;
|
|
26
|
+
export declare function getFieldInterface(field: DateFieldLike | null | undefined): string;
|
|
27
|
+
export declare function isDateLikeField(field: DateFieldLike | null | undefined, fallbackFieldName?: string, fallbackFieldInterface?: string): boolean;
|
|
28
|
+
export declare function resolveDateVariableComponentProps(field: DateFieldLike | null | undefined, fieldInterface?: string): DateVariableComponentProps;
|
|
29
|
+
export declare function normalizeDateVariableExactValue(rawValue: unknown, options: Pick<DateVariableComponentProps, 'format' | 'showTime' | 'exactNormalizeMode'>): unknown;
|
|
30
|
+
export declare function toExactPickerDisplayValue(rawValue: unknown, options: {
|
|
31
|
+
format: string;
|
|
32
|
+
isRange: boolean;
|
|
33
|
+
}): dayjs.Dayjs | [dayjs.Dayjs, dayjs.Dayjs] | null;
|
|
34
|
+
/** Compatibility helper retained for existing callers and tests. */
|
|
35
|
+
export declare function normalizeDateVariableOutput(rawValue: unknown, options: DateVariableComponentProps): unknown;
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
export * from './dateValue';
|
|
10
|
+
export * from './DateVariableEditor';
|
|
11
|
+
export * from './FieldValueVariableInput';
|
|
@@ -15,7 +15,7 @@ type OperatorMeta = {
|
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
type ComponentRegistry = {
|
|
18
|
-
getComponent?: (name: string) => ComponentType<Record<string, unknown>> | undefined;
|
|
18
|
+
getComponent?: (name: string, isShowError?: boolean) => ComponentType<Record<string, unknown>> | undefined;
|
|
19
19
|
};
|
|
20
20
|
type OperatorComponentRenderOptions = {
|
|
21
21
|
app?: ComponentRegistry;
|
|
@@ -29,7 +29,7 @@ export declare function pickOperatorStyle(value: unknown): CSSProperties | undef
|
|
|
29
29
|
/**
|
|
30
30
|
* 根据操作符的 schema 定位组件及其 props。
|
|
31
31
|
*/
|
|
32
|
-
export declare function resolveOperatorComponent(app: ComponentRegistry | undefined, operator: string, operators?: OperatorMeta[]): {
|
|
32
|
+
export declare function resolveOperatorComponent(app: ComponentRegistry | undefined, operator: string, operators?: OperatorMeta[], isShowError?: boolean): {
|
|
33
33
|
Comp: React.ComponentType<Record<string, unknown>>;
|
|
34
34
|
props: Record<string, unknown>;
|
|
35
35
|
};
|
|
@@ -6,7 +6,13 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import type { AxiosRequestConfig } from 'axios';
|
|
10
|
+
type UpdateRecordActionParams = {
|
|
11
|
+
assignedValues?: unknown;
|
|
12
|
+
requestConfig?: AxiosRequestConfig;
|
|
13
|
+
};
|
|
9
14
|
export declare function refreshLinkageRulesAfterUpdate(ctx: any): Promise<void>;
|
|
10
|
-
export declare function applyUpdateRecordAction(ctx: any, params:
|
|
15
|
+
export declare function applyUpdateRecordAction(ctx: any, params: UpdateRecordActionParams, options?: {
|
|
11
16
|
settingsFlowKey?: string;
|
|
12
|
-
}): Promise<
|
|
17
|
+
}): Promise<boolean>;
|
|
18
|
+
export {};
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { BaseRecordResource, Collection, CollectionField, DataSource, DefaultStructure, FlowModelContext, MultiRecordResource, SingleRecordResource } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
10
11
|
import { DataBlockModel } from './DataBlockModel';
|
|
11
12
|
export interface ResourceSettingsInitParams {
|
|
12
13
|
dataSourceKey: string;
|
|
@@ -66,6 +67,8 @@ export declare class CollectionBlockModel<T = DefaultStructure> extends DataBloc
|
|
|
66
67
|
onInit(options: any): void;
|
|
67
68
|
createResource(ctx: any, params: any): SingleRecordResource | MultiRecordResource;
|
|
68
69
|
refresh(): Promise<void>;
|
|
70
|
+
isExternalDataSource(): boolean;
|
|
71
|
+
render(): React.JSX.Element;
|
|
69
72
|
protected defaultBlockTitle(): string;
|
|
70
73
|
addAppends(fieldPath: string, refresh?: boolean): void;
|
|
71
74
|
}
|
|
@@ -39,3 +39,6 @@ export declare class DetailsBlockModel extends CollectionBlockModel<{
|
|
|
39
39
|
renderConfigureActions(): React.JSX.Element;
|
|
40
40
|
renderComponent(): React.JSX.Element;
|
|
41
41
|
}
|
|
42
|
+
export declare const DetailsPagination: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<{
|
|
43
|
+
model: DetailsBlockModel;
|
|
44
|
+
}>>;
|
|
@@ -28,6 +28,7 @@ export declare class FilterFormGridModel extends GridModel {
|
|
|
28
28
|
readonly loading: {
|
|
29
29
|
value: boolean;
|
|
30
30
|
};
|
|
31
|
+
private isRecordSelectFilterField;
|
|
31
32
|
private getAssociationFilterTargetKey;
|
|
32
33
|
private normalizeFilterFormLayout;
|
|
33
34
|
private normalizeStoredFullLayout;
|
|
@@ -10,6 +10,8 @@ import type { ButtonProps } from 'antd/es/button';
|
|
|
10
10
|
import { FilterFormActionModel } from './FilterFormActionModel';
|
|
11
11
|
export declare class FilterFormSubmitActionModel extends FilterFormActionModel {
|
|
12
12
|
defaultProps: ButtonProps;
|
|
13
|
-
|
|
13
|
+
private getLifecycleAction;
|
|
14
|
+
private syncAutoTriggerFilter;
|
|
15
|
+
onMount(): void;
|
|
14
16
|
onUnmount(): void;
|
|
15
17
|
}
|
|
@@ -24,8 +24,15 @@ type DefaultCollectionBlockModelStructure = {
|
|
|
24
24
|
type CustomFormBlockModelClassesEnum = {};
|
|
25
25
|
export declare class FormBlockModel<T extends DefaultCollectionBlockModelStructure = DefaultCollectionBlockModelStructure> extends CollectionBlockModel<T> {
|
|
26
26
|
formValueRuntime?: FormValueRuntime;
|
|
27
|
+
serialize(): {
|
|
28
|
+
variableContractType: {
|
|
29
|
+
type: string;
|
|
30
|
+
use: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
27
33
|
private userModifiedTopLevelFields;
|
|
28
34
|
get form(): FormInstance<any>;
|
|
35
|
+
submitFromRunJs(): void;
|
|
29
36
|
_defaultCustomModelClasses: {
|
|
30
37
|
FormActionGroupModel: string;
|
|
31
38
|
FormItemModel: string;
|
|
@@ -18,6 +18,12 @@ export type DefaultFormGridStructure = {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export declare class FormGridModel<T extends DefaultFormGridStructure = DefaultFormGridStructure> extends GridModel<T> {
|
|
21
|
+
serialize(): {
|
|
22
|
+
variableContractType: {
|
|
23
|
+
type: string;
|
|
24
|
+
use: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
21
27
|
itemFallback: React.JSX.Element;
|
|
22
28
|
itemSettingsMenuLevel: number;
|
|
23
29
|
itemFlowSettings: {
|
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import type { FlowModelOptions } from '@nocobase/flow-engine';
|
|
9
10
|
import React from 'react';
|
|
10
11
|
import { TableCustomColumnModel } from './TableCustomColumnModel';
|
|
11
12
|
export declare class JSColumnModel extends TableCustomColumnModel {
|
|
12
13
|
private _RenderComponent?;
|
|
14
|
+
onInit(options: FlowModelOptions): void;
|
|
13
15
|
renderHiddenInConfig(): React.JSX.Element;
|
|
14
16
|
getInputArgs(): {};
|
|
15
17
|
getColumnProps(): {
|
|
@@ -36,6 +36,7 @@ export declare class TableBlockModel extends CollectionBlockModel<TableBlockMode
|
|
|
36
36
|
};
|
|
37
37
|
customModelClasses: CustomTableBlockModelClassesEnum;
|
|
38
38
|
get resource(): MultiRecordResource<any>;
|
|
39
|
+
resetAfterFilterChange(): void;
|
|
39
40
|
private readonly columns;
|
|
40
41
|
private disposeAutorun;
|
|
41
42
|
onMount(): void;
|
|
@@ -7,9 +7,19 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { DisplayItemModel, FlowModelContext, ModelRenderMode } from '@nocobase/flow-engine';
|
|
10
|
+
import type { FlowModel } from '@nocobase/flow-engine';
|
|
10
11
|
import { TableColumnProps } from 'antd';
|
|
11
12
|
import React from 'react';
|
|
12
13
|
export declare function FieldDeletePlaceholder(props: any): React.JSX.Element;
|
|
14
|
+
type FieldPermissionPlaceholderModel = FlowModel & {
|
|
15
|
+
fieldPath?: string;
|
|
16
|
+
forbidden?: {
|
|
17
|
+
actionName?: string;
|
|
18
|
+
} | null;
|
|
19
|
+
};
|
|
20
|
+
export declare function FieldWithoutPermissionPlaceholder({ targetModel, }?: {
|
|
21
|
+
targetModel?: FieldPermissionPlaceholderModel;
|
|
22
|
+
}): React.JSX.Element;
|
|
13
23
|
export declare const TABLE_COLUMN_MIN_WIDTH = 10;
|
|
14
24
|
export declare function normalizeTableColumnWidth(width: number | null | undefined): number;
|
|
15
25
|
export declare const CustomWidth: ({ setOpen, t, handleChange, defaultValue }: {
|
|
@@ -30,3 +40,4 @@ export declare class TableColumnModel extends DisplayItemModel {
|
|
|
30
40
|
onInit(options: any): void;
|
|
31
41
|
renderItem(): any;
|
|
32
42
|
}
|
|
43
|
+
export {};
|
|
@@ -3,6 +3,7 @@ export declare function extractIndex(str: any): string;
|
|
|
3
3
|
export declare function adjustColumnOrder(columns: any): any[];
|
|
4
4
|
export declare function setNestedValue(data: any, recordIndex: any, value: any): void;
|
|
5
5
|
export declare function extractIds(data: any): any[];
|
|
6
|
+
export declare function extractRowKeys(data: Record<string, unknown>[], key: string | string[]): any;
|
|
6
7
|
/**
|
|
7
8
|
* 生成表格行唯一 key
|
|
8
9
|
* @param record 当前行数据
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
import { CollectionField, FlowModel } from '@nocobase/flow-engine';
|
|
9
|
+
import { CollectionField, MultiRecordResource, FlowModel } from '@nocobase/flow-engine';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { FieldModel } from '../../base/FieldModel';
|
|
12
12
|
import { type ItemChain } from './itemChain';
|
|
@@ -45,6 +45,7 @@ export declare function RecordPickerContent({ model, toOne }: {
|
|
|
45
45
|
toOne?: boolean;
|
|
46
46
|
}): React.JSX.Element;
|
|
47
47
|
export declare class RecordPickerFieldModel extends FieldModel {
|
|
48
|
+
resource: MultiRecordResource;
|
|
48
49
|
selectedRows: {
|
|
49
50
|
value: any[];
|
|
50
51
|
};
|
|
@@ -9,22 +9,6 @@
|
|
|
9
9
|
import { CollectionField, MultiRecordResource } from '@nocobase/flow-engine';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { AssociationFieldModel } from './AssociationFieldModel';
|
|
12
|
-
import { type AssociationOption, type LazySelectProps } from './recordSelectShared';
|
|
13
|
-
type HydrateStatus = 'pending' | 'done';
|
|
14
|
-
type HydrationCandidate = {
|
|
15
|
-
item: AssociationOption;
|
|
16
|
-
tk: any;
|
|
17
|
-
tkKey: string;
|
|
18
|
-
};
|
|
19
|
-
export declare function collectAssociationHydrationCandidates(options: {
|
|
20
|
-
value: LazySelectProps['value'];
|
|
21
|
-
isMultiple: boolean;
|
|
22
|
-
valueKey: string;
|
|
23
|
-
labelKey: string;
|
|
24
|
-
statusMap: Map<string, HydrateStatus>;
|
|
25
|
-
}): HydrationCandidate[];
|
|
26
|
-
export declare function getAssociationHydrationNamePath(model: any): any;
|
|
27
|
-
export declare function getAssociationHydrationSetterContext(model: any): any;
|
|
28
12
|
export declare function CreateContent({ model, toOne }: {
|
|
29
13
|
model: any;
|
|
30
14
|
toOne?: boolean;
|
|
@@ -45,4 +29,3 @@ export declare class RecordSelectFieldModel extends AssociationFieldModel {
|
|
|
45
29
|
change(value: any): void;
|
|
46
30
|
render(): React.JSX.Element;
|
|
47
31
|
}
|
|
48
|
-
export {};
|
|
@@ -39,6 +39,46 @@ export interface LazySelectProps extends Omit<SelectProps<any>, 'mode' | 'option
|
|
|
39
39
|
allowCreate?: boolean;
|
|
40
40
|
allowEdit?: boolean;
|
|
41
41
|
}
|
|
42
|
+
type AssociationHydrationSetterOptions = {
|
|
43
|
+
source?: string;
|
|
44
|
+
markExplicit?: boolean;
|
|
45
|
+
triggerEvent?: boolean;
|
|
46
|
+
};
|
|
47
|
+
type AssociationHydrationSetterContext = {
|
|
48
|
+
setFormValue?: (namePath: unknown, value: unknown, options?: AssociationHydrationSetterOptions) => Promise<unknown> | void;
|
|
49
|
+
};
|
|
50
|
+
export type AssociationHydrationModel = {
|
|
51
|
+
resource?: {
|
|
52
|
+
get?: (tk: unknown) => Promise<unknown> | unknown;
|
|
53
|
+
};
|
|
54
|
+
context?: unknown;
|
|
55
|
+
props?: {
|
|
56
|
+
name?: unknown;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
type AssociationHydrationStatus = 'pending' | 'done';
|
|
60
|
+
type AssociationHydrationCandidate = {
|
|
61
|
+
item: AssociationOption;
|
|
62
|
+
tk: unknown;
|
|
63
|
+
tkKey: string;
|
|
64
|
+
};
|
|
65
|
+
export declare function isAssociationRecord(value: unknown): value is AssociationOption;
|
|
66
|
+
export declare function collectAssociationHydrationCandidates(options: {
|
|
67
|
+
value: LazySelectProps['value'];
|
|
68
|
+
isMultiple: boolean;
|
|
69
|
+
valueKey: string;
|
|
70
|
+
labelKey: string;
|
|
71
|
+
statusMap: Map<string, AssociationHydrationStatus>;
|
|
72
|
+
}): AssociationHydrationCandidate[];
|
|
73
|
+
export declare function getAssociationHydrationNamePath(model: AssociationHydrationModel): any;
|
|
74
|
+
export declare function getAssociationHydrationSetterContext(model: AssociationHydrationModel): AssociationHydrationSetterContext;
|
|
75
|
+
export declare function useAssociationValueHydration(options: {
|
|
76
|
+
model: AssociationHydrationModel;
|
|
77
|
+
value: LazySelectProps['value'];
|
|
78
|
+
isMultiple: boolean;
|
|
79
|
+
fieldNames: AssociationFieldNames;
|
|
80
|
+
onChange: LazySelectProps['onChange'];
|
|
81
|
+
}): void;
|
|
42
82
|
export interface LabelByFieldProps {
|
|
43
83
|
option: AssociationOption;
|
|
44
84
|
fieldNames: AssociationFieldNames;
|
|
@@ -46,3 +86,4 @@ export interface LabelByFieldProps {
|
|
|
46
86
|
export declare function LabelByField(props: Readonly<LabelByFieldProps>): React.JSX.Element;
|
|
47
87
|
export declare function toSelectValue(record: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, fieldNames: AssociationFieldNames, multiple?: boolean, valueMode?: 'record' | 'value', options?: AssociationOption[]): any;
|
|
48
88
|
export declare function resolveOptions(options: AssociationOption[] | undefined, value: AssociationOption | AssociationOption[] | string | string[] | number | number[] | undefined, isMultiple: boolean): AssociationOption[];
|
|
89
|
+
export {};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
export declare const getStrength: (val: any) =>
|
|
9
|
+
export declare const getStrength: (val: any) => 0 | 60 | 100 | 80 | 40 | 20;
|
package/es/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export * from './PluginSettingsManager';
|
|
|
27
27
|
export * from './layout-manager';
|
|
28
28
|
export * from './hooks';
|
|
29
29
|
export { default as languageCodes } from './locale/languageCodes';
|
|
30
|
-
export { CurrentUserContext, NocoBaseBuildInPlugin, NocoBaseBuildInPluginV2, useCurrentRoles, useCurrentUserContext, } from './nocobase-buildin-plugin';
|
|
30
|
+
export { CurrentUserContext, NocoBaseBuildInPlugin, NocoBaseBuildInPluginV2, resolveUnauthenticatedSignInRoute, useCurrentRoles, useCurrentUserContext, } from './nocobase-buildin-plugin';
|
|
31
31
|
export type { CurrentRoleOption, CurrentUserState } from './nocobase-buildin-plugin';
|
|
32
32
|
export { getRouteRuntimeVersion } from './utils/getRouteRuntimeVersion';
|
|
33
33
|
export type { RouteRuntimeVersion } from './utils/getRouteRuntimeVersion';
|
|
@@ -46,6 +46,7 @@ export type { CodeEditorExtra, CodeEditorExtraRegistry, EditorRef } from './flow
|
|
|
46
46
|
export { DEFAULT_DATA_SOURCE_KEY, IconPicker, isTitleField, isTitleFieldInterface, NocoBaseDesktopRouteType, } from './flow-compat';
|
|
47
47
|
export type { NocoBaseDesktopRoute } from './flow-compat';
|
|
48
48
|
export * from './utils/markdownSanitize';
|
|
49
|
+
export * from './ui-operation';
|
|
49
50
|
export { default as AntdAppProvider } from './theme/AntdAppProvider';
|
|
50
51
|
export { isSettingsApp } from './settings-app/isSettingsApp';
|
|
51
52
|
export { MINIMAL_THEME_UID, useSettingsThemeConfig } from './settings-app/useSettingsThemeConfig';
|