@nocobase/client 2.0.50 → 2.0.52

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.
@@ -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 const dateRangeLimit: import("@nocobase/flow-engine").ActionDefinition<import("@nocobase/flow-engine").FlowModel<import("@nocobase/flow-engine").DefaultStructure>, import("@nocobase/flow-engine").FlowContext>;
@@ -19,6 +19,7 @@ export * from './refreshTargetBlocks';
19
19
  export * from './setTargetDataScope';
20
20
  export { titleField } from './titleField';
21
21
  export * from './dateTimeFormat';
22
+ export * from './dateRangeLimit';
22
23
  export * from './sortingRules';
23
24
  export * from './dataLoadingMode';
24
25
  export * from './renderMode';
@@ -16,6 +16,7 @@ type CollectionFieldLike = {
16
16
  title?: unknown;
17
17
  type?: unknown;
18
18
  interface?: unknown;
19
+ uiSchema?: unknown;
19
20
  targetKey?: unknown;
20
21
  targetCollectionTitleFieldName?: unknown;
21
22
  targetCollection?: any;
@@ -19,5 +19,10 @@ type Option = {
19
19
  } & Record<string, any>;
20
20
  export declare function translateOptions(options: Option[], t: (s: string) => string): Option[];
21
21
  export declare function enumToOptions(uiEnum: UiSchemaEnumItem[] | undefined, t: (s: string) => string): Option[] | undefined;
22
+ export declare function normalizeSelectRenderValue(value: unknown, props?: Record<string, any>): unknown;
23
+ export declare function getSelectedEnumLabels(value: any, fallbackOptions?: Option[]): Array<{
24
+ value: any;
25
+ label: any;
26
+ }>;
22
27
  export declare function ensureOptionsFromUiSchemaEnumIfAbsent(model: FlowModel, collectionField: CollectionField): boolean;
23
28
  export {};
@@ -13,5 +13,10 @@ export declare const getAssociationTargetResourceSettings: (ctx: FlowModelContex
13
13
  dataSourceKey: any;
14
14
  collectionName: any;
15
15
  };
16
+ export declare const getAssociationSelectorContextInputArgs: (ctx: FlowModelContext | any) => {
17
+ collectionField: any;
18
+ sourceId: any;
19
+ associatedRecords: any;
20
+ };
16
21
  export declare const applyDisassociateAction: (ctx: FlowModelContext | any) => Promise<void>;
17
22
  export declare const applyAssociateAction: (ctx: FlowModelContext | any, selectedRows: any[]) => Promise<void>;
@@ -26,6 +26,10 @@ export declare class PageModel extends FlowModel<PageModelStructure> {
26
26
  private dirtyRefreshScheduled;
27
27
  private unmounted;
28
28
  private documentTitleUpdateVersion;
29
+ /**
30
+ * 根页面标签页开关以路由表为准,避免 flow model 里的旧配置覆盖路由管理设置。
31
+ */
32
+ private getEnableTabs;
29
33
  private getActiveTabKey;
30
34
  private scheduleActiveLifecycleRefresh;
31
35
  onMount(): void;
@@ -10,6 +10,14 @@ import { DragEndEvent } from '@dnd-kit/core';
10
10
  import { PageModel } from './PageModel';
11
11
  export declare class RootPageModel extends PageModel {
12
12
  mounted: boolean;
13
+ /**
14
+ * 打开页面设置前,把标签页开关表单值同步为路由表中的当前状态。
15
+ */
16
+ private syncPageSettingsEnableTabsFromRoute;
17
+ /**
18
+ * 保存页面设置后立即同步当前页面状态,让标签页显隐无需等路由列表刷新或页面重载。
19
+ */
20
+ private syncEnableTabsToCurrentPage;
13
21
  /**
14
22
  * 新建 tab 在首次保存完成前,前端 route 里可能还没有数据库 id。
15
23
  * 拖拽前兜底触发一次保存,确保 move 接口拿到真实主键。
@@ -19,6 +27,7 @@ export declare class RootPageModel extends PageModel {
19
27
  */
20
28
  private ensurePersistedRouteId;
21
29
  onMount(): void;
30
+ openFlowSettings(options?: Parameters<PageModel['openFlowSettings']>[0]): Promise<boolean>;
22
31
  saveStepParams(): Promise<void>;
23
32
  handleDragEnd(event: DragEndEvent): Promise<void>;
24
33
  }
@@ -20,6 +20,8 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
20
20
  */
21
21
  autoTriggerFilter: boolean;
22
22
  private removeTargetBlockListener?;
23
+ private initialDefaultsPromise?;
24
+ private initialRefreshHandledTargetIds;
23
25
  get form(): any;
24
26
  get title(): string;
25
27
  useHooksBeforeRender(): void;
@@ -29,6 +31,8 @@ export declare class FilterFormBlockModel extends FilterBlockModel<{
29
31
  onMount(): void;
30
32
  onUnmount(): void;
31
33
  private applyDefaultsAndInitialFilter;
34
+ prepareInitialFilterValues(): Promise<boolean>;
35
+ markInitialTargetRefreshHandled(targetId: string): void;
32
36
  private ensureFilterItemsBeforeRender;
33
37
  applyFormDefaultValues(options?: {
34
38
  force?: boolean;
@@ -17,6 +17,9 @@ type FilterConfig = {
17
17
  /** 筛选操作符,每个条件的操作符可以不一样 */
18
18
  operator?: string;
19
19
  };
20
+ export type RefreshTargetsByFilterOptions = {
21
+ excludeTargetIds?: Set<string> | string[];
22
+ };
20
23
  export type ConnectFieldsConfig = {
21
24
  targets: {
22
25
  /** 数据区块或者图表区块的 model uid */
@@ -32,6 +35,7 @@ export declare class FilterManager {
32
35
  saveFilterConfigs(): Promise<void>;
33
36
  getFilterConfigs(): FilterConfig[];
34
37
  getConnectFieldsConfig(filterModelUid: string): ConnectFieldsConfig | undefined;
38
+ prepareFiltersForTarget(targetId: string): Promise<Set<any>>;
35
39
  saveConnectFieldsConfig(filterModelUid: string, config: ConnectFieldsConfig): Promise<void>;
36
40
  /**
37
41
  * 添加筛选配置
@@ -136,6 +140,6 @@ export declare class FilterManager {
136
140
  * await filterManager.refreshTargetsByFilter(['filter-1', 'filter-2']);
137
141
  * ```
138
142
  */
139
- refreshTargetsByFilter(filterId: string | string[]): Promise<void>;
143
+ refreshTargetsByFilter(filterId: string | string[], options?: RefreshTargetsByFilterOptions): Promise<void>;
140
144
  }
141
145
  export {};
@@ -46,6 +46,8 @@ export declare class FormValueRuntime {
46
46
  syncAssignRules(items: FormAssignRuleItem[]): void;
47
47
  get formValues(): any;
48
48
  getFormValuesSnapshot(): any;
49
+ canApplyDefaultValuePatch(namePath: NamePath, resolved: any): boolean;
50
+ recordDefaultValuePatch(namePath: NamePath, value?: any): void;
49
51
  private getFormValueAtPath;
50
52
  mount(options?: {
51
53
  sync?: boolean;
@@ -82,6 +84,11 @@ export declare class FormValueRuntime {
82
84
  private bumpChangeTick;
83
85
  private emitFormValuesChange;
84
86
  private markExplicit;
87
+ private normalizeObservedNamePath;
88
+ private clearExplicitForDefaultPatch;
89
+ private shouldPreserveDescendantDefaultsOnExplicit;
90
+ private shouldKeepDefaultPathEnabled;
91
+ private shouldKeepDefaultPathValueEnabled;
85
92
  private isExplicit;
86
93
  private findExplicitHit;
87
94
  }
@@ -13,6 +13,7 @@ export interface LegacyValueExtractor {
13
13
  export interface LegacyClearer {
14
14
  (model: any): void;
15
15
  }
16
+ export declare function hasPersistedAssignRulesValue(model: any, flowKey: string, stepKey: string): boolean;
16
17
  export declare function createLegacyValueExtractor(flowKeys: string[]): LegacyValueExtractor;
17
18
  export declare function createLegacyClearer(flowKeys: string[]): LegacyClearer;
18
19
  export declare function collectLegacyDefaultValueRules(formModel: any, extractor: LegacyValueExtractor): FieldAssignRuleItem[];
@@ -7,6 +7,14 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { TableBlockModel } from './TableBlockModel';
10
+ export declare function getAssociationSelectForeignKeyFilter(collectionField: any): {
11
+ [x: number]: {
12
+ $is: any;
13
+ };
14
+ };
15
+ export declare function getAssociationSelectAssociatedRecordsFilter(collection: any, associatedRecords?: any[]): {
16
+ [x: string]: any[];
17
+ };
10
18
  export declare class TableSelectModel extends TableBlockModel {
11
19
  static scene: import("../../base").BlockSceneType;
12
20
  rowSelectionProps: any;
@@ -11,9 +11,13 @@ import { TableColumnProps } from 'antd';
11
11
  import React from 'react';
12
12
  import { SubTableFieldModel } from '.';
13
13
  import { FieldModel } from '../../../base/FieldModel';
14
+ export declare const SUB_TABLE_COLUMN_FIELD_COMPONENT_CONTEXT = "subTableColumn";
15
+ export declare function isSubTableColumnFieldComponentContext(ctx: any): boolean;
14
16
  export declare function FieldWithoutPermissionPlaceholder({ targetModel }: {
15
17
  targetModel: any;
16
18
  }): React.JSX.Element;
19
+ export declare function buildRowPathFromFieldIndex(fieldIndex: unknown): Array<string | number> | null;
20
+ export declare function getLatestSubTableRowRecord(form: any, fieldIndex: unknown, fallbackRecord: any): any;
17
21
  export interface SubTableColumnModelStructure {
18
22
  parent: SubTableFieldModel;
19
23
  subModels: {
@@ -22,6 +26,7 @@ export interface SubTableColumnModelStructure {
22
26
  }
23
27
  export declare class SubTableColumnModel<T extends SubTableColumnModelStructure = SubTableColumnModelStructure> extends EditableItemModel<T> {
24
28
  static renderMode: ModelRenderMode;
29
+ static fieldComponentContext: string;
25
30
  renderHiddenInConfig(): React.JSX.Element;
26
31
  static defineChildren(ctx: FlowModelContext): any;
27
32
  get collection(): any;
@@ -8,7 +8,7 @@
8
8
  */
9
9
  import { CollectionField } from '@nocobase/flow-engine';
10
10
  import React from 'react';
11
- import { FieldModel } from '../base';
11
+ import { FieldModel } from '../base/FieldModel';
12
12
  export declare function transformNestedData(inputData: any): any[];
13
13
  export declare class ClickableFieldModel extends FieldModel {
14
14
  get collectionField(): CollectionField;
@@ -0,0 +1,20 @@
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
+ type DateLimitProps = {
10
+ _minDate?: any;
11
+ _maxDate?: any;
12
+ currentForm?: any;
13
+ };
14
+ export declare function useDateLimit(props: DateLimitProps): {
15
+ minDate: any;
16
+ maxDate: any;
17
+ disabledDate: any;
18
+ disabledTime: any;
19
+ };
20
+ export {};
@@ -16,6 +16,10 @@ import { FieldModel } from '../base/FieldModel';
16
16
  */
17
17
  export declare class JSEditableFieldModel extends FieldModel {
18
18
  private _mountedOnce;
19
+ private _pendingJsSettingsApply;
20
+ private _lastAppliedJsSettings?;
21
+ scheduleApplyJsSettings(): void;
22
+ useHooksBeforeRender(): void;
19
23
  render(): React.JSX.Element;
20
24
  /**
21
25
  * 在 CreateForm / 提交后重置等场景下,字段可能被卸载并重新挂载。
@@ -0,0 +1,12 @@
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 hasDisplayValue(value: any): boolean;
10
+ export declare function normalizeDisplayValue(value: any, options?: {
11
+ collectionField?: any;
12
+ }): any;