@nocobase/client-v2 2.1.0-alpha.30 → 2.1.0-alpha.31
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/flow/actions/linkageRulesFormValueRefresh.d.ts +10 -0
- package/es/flow/index.d.ts +1 -0
- package/es/flow/models/actions/AssociateActionModel.d.ts +19 -0
- package/es/flow/models/actions/AssociationActionUtils.d.ts +17 -0
- package/es/flow/models/actions/DisassociateActionModel.d.ts +16 -0
- package/es/flow/models/actions/index.d.ts +3 -0
- package/es/flow/models/base/GridModel.d.ts +3 -1
- package/es/flow/models/blocks/filter-form/FilterFormGridModel.d.ts +15 -6
- package/es/flow/models/blocks/shared/filterOperators.d.ts +9 -0
- package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +1 -0
- package/es/flow/models/fields/AssociationFieldModel/recordSelectSettingsUtils.d.ts +9 -0
- package/es/flow-compat/data.d.ts +9 -2
- package/es/flow-compat/index.d.ts +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.mjs +90 -90
- package/lib/index.js +87 -87
- package/package.json +5 -5
- package/src/BaseApplication.tsx +1 -1
- package/src/__tests__/app.test.tsx +23 -6
- package/src/__tests__/globalDeps.test.ts +5 -0
- package/src/flow/actions/__tests__/linkageRules.formValueDrivenRefresh.test.ts +438 -0
- package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +42 -0
- package/src/flow/actions/linkageRules.tsx +8 -1
- package/src/flow/actions/linkageRulesFormValueRefresh.ts +492 -0
- package/src/flow/actions/linkageRulesRefresh.tsx +4 -2
- package/src/flow/actions/titleField.tsx +8 -3
- package/src/flow/components/FieldAssignValueInput.tsx +1 -0
- package/src/flow/components/filter/LinkageFilterItem.tsx +6 -5
- package/src/flow/components/filter/VariableFilterItem.tsx +14 -13
- package/src/flow/components/filter/__tests__/LinkageFilterItem.test.tsx +33 -0
- package/src/flow/components/filter/__tests__/VariableFilterItem.test.tsx +48 -5
- package/src/flow/index.ts +1 -0
- package/src/flow/internal/utils/__tests__/titleFieldQuickSync.test.ts +1 -0
- package/src/flow/internal/utils/titleFieldQuickSync.ts +2 -2
- package/src/flow/models/actions/AssociateActionModel.tsx +196 -0
- package/src/flow/models/actions/AssociationActionUtils.ts +90 -0
- package/src/flow/models/actions/DisassociateActionModel.tsx +57 -0
- package/src/flow/models/actions/FilterActionModel.tsx +17 -9
- package/src/flow/models/actions/__tests__/AssociationActionModel.test.ts +250 -0
- package/src/flow/models/actions/index.ts +3 -0
- package/src/flow/models/base/GridModel.tsx +21 -1
- package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +98 -0
- package/src/flow/models/blocks/details/DetailsItemModel.tsx +3 -0
- package/src/flow/models/blocks/filter-form/FilterFormGridModel.tsx +200 -36
- package/src/flow/models/blocks/filter-form/__tests__/FilterFormGridModel.toggleFormFieldsCollapse.test.ts +270 -1
- package/src/flow/models/blocks/filter-form/__tests__/customFieldOperators.test.tsx +23 -0
- package/src/flow/models/blocks/filter-form/customFieldOperators.ts +12 -1
- package/src/flow/models/blocks/filter-form/fields/FieldComponentProps.tsx +22 -8
- package/src/flow/models/blocks/filter-form/fields/__tests__/FilterFormCustomFieldModel.recordSelect.test.tsx +18 -0
- package/src/flow/models/blocks/filter-manager/FilterManager.ts +51 -1
- package/src/flow/models/blocks/filter-manager/__tests__/FilterManager.test.ts +75 -0
- package/src/flow/models/blocks/form/FormItemModel.tsx +48 -28
- package/src/flow/models/blocks/shared/filterOperators.ts +14 -0
- package/src/flow/models/blocks/table/TableBlockModel.tsx +19 -3
- package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +5 -1
- package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +21 -5
- package/src/flow/models/fields/AssociationFieldModel/recordSelectSettingsUtils.ts +20 -0
- package/src/flow/models/fields/DividerItemModel.tsx +30 -15
- package/src/flow/models/fields/mobile-components/MobileSelect.tsx +11 -3
- package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +235 -0
- package/src/flow-compat/data.ts +25 -3
- package/src/flow-compat/index.ts +7 -1
- package/src/index.ts +1 -0
- package/src/utils/globalDeps.ts +6 -0
|
@@ -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 { FlowContext } from '@nocobase/flow-engine';
|
|
10
|
+
export declare function ensureFormValueDrivenLinkageRefresh(ctx: FlowContext, params: any, actionName: string): void;
|
package/es/flow/index.d.ts
CHANGED
|
@@ -27,4 +27,5 @@ export * from './admin-shell/AdminLayoutRouteCoordinator';
|
|
|
27
27
|
export * from '../settings-center';
|
|
28
28
|
export { openViewFlow } from './flows/openViewFlow';
|
|
29
29
|
export { editMarkdownFlow } from './flows/editMarkdownFlow';
|
|
30
|
+
export { resolveDynamicNamePath } from './models/blocks/form/value-runtime/path';
|
|
30
31
|
export { TextAreaWithContextSelector } from './components/TextAreaWithContextSelector';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { ButtonProps } from 'antd';
|
|
10
|
+
import { ActionModel } from '../base';
|
|
11
|
+
export declare class AssociateActionModel extends ActionModel {
|
|
12
|
+
static scene: import("../base").ActionSceneType;
|
|
13
|
+
static capabilityActionName: string;
|
|
14
|
+
defaultPopupTitle: string;
|
|
15
|
+
selectedRows: any[];
|
|
16
|
+
defaultProps: ButtonProps;
|
|
17
|
+
getAclActionName(): string;
|
|
18
|
+
associateSelectedRows(): Promise<void>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
+
export declare const getAssociationBlockResourceSettings: (ctx: FlowModelContext | any) => any;
|
|
11
|
+
export declare const isAssociationBlockContext: (ctx: FlowModelContext | any) => boolean;
|
|
12
|
+
export declare const getAssociationTargetResourceSettings: (ctx: FlowModelContext | any) => {
|
|
13
|
+
dataSourceKey: any;
|
|
14
|
+
collectionName: any;
|
|
15
|
+
};
|
|
16
|
+
export declare const applyDisassociateAction: (ctx: FlowModelContext | any) => Promise<void>;
|
|
17
|
+
export declare const applyAssociateAction: (ctx: FlowModelContext | any, selectedRows: any[]) => Promise<void>;
|
|
@@ -0,0 +1,16 @@
|
|
|
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 { ButtonProps } from 'antd';
|
|
10
|
+
import { ActionModel } from '../base';
|
|
11
|
+
export declare class DisassociateActionModel extends ActionModel {
|
|
12
|
+
static scene: import("../base").ActionSceneType;
|
|
13
|
+
static capabilityActionName: string;
|
|
14
|
+
defaultProps: ButtonProps;
|
|
15
|
+
getAclActionName(): string;
|
|
16
|
+
}
|
|
@@ -7,8 +7,11 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
export * from './AddNewActionModel';
|
|
10
|
+
export * from './AssociateActionModel';
|
|
11
|
+
export * from './AssociationActionUtils';
|
|
10
12
|
export * from './BulkDeleteActionModel';
|
|
11
13
|
export * from './DeleteActionModel';
|
|
14
|
+
export * from './DisassociateActionModel';
|
|
12
15
|
export * from './EditActionModel';
|
|
13
16
|
export * from './FilterActionModel';
|
|
14
17
|
export * from './JSActionModel';
|
|
@@ -33,6 +33,7 @@ export declare class GridModel<T extends {
|
|
|
33
33
|
private readonly itemExtraToolbarItems;
|
|
34
34
|
private dragState?;
|
|
35
35
|
private _memoItemFlowSettings?;
|
|
36
|
+
onInit(options: any): void;
|
|
36
37
|
private updateDragPointerPosition;
|
|
37
38
|
private handleDragScroll;
|
|
38
39
|
private bindDragDocumentListeners;
|
|
@@ -46,6 +47,7 @@ export declare class GridModel<T extends {
|
|
|
46
47
|
getItemUids(): string[];
|
|
47
48
|
protected normalizeLayoutFromSource(source?: Partial<GridLayoutData>): GridLayoutV2;
|
|
48
49
|
getGridLayout(): GridLayoutV2;
|
|
50
|
+
serialize(): Record<string, any>;
|
|
49
51
|
syncLayoutProps(layout: GridLayoutV2): void;
|
|
50
52
|
setGridStepLayout(layout: GridLayoutV2): void;
|
|
51
53
|
private findLayoutRowByPath;
|
|
@@ -73,7 +75,7 @@ export declare class GridModel<T extends {
|
|
|
73
75
|
handleDragStart(event: DragStartEvent): void;
|
|
74
76
|
handleDragMove(event: DragMoveEvent): void;
|
|
75
77
|
private finishDrag;
|
|
76
|
-
handleDragEnd(
|
|
78
|
+
handleDragEnd(event: DragEndEvent): void;
|
|
77
79
|
handleDragCancel(_event: DragCancelEvent): void;
|
|
78
80
|
renderAddSubModelButton(): JSX.Element;
|
|
79
81
|
/**
|
|
@@ -6,12 +6,14 @@
|
|
|
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 { DragOverlayConfig } from '@nocobase/flow-engine';
|
|
9
|
+
import { DragOverlayConfig, GridLayoutData, GridLayoutV2 } from '@nocobase/flow-engine';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { GridModel } from '../../base';
|
|
12
12
|
import { FilterFormItemModel } from './FilterFormItemModel';
|
|
13
13
|
export declare class FilterFormGridModel extends GridModel {
|
|
14
14
|
private fullLayoutBeforeCollapse?;
|
|
15
|
+
private normalizedItemUidsOverride?;
|
|
16
|
+
private readingFullLayoutForSettingsInteraction;
|
|
15
17
|
itemSettingsMenuLevel: number;
|
|
16
18
|
itemFlowSettings: {
|
|
17
19
|
showBackground: boolean;
|
|
@@ -27,17 +29,24 @@ export declare class FilterFormGridModel extends GridModel {
|
|
|
27
29
|
value: boolean;
|
|
28
30
|
};
|
|
29
31
|
private getAssociationFilterTargetKey;
|
|
32
|
+
private normalizeFilterFormLayout;
|
|
33
|
+
private normalizeStoredFullLayout;
|
|
34
|
+
protected normalizeLayoutFromSource(source?: Partial<GridLayoutData>): GridLayoutV2;
|
|
35
|
+
getGridLayout(): GridLayoutV2;
|
|
36
|
+
saveGridLayout(layout?: GridLayoutData | GridLayoutV2): void;
|
|
37
|
+
handleDragStart(event: Parameters<GridModel['handleDragStart']>[0]): void;
|
|
38
|
+
private collectLayoutItemUids;
|
|
39
|
+
private getCellVisibleRowCount;
|
|
40
|
+
private getRowVisibleRowCount;
|
|
41
|
+
private limitCellByVisibleCount;
|
|
42
|
+
private limitRowByVisibleCount;
|
|
43
|
+
private limitLayoutRowsByVisibleCount;
|
|
30
44
|
/**
|
|
31
45
|
* 获取筛选表单当前“完整布局”。
|
|
32
46
|
* 折叠态会临时裁剪 props.rows,因此这里优先选取行数更多的那份布局,
|
|
33
47
|
* 避免拖拽排序或重新挂载后只拿到被裁剪过的运行时 rows。
|
|
34
48
|
*/
|
|
35
49
|
private getFullLayout;
|
|
36
|
-
/**
|
|
37
|
-
* 按“可视字段行数”裁剪布局,而不是只按 grid row 数裁剪。
|
|
38
|
-
* 这样即使拖拽后多个字段被排进同一个 cell,也仍然可以正确折叠。
|
|
39
|
-
*/
|
|
40
|
-
private limitRowsByVisibleCount;
|
|
41
50
|
toggleFormFieldsCollapse(collapse: boolean, visibleRows: number): void;
|
|
42
51
|
onModelCreated(subModel: FilterFormItemModel): Promise<void>;
|
|
43
52
|
renderAddSubModelButton(): React.JSX.Element;
|
|
@@ -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 isArrayLikeField(field: any): boolean;
|
package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare class SubTableColumnModel<T extends SubTableColumnModelStructure
|
|
|
25
25
|
renderHiddenInConfig(): React.JSX.Element;
|
|
26
26
|
static defineChildren(ctx: FlowModelContext): any;
|
|
27
27
|
get collection(): any;
|
|
28
|
+
get hasFormulaColumn(): boolean;
|
|
28
29
|
onInit(options: any): void;
|
|
29
30
|
afterAddAsSubModel(): Promise<void>;
|
|
30
31
|
getColumnProps(): TableColumnProps;
|
|
@@ -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 hasAncestorModel(model: any, modelNames: string[]): boolean;
|
package/es/flow-compat/data.d.ts
CHANGED
|
@@ -6,10 +6,17 @@
|
|
|
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 type { CollectionFieldInterfaceDataSourceManager } from '@nocobase/flow-engine';
|
|
10
10
|
export interface CollectionFieldOptions {
|
|
11
11
|
interface?: string;
|
|
12
12
|
[key: string]: any;
|
|
13
13
|
}
|
|
14
|
+
type FieldInterfaceOptions = {
|
|
15
|
+
titleUsable?: boolean;
|
|
16
|
+
} | null | undefined;
|
|
14
17
|
export declare const DEFAULT_DATA_SOURCE_KEY = "main";
|
|
15
|
-
export declare const
|
|
18
|
+
export declare const getFlowFieldInterfaceOptions: (interfaceName: string | undefined, ...dataSourceManagers: Array<CollectionFieldInterfaceDataSourceManager | null | undefined>) => any;
|
|
19
|
+
export declare const hasFlowFieldInterfaceLookup: (...dataSourceManagers: Array<CollectionFieldInterfaceDataSourceManager | null | undefined>) => boolean;
|
|
20
|
+
export declare const isTitleFieldInterface: (fieldInterfaceOptions: FieldInterfaceOptions) => boolean;
|
|
21
|
+
export declare const isTitleField: (dataSourceManager: CollectionFieldInterfaceDataSourceManager | null | undefined, field: CollectionFieldOptions | null | undefined) => boolean;
|
|
22
|
+
export {};
|
|
@@ -10,7 +10,7 @@ export { Plugin } from '../Plugin';
|
|
|
10
10
|
export { useApp } from '../hooks/useApp';
|
|
11
11
|
export { usePlugin } from '../hooks/usePlugin';
|
|
12
12
|
export { ColorPicker } from './ColorPicker';
|
|
13
|
-
export { DEFAULT_DATA_SOURCE_KEY, isTitleField } from './data';
|
|
13
|
+
export { DEFAULT_DATA_SOURCE_KEY, getFlowFieldInterfaceOptions, hasFlowFieldInterfaceLookup, isTitleField, isTitleFieldInterface, } from './data';
|
|
14
14
|
export { FieldValidation } from './FieldValidation';
|
|
15
15
|
export { HighPerformanceSpin } from './HighPerformanceSpin';
|
|
16
16
|
export { Icon, hasIcon, icons, registerIcon, registerIcons } from './Icon';
|
package/es/index.d.ts
CHANGED
|
@@ -30,4 +30,5 @@ export * from './collection-field-interface/CollectionFieldInterface';
|
|
|
30
30
|
export * from './collection-field-interface/CollectionFieldInterfaceManager';
|
|
31
31
|
export * from './collection-manager/interfaces';
|
|
32
32
|
export * from './flow';
|
|
33
|
+
export { DEFAULT_DATA_SOURCE_KEY, isTitleField, isTitleFieldInterface } from './flow-compat';
|
|
33
34
|
export { default as AntdAppProvider } from './theme/AntdAppProvider';
|