@nocobase/client 2.0.51 → 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>;
@@ -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 {};
@@ -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,6 +11,8 @@ 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;
@@ -24,6 +26,7 @@ export interface SubTableColumnModelStructure {
24
26
  }
25
27
  export declare class SubTableColumnModel<T extends SubTableColumnModelStructure = SubTableColumnModelStructure> extends EditableItemModel<T> {
26
28
  static renderMode: ModelRenderMode;
29
+ static fieldComponentContext: string;
27
30
  renderHiddenInConfig(): React.JSX.Element;
28
31
  static defineChildren(ctx: FlowModelContext): any;
29
32
  get collection(): any;
@@ -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 {};
@@ -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;