@nocobase/client-v2 2.2.0-alpha.1 → 2.2.0-alpha.3
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/PluginSettingsManager.d.ts +33 -0
- package/es/RouteRepository.d.ts +21 -6
- package/es/components/category-tabs/SortableCategoryTabs.d.ts +55 -0
- package/es/components/category-tabs/index.d.ts +9 -0
- package/es/components/form/JsonTextArea.d.ts +2 -1
- package/es/components/form/TypedVariableInput.d.ts +22 -4
- package/es/components/form/VariableJsonTextArea.d.ts +19 -0
- package/es/components/form/filter/CollectionFilterItem.d.ts +11 -1
- package/es/components/form/filter/index.d.ts +2 -0
- package/es/components/form/index.d.ts +1 -0
- package/es/components/index.d.ts +2 -0
- package/es/flow/actions/afterSuccess.d.ts +8 -1
- package/es/flow/actions/index.d.ts +1 -1
- package/es/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.d.ts +2 -1
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuModels.d.ts +2 -0
- package/es/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.d.ts +3 -2
- package/es/flow/admin-shell/admin-layout/AdminLayoutSlotModels.d.ts +5 -0
- package/es/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.d.ts +6 -0
- package/es/flow/components/FieldAssignRulesEditor.d.ts +3 -1
- package/es/flow/components/FieldAssignValueInput.d.ts +2 -0
- package/es/flow/index.d.ts +1 -0
- package/es/flow/models/base/GridModel.d.ts +1 -1
- package/es/flow/models/blocks/filter-form/FilterFormBlockModel.d.ts +5 -0
- package/es/flow/models/blocks/form/FormBlockModel.d.ts +4 -0
- package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
- package/es/flow/models/blocks/form/value-runtime/rules.d.ts +21 -0
- package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +30 -0
- package/es/flow/models/blocks/form/value-runtime/types.d.ts +2 -2
- package/es/flow/models/blocks/js-block/JSBlock.d.ts +1 -0
- package/es/flow/models/blocks/table/TableActionsColumnModel.d.ts +1 -0
- package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -0
- package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +1 -1
- package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +2 -1
- package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +6 -4
- package/es/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.d.ts +2 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +6 -0
- package/es/flow/resolveViewParamsToViewList.d.ts +1 -1
- package/es/flow/utils/dataScopeRowSnapshot.d.ts +59 -0
- package/es/flow/utils/dateTimeDisplayProps.d.ts +49 -0
- package/es/flow/utils/formValueDeps.d.ts +32 -0
- package/es/flow-compat/FieldValidation.d.ts +2 -1
- package/es/index.d.ts +2 -1
- package/es/index.mjs +233 -137
- package/lib/index.js +234 -138
- package/package.json +7 -7
- package/src/PluginSettingsManager.ts +53 -0
- package/src/RouteRepository.ts +126 -24
- package/src/__tests__/PluginSettingsManager.test.ts +13 -0
- package/src/__tests__/RouteRepository.test.ts +216 -0
- package/src/__tests__/browserChecker.test.ts +61 -0
- package/src/__tests__/exports.test.ts +16 -0
- package/src/__tests__/nocobase-buildin-plugin-auth.test.tsx +199 -0
- package/src/__tests__/plugin-manager.test.tsx +44 -2
- package/src/__tests__/settings-center.test.tsx +40 -1
- package/src/collection-manager/field-configure.ts +1 -1
- package/src/collection-manager/interfaces/id.ts +1 -1
- package/src/collection-manager/interfaces/m2m.tsx +2 -2
- package/src/collection-manager/interfaces/m2o.tsx +2 -2
- package/src/collection-manager/interfaces/nanoid.ts +1 -1
- package/src/collection-manager/interfaces/o2m.tsx +2 -2
- package/src/collection-manager/interfaces/obo.tsx +2 -2
- package/src/collection-manager/interfaces/oho.tsx +2 -2
- package/src/collection-manager/interfaces/properties/index.ts +2 -2
- package/src/collection-manager/interfaces/uuid.ts +1 -1
- package/src/components/AppComponents.tsx +19 -3
- package/src/components/README.md +7 -1
- package/src/components/README.zh-CN.md +6 -1
- package/src/components/category-tabs/SortableCategoryTabs.tsx +210 -0
- package/src/components/category-tabs/index.ts +10 -0
- package/src/components/form/JsonTextArea.tsx +21 -11
- package/src/components/form/TypedVariableInput.tsx +416 -93
- package/src/components/form/VariableJsonTextArea.tsx +175 -0
- package/src/components/form/__tests__/JsonTextArea.test.tsx +43 -0
- package/src/components/form/__tests__/TypedVariableInput.test.tsx +268 -9
- package/src/components/form/__tests__/VariableJsonTextArea.test.tsx +86 -0
- package/src/components/form/filter/CollectionFilterItem.tsx +32 -7
- package/src/components/form/filter/__tests__/CollectionFilterItem.test.tsx +38 -0
- package/src/components/form/filter/index.ts +2 -0
- package/src/components/form/index.tsx +1 -0
- package/src/components/index.ts +2 -0
- package/src/flow/__tests__/FlowRoute.test.tsx +443 -5
- package/src/flow/__tests__/getKey.test.ts +7 -0
- package/src/flow/__tests__/resolveViewParamsToViewList.test.ts +34 -0
- package/src/flow/actions/__tests__/afterSuccess.test.ts +73 -0
- package/src/flow/actions/__tests__/dataScopeFilter.test.ts +58 -0
- package/src/flow/actions/__tests__/dataScopeFormValueClear.test.ts +1022 -0
- package/src/flow/actions/__tests__/fieldLinkageRules.scopeDepth.test.ts +150 -1
- package/src/flow/actions/__tests__/linkageAssignField.legacy.test.ts +135 -0
- package/src/flow/actions/__tests__/linkageRules.hiddenSync.restore.test.ts +19 -5
- package/src/flow/actions/__tests__/linkageRules.subFormSetFieldProps.test.ts +92 -0
- package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +104 -0
- package/src/flow/actions/__tests__/subFormFieldLinkageRules.inputArgs.test.ts +2 -2
- package/src/flow/actions/afterSuccess.tsx +142 -3
- package/src/flow/actions/customVariable.tsx +1 -2
- package/src/flow/actions/dataScopeFilter.ts +10 -0
- package/src/flow/actions/dateTimeFormat.tsx +42 -28
- package/src/flow/actions/index.ts +1 -1
- package/src/flow/actions/linkageRules.tsx +123 -35
- package/src/flow/actions/linkageRulesFormValueRefresh.ts +22 -130
- package/src/flow/actions/openView.tsx +38 -4
- package/src/flow/actions/runjs.tsx +2 -14
- package/src/flow/actions/validation.tsx +62 -30
- package/src/flow/admin-shell/BaseLayoutModel.tsx +25 -3
- package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +5 -2
- package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +13 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +34 -10
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +310 -0
- package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +44 -8
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuFlowUtils.ts +5 -3
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuModels.tsx +61 -9
- package/src/flow/admin-shell/admin-layout/AdminLayoutMenuUtils.tsx +71 -8
- package/src/flow/admin-shell/admin-layout/AdminLayoutModel.tsx +1 -1
- package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +23 -9
- package/src/flow/admin-shell/admin-layout/HelpLite.tsx +1 -3
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutComponent.test.tsx +188 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutMenuModels.test.ts +99 -0
- package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +82 -0
- package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +166 -2
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.test.ts +20 -0
- package/src/flow/admin-shell/admin-layout/resolveAdminRouteRuntimeTarget.ts +33 -5
- package/src/flow/components/DefaultValue.tsx +1 -2
- package/src/flow/components/DynamicFlowsIcon.tsx +447 -126
- package/src/flow/components/FieldAssignRulesEditor.tsx +128 -21
- package/src/flow/components/FieldAssignValueInput.tsx +10 -5
- package/src/flow/components/FlowRoute.tsx +56 -11
- package/src/flow/components/__tests__/DynamicFlowsIcon.test.tsx +148 -2
- package/src/flow/components/__tests__/FieldAssignRulesEditor.test.tsx +508 -4
- package/src/flow/components/__tests__/fieldAssignOptions.test.ts +151 -3
- package/src/flow/components/code-editor/__tests__/useCodeRunner.test.tsx +2 -17
- package/src/flow/components/code-editor/hooks/useCodeRunner.ts +2 -14
- package/src/flow/components/code-editor/runjsDiagnostics.ts +8 -45
- package/src/flow/components/fieldAssignOptions.ts +155 -27
- package/src/flow/flows/editMarkdownFlow.tsx +1 -1
- package/src/flow/getViewDiffAndUpdateHidden.tsx +1 -0
- package/src/flow/index.ts +2 -1
- package/src/flow/internal/utils/operatorSchemaHelper.ts +15 -1
- package/src/flow/models/actions/JSActionModel.tsx +2 -7
- package/src/flow/models/actions/JSCollectionActionModel.tsx +2 -7
- package/src/flow/models/actions/JSItemActionModel.tsx +2 -7
- package/src/flow/models/actions/JSRecordActionModel.tsx +2 -7
- package/src/flow/models/base/ActionModel.tsx +12 -1
- package/src/flow/models/base/ActionModelCore.tsx +6 -4
- package/src/flow/models/base/GridModel.tsx +38 -7
- package/src/flow/models/base/PageModel/PageModel.tsx +4 -1
- package/src/flow/models/base/PageModel/__tests__/PageModel.test.ts +28 -4
- package/src/flow/models/base/__tests__/ActionModel.test.ts +83 -0
- package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +37 -0
- package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +239 -1
- package/src/flow/models/base/__tests__/transformRowsToSingleColumn.test.ts +48 -0
- package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +31 -3
- package/src/flow/models/blocks/filter-form/FilterFormJSActionModel.tsx +2 -7
- package/src/flow/models/blocks/filter-form/__tests__/defaultValues.wiring.test.ts +77 -0
- package/src/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.tsx +1 -1
- package/src/flow/models/blocks/filter-manager/flow-actions/__tests__/customizeFilterRender.test.tsx +56 -1
- package/src/flow/models/blocks/form/EditFormModel.tsx +1 -0
- package/src/flow/models/blocks/form/FormActionModel.tsx +1 -1
- package/src/flow/models/blocks/form/FormBlockModel.tsx +7 -0
- package/src/flow/models/blocks/form/JSFormActionModel.tsx +2 -7
- package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +17 -0
- package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +54 -1
- package/src/flow/models/blocks/form/submitHandler.ts +17 -3
- package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +940 -75
- package/src/flow/models/blocks/form/value-runtime/rules.ts +445 -13
- package/src/flow/models/blocks/form/value-runtime/runtime.ts +348 -13
- package/src/flow/models/blocks/form/value-runtime/types.ts +2 -2
- package/src/flow/models/blocks/js-block/JSBlock.tsx +225 -9
- package/src/flow/models/blocks/js-block/__tests__/JSBlockModel.test.tsx +150 -0
- package/src/flow/models/blocks/table/JSColumnModel.tsx +1 -9
- package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +36 -13
- package/src/flow/models/blocks/table/TableBlockModel.tsx +38 -17
- package/src/flow/models/blocks/table/TableColumnModel.tsx +36 -3
- package/src/flow/models/blocks/table/__tests__/TableActionsColumnModel.test.tsx +111 -1
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.dragSort.test.ts +127 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.mobileSettingsButtons.test.tsx +78 -0
- package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +1 -0
- package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +159 -1
- package/src/flow/models/blocks/table/dragSort/dragSortHooks.tsx +28 -17
- package/src/flow/models/blocks/table/dragSort/dragSortSettings.ts +13 -6
- package/src/flow/models/blocks/table/dragSort/dragSortUtils.ts +15 -2
- package/src/flow/models/fields/AssociationFieldModel/AssociationFieldModel.tsx +1 -1
- package/src/flow/models/fields/AssociationFieldModel/PopupSubTableFieldModel/PopupSubTableFieldModel.tsx +29 -6
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +16 -4
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +141 -19
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableField.tsx +13 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/__tests__/SubTableColumnModel.rowRecord.test.ts +197 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/__tests__/SubTableFieldModel.reset.test.ts +180 -0
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/index.tsx +6 -4
- package/src/flow/models/fields/AssociationFieldModel/__tests__/AssociationFieldModel.updateAssociation.test.ts +72 -0
- package/src/flow/models/fields/AssociationFieldModel/__tests__/RecordPickerFieldModel.itemContext.test.ts +23 -0
- package/src/flow/models/fields/ClickableFieldModel.tsx +5 -0
- package/src/flow/models/fields/DisplayDateTimeFieldModel.tsx +29 -1
- package/src/flow/models/fields/InputFieldModel.tsx +40 -2
- package/src/flow/models/fields/JSEditableFieldModel.tsx +2 -11
- package/src/flow/models/fields/JSFieldModel.tsx +2 -7
- package/src/flow/models/fields/JSItemModel.tsx +2 -14
- package/src/flow/models/fields/SelectFieldModel.tsx +6 -4
- package/src/flow/models/fields/TextareaFieldModel.tsx +49 -3
- package/src/flow/models/fields/__tests__/DisplayDateTimeFieldModel.test.tsx +96 -0
- package/src/flow/models/fields/__tests__/InputFieldModel.test.tsx +117 -1
- package/src/flow/models/fields/__tests__/SelectFieldModel.test.tsx +43 -0
- package/src/flow/models/fields/__tests__/TextareaFieldModel.test.tsx +100 -0
- package/src/flow/models/topbar/TopbarActionModel.tsx +93 -10
- package/src/flow/resolveViewParamsToViewList.tsx +11 -3
- package/src/flow/utils/__tests__/dateTimeFormat.test.ts +258 -0
- package/src/flow/utils/dataScopeFormValueClear.ts +218 -81
- package/src/flow/utils/dataScopeRowSnapshot.ts +616 -0
- package/src/flow/utils/dateTimeDisplayProps.ts +135 -0
- package/src/flow/utils/formValueDeps.ts +170 -0
- package/src/flow-compat/FieldValidation.tsx +122 -60
- package/src/flow-compat/Popover.tsx +43 -4
- package/src/flow-compat/__tests__/Popover.test.tsx +34 -0
- package/src/index.ts +8 -1
- package/src/layout-manager/__tests__/LayoutRoute.test.tsx +41 -1
- package/src/nocobase-buildin-plugin/index.tsx +44 -14
- package/src/settings-center/AdminSettingsLayout.tsx +10 -2
- package/src/settings-center/SystemSettingsPage.tsx +1 -2
- package/src/settings-center/plugin-manager/PluginCard.tsx +2 -2
- package/src/settings-center/plugin-manager/index.tsx +3 -0
- package/src/settings-center/utils.tsx +0 -6
|
@@ -12,11 +12,16 @@ import type { FormAssignRuleItem, NamePath, Patch, SetOptions } from './types';
|
|
|
12
12
|
type FormBlockModel = FlowModel & {
|
|
13
13
|
getAclActionName?: () => string;
|
|
14
14
|
};
|
|
15
|
+
export type FormValuePatch = {
|
|
16
|
+
path: NamePath;
|
|
17
|
+
value: unknown;
|
|
18
|
+
};
|
|
15
19
|
export declare class FormValueRuntime {
|
|
16
20
|
private readonly model;
|
|
17
21
|
private readonly getForm;
|
|
18
22
|
private readonly valuesMirror;
|
|
19
23
|
private readonly explicitSet;
|
|
24
|
+
private readonly userEditedSet;
|
|
20
25
|
private readonly lastDefaultValueByPathKey;
|
|
21
26
|
private readonly lastWriteMetaByPathKey;
|
|
22
27
|
private readonly observableBindings;
|
|
@@ -29,6 +34,8 @@ export declare class FormValueRuntime {
|
|
|
29
34
|
private lastObservedSource;
|
|
30
35
|
private lastObservedToken;
|
|
31
36
|
private readonly formValuesProxy;
|
|
37
|
+
private readonly mountedFieldModelsByPathKey;
|
|
38
|
+
private readonly mountedFieldModelPathKeys;
|
|
32
39
|
private mountedListener?;
|
|
33
40
|
private unmountedListener?;
|
|
34
41
|
private readonly formPatcher;
|
|
@@ -42,11 +49,16 @@ export declare class FormValueRuntime {
|
|
|
42
49
|
*
|
|
43
50
|
* - mode=default → source=default(遵循 explicit/空值覆盖语义)
|
|
44
51
|
* - mode=assign → source=system(不受 explicit 影响,依赖变化时持续生效)
|
|
52
|
+
* - mode=override → source=override(首次覆盖已有值,用户修改后停止)
|
|
45
53
|
*/
|
|
46
54
|
syncAssignRules(items: FormAssignRuleItem[]): void;
|
|
47
55
|
get formValues(): any;
|
|
48
56
|
getFormValuesSnapshot(): any;
|
|
57
|
+
getUserEditedValuePatches(): FormValuePatch[];
|
|
58
|
+
getUserEditedValuesSnapshot(): Record<string, unknown>;
|
|
59
|
+
private toMirrorSnapshot;
|
|
49
60
|
canApplyDefaultValuePatch(namePath: NamePath, resolved: any): boolean;
|
|
61
|
+
canApplyOverrideValuePatch(namePath: NamePath): boolean;
|
|
50
62
|
recordDefaultValuePatch(namePath: NamePath, value?: any): void;
|
|
51
63
|
private getFormValueAtPath;
|
|
52
64
|
mount(options?: {
|
|
@@ -54,6 +66,7 @@ export declare class FormValueRuntime {
|
|
|
54
66
|
}): void;
|
|
55
67
|
dispose(): void;
|
|
56
68
|
resetAfterFormReset(): void;
|
|
69
|
+
resetUserEditedState(): void;
|
|
57
70
|
isSuppressed(): boolean;
|
|
58
71
|
handleFormFieldsChange(changedFields: Array<{
|
|
59
72
|
name?: NamePath | string | number;
|
|
@@ -83,7 +96,19 @@ export declare class FormValueRuntime {
|
|
|
83
96
|
private tryResolveNamePath;
|
|
84
97
|
private bumpChangeTick;
|
|
85
98
|
private emitFormValuesChange;
|
|
99
|
+
private syncMountedFieldModelValue;
|
|
100
|
+
private syncMountedFieldModelValueForModel;
|
|
101
|
+
private rebuildMountedFieldModelIndex;
|
|
102
|
+
private indexMountedFieldModelTree;
|
|
103
|
+
private unindexMountedFieldModelTree;
|
|
104
|
+
private visitModelAndForks;
|
|
105
|
+
private indexMountedFieldModel;
|
|
106
|
+
private unindexMountedFieldModel;
|
|
107
|
+
private isMountedModelInThisForm;
|
|
108
|
+
private getMountedModelNamePaths;
|
|
109
|
+
private normalizeNamePathValue;
|
|
86
110
|
private markExplicit;
|
|
111
|
+
private markUserEdited;
|
|
87
112
|
private normalizeObservedNamePath;
|
|
88
113
|
private clearExplicitForDefaultPatch;
|
|
89
114
|
private shouldPreserveDescendantDefaultsOnExplicit;
|
|
@@ -91,5 +116,10 @@ export declare class FormValueRuntime {
|
|
|
91
116
|
private shouldKeepDefaultPathValueEnabled;
|
|
92
117
|
private isExplicit;
|
|
93
118
|
private findExplicitHit;
|
|
119
|
+
private findUserEditedHit;
|
|
120
|
+
private findLatestWriteMeta;
|
|
121
|
+
private isCurrentUserEditedPath;
|
|
122
|
+
private omitNonUserDescendantValues;
|
|
123
|
+
private isDescendantPathKey;
|
|
94
124
|
}
|
|
95
125
|
export {};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
export type NamePath = Array<string | number>;
|
|
10
|
-
export type ValueSource = 'default' | 'linkage' | 'user' | 'system';
|
|
10
|
+
export type ValueSource = 'default' | 'linkage' | 'user' | 'system' | 'override';
|
|
11
11
|
export type Patch = Record<string, any> | Array<{
|
|
12
12
|
path: string | NamePath;
|
|
13
13
|
value: any;
|
|
@@ -48,7 +48,7 @@ export interface FormValuesChangePayload {
|
|
|
48
48
|
allValues?: any;
|
|
49
49
|
allValuesSnapshot?: any;
|
|
50
50
|
}
|
|
51
|
-
export type AssignMode = 'default' | 'assign';
|
|
51
|
+
export type AssignMode = 'default' | 'assign' | 'override';
|
|
52
52
|
export type FormAssignRuleItem = {
|
|
53
53
|
key?: string;
|
|
54
54
|
enable?: boolean;
|
|
@@ -10,6 +10,7 @@ import React from 'react';
|
|
|
10
10
|
import { BlockModel } from '../../base';
|
|
11
11
|
export declare class JSBlockModel extends BlockModel {
|
|
12
12
|
private _mountedOnce;
|
|
13
|
+
get showBlockCard(): boolean;
|
|
13
14
|
renderComponent(): React.ReactNode;
|
|
14
15
|
render(): React.JSX.Element;
|
|
15
16
|
protected onMount(): void;
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { TableCustomColumnModel } from './TableCustomColumnModel';
|
|
11
|
+
export declare const tableRowActionsClassName: string;
|
|
11
12
|
export declare class TableActionsColumnModel extends TableCustomColumnModel {
|
|
12
13
|
afterAddAsSubModel(): Promise<void>;
|
|
13
14
|
getColumnProps(): {
|
|
@@ -64,6 +64,7 @@ export declare class TableBlockModel extends CollectionBlockModel<TableBlockMode
|
|
|
64
64
|
isRowSelectionEnabled(): boolean;
|
|
65
65
|
isShowIndexEnabled(): boolean;
|
|
66
66
|
getRecordIndex(record: Record<string, unknown>, index: number): string | number;
|
|
67
|
+
getDragSortFieldName(): string | undefined;
|
|
67
68
|
getLeftAuxiliaryColumn(): {
|
|
68
69
|
key: string;
|
|
69
70
|
width: number;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import type { TableBlockModel } from '../TableBlockModel';
|
|
11
|
-
export declare function useDragSortBodyWrapper(model: TableBlockModel, dataSourceRef: React.MutableRefObject<any>, getRowKeyFunc: (record: any) => string | number): (props: any) => React.JSX.Element;
|
|
11
|
+
export declare function useDragSortBodyWrapper(model: TableBlockModel, dataSourceRef: React.MutableRefObject<any>, getRowKeyFunc: (record: any) => string | number, dragSortFieldName?: string): (props: any) => React.JSX.Element;
|
|
12
12
|
export declare function useDragSortRowComponent(dragSort: boolean): React.FC<{
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
rowIndex?: number;
|
|
@@ -15,7 +15,7 @@ export declare const dragSortSettings: {
|
|
|
15
15
|
defaultParams: {
|
|
16
16
|
dragSort: boolean;
|
|
17
17
|
};
|
|
18
|
-
handler(ctx: any, params: any):
|
|
18
|
+
handler(ctx: any, params: any): void;
|
|
19
19
|
};
|
|
20
20
|
export declare const dragSortBySettings: {
|
|
21
21
|
title: string;
|
|
@@ -29,6 +29,7 @@ export declare const dragSortBySettings: {
|
|
|
29
29
|
value: any;
|
|
30
30
|
disabled: any;
|
|
31
31
|
}[];
|
|
32
|
+
allowClear: boolean;
|
|
32
33
|
placeholder: any;
|
|
33
34
|
};
|
|
34
35
|
};
|
|
@@ -6,25 +6,27 @@
|
|
|
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 { Collection } from '@nocobase/flow-engine';
|
|
9
|
+
import type { Collection, CollectionField } from '@nocobase/flow-engine';
|
|
10
10
|
/**
|
|
11
11
|
* 从 collection 中获取所有 sort 类型的字段
|
|
12
12
|
* @param collection - 集合对象
|
|
13
13
|
* @returns 排序字段数组
|
|
14
14
|
*/
|
|
15
|
-
export declare function getSortFields(collection: Collection | undefined):
|
|
15
|
+
export declare function getSortFields(collection: Collection | undefined): CollectionField[];
|
|
16
|
+
export declare function getSortField(collection: Collection | undefined, fieldName?: string | null): CollectionField | undefined;
|
|
17
|
+
export declare function hasSortField(collection: Collection | undefined, fieldName?: string | null): boolean;
|
|
16
18
|
/**
|
|
17
19
|
* 获取 collection 中第一个可用的 sort 字段
|
|
18
20
|
* @param collection - 集合对象
|
|
19
21
|
* @returns 第一个排序字段,如果没有则返回 undefined
|
|
20
22
|
*/
|
|
21
|
-
export declare function getFirstSortField(collection: Collection | undefined):
|
|
23
|
+
export declare function getFirstSortField(collection: Collection | undefined): CollectionField;
|
|
22
24
|
/**
|
|
23
25
|
* 将 sort 字段转换为选项格式
|
|
24
26
|
* @param fields - 字段数组
|
|
25
27
|
* @returns 选项数组
|
|
26
28
|
*/
|
|
27
|
-
export declare function convertFieldsToOptions(fields:
|
|
29
|
+
export declare function convertFieldsToOptions(fields: CollectionField[]): {
|
|
28
30
|
label: any;
|
|
29
31
|
value: any;
|
|
30
32
|
disabled: any;
|
|
@@ -23,6 +23,8 @@ export declare function collectAssociationHydrationCandidates(options: {
|
|
|
23
23
|
labelKey: string;
|
|
24
24
|
statusMap: Map<string, HydrateStatus>;
|
|
25
25
|
}): HydrationCandidate[];
|
|
26
|
+
export declare function getAssociationHydrationNamePath(model: any): any;
|
|
27
|
+
export declare function getAssociationHydrationSetterContext(model: any): any;
|
|
26
28
|
export declare function CreateContent({ model, toOne }: {
|
|
27
29
|
model: any;
|
|
28
30
|
toOne?: boolean;
|
package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare function FieldWithoutPermissionPlaceholder({ targetModel }: {
|
|
|
18
18
|
}): React.JSX.Element;
|
|
19
19
|
export declare function buildRowPathFromFieldIndex(fieldIndex: unknown): Array<string | number> | null;
|
|
20
20
|
export declare function getLatestSubTableRowRecord(form: any, fieldIndex: unknown, fallbackRecord: any): any;
|
|
21
|
+
export declare function buildSubTableColumnNamePath(fieldPath: Array<string | number>, rowIdx: number, namePath: string | number, rowFieldIndex: unknown): Array<string | number>;
|
|
21
22
|
export declare function isSubTableColumnReadPretty(parent: any): boolean;
|
|
22
23
|
export declare function isSubTableColumnConfiguredReadPretty(parent: any): boolean;
|
|
23
24
|
export declare function getSubTableColumnTitleField(parent: any): any;
|
|
@@ -31,10 +32,15 @@ export interface SubTableColumnModelStructure {
|
|
|
31
32
|
export declare class SubTableColumnModel<T extends SubTableColumnModelStructure = SubTableColumnModelStructure> extends EditableItemModel<T> {
|
|
32
33
|
static renderMode: ModelRenderMode;
|
|
33
34
|
static fieldComponentContext: string;
|
|
35
|
+
private getAssociationField;
|
|
36
|
+
private getParentFormValues;
|
|
37
|
+
private createParentItemAccessors;
|
|
38
|
+
private createRowItemContextPropertyOptions;
|
|
34
39
|
renderHiddenInConfig(): React.JSX.Element;
|
|
35
40
|
static defineChildren(ctx: FlowModelContext): any;
|
|
36
41
|
get collection(): any;
|
|
37
42
|
get hasFormulaColumn(): boolean;
|
|
43
|
+
get hasFormValueDrivenDataScopeColumn(): boolean;
|
|
38
44
|
onInit(options: any): void;
|
|
39
45
|
afterAddAsSubModel(): Promise<void>;
|
|
40
46
|
getColumnProps(): TableColumnProps;
|
|
@@ -17,4 +17,4 @@ export interface ViewItem {
|
|
|
17
17
|
index: number;
|
|
18
18
|
}
|
|
19
19
|
export declare function resolveViewParamsToViewList(flowEngine: FlowEngine, viewParams: ViewParam[], routeModel: FlowModel): ViewItem[];
|
|
20
|
-
export declare function updateViewListHidden(viewItems: ViewItem[]): void;
|
|
20
|
+
export declare function updateViewListHidden(viewItems: ViewItem[], isMobileLayout?: boolean): void;
|
|
@@ -0,0 +1,59 @@
|
|
|
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 { FlowContext } from '@nocobase/flow-engine';
|
|
10
|
+
import { type FieldIndexEntry, type NamePath } from './formValueDeps';
|
|
11
|
+
export type FilterTargetKey = string | string[] | null | undefined;
|
|
12
|
+
export type RowIdentity = string;
|
|
13
|
+
export type RowScopedFieldIndexEntry = FieldIndexEntry & {
|
|
14
|
+
filterTargetKey?: FilterTargetKey;
|
|
15
|
+
};
|
|
16
|
+
export type RowScope = {
|
|
17
|
+
entries: RowScopedFieldIndexEntry[];
|
|
18
|
+
tailPath: NamePath;
|
|
19
|
+
identityTailPaths: NamePath[];
|
|
20
|
+
};
|
|
21
|
+
export type DataScopeValuePath = {
|
|
22
|
+
path: NamePath;
|
|
23
|
+
rowScope?: RowScope;
|
|
24
|
+
};
|
|
25
|
+
export type DataScopeStructuralPath = {
|
|
26
|
+
path: NamePath;
|
|
27
|
+
kind: 'index' | 'length';
|
|
28
|
+
rowScope?: RowScope;
|
|
29
|
+
};
|
|
30
|
+
export type DataScopeTriggerPath = {
|
|
31
|
+
path: NamePath;
|
|
32
|
+
includeChildren: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type DataScopeClearDeps = {
|
|
35
|
+
wildcard: boolean;
|
|
36
|
+
valuePaths: DataScopeValuePath[];
|
|
37
|
+
structuralPaths: DataScopeStructuralPath[];
|
|
38
|
+
triggerPaths: DataScopeTriggerPath[];
|
|
39
|
+
};
|
|
40
|
+
export type DataScopeSnapshotValue = {
|
|
41
|
+
value: unknown;
|
|
42
|
+
rowIdentities?: Array<RowIdentity | null>;
|
|
43
|
+
rowDetached?: boolean;
|
|
44
|
+
};
|
|
45
|
+
export type DataScopeClearSnapshot = {
|
|
46
|
+
complete: boolean;
|
|
47
|
+
rowDetached: boolean;
|
|
48
|
+
rowMissing: boolean;
|
|
49
|
+
values: Map<string, DataScopeSnapshotValue>;
|
|
50
|
+
structures: Map<string, DataScopeSnapshotValue>;
|
|
51
|
+
};
|
|
52
|
+
export type DataScopeClearChangeStatus = {
|
|
53
|
+
status: 'changed' | 'unchanged' | 'unknown';
|
|
54
|
+
snapshot: DataScopeClearSnapshot | null;
|
|
55
|
+
};
|
|
56
|
+
export declare function applyDataScopeFieldIndexTargetKeys(ctx: FlowContext, entries: FieldIndexEntry[]): RowScopedFieldIndexEntry[];
|
|
57
|
+
export declare function createDataScopeRowScope(entries: RowScopedFieldIndexEntry[], parentDepth: number, tailPath: NamePath): RowScope | undefined;
|
|
58
|
+
export declare function buildDepsSnapshot(deps: DataScopeClearDeps, formBlock: any, payload?: unknown): DataScopeClearSnapshot | null;
|
|
59
|
+
export declare function getDepsChangeStatus(deps: DataScopeClearDeps, formBlock: any, payload: unknown, snapshot: DataScopeClearSnapshot | null): DataScopeClearChangeStatus;
|
|
@@ -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 type { FlowModelContext } from '@nocobase/flow-engine';
|
|
10
|
+
type DateTimeDisplayProps = {
|
|
11
|
+
dateOnly?: boolean;
|
|
12
|
+
dateFormat?: string;
|
|
13
|
+
format?: string;
|
|
14
|
+
picker?: string;
|
|
15
|
+
showTime?: boolean;
|
|
16
|
+
timeFormat?: string;
|
|
17
|
+
};
|
|
18
|
+
type DateTimeCollectionField = {
|
|
19
|
+
type?: string;
|
|
20
|
+
interface?: string;
|
|
21
|
+
getComponentProps?: () => DateTimeDisplayProps;
|
|
22
|
+
targetCollection?: {
|
|
23
|
+
getField?: (name?: string) => DateTimeCollectionField | undefined;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
type DateTimeModelContext = FlowModelContext & {
|
|
27
|
+
collectionField?: DateTimeCollectionField;
|
|
28
|
+
};
|
|
29
|
+
type DateTimeModel = {
|
|
30
|
+
props?: DateTimeDisplayProps & {
|
|
31
|
+
titleField?: string;
|
|
32
|
+
};
|
|
33
|
+
context?: DateTimeModelContext;
|
|
34
|
+
getStepParams?: (flowKey: string, stepKey: string) => DateTimeDisplayProps | undefined;
|
|
35
|
+
};
|
|
36
|
+
type ResolveDateTimeDisplayPropsOptions = {
|
|
37
|
+
model?: DateTimeModel;
|
|
38
|
+
collectionField?: DateTimeCollectionField;
|
|
39
|
+
titleField?: string;
|
|
40
|
+
currentProps?: DateTimeDisplayProps;
|
|
41
|
+
params?: DateTimeDisplayProps;
|
|
42
|
+
withDefaults?: boolean;
|
|
43
|
+
};
|
|
44
|
+
export declare const getDateTimeFormatCollectionField: (options: ResolveDateTimeDisplayPropsOptions) => DateTimeCollectionField;
|
|
45
|
+
export declare const isTimeCollectionField: (collectionField?: DateTimeCollectionField) => boolean;
|
|
46
|
+
export declare const isDateOnlyCollectionField: (collectionField?: DateTimeCollectionField) => boolean;
|
|
47
|
+
export declare const getSavedDateTimeFormatParams: (model?: DateTimeModel) => DateTimeDisplayProps;
|
|
48
|
+
export declare const resolveDateTimeDisplayProps: (options: ResolveDateTimeDisplayPropsOptions) => DateTimeDisplayProps;
|
|
49
|
+
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 { FlowContext } from '@nocobase/flow-engine';
|
|
10
|
+
export type NamePath = Array<string | number>;
|
|
11
|
+
export type FieldIndexEntry = {
|
|
12
|
+
name: string;
|
|
13
|
+
index: number;
|
|
14
|
+
};
|
|
15
|
+
export declare function isSameNamePath(a: NamePath, b: NamePath): boolean;
|
|
16
|
+
export declare function isNamePathPrefix(prefix: NamePath, path: NamePath): boolean;
|
|
17
|
+
export declare function dedupeNamePaths(paths: NamePath[]): NamePath[];
|
|
18
|
+
export declare function minimizeNamePaths(paths: NamePath[]): NamePath[];
|
|
19
|
+
export declare function parseFieldIndexEntries(fieldIndex: unknown): FieldIndexEntry[];
|
|
20
|
+
export declare function getFieldIndexEntriesFromContext(ctx: FlowContext | {
|
|
21
|
+
model?: unknown;
|
|
22
|
+
fieldIndex?: unknown;
|
|
23
|
+
}): FieldIndexEntry[];
|
|
24
|
+
export declare function buildItemRowPath(entries: FieldIndexEntry[], parentDepth: number): NamePath | null;
|
|
25
|
+
export declare function buildItemListRootPath(entries: FieldIndexEntry[], parentDepth: number): NamePath | null;
|
|
26
|
+
export declare function parseDependencyPath(subPath: string): NamePath;
|
|
27
|
+
export declare function parsePathKey(pathKey: string): NamePath;
|
|
28
|
+
export declare function getChangedPathsFromPayload(payload: unknown, options?: {
|
|
29
|
+
includeArrayChangedValues?: boolean;
|
|
30
|
+
}): NamePath[];
|
|
31
|
+
export declare function isFormValueChangeSource(model: unknown): boolean;
|
|
32
|
+
export declare function findFormValueChangeSource(ctx: FlowContext): unknown | null;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
10
|
interface ValidationRule {
|
|
11
|
-
key
|
|
11
|
+
key?: string;
|
|
12
12
|
name: string;
|
|
13
13
|
args?: {
|
|
14
14
|
[key: string]: any;
|
|
@@ -22,6 +22,7 @@ interface ValidationData {
|
|
|
22
22
|
interface FieldValidationProps {
|
|
23
23
|
value?: ValidationData;
|
|
24
24
|
onChange?: (value: ValidationData) => void;
|
|
25
|
+
inheritedValue?: ValidationData;
|
|
25
26
|
type?: string;
|
|
26
27
|
availableValidationOptions?: string[];
|
|
27
28
|
excludeValidationOptions?: string[];
|
package/es/index.d.ts
CHANGED
|
@@ -37,5 +37,6 @@ export * from './collection-manager/interfaces';
|
|
|
37
37
|
export * from './collection-manager/template-fields';
|
|
38
38
|
export * from './data-source';
|
|
39
39
|
export * from './flow';
|
|
40
|
-
export { DEFAULT_DATA_SOURCE_KEY, isTitleField, isTitleFieldInterface } from './flow-compat';
|
|
40
|
+
export { DEFAULT_DATA_SOURCE_KEY, IconPicker, isTitleField, isTitleFieldInterface, NocoBaseDesktopRouteType, } from './flow-compat';
|
|
41
|
+
export type { NocoBaseDesktopRoute } from './flow-compat';
|
|
41
42
|
export { default as AntdAppProvider } from './theme/AntdAppProvider';
|