@nocobase/client-v2 2.2.0-beta.7 → 2.2.0-beta.9

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 (113) hide show
  1. package/es/BaseApplication.d.ts +2 -0
  2. package/es/RouteRepository.d.ts +8 -0
  3. package/es/RouterManager.d.ts +15 -0
  4. package/es/authRedirect.d.ts +1 -0
  5. package/es/entry-actions/EntryActionManager.d.ts +24 -0
  6. package/es/entry-actions/index.d.ts +9 -0
  7. package/es/flow/actions/afterSuccess.d.ts +8 -1
  8. package/es/flow/actions/index.d.ts +1 -1
  9. package/es/flow/admin-shell/BaseLayoutModel.d.ts +6 -0
  10. package/es/flow/admin-shell/BaseLayoutRouteCoordinator.d.ts +7 -0
  11. package/es/flow/admin-shell/admin-layout/AdminLayoutSlotModels.d.ts +1 -0
  12. package/es/flow/admin-shell/admin-layout/AppListRender.d.ts +2 -1
  13. package/es/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.d.ts +24 -0
  14. package/es/flow/admin-shell/admin-layout/index.d.ts +1 -0
  15. package/es/flow/admin-shell/admin-layout/useApplications.d.ts +7 -2
  16. package/es/flow/models/base/ActionModelCore.d.ts +2 -0
  17. package/es/flow/models/blocks/form/submitHandler.d.ts +1 -1
  18. package/es/flow/models/blocks/form/value-runtime/runtime.d.ts +9 -0
  19. package/es/flow/models/blocks/js-block/JSBlock.d.ts +1 -0
  20. package/es/flow/models/blocks/table/TableActionsColumnModel.d.ts +1 -0
  21. package/es/flow/models/blocks/table/TableBlockModel.d.ts +1 -0
  22. package/es/flow/models/blocks/table/dragSort/dragSortHooks.d.ts +1 -1
  23. package/es/flow/models/blocks/table/dragSort/dragSortSettings.d.ts +2 -1
  24. package/es/flow/models/blocks/table/dragSort/dragSortUtils.d.ts +6 -4
  25. package/es/flow/resolveViewParamsToViewList.d.ts +1 -1
  26. package/es/flow/routeTransientInputArgs.d.ts +14 -0
  27. package/es/index.d.ts +2 -0
  28. package/es/index.mjs +243 -141
  29. package/es/utils/markdownSanitize.d.ts +11 -0
  30. package/lib/index.js +232 -130
  31. package/package.json +7 -7
  32. package/src/BaseApplication.tsx +2 -0
  33. package/src/RouteRepository.ts +25 -0
  34. package/src/RouterManager.tsx +142 -1
  35. package/src/__tests__/RouteRepository.test.ts +23 -0
  36. package/src/__tests__/RouterManager.test.ts +125 -0
  37. package/src/__tests__/authRedirect.test.ts +17 -0
  38. package/src/authRedirect.ts +38 -0
  39. package/src/collection-manager/field-configure.ts +1 -1
  40. package/src/collection-manager/interfaces/id.ts +1 -1
  41. package/src/collection-manager/interfaces/m2m.tsx +2 -2
  42. package/src/collection-manager/interfaces/m2o.tsx +2 -2
  43. package/src/collection-manager/interfaces/nanoid.ts +1 -1
  44. package/src/collection-manager/interfaces/o2m.tsx +2 -2
  45. package/src/collection-manager/interfaces/obo.tsx +2 -2
  46. package/src/collection-manager/interfaces/oho.tsx +2 -2
  47. package/src/collection-manager/interfaces/properties/index.ts +2 -2
  48. package/src/collection-manager/interfaces/uuid.ts +1 -1
  49. package/src/entry-actions/EntryActionManager.ts +76 -0
  50. package/src/entry-actions/index.ts +10 -0
  51. package/src/flow/FlowPage.tsx +29 -2
  52. package/src/flow/__tests__/FlowPage.test.tsx +152 -25
  53. package/src/flow/__tests__/FlowRoute.test.tsx +547 -2
  54. package/src/flow/__tests__/getKey.test.ts +7 -0
  55. package/src/flow/__tests__/resolveViewParamsToViewList.test.ts +34 -0
  56. package/src/flow/actions/__tests__/afterSuccess.test.ts +73 -0
  57. package/src/flow/actions/__tests__/dataScopeFilter.test.ts +62 -0
  58. package/src/flow/actions/__tests__/openView.defineProps.route.test.tsx +164 -0
  59. package/src/flow/actions/afterSuccess.tsx +142 -3
  60. package/src/flow/actions/dataScopeFilter.ts +10 -1
  61. package/src/flow/actions/dateTimeFormat.tsx +2 -2
  62. package/src/flow/actions/index.ts +1 -1
  63. package/src/flow/actions/openView.tsx +59 -5
  64. package/src/flow/admin-shell/BaseLayoutModel.tsx +149 -3
  65. package/src/flow/admin-shell/BaseLayoutRouteCoordinator.ts +187 -42
  66. package/src/flow/admin-shell/__tests__/AdminLayoutRouteCoordinator.test.ts +1020 -110
  67. package/src/flow/admin-shell/admin-layout/AdminLayoutComponent.tsx +42 -4
  68. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.test.tsx +177 -1
  69. package/src/flow/admin-shell/admin-layout/AdminLayoutEntryGuard.tsx +20 -0
  70. package/src/flow/admin-shell/admin-layout/AdminLayoutSlotModels.tsx +5 -4
  71. package/src/flow/admin-shell/admin-layout/AppListRender.tsx +13 -2
  72. package/src/flow/admin-shell/admin-layout/AppSwitcherActionPanelModel.tsx +289 -0
  73. package/src/flow/admin-shell/admin-layout/__tests__/AdminLayoutModel.test.tsx +518 -2
  74. package/src/flow/admin-shell/admin-layout/__tests__/TopbarActionsBar.test.tsx +48 -0
  75. package/src/flow/admin-shell/admin-layout/index.ts +1 -0
  76. package/src/flow/admin-shell/admin-layout/useApplications.tsx +81 -12
  77. package/src/flow/common/Markdown/Display.tsx +14 -3
  78. package/src/flow/common/Markdown/Edit.tsx +19 -7
  79. package/src/flow/components/FlowRoute.tsx +128 -16
  80. package/src/flow/getViewDiffAndUpdateHidden.tsx +1 -0
  81. package/src/flow/internal/components/Markdown/util.ts +2 -1
  82. package/src/flow/models/base/ActionModel.tsx +10 -8
  83. package/src/flow/models/base/ActionModelCore.tsx +11 -4
  84. package/src/flow/models/base/__tests__/ActionModelCore.render.test.tsx +37 -0
  85. package/src/flow/models/blocks/filter-form/fields/FilterFormCustomFieldModel.tsx +1 -1
  86. package/src/flow/models/blocks/form/FormActionModel.tsx +1 -1
  87. package/src/flow/models/blocks/form/__tests__/submitHandler.test.ts +54 -1
  88. package/src/flow/models/blocks/form/submitHandler.ts +17 -3
  89. package/src/flow/models/blocks/form/value-runtime/__tests__/runtime.test.ts +87 -0
  90. package/src/flow/models/blocks/form/value-runtime/runtime.ts +91 -0
  91. package/src/flow/models/blocks/js-block/JSBlock.tsx +223 -2
  92. package/src/flow/models/blocks/js-block/__tests__/JSBlockModel.test.tsx +150 -0
  93. package/src/flow/models/blocks/table/TableActionsColumnModel.tsx +35 -12
  94. package/src/flow/models/blocks/table/TableBlockModel.tsx +25 -14
  95. package/src/flow/models/blocks/table/TableColumnModel.tsx +6 -2
  96. package/src/flow/models/blocks/table/__tests__/TableActionsColumnModel.test.tsx +57 -1
  97. package/src/flow/models/blocks/table/__tests__/TableBlockModel.dragSort.test.ts +127 -0
  98. package/src/flow/models/blocks/table/__tests__/TableBlockModel.rowSelection.test.tsx +1 -0
  99. package/src/flow/models/blocks/table/__tests__/TableColumnModel.test.tsx +51 -0
  100. package/src/flow/models/blocks/table/dragSort/dragSortHooks.tsx +28 -17
  101. package/src/flow/models/blocks/table/dragSort/dragSortSettings.ts +13 -6
  102. package/src/flow/models/blocks/table/dragSort/dragSortUtils.ts +15 -2
  103. package/src/flow/models/fields/AssociationFieldModel/RecordSelectFieldModel.tsx +45 -13
  104. package/src/flow/models/fields/TextareaFieldModel.tsx +42 -19
  105. package/src/flow/models/fields/__tests__/TextareaFieldModel.test.tsx +32 -1
  106. package/src/flow/models/topbar/TopbarActionModel.tsx +78 -3
  107. package/src/flow/resolveViewParamsToViewList.tsx +11 -3
  108. package/src/flow/routeTransientInputArgs.ts +27 -0
  109. package/src/flow/utils/__tests__/dateTimeFormat.test.ts +42 -0
  110. package/src/index.ts +2 -0
  111. package/src/nocobase-buildin-plugin/index.tsx +7 -1
  112. package/src/settings-center/SystemSettingsPage.tsx +1 -1
  113. package/src/utils/markdownSanitize.ts +88 -0
