@nocobase/client-v2 2.3.0-alpha.1 → 2.3.0-beta.11
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/components/form/ScanInput/useCodeScanner.d.ts +12 -2
- package/es/components/form/ScanInput/zxingWasmDecoder.d.ts +9 -0
- package/es/flow/actions/linkageRules.d.ts +25 -0
- package/es/flow/components/FieldAssignValueInput.d.ts +6 -30
- package/es/flow/components/FlowRoute.d.ts +2 -2
- package/es/flow/components/field-value-variable/DateVariableEditor.d.ts +24 -0
- package/es/flow/components/field-value-variable/FieldValueVariableInput.d.ts +32 -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/filter/VariableFilterItem.d.ts +7 -0
- package/es/flow/components/placeholders/BlockPlaceholder.d.ts +1 -0
- package/es/flow/internal/registerDeviceTypeContext.d.ts +10 -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/ActionModelCore.d.ts +4 -2
- package/es/flow/models/base/BlockGridModel.d.ts +3 -0
- 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 +12 -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/models/fields/DateTimeFieldModel/dateLimit.d.ts +15 -7
- package/es/flow-compat/passwordUtils.d.ts +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.mjs +148 -145
- package/es/ui-operation/index.d.ts +15 -0
- package/es/ui-operation/ui-operation-codec.d.ts +10 -0
- package/lib/index.js +170 -167
- package/lib/locale/languageCodes.js +1 -0
- package/package.json +10 -8
- package/src/APIClient.ts +92 -0
- package/src/Application.tsx +3 -1
- package/src/__tests__/APIClient.test.tsx +58 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +7 -2
- package/src/__tests__/settings-center.test.tsx +270 -6
- package/src/acl/ACLProvider.tsx +2 -0
- package/src/acl/__tests__/ACLProvider.test.tsx +92 -0
- package/src/collection-manager/__tests__/field-configure.test.ts +52 -0
- package/src/collection-manager/field-configure.ts +2 -2
- package/src/components/form/ScanInput/CodeScanner.tsx +64 -35
- package/src/components/form/ScanInput/__tests__/CodeScanner.test.tsx +107 -0
- package/src/components/form/ScanInput/__tests__/useCodeScanner.test.tsx +294 -24
- package/src/components/form/ScanInput/__tests__/zxingWasmDecoder.test.ts +78 -0
- package/src/components/form/ScanInput/useCodeScanner.ts +281 -23
- package/src/components/form/ScanInput/zxingWasmDecoder.ts +64 -0
- 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/__tests__/FlowRoute.test.tsx +126 -8
- package/src/flow/__tests__/PluginFlowEngine.test.ts +58 -0
- package/src/flow/actions/__tests__/actionLinkageRules.forkProps.test.ts +314 -0
- package/src/flow/actions/__tests__/dataScopeFormValueClear.test.ts +102 -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/__tests__/validation.test.ts +48 -0
- package/src/flow/actions/linkageRules.tsx +59 -16
- 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/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +42 -23
- package/src/flow/common/Markdown/style.ts +4 -0
- package/src/flow/components/BlockItemCard.tsx +2 -2
- package/src/flow/components/FieldAssignValueInput.tsx +42 -621
- package/src/flow/components/FlowRoute.tsx +71 -29
- package/src/flow/components/field-value-variable/DateVariableEditor.tsx +181 -0
- package/src/flow/components/field-value-variable/FieldValueVariableInput.tsx +335 -0
- package/src/flow/components/field-value-variable/__tests__/FieldValueVariableInput.test.tsx +389 -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 +23 -6
- package/src/flow/components/filter/__tests__/VariableFilterItem.rightMetaTree.test.tsx +158 -0
- 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/index.ts +2 -0
- package/src/flow/internal/components/Markdown/DisplayMarkdown.tsx +14 -9
- package/src/flow/internal/components/Markdown/__tests__/DisplayMarkdown.test.tsx +46 -0
- package/src/flow/internal/registerDeviceTypeContext.ts +39 -0
- 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/ActionModelCore.tsx +11 -2
- package/src/flow/models/base/BlockGridModel.tsx +26 -0
- package/src/flow/models/base/CollectionBlockModel.tsx +38 -3
- package/src/flow/models/base/GridModel.tsx +0 -1
- package/src/flow/models/base/PageModel/PageTabModel.tsx +67 -17
- package/src/flow/models/base/PageModel/__tests__/PageTabModel.test.ts +509 -12
- package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +49 -0
- package/src/flow/models/base/__tests__/BlockGridModel.selectSceneActivation.test.ts +124 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.addAppends.test.ts +41 -0
- package/src/flow/models/base/__tests__/CollectionBlockModel.initialBeforeRenderRefresh.test.ts +125 -9
- package/src/flow/models/blocks/assign-form/AssignFormGridModel.tsx +22 -1
- package/src/flow/models/blocks/assign-form/AssignFormItemModel.tsx +36 -50
- package/src/flow/models/blocks/assign-form/__tests__/assignFieldValuesFlow.editor.test.tsx +140 -0
- 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/FilterFormBlockModel.tsx +27 -3
- 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__/FilterFormGridModel.toggleFormFieldsCollapse.test.ts +29 -0
- 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-form/__tests__/defaultValues.wiring.test.ts +32 -4
- package/src/flow/models/blocks/filter-form/fields/FieldComponentProps.tsx +1 -1
- package/src/flow/models/blocks/filter-form/fields/__tests__/FieldComponentProps.options.test.tsx +61 -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 +73 -5
- package/src/flow/models/blocks/form/FormGridModel.tsx +4 -0
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +153 -2
- package/src/flow/models/blocks/form/__tests__/popupLinkage.test.tsx +175 -0
- 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/js-block/JSBlock.tsx +1 -1
- package/src/flow/models/blocks/table/JSColumnModel.tsx +10 -1
- package/src/flow/models/blocks/table/TableBlockModel.tsx +28 -2
- package/src/flow/models/blocks/table/TableColumnModel.tsx +48 -9
- 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/__tests__/TableBlockModel.quickEditRefresh.test.ts +12 -0
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +33 -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 +12 -3
- 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 +29 -3
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +9 -136
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +5 -1
- package/src/flow/models/fields/AssociationFieldModel/__tests__/RecordPickerFieldModel.itemContext.test.ts +191 -3
- package/src/flow/models/fields/AssociationFieldModel/recordSelectShared.tsx +156 -0
- package/src/flow/models/fields/DateTimeFieldModel/__tests__/DateTimeNoTzFieldModel.dateLimit.test.tsx +149 -0
- package/src/flow/models/fields/DateTimeFieldModel/dateLimit.ts +149 -113
- package/src/flow/models/fields/DisplayAssociationField/DisplaySubTableFieldModel.tsx +42 -7
- package/src/flow/models/fields/DisplayAssociationField/__tests__/DisplaySubTableFieldModel.test.tsx +351 -0
- package/src/flow/models/fields/DisplayHtmlFieldModel.tsx +2 -1
- package/src/flow/models/fields/DisplayNumberFieldModel.tsx +1 -1
- package/src/flow/models/fields/JsonFieldModel.tsx +31 -8
- package/src/flow/models/fields/NumberFieldModel.tsx +1 -1
- package/src/flow/models/fields/RichTextFieldModel/__tests__/RichTextFieldModel.test.tsx +74 -0
- package/src/flow/models/fields/RichTextFieldModel/index.tsx +27 -6
- package/src/flow/models/fields/__tests__/DisplayNumberFieldModel.test.ts +33 -0
- package/src/flow/models/fields/__tests__/JsonFieldModel.test.ts +82 -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/flow/models/topbar/TopbarActionModel.tsx +5 -5
- package/src/flow/utils/dataScopeFormValueClear.ts +4 -3
- package/src/index.ts +1 -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/locale/languageCodes.ts +1 -0
- package/src/settings-center/AdminSettingsLayout.tsx +23 -2
- 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 {};
|
|
@@ -6,6 +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 type { RefObject } from 'react';
|
|
9
10
|
import type { CodeFormatsToSupport } from './types';
|
|
10
11
|
type ScannerSize = {
|
|
11
12
|
width: number;
|
|
@@ -15,18 +16,27 @@ type UseCodeScannerOptions = {
|
|
|
15
16
|
enabled: boolean;
|
|
16
17
|
elementId: string;
|
|
17
18
|
formatsToSupport?: CodeFormatsToSupport;
|
|
18
|
-
scanBoxSize?: ScannerSize;
|
|
19
19
|
onScannerSizeChanged?: (size: ScannerSize) => void;
|
|
20
|
+
scanViewportRef?: RefObject<HTMLElement | null>;
|
|
20
21
|
onScanSuccess: (text: string) => void;
|
|
21
22
|
onScanFailure?: () => void;
|
|
22
23
|
onCameraStartFailure?: (error: unknown) => void;
|
|
23
24
|
};
|
|
25
|
+
type QrFrameCaptureLimits = {
|
|
26
|
+
maxHeight: number;
|
|
27
|
+
maxPixels: number;
|
|
28
|
+
maxWidth: number;
|
|
29
|
+
};
|
|
24
30
|
export declare const DEFAULT_CODE_FORMATS: CodeFormatsToSupport;
|
|
25
31
|
export declare function getCodeScanBoxSize(width: number, height: number): {
|
|
26
32
|
width: number;
|
|
27
33
|
height: number;
|
|
28
34
|
};
|
|
29
|
-
export declare function
|
|
35
|
+
export declare function isIOSBrowser(): boolean;
|
|
36
|
+
export declare function getQrVideoFrameImageData(video: HTMLVideoElement, canvas: HTMLCanvasElement, scanViewport?: Element, limits?: QrFrameCaptureLimits): ImageData;
|
|
37
|
+
export declare function scanQrVideoFrame(video: HTMLVideoElement, canvas: HTMLCanvasElement, scanViewport?: Element): string;
|
|
38
|
+
export declare function scanQrVideoFrameWithZxingWasm(video: HTMLVideoElement, canvas: HTMLCanvasElement, scanViewport: Element): Promise<string>;
|
|
39
|
+
export declare function useCodeScanner({ enabled, elementId, formatsToSupport, onScannerSizeChanged, scanViewportRef, onScanSuccess, onScanFailure, onCameraStartFailure, }: UseCodeScannerOptions): {
|
|
30
40
|
startScanFile: (file: File) => Promise<void>;
|
|
31
41
|
};
|
|
32
42
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
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 decodeQrCodeWithZxingWasm(imageData: ImageData): Promise<string>;
|
|
@@ -7,7 +7,31 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import { FlowContext, FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
export declare function updateLinkageRules<T>(rules: T[], updater: (nextRules: T[]) => void): T[];
|
|
10
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
|
+
}[];
|
|
11
35
|
export declare const linkageSetActionProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
12
36
|
export declare const linkageSetMenuItemProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
13
37
|
export declare const linkageSetTabProps: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
@@ -25,3 +49,4 @@ export declare const tabLinkageRules: import("@nocobase/flow-engine").ActionDefi
|
|
|
25
49
|
export declare const fieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
26
50
|
export declare const subFormFieldLinkageRules: import("@nocobase/flow-engine").ActionDefinition<FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
|
|
27
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,16 @@ 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;
|
|
37
|
+
/** 是否允许在变量选择器中使用内置日期变量。默认 true。 */
|
|
38
|
+
allowDateVariables?: boolean;
|
|
62
39
|
maxAssociationFieldDepth?: number;
|
|
63
40
|
disabled?: boolean;
|
|
64
|
-
variableConverters?:
|
|
41
|
+
variableConverters?: VariableInputProps['converters'];
|
|
65
42
|
}
|
|
66
43
|
export declare function mergeItemMetaTreeForAssignValue(baseTree: MetaTreeNode[], extraTree: MetaTreeNode[]): MetaTreeNode[];
|
|
67
44
|
export declare function resolveAssignValueFieldPath(itemModel: any): string | undefined;
|
|
@@ -95,4 +72,3 @@ export declare function resolveAssignValueFieldModelConfig(options: {
|
|
|
95
72
|
* - 支持变量引用,并提供 Constant / Null 两种快捷项
|
|
96
73
|
*/
|
|
97
74
|
export declare const FieldAssignValueInput: React.FC<Props>;
|
|
98
|
-
export {};
|
|
@@ -19,8 +19,8 @@ export type FlowRouteProps = {
|
|
|
19
19
|
/**
|
|
20
20
|
* 管理后台动态页面路由组件。
|
|
21
21
|
*
|
|
22
|
-
* 负责读取当前路由页面 UID
|
|
23
|
-
*
|
|
22
|
+
* 负责读取当前路由页面 UID,并把页面生命周期桥接到 AdminLayout host model。
|
|
23
|
+
* 设备变量通常由 PluginFlowEngine 共享初始化提供;独立渲染时会在挂载后补充注册。
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
26
26
|
* ```tsx
|
|
@@ -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,32 @@
|
|
|
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
|
+
allowDateVariables?: boolean;
|
|
29
|
+
converters?: VariableInputProps['converters'];
|
|
30
|
+
};
|
|
31
|
+
export declare const FieldValueVariableInput: React.FC<FieldValueVariableInputProps>;
|
|
32
|
+
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';
|
|
@@ -36,6 +36,13 @@ export interface VariableFilterItemProps {
|
|
|
36
36
|
rightVariableConverters?: Pick<Converters, 'resolvePathFromValue' | 'resolveValueFromPath'>;
|
|
37
37
|
ignoreFieldNames?: string[];
|
|
38
38
|
maxAssociationFieldDepth?: number;
|
|
39
|
+
/**
|
|
40
|
+
* 右侧变量树的关联层级上限,默认与 `maxAssociationFieldDepth` 一致。
|
|
41
|
+
* 传 `null` 表示不限制:右侧是变量树而非集合字段树,其深度可能已由调用方约束
|
|
42
|
+
* (例如工作流的变量树由触发器的「预加载关系数据」决定),此时再按左侧的层级上限裁剪
|
|
43
|
+
* 会让已配置好的深层变量选不到。
|
|
44
|
+
*/
|
|
45
|
+
rightMaxAssociationFieldDepth?: number | null;
|
|
39
46
|
}
|
|
40
47
|
/**
|
|
41
48
|
* 上下文筛选项组件
|
|
@@ -0,0 +1,10 @@
|
|
|
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 { FlowEngine } from '@nocobase/flow-engine';
|
|
10
|
+
export declare const registerDeviceTypeContext: (flowEngine: FlowEngine) => void;
|
|
@@ -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 {};
|
|
@@ -6,7 +6,8 @@
|
|
|
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 {
|
|
9
|
+
import { FlowModel } from '@nocobase/flow-engine';
|
|
10
|
+
import type { DefaultStructure, FlowModelOptions } from '@nocobase/flow-engine';
|
|
10
11
|
import type { ButtonProps } from 'antd/es/button';
|
|
11
12
|
import React from 'react';
|
|
12
13
|
export declare function ActionWithoutPermission(props: any): React.JSX.Element;
|
|
@@ -41,7 +42,8 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
|
|
|
41
42
|
static _getScene(): any[];
|
|
42
43
|
static _isScene(scene: ActionSceneType): boolean;
|
|
43
44
|
getAclActionName(): any;
|
|
44
|
-
onInit(options:
|
|
45
|
+
onInit(options: FlowModelOptions<T>): void;
|
|
46
|
+
serialize(): Record<string, any>;
|
|
45
47
|
getInputArgs(): Record<string, any>;
|
|
46
48
|
onClick(event: any): void;
|
|
47
49
|
getTitle(): string;
|
|
@@ -11,8 +11,11 @@ import React from 'react';
|
|
|
11
11
|
import { FilterManager } from '../blocks/filter-manager/FilterManager';
|
|
12
12
|
import { GridModel } from './GridModel';
|
|
13
13
|
export declare class BlockGridModel extends GridModel {
|
|
14
|
+
private viewActivatedListener?;
|
|
14
15
|
dragOverlayConfig: DragOverlayConfig;
|
|
15
16
|
onInit(options: any): void;
|
|
17
|
+
onMount(): void;
|
|
18
|
+
protected onUnmount(): void;
|
|
16
19
|
get subModelBaseClasses(): string[];
|
|
17
20
|
get filterManager(): FilterManager;
|
|
18
21
|
get addBlockItems(): SubModelItemsType | undefined;
|
|
@@ -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 }: {
|
|
@@ -23,9 +33,11 @@ export declare class TableColumnModel extends DisplayItemModel {
|
|
|
23
33
|
afterAddAsSubModel(): Promise<void>;
|
|
24
34
|
renderHiddenInConfig(): React.ReactNode | undefined;
|
|
25
35
|
static defineChildren(ctx: FlowModelContext): any;
|
|
36
|
+
canQuickEdit(record: Record<string, unknown>): boolean;
|
|
26
37
|
getColumnProps(): TableColumnProps & {
|
|
27
38
|
sortField?: string;
|
|
28
39
|
};
|
|
29
40
|
onInit(options: any): void;
|
|
30
41
|
renderItem(): any;
|
|
31
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 {};
|