@nocobase/client-v2 2.1.0-beta.24 → 2.1.0-beta.26

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.
Files changed (57) hide show
  1. package/es/BaseApplication.d.ts +1 -0
  2. package/es/flow/actions/dataScopeFilter.d.ts +9 -0
  3. package/es/flow/actions/linkageRulesFormValueRefresh.d.ts +10 -0
  4. package/es/flow/index.d.ts +1 -0
  5. package/es/flow/internal/utils/rebuildFieldSubModel.d.ts +2 -1
  6. package/es/flow/models/actions/AssociateActionModel.d.ts +19 -0
  7. package/es/flow/models/actions/AssociationActionUtils.d.ts +17 -0
  8. package/es/flow/models/actions/DisassociateActionModel.d.ts +16 -0
  9. package/es/flow/models/actions/index.d.ts +3 -0
  10. package/es/flow/models/base/GridModel.d.ts +3 -1
  11. package/es/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.d.ts +1 -0
  12. package/es/flow/models/fields/AssociationFieldModel/recordSelectSettingsUtils.d.ts +9 -0
  13. package/es/flow/models/fields/JSFieldModel.d.ts +5 -0
  14. package/es/index.d.ts +1 -0
  15. package/es/index.mjs +101 -101
  16. package/lib/index.js +99 -99
  17. package/package.json +6 -5
  18. package/src/BaseApplication.tsx +4 -0
  19. package/src/__tests__/globalDeps.test.ts +6 -0
  20. package/src/__tests__/remotePlugins.test.ts +27 -0
  21. package/src/flow/actions/__tests__/dataScopeFilter.test.ts +158 -0
  22. package/src/flow/actions/__tests__/linkageRules.formValueDrivenRefresh.test.ts +438 -0
  23. package/src/flow/actions/__tests__/linkageRulesRefresh.test.ts +42 -0
  24. package/src/flow/actions/dataScope.tsx +6 -4
  25. package/src/flow/actions/dataScopeFilter.ts +70 -0
  26. package/src/flow/actions/linkageRules.tsx +8 -1
  27. package/src/flow/actions/linkageRulesFormValueRefresh.ts +492 -0
  28. package/src/flow/actions/linkageRulesRefresh.tsx +4 -2
  29. package/src/flow/actions/setTargetDataScope.tsx +6 -5
  30. package/src/flow/index.ts +1 -0
  31. package/src/flow/internal/utils/__tests__/rebuildFieldSubModel.test.ts +77 -2
  32. package/src/flow/internal/utils/rebuildFieldSubModel.ts +21 -5
  33. package/src/flow/models/actions/AssociateActionModel.tsx +196 -0
  34. package/src/flow/models/actions/AssociationActionUtils.ts +90 -0
  35. package/src/flow/models/actions/DisassociateActionModel.tsx +57 -0
  36. package/src/flow/models/actions/__tests__/AssociationActionModel.test.ts +250 -0
  37. package/src/flow/models/actions/index.ts +3 -0
  38. package/src/flow/models/base/GridModel.tsx +21 -1
  39. package/src/flow/models/base/__tests__/GridModel.dragSnapshotContainer.test.ts +98 -0
  40. package/src/flow/models/blocks/details/DetailsItemModel.tsx +3 -0
  41. package/src/flow/models/blocks/filter-form/FilterFormBlockModel.tsx +9 -5
  42. package/src/flow/models/blocks/filter-form/__tests__/FilterFormBlockModel.cleanup.test.ts +138 -0
  43. package/src/flow/models/blocks/form/__tests__/FormBlockModel.test.tsx +22 -0
  44. package/src/flow/models/blocks/table/JSColumnModel.tsx +30 -2
  45. package/src/flow/models/blocks/table/TableBlockModel.tsx +8 -1
  46. package/src/flow/models/blocks/table/TableColumnModel.tsx +1 -0
  47. package/src/flow/models/blocks/table/__tests__/JSColumnModel.test.tsx +51 -0
  48. package/src/flow/models/blocks/table/__tests__/TableBlockModel.quickEditRefresh.test.ts +49 -0
  49. package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +5 -1
  50. package/src/flow/models/fields/AssociationFieldModel/SubTableFieldModel/SubTableColumnModel.tsx +21 -5
  51. package/src/flow/models/fields/AssociationFieldModel/recordSelectSettingsUtils.ts +20 -0
  52. package/src/flow/models/fields/JSFieldModel.tsx +54 -14
  53. package/src/flow/models/fields/mobile-components/MobileSelect.tsx +11 -3
  54. package/src/flow/models/fields/mobile-components/__tests__/MobileSelect.test.tsx +235 -0
  55. package/src/index.ts +1 -0
  56. package/src/utils/globalDeps.ts +10 -0
  57. package/src/utils/requirejs.ts +1 -1
@@ -121,6 +121,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
121
121
  * 注册两边共享的默认 providers。
122
122
  */
123
123
  protected addBaseProviders(): void;
124
+ protected addFinalProviders(): void;
124
125
  addReactRouterComponents(): void;
125
126
  addRoutes(): void;
126
127
  updateFavicon(favicon?: string): void;
@@ -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 normalizeDataScopeFilter(rawFilter: any, resolvedFilter: any): any;
@@ -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;
@@ -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';
@@ -9,8 +9,9 @@
9
9
  /**
10
10
  * 通用的字段子模型重建工具:
11
11
  * - 保留原有 uid
12
- * - 通过 FieldModel 入口 + fieldBinding.use 动态选择目标字段类
12
+ * - 直接重建为目标字段类,保持与 defineChildren 初始创建逻辑一致
13
13
  * - 支持同步父项模式(pattern)
14
+ * - 同一字段模型类型下保留已有字段设置;切换到其他字段模型类型时丢弃不兼容设置
14
15
  * - 重建后触发 beforeRender(useCache: false)
15
16
  */
16
17
  import { FieldModel } from '../../models/base/FieldModel';
@@ -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(_event: DragEndEvent): void;
78
+ handleDragEnd(event: DragEndEvent): void;
77
79
  handleDragCancel(_event: DragCancelEvent): void;
78
80
  renderAddSubModelButton(): JSX.Element;
79
81
  /**
@@ -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;
@@ -17,6 +17,9 @@ import { FieldModel } from '../base/FieldModel';
17
17
  */
18
18
  export declare class JSFieldModel extends FieldModel {
19
19
  private _mountedOnce;
20
+ private _lastRenderedElement?;
21
+ private _pendingRenderedElement?;
22
+ private _lastRunJs?;
20
23
  getInputArgs(): {
21
24
  collectionName: any;
22
25
  associationName: string;
@@ -36,6 +39,8 @@ export declare class JSFieldModel extends FieldModel {
36
39
  /**
37
40
  * 渲染一个占位容器,供 JS 脚本写入内容
38
41
  */
42
+ private getRunJsCode;
43
+ private refreshRenderedElement;
39
44
  render(): React.JSX.Element;
40
45
  /**
41
46
  * 组件挂载后,如果容器引用已就绪,强制重跑一次 beforeRender flows 以把 HTML 写入当前 DOM。
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 } from './flow-compat';
33
34
  export { default as AntdAppProvider } from './theme/AntdAppProvider';