@@ -12,6 +12,7 @@ import type { i18n as i18next } from 'i18next';
12
12
  import React, { ReactElement, ReactNode } from 'react';
13
13
  import type { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
14
14
  import { AIManager } from './ai';
15
+ import { EntryActionManager } from './entry-actions';
15
16
  import { SystemSettingsSource } from './flow/system-settings';
16
17
  import { LayoutManager } from './layout-manager/LayoutManager';
17
18
  import type { PluginClass, PluginManager, PluginType } from './PluginManager';
@@ -75,6 +76,7 @@ export declare abstract class BaseApplication<TOptions extends BaseApplicationOp
75
76
  pluginManager: TPluginManager;
76
77
  pluginSettingsManager: TPluginSettingsManager;
77
78
  layoutManager: LayoutManager<this>;
79
+ entryActionManager: EntryActionManager;
78
80
  aiManager: AIManager;
79
81
  devDynamicImport?: DevDynamicImport;
80
82
  requirejs: RequireJS;
@@ -124,6 +124,13 @@ export declare class RouteRepository {
124
124
  * @returns 匹配到的路由节点
125
125
  */
126
126
  getRouteBySchemaUid(schemaUid: string): NocoBaseDesktopRoute | undefined;
127
+ /**
128
+ * 通过路由 id 反查对应路由节点。
129
+ *
130
+ * @param routeId 桌面路由主键
131
+ * @returns 匹配到的路由节点
132
+ */
133
+ getRouteById(routeId: string | number): NocoBaseDesktopRoute | undefined;
127
134
  protected getAPIClient(): APIClient;
128
135
  protected getResource(collectionName: string): import("@nocobase/sdk").IResource;
129
136
  protected emitChange(layoutUid?: string): void;
@@ -135,5 +142,6 @@ export declare class RouteRepository {
135
142
  private nextRefreshRequestId;
136
143
  private getRefreshRequestId;
137
144
  private findRoute;
145
+ private findRouteById;
138
146
  }
139
147
  export {};
@@ -40,9 +40,18 @@ export type RenderComponentType = (Component: ComponentTypeAndString, props?: an
40
40
  export type RouterComponentType = React.FC<{
41
41
  BaseLayout?: ComponentType;
42
42
  }>;
43
+ type AdminRouteNavigationTarget = {
44
+ currentPathname?: string;
45
+ targetPathname: unknown;
46
+ basePath?: string;
47
+ adminRoutePath?: string;
48
+ replace?: boolean;
49
+ };
50
+ export declare function shouldOpenAdminRouteInNewWindow(options: AdminRouteNavigationTarget): boolean;
43
51
  export declare class RouterManager<TApp extends BaseApplication<any> = BaseApplication<any>> {
44
52
  protected routes: Record<string, RouteType>;
45
53
  protected options: RouterOptions;
54
+ private routerNavigate?;
46
55
  app: TApp;
47
56
  router: Router;
48
57
  get basename(): string;
@@ -52,6 +61,11 @@ export declare class RouterManager<TApp extends BaseApplication<any> = BaseAppli
52
61
  (to: import("react-router").To, opts?: import("@remix-run/router").RouterNavigateOptions): Promise<void>;
53
62
  };
54
63
  constructor(options: RouterOptions, app: TApp);
64
+ private navigateWithPortalPolicy;
65
+ private shouldOpenAdminRouteInNewWindow;
66
+ private getRuntimeBasePath;
67
+ private getAdminRoutePath;
68
+ private getAdminRouteNavigationHref;
55
69
  protected resolveLoadedComponent(moduleOrComponent: ComponentLoaderResult): ComponentTypeAndString | undefined;
56
70
  protected createRouteLazyComponent(componentLoader: ComponentLoader): ComponentType;
57
71
  /**
@@ -73,3 +87,4 @@ export declare class RouterManager<TApp extends BaseApplication<any> = BaseAppli
73
87
  has(name: string): boolean;
74
88
  remove(name: string): void;
75
89
  }
90
+ export {};
@@ -31,6 +31,7 @@ export declare function getModernClientPrefix(): string;
31
31
  export declare function stripModernClientPrefix(publicPath?: string): string;
32
32
  export declare function getV2EffectiveBasePath(app: AppLike): string;
33
33
  declare function getDefaultV2AdminRedirectPath(app: AppLike): string;
34
+ export declare function normalizeV2RedirectPath(app: AppLike, target?: string | null, fallbackPath?: string): string;
34
35
  /**
35
36
  * 将当前 v2 页面地址转换为根相对 redirect 路径。
36
37
  *
@@ -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 FlowModelContext, type SubModelItem, type SubModelItemsType } from '@nocobase/flow-engine';
10
+ export type EntryActionScope = 'action-panel' | 'app-switcher' | string;
11
+ export type EntryActionProvider = (ctx: FlowModelContext) => SubModelItem[] | Promise<SubModelItem[]>;
12
+ export declare class EntryActionManager {
13
+ private readonly providers;
14
+ revision: number;
15
+ constructor();
16
+ register(name: string, options: {
17
+ scope: EntryActionScope;
18
+ provider: EntryActionProvider;
19
+ sort?: number;
20
+ }): void;
21
+ unregister(name: string): void;
22
+ invalidate(): void;
23
+ getItems(scope: EntryActionScope): SubModelItemsType;
24
+ }
@@ -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 * from './EntryActionManager';
@@ -6,4 +6,11 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export declare const afterSuccess: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
9
+ import { FlowContext, type FlowRuntimeContext, type MetaTreeNode } from '@nocobase/flow-engine';
10
+ type ResponseRecordPlainStepContext = {
11
+ steps?: FlowRuntimeContext['steps'];
12
+ };
13
+ export declare function getAfterSuccessResponseRecord(ctx: FlowContext | ResponseRecordPlainStepContext): any;
14
+ export declare function getMetaTreeWithResponseRecord(ctx: FlowRuntimeContext): MetaTreeNode[];
15
+ export declare const afterSuccess: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, FlowContext>;
16
+ export {};
@@ -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
- export * from './afterSuccess';
9
+ export { afterSuccess } from './afterSuccess';
10
10
  export * from './confirm';
11
11
  export * from './dataScope';
12
12
  export * from './openView';
@@ -41,6 +41,7 @@ export interface LayoutRouteLike {
41
41
  id?: string;
42
42
  name?: string;
43
43
  pathname?: string;
44
+ state?: unknown;
44
45
  params?: Record<string, string | undefined>;
45
46
  layoutRouteName?: string;
46
47
  layoutBasePathname?: string;
@@ -56,6 +57,7 @@ export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = Ba
56
57
  currentLayoutRoute: LayoutRouteMatch | null;
57
58
  protected routeCoordinator?: BaseLayoutRouteCoordinator;
58
59
  private activePageUid;
60
+ private currentRouteState?;
59
61
  private layoutContentElement;
60
62
  private readonly routePageMetaMap;
61
63
  private contextBindingsActive;
@@ -82,6 +84,10 @@ export declare class BaseLayoutModel<TStructure extends BaseLayoutStructure = Ba
82
84
  private teardownRuntime;
83
85
  private getCurrentRouteByActivePage;
84
86
  private getCurrentCoordinatorRouteLike;
87
+ private restoreCurrentLayoutRouteFromRouterContext;
88
+ private shouldIgnoreStaleLayoutRouteCleanup;
89
+ private getRouterContextRouteLike;
90
+ private isRouteLikeOwnedByCurrentLayout;
85
91
  }
86
92
  /**
87
93
  * 按固定 UID 获取或创建 Layout host model。
@@ -25,6 +25,7 @@ interface RouteLike {
25
25
  name?: string;
26
26
  };
27
27
  pathname?: string;
28
+ state?: unknown;
28
29
  pageUid?: string;
29
30
  layoutBasePathname?: string;
30
31
  layoutRoute?: {
@@ -46,6 +47,7 @@ export declare class BaseLayoutRouteCoordinator {
46
47
  private basePathname;
47
48
  private readonly runtimes;
48
49
  private layoutContentElement;
50
+ private lastNonNullLayoutContentElement;
49
51
  constructor(flowEngine: FlowEngine, options?: BaseLayoutRouteCoordinatorOptions);
50
52
  setLayoutContentElement(element: HTMLElement | null): void;
51
53
  registerPage(pageUid: string, meta: RoutePageMeta): RouteModel<import("@nocobase/flow-engine").DefaultStructure>;
@@ -62,6 +64,11 @@ export declare class BaseLayoutRouteCoordinator {
62
64
  private shouldStepNavigate;
63
65
  private scheduleInitialDeepLinkReplay;
64
66
  private stepNavigate;
67
+ private replayActiveRuntimeViewsAfterLayoutContentElementChange;
68
+ private invalidatePendingRuntimeViewOpens;
69
+ private resetRuntimeViewStateForLayoutContentElementChange;
70
+ private markPendingOpenViews;
71
+ private clearPendingOpenViews;
65
72
  private handleOpenViews;
66
73
  private openViews;
67
74
  private ensureRouteModelContext;
@@ -13,6 +13,7 @@ type AdminLayoutContentProps = {
13
13
  layout?: (AdminLayoutRoutePathLike & {
14
14
  routeName?: string;
15
15
  }) | null;
16
+ designable?: boolean;
16
17
  };
17
18
  /**
18
19
  * AdminLayout 内部使用的内容区容器。
@@ -8,4 +8,5 @@
8
8
  */
9
9
  import type { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
10
10
  import React from 'react';
11
- export declare function useAppListRender(): (appList: AppListProps) => React.JSX.Element;
11
+ import type { AppSwitcherActionPanelModel } from './AppSwitcherActionPanelModel';
12
+ export declare function useAppListRender(appSwitcherModel?: AppSwitcherActionPanelModel): (appList: AppListProps) => React.JSX.Element;
@@ -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 { ActionModel } from '../../models/base';
10
+ import { FlowModel, type SubModelItemsType } from '@nocobase/flow-engine';
11
+ import React from 'react';
12
+ type AppSwitcherActionPanelStructure = {
13
+ subModels: {
14
+ actions?: ActionModel[];
15
+ };
16
+ };
17
+ export declare class AppSwitcherActionPanelModel extends FlowModel<AppSwitcherActionPanelStructure> {
18
+ getConfigureActionsItems(): SubModelItemsType;
19
+ renderConfigureActions(): React.JSX.Element;
20
+ private getRenderableActions;
21
+ hasActions(): boolean;
22
+ renderContent(): React.JSX.Element;
23
+ }
24
+ export {};
@@ -8,6 +8,7 @@
8
8
  */
9
9
  export * from './AdminLayoutComponent';
10
10
  export * from './AdminLayoutModel';
11
+ export * from './AppSwitcherActionPanelModel';
11
12
  export * from '../BaseLayoutModel';
12
13
  export * from '../BaseLayoutRouteCoordinator';
13
14
  export * from './AdminLayoutSlotModels';
@@ -6,8 +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 { AppListProps } from '@ant-design/pro-layout/es/components/AppsLogoComponents/types';
9
10
  import React from 'react';
10
- export declare const useApplications: () => {
11
+ import type { AdminLayoutModel } from './AdminLayoutModel';
12
+ import type { AppSwitcherActionPanelModel } from './AppSwitcherActionPanelModel';
13
+ export declare const APP_SWITCHER_ACTION_PANEL_MODEL_UID: string;
14
+ export declare const useApplications: (adminLayoutModel?: AdminLayoutModel) => {
11
15
  Component: React.JSXElementConstructor<any> | React.ExoticComponent<any>;
12
- appList: any[];
16
+ appList: AppListProps;
17
+ appSwitcherModel: AppSwitcherActionPanelModel;
13
18
  };
@@ -30,6 +30,7 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
30
30
  enableEditTooltip: boolean;
31
31
  enableEditTitle: boolean;
32
32
  enableEditIcon: boolean;
33
+ enableEditIconOnly: boolean;
33
34
  enableEditType: boolean;
34
35
  enableEditDanger: boolean;
35
36
  enableEditColor: boolean;
@@ -44,6 +45,7 @@ export declare class ActionModel<T extends DefaultStructure = DefaultStructure>
44
45
  getInputArgs(): Record<string, any>;
45
46
  onClick(event: any): void;
46
47
  getTitle(): string;
48
+ getTitleFieldDescription(): any;
47
49
  getIcon(): React.ReactNode;
48
50
  renderButton(): React.JSX.Element;
49
51
  render(): React.JSX.Element;
@@ -6,4 +6,4 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export declare function submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<void>;
9
+ export declare function submitHandler(ctx: any, params: any, cb?: (values?: any, filterByTk?: any) => void): Promise<unknown>;
@@ -12,6 +12,10 @@ 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;
@@ -50,6 +54,8 @@ export declare class FormValueRuntime {
50
54
  syncAssignRules(items: FormAssignRuleItem[]): void;
51
55
  get formValues(): any;
52
56
  getFormValuesSnapshot(): any;
57
+ getUserEditedValuePatches(): FormValuePatch[];
58
+ getUserEditedValuesSnapshot(): Record<string, unknown>;
53
59
  private toMirrorSnapshot;
54
60
  canApplyDefaultValuePatch(namePath: NamePath, resolved: any): boolean;
55
61
  canApplyOverrideValuePatch(namePath: NamePath): boolean;
@@ -111,6 +117,9 @@ export declare class FormValueRuntime {
111
117
  private isExplicit;
112
118
  private findExplicitHit;
113
119
  private findUserEditedHit;
120
+ private findLatestWriteMeta;
121
+ private isCurrentUserEditedPath;
122
+ private omitNonUserDescendantValues;
114
123
  private isDescendantPathKey;
115
124
  }
116
125
  export {};
@@ -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): Promise<void>;
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): import("@nocobase/flow-engine").CollectionField[];
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): import("@nocobase/flow-engine").CollectionField;
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: any[]): {
29
+ export declare function convertFieldsToOptions(fields: CollectionField[]): {
28
30
  label: any;
29
31
  value: any;
30
32
  disabled: any;
@@ -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,14 @@
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 const ROUTE_TRANSIENT_INPUT_ARGS_KEY = "__nocobaseOpenViewInputArgs";
10
+ export type RouteTransientInputArgsState = {
11
+ [ROUTE_TRANSIENT_INPUT_ARGS_KEY]?: Record<string, Record<string, unknown>>;
12
+ usr?: RouteTransientInputArgsState;
13
+ };
14
+ export declare const getRouteTransientInputArgs: (state: unknown, viewUid?: string) => Record<string, unknown>;
package/es/index.d.ts CHANGED
@@ -36,7 +36,9 @@ export * from './collection-manager/filter-operators';
36
36
  export * from './collection-manager/interfaces';
37
37
  export * from './collection-manager/template-fields';
38
38
  export * from './data-source';
39
+ export * from './entry-actions';
39
40
  export * from './flow';
40
41
  export { DEFAULT_DATA_SOURCE_KEY, IconPicker, isTitleField, isTitleFieldInterface, NocoBaseDesktopRouteType, } from './flow-compat';
41
42
  export type { NocoBaseDesktopRoute } from './flow-compat';
43
+ export * from './utils/markdownSanitize';
42
44
  export { default as AntdAppProvider } from './theme/AntdAppProvider';