@nocobase/client-v2 2.1.0-beta.29 → 2.1.0-beta.32
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/BaseApplication.d.ts +1 -0
- package/es/PluginManager.d.ts +1 -0
- package/es/components/form/DrawerFormLayout.d.ts +49 -0
- package/es/components/form/EnvVariableInput.d.ts +42 -0
- package/es/components/form/FileSizeInput.d.ts +27 -0
- package/es/components/form/createFormRegistry.d.ts +33 -0
- package/es/components/form/index.d.ts +13 -0
- package/es/components/index.d.ts +1 -1
- package/es/flow/actions/index.d.ts +1 -1
- package/es/flow/actions/linkageRules.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +4 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutModel.d.ts +7 -0
- package/es/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.d.ts +5 -0
- package/es/flow/components/FieldAssignRulesEditor.d.ts +1 -0
- package/es/flow/internal/utils/enumOptionsUtils.d.ts +5 -0
- package/es/flow/models/actions/AssociationActionUtils.d.ts +5 -0
- package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +4 -0
- package/es/flow/models/blocks/filter-manager/FilterManager.d.ts +5 -1
- package/es/flow/models/blocks/table/TableSelectModel.d.ts +8 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +3 -0
- package/es/flow/models/fields/DisplayTitleFieldModel.d.ts +1 -1
- package/es/flow/models/utils/displayValueUtils.d.ts +12 -0
- package/es/flow-compat/passwordUtils.d.ts +1 -1
- package/es/index.mjs +122 -106
- package/es/utils/remotePlugins.d.ts +0 -4
- package/lib/index.js +121 -105
- package/package.json +6 -5
- package/src/BaseApplication.tsx +14 -8
- package/src/PluginManager.ts +1 -0
- package/src/__tests__/app.test.tsx +28 -1
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +67 -46
- package/src/__tests__/remotePlugins.test.ts +29 -18
- package/src/__tests__/settings-center.test.tsx +30 -0
- package/src/components/form/DrawerFormLayout.tsx +103 -0
- package/src/components/form/EnvVariableInput.tsx +126 -0
- package/src/components/form/FileSizeInput.tsx +105 -0
- package/src/components/form/createFormRegistry.ts +60 -0
- package/src/components/form/index.tsx +14 -0
- package/src/components/index.ts +1 -1
- package/src/flow/__tests__/FlowRoute.test.tsx +4 -5
- package/src/flow/actions/__tests__/actionLinkageRules.race.repro.test.ts +199 -0
- package/src/flow/actions/__tests__/dataScopeFilter.test.ts +92 -13
- package/src/flow/actions/__tests__/linkageRules.formValueDrivenRefresh.test.ts +6 -1
- package/src/flow/actions/__tests__/linkageRules.menu.test.ts +90 -0
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +476 -1
- package/src/flow/actions/index.ts +2 -0
- package/src/flow/actions/linkageRules.tsx +316 -280
- package/src/flow/actions/linkageRulesFormValueRefresh.ts +2 -8
- package/src/flow/actions/setTargetDataScope.tsx +32 -3
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +8 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +70 -12
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +26 -87
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +11 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +5 -1
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +292 -31
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +50 -12
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +77 -56
- package/src/flow/components/AdminLayout.tsx +2 -2
- package/src/flow/components/FieldAssignRulesEditor.tsx +2 -0
- package/src/flow/components/FlowRoute.tsx +17 -4
- package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +81 -4
- package/src/flow/components/filter/LinkageFilterItem.tsx +9 -2
- package/src/flow/components/filter/VariableFilterItem.tsx +2 -6
- package/src/flow/components/filter/__tests__/LinkageFilterItem.test.tsx +71 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +48 -0
- package/src/flow/internal/utils/__tests__/enumOptionsUtils.test.ts +10 -1
- package/src/flow/internal/utils/enumOptionsUtils.ts +29 -0
- package/src/flow/models/actions/AssociateActionModel.tsx +2 -2
- package/src/flow/models/actions/AssociationActionUtils.ts +14 -0
- package/src/flow/models/actions/__tests__/AssociationActionModel.test.ts +63 -0
- package/src/flow/models/base/CollectionBlockModel.tsx +7 -0
- package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +33 -9
- package/src/flow/models/blocks/filter-form/FilterFormItemModel.tsx +53 -13
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormItemModel.getFilterValue.test.ts +63 -3
- package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +33 -1
- package/src/flow/models/blocks/filter-manager/FilterManager.ts +66 -2
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.test.ts +270 -0
- package/src/flow/models/blocks/form/FormBlockModel.tsx +8 -5
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +30 -0
- package/src/flow/models/blocks/form/value-runtime/rules.ts +6 -1
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +6 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +11 -6
- package/src/flow/models/blocks/table/TableColumnModel.tsx +3 -0
- package/src/flow/models/blocks/table/TableSelectModel.tsx +36 -26
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowClick.test.ts +69 -0
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +96 -1
- package/src/flow/models/blocks/table/__tests__/TableSelectModel.test.ts +41 -0
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +4 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +7 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +4 -1
- package/src/flow/models/fields/ClickableFieldModel.tsx +9 -4
- package/src/flow/models/fields/DisplayTitleFieldModel.tsx +12 -4
- package/src/flow/models/fields/SelectFieldModel.tsx +31 -1
- package/src/flow/models/fields/__tests__/ClickableFieldModel.test.ts +23 -0
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +2 -1
- package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +7 -0
- package/src/flow/models/utils/displayValueUtils.ts +57 -0
- package/src/flow/system-settings/useSystemSettings.tsx +36 -1
- package/src/utils/globalDeps.ts +2 -0
- package/src/utils/remotePlugins.ts +7 -27
package/es/BaseApplication.d.ts
CHANGED
|
@@ -171,6 +171,7 @@ export declare class ApplicationModel extends FlowModel {
|
|
|
171
171
|
getRouter(): RouterComponentType;
|
|
172
172
|
render(): React.JSX.Element;
|
|
173
173
|
renderMaintaining(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
174
|
+
renderMaintainingDialog(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
174
175
|
renderError(): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
175
176
|
renderContent(): React.JSX.Element;
|
|
176
177
|
}
|
package/es/PluginManager.d.ts
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
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 React from 'react';
|
|
10
|
+
export interface DrawerFormLayoutProps {
|
|
11
|
+
/** Header title rendered next to the close (X) button. */
|
|
12
|
+
title: React.ReactNode;
|
|
13
|
+
/** Form body — typically a `<Form>` wrapping `<Form.Item>` fields. */
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Called before the drawer is closed by either the Cancel button or the
|
|
17
|
+
* header's X icon. Use for "discard changes" confirmations.
|
|
18
|
+
*/
|
|
19
|
+
onCancel?: () => void | Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Called when the Submit button is clicked. Caller owns validation + the
|
|
22
|
+
* actual API call; the drawer is closed automatically when `onSubmit`
|
|
23
|
+
* resolves. Throw from `onSubmit` to keep the drawer open (e.g. on a
|
|
24
|
+
* validation error).
|
|
25
|
+
*/
|
|
26
|
+
onSubmit?: () => void | Promise<void>;
|
|
27
|
+
/** Drives the Submit button's loading state. */
|
|
28
|
+
submitting?: boolean;
|
|
29
|
+
/** Override the Submit button label. Defaults to "Submit". */
|
|
30
|
+
submitText?: React.ReactNode;
|
|
31
|
+
/** Override the Cancel button label. Defaults to "Cancel". */
|
|
32
|
+
cancelText?: React.ReactNode;
|
|
33
|
+
/**
|
|
34
|
+
* Full override of the footer content. When provided, the default
|
|
35
|
+
* Cancel + Submit buttons are replaced. Useful for forms that need
|
|
36
|
+
* extra actions (e.g. Preview, Save draft).
|
|
37
|
+
*/
|
|
38
|
+
footer?: React.ReactNode;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Standard layout for drawer-hosted forms: a close-icon + title header on
|
|
42
|
+
* top, the caller-provided form body in the middle, and a Cancel + Submit
|
|
43
|
+
* footer at the bottom. Wraps `useFlowView()`'s `Header` / `Footer` slots
|
|
44
|
+
* so the drawer chrome stays consistent across plugins.
|
|
45
|
+
*
|
|
46
|
+
* Callers own the `<Form>` instance, validation, and the actual API call.
|
|
47
|
+
* This component only handles the chrome and the close behaviour.
|
|
48
|
+
*/
|
|
49
|
+
export declare function DrawerFormLayout(props: DrawerFormLayoutProps): React.JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
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 } from '@nocobase/flow-engine';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
/**
|
|
12
|
+
* Convert a stored value like `"{{ $env.foo.bar }}"` back into the
|
|
13
|
+
* `[$env, foo, bar]` path used by the variable picker.
|
|
14
|
+
*/
|
|
15
|
+
export declare function parseEnvPath(value?: string): string[] | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Format a meta tree node back into a `"{{ $env.x.y }}"` server-compatible
|
|
18
|
+
* expression. Used as the `formatPathToValue` converter so the picker output
|
|
19
|
+
* survives a round trip through the API.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatEnvPath(meta?: MetaTreeNode): string;
|
|
22
|
+
export interface EnvVariableInputProps {
|
|
23
|
+
value?: string;
|
|
24
|
+
onChange?: (value: string) => void;
|
|
25
|
+
addonBefore?: React.ReactNode;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* When true, plain (non-variable) values are masked via `Input.Password`
|
|
29
|
+
* so secret credentials are not displayed verbatim. Variable expressions
|
|
30
|
+
* remain editable through the variable picker even in password mode.
|
|
31
|
+
*/
|
|
32
|
+
password?: boolean;
|
|
33
|
+
placeholder?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Generic input component for fields that accept either a literal value or a
|
|
37
|
+
* `{{ $env.X }}` reference. The `$env` namespace is wired through the
|
|
38
|
+
* environment-variables plugin's `flowEngine.context.defineProperty('$env', ...)`
|
|
39
|
+
* registration; this component is the single consumption point and degrades
|
|
40
|
+
* gracefully to a plain text input when no env variables are defined.
|
|
41
|
+
*/
|
|
42
|
+
export declare function EnvVariableInput(props: EnvVariableInputProps): React.JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
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 React from 'react';
|
|
10
|
+
export interface FileSizeInputProps {
|
|
11
|
+
value?: number;
|
|
12
|
+
onChange?: (value?: number) => void;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** Minimum byte size. Empty / below-min input snaps to this on blur. Defaults to 1. */
|
|
15
|
+
min?: number;
|
|
16
|
+
/** Maximum byte size. Defaults to `Number.POSITIVE_INFINITY`. */
|
|
17
|
+
max?: number;
|
|
18
|
+
/** Default byte size used to derive the initial unit shown when the field is empty. Defaults to 20 MB. */
|
|
19
|
+
defaultValue?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Byte-valued size input paired with a unit selector (Byte / KB / MB / GB).
|
|
23
|
+
* The persisted value is always normalized to bytes; the displayed number is
|
|
24
|
+
* derived from the picked unit. Useful for fields like file-size limits or
|
|
25
|
+
* memory quotas where the natural input unit varies by magnitude.
|
|
26
|
+
*/
|
|
27
|
+
export declare function FileSizeInput(props: FileSizeInputProps): React.JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
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 interface FormRegistryEntry {
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
12
|
+
export interface FormRegistry<T extends FormRegistryEntry> {
|
|
13
|
+
readonly namespace: string;
|
|
14
|
+
register(entry: T): void;
|
|
15
|
+
unregister(name: string): boolean;
|
|
16
|
+
get(name: string): T | undefined;
|
|
17
|
+
has(name: string): boolean;
|
|
18
|
+
list(): T[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create an isolated, namespaced registry of form-like entries.
|
|
22
|
+
*
|
|
23
|
+
* Each call returns a fresh registry instance backed by its own closure-scoped
|
|
24
|
+
* `Map`, so plugins do not share state across namespaces. Plugins that need an
|
|
25
|
+
* extension point for form-shaped registrations (e.g. storage configuration
|
|
26
|
+
* forms, data-source connection forms) can build their own typed registry on
|
|
27
|
+
* top of this primitive instead of re-implementing the same boilerplate.
|
|
28
|
+
*
|
|
29
|
+
* Re-registering the same `name` overwrites the previous entry and emits a
|
|
30
|
+
* console warning. This is intentional so HMR / hot reload works without
|
|
31
|
+
* throwing, while still surfacing unintended duplicates during development.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createFormRegistry<T extends FormRegistryEntry>(namespace: string): FormRegistry<T>;
|
|
@@ -0,0 +1,13 @@
|
|
|
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 './createFormRegistry';
|
|
10
|
+
export * from './DrawerFormLayout';
|
|
11
|
+
export * from './EnvVariableInput';
|
|
12
|
+
export * from './FileSizeInput';
|
|
13
|
+
export * from './JsonTextArea';
|
package/es/components/index.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export * from './formAssignRules';
|
|
|
35
35
|
export * from './filterFormDefaultValues';
|
|
36
36
|
export * from './linkageRulesRefresh';
|
|
37
37
|
export * from './blockHeight';
|
|
38
|
-
export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
|
|
38
|
+
export { fieldLinkageRules, subFormFieldLinkageRules, detailsFieldLinkageRules, linkageSetDetailsFieldProps, actionLinkageRules, menuLinkageRules, blockLinkageRules, linkageSetBlockProps, linkageSetActionProps, linkageSetMenuItemProps, linkageSetFieldProps, subFormLinkageSetFieldProps, linkageAssignField, linkageRunjs, subFormLinkageAssignField, } from './linkageRules';
|
|
39
39
|
export { displayFieldComponent } from './displayFieldComponent';
|
|
40
40
|
export * from './overflowMode';
|
|
41
41
|
export * from './numberFormat';
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { FlowContext, FlowModel } from '@nocobase/flow-engine';
|
|
10
10
|
export declare const linkageSetBlockProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
11
11
|
export declare const linkageSetActionProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
12
|
+
export declare const linkageSetMenuItemProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
12
13
|
export declare const linkageSetFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
13
14
|
export declare const subFormLinkageSetFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
14
15
|
export declare const linkageSetDetailsFieldProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
@@ -18,6 +19,7 @@ export declare const setFieldsDefaultValue: import("@nocobase/flow-engine").Acti
|
|
|
18
19
|
export declare const linkageRunjs: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
19
20
|
export declare const blockLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
20
21
|
export declare const actionLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
22
|
+
export declare const menuLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
21
23
|
export declare const fieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
22
24
|
export declare const subFormFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
23
25
|
export declare const detailsFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
@@ -25,6 +25,8 @@ export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuI
|
|
|
25
25
|
getRouteRepository(): any;
|
|
26
26
|
hasPersistedMenuInstanceFlowFlag(route?: NocoBaseDesktopRoute): boolean;
|
|
27
27
|
getCurrentPersistedInstanceFlowCount(): number;
|
|
28
|
+
hasPersistableMenuLinkageRules(): boolean;
|
|
29
|
+
hasCurrentPersistedMenuState(): boolean;
|
|
28
30
|
buildRouteOptionsWithPersistedFlowFlag(hasPersistedMenuInstanceFlow: boolean): {
|
|
29
31
|
[x: string]: any;
|
|
30
32
|
hasPersistedMenuInstanceFlow?: boolean;
|
|
@@ -43,6 +45,8 @@ export declare class AdminLayoutMenuItemModel extends FlowModel<AdminLayoutMenuI
|
|
|
43
45
|
* @returns {boolean} 是否需要走 FlowModel 默认保存链路
|
|
44
46
|
*/
|
|
45
47
|
hasPersistableInstanceFlows(): boolean;
|
|
48
|
+
setHidden(value: boolean): void;
|
|
49
|
+
protected renderHiddenInConfig(): React.ReactNode | undefined;
|
|
46
50
|
createMenuRoute(route: NocoBaseDesktopRoute, options?: {
|
|
47
51
|
parentId?: string | number;
|
|
48
52
|
refreshAfterMutation?: boolean;
|
|
@@ -37,12 +37,19 @@ type GetAdminLayoutModelOptions<TModel extends FlowModel = AdminLayoutModel> = {
|
|
|
37
37
|
*/
|
|
38
38
|
export declare class AdminLayoutModel extends FlowModel<AdminLayoutStructure> {
|
|
39
39
|
isMobileLayout: boolean;
|
|
40
|
+
menuRouteRefreshVersion: number;
|
|
40
41
|
private routeCoordinator?;
|
|
41
42
|
private routeDisposer?;
|
|
42
43
|
private activePageUid;
|
|
43
44
|
private layoutContentElement;
|
|
44
45
|
private readonly routePageMetaMap;
|
|
45
46
|
constructor(options: any);
|
|
47
|
+
/**
|
|
48
|
+
* 通知 Layout 重新生成 ProLayout 菜单路由。
|
|
49
|
+
*
|
|
50
|
+
* @returns {void}
|
|
51
|
+
*/
|
|
52
|
+
refreshMenuRouteTree(): void;
|
|
46
53
|
/**
|
|
47
54
|
* 注册页面运行时信息。
|
|
48
55
|
*
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
import type { BaseApplication } from '../../../BaseApplication';
|
|
10
10
|
import { type NocoBaseDesktopRoute } from '../../../flow-compat';
|
|
11
11
|
export type AdminRouteNavigationMode = 'spa' | 'document';
|
|
12
|
+
export type AdminRouteRuntimeTargetReason = 'ok' | 'missingSchemaUid' | 'unsupportedV2Runtime' | 'emptyGroup' | 'unsupportedRouteType';
|
|
12
13
|
export type AdminRouteRuntimeTarget = {
|
|
13
14
|
runtimePath: string | null;
|
|
14
15
|
navigationMode: AdminRouteNavigationMode;
|
|
15
16
|
isLegacy: boolean;
|
|
17
|
+
reason: AdminRouteRuntimeTargetReason;
|
|
16
18
|
};
|
|
17
19
|
type LocationLike = {
|
|
18
20
|
pathname: string;
|
|
@@ -30,7 +32,10 @@ type ResolveAdminRouteRuntimeTargetOptions = {
|
|
|
30
32
|
preserveLocationState?: boolean;
|
|
31
33
|
log?: (message?: any, ...optionalParams: any[]) => void;
|
|
32
34
|
};
|
|
35
|
+
export declare function isV2AdminRuntime(app?: ResolveAdminRouteRuntimeTargetOptions['app']): boolean;
|
|
33
36
|
export declare function toRouterNavigationPath(pathname: string, basename?: string): string;
|
|
37
|
+
export declare function isV2MenuRoute(route: NocoBaseDesktopRoute | undefined): boolean;
|
|
38
|
+
export declare function findFirstV2LandingRoute(routes: NocoBaseDesktopRoute[] | undefined): NocoBaseDesktopRoute | undefined;
|
|
34
39
|
export declare function findFirstAccessiblePageRoute(routes: NocoBaseDesktopRoute[] | undefined): NocoBaseDesktopRoute | undefined;
|
|
35
40
|
/**
|
|
36
41
|
* 将 desktop route 解析为实际运行时跳转目标。
|
|
@@ -19,5 +19,10 @@ type Option = {
|
|
|
19
19
|
} & Record<string, any>;
|
|
20
20
|
export declare function translateOptions(options: Option[], t: (s: string) => string): Option[];
|
|
21
21
|
export declare function enumToOptions(uiEnum: UiSchemaEnumItem[] | undefined, t: (s: string) => string): Option[] | undefined;
|
|
22
|
+
export declare function normalizeSelectRenderValue(value: unknown, props?: Record<string, any>): unknown;
|
|
23
|
+
export declare function getSelectedEnumLabels(value: any, fallbackOptions?: Option[]): Array<{
|
|
24
|
+
value: any;
|
|
25
|
+
label: any;
|
|
26
|
+
}>;
|
|
22
27
|
export declare function ensureOptionsFromUiSchemaEnumIfAbsent(model: FlowModel, collectionField: CollectionField): boolean;
|
|
23
28
|
export {};
|
|
@@ -13,5 +13,10 @@ export declare const getAssociationTargetResourceSettings: (ctx: FlowModelContex
|
|
|
13
13
|
dataSourceKey: any;
|
|
14
14
|
collectionName: any;
|
|
15
15
|
};
|
|
16
|
+
export declare const getAssociationSelectorContextInputArgs: (ctx: FlowModelContext | any) => {
|
|
17
|
+
collectionField: any;
|
|
18
|
+
sourceId: any;
|
|
19
|
+
associatedRecords: any;
|
|
20
|
+
};
|
|
16
21
|
export declare const applyDisassociateAction: (ctx: FlowModelContext | any) => Promise<void>;
|
|
17
22
|
export declare const applyAssociateAction: (ctx: FlowModelContext | any, selectedRows: any[]) => Promise<void>;
|
|
@@ -20,6 +20,8 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
|
|
|
20
20
|
*/
|
|
21
21
|
autoTriggerFilter: boolean;
|
|
22
22
|
private removeTargetBlockListener?;
|
|
23
|
+
private initialDefaultsPromise?;
|
|
24
|
+
private initialRefreshHandledTargetIds;
|
|
23
25
|
get form(): any;
|
|
24
26
|
get title(): string;
|
|
25
27
|
useHooksBeforeRender(): void;
|
|
@@ -29,6 +31,8 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
|
|
|
29
31
|
onMount(): void;
|
|
30
32
|
onUnmount(): void;
|
|
31
33
|
private applyDefaultsAndInitialFilter;
|
|
34
|
+
prepareInitialFilterValues(): Promise<boolean>;
|
|
35
|
+
markInitialTargetRefreshHandled(targetId: string): void;
|
|
32
36
|
private ensureFilterItemsBeforeRender;
|
|
33
37
|
applyFormDefaultValues(options?: {
|
|
34
38
|
force?: boolean;
|
|
@@ -17,6 +17,9 @@ type FilterConfig = {
|
|
|
17
17
|
/** 筛选操作符,每个条件的操作符可以不一样 */
|
|
18
18
|
operator?: string;
|
|
19
19
|
};
|
|
20
|
+
export type RefreshTargetsByFilterOptions = {
|
|
21
|
+
excludeTargetIds?: Set<string> | string[];
|
|
22
|
+
};
|
|
20
23
|
export type ConnectFieldsConfig = {
|
|
21
24
|
targets: {
|
|
22
25
|
/** 数据区块或者图表区块的 model uid */
|
|
@@ -32,6 +35,7 @@ export declare class FilterManager {
|
|
|
32
35
|
saveFilterConfigs(): Promise<void>;
|
|
33
36
|
getFilterConfigs(): FilterConfig[];
|
|
34
37
|
getConnectFieldsConfig(filterModelUid: string): ConnectFieldsConfig | undefined;
|
|
38
|
+
prepareFiltersForTarget(targetId: string): Promise<Set<any>>;
|
|
35
39
|
saveConnectFieldsConfig(filterModelUid: string, config: ConnectFieldsConfig): Promise<void>;
|
|
36
40
|
/**
|
|
37
41
|
* 添加筛选配置
|
|
@@ -136,6 +140,6 @@ export declare class FilterManager {
|
|
|
136
140
|
* await filterManager.refreshTargetsByFilter(['filter-1', 'filter-2']);
|
|
137
141
|
* ```
|
|
138
142
|
*/
|
|
139
|
-
refreshTargetsByFilter(filterId: string | string[]): Promise<void>;
|
|
143
|
+
refreshTargetsByFilter(filterId: string | string[], options?: RefreshTargetsByFilterOptions): Promise<void>;
|
|
140
144
|
}
|
|
141
145
|
export {};
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { TableBlockModel } from './TableBlockModel';
|
|
10
|
+
export declare function getAssociationSelectForeignKeyFilter(collectionField: any): {
|
|
11
|
+
[x: number]: {
|
|
12
|
+
$is: any;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function getAssociationSelectAssociatedRecordsFilter(collection: any, associatedRecords?: any[]): {
|
|
16
|
+
[x: string]: any[];
|
|
17
|
+
};
|
|
10
18
|
export declare class TableSelectModel extends TableBlockModel {
|
|
11
19
|
static scene: import("../../base/BlockModel").BlockSceneType;
|
|
12
20
|
rowSelectionProps: any;
|
package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts
CHANGED
|
@@ -11,6 +11,8 @@ import { TableColumnProps } from 'antd';
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
import { SubTableFieldModel } from '.';
|
|
13
13
|
import { FieldModel } from '../../../base/FieldModel';
|
|
14
|
+
export declare const SUB_TABLE_COLUMN_FIELD_COMPONENT_CONTEXT = "subTableColumn";
|
|
15
|
+
export declare function isSubTableColumnFieldComponentContext(ctx: any): boolean;
|
|
14
16
|
export declare function FieldWithoutPermissionPlaceholder({ targetModel }: {
|
|
15
17
|
targetModel: any;
|
|
16
18
|
}): React.JSX.Element;
|
|
@@ -24,6 +26,7 @@ export interface SubTableColumnModelStructure {
|
|
|
24
26
|
}
|
|
25
27
|
export declare class SubTableColumnModel<T extends SubTableColumnModelStructure = SubTableColumnModelStructure> extends EditableItemModel<T> {
|
|
26
28
|
static renderMode: ModelRenderMode;
|
|
29
|
+
static fieldComponentContext: string;
|
|
27
30
|
renderHiddenInConfig(): React.JSX.Element;
|
|
28
31
|
static defineChildren(ctx: FlowModelContext): any;
|
|
29
32
|
get collection(): any;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { CollectionField } from '@nocobase/flow-engine';
|
|
10
|
-
import { FieldModel } from '../base
|
|
10
|
+
import { FieldModel } from '../base';
|
|
11
11
|
export declare class DisplayTitleFieldModel extends FieldModel {
|
|
12
12
|
get collectionField(): CollectionField;
|
|
13
13
|
renderComponent(value: any): any;
|
|
@@ -0,0 +1,12 @@
|
|
|
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 hasDisplayValue(value: any): boolean;
|
|
10
|
+
export declare function normalizeDisplayValue(value: any, options?: {
|
|
11
|
+
collectionField?: any;
|
|
12
|
+
}): any;
|
|
@@ -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) => 0 | 100 | 80 | 60 | 40
|
|
9
|
+
export declare const getStrength: (val: any) => 0 | 20 | 100 | 80 | 60 | 40;
|