@nocobase/client-v2 2.2.0-beta.2 → 2.2.0-beta.3

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.
@@ -31,10 +31,15 @@ export interface SubTableColumnModelStructure {
31
31
  export declare class SubTableColumnModel<T extends SubTableColumnModelStructure = SubTableColumnModelStructure> extends EditableItemModel<T> {
32
32
  static renderMode: ModelRenderMode;
33
33
  static fieldComponentContext: string;
34
+ private getAssociationField;
35
+ private getParentFormValues;
36
+ private createParentItemAccessors;
37
+ private createRowItemContextPropertyOptions;
34
38
  renderHiddenInConfig(): React.JSX.Element;
35
39
  static defineChildren(ctx: FlowModelContext): any;
36
40
  get collection(): any;
37
41
  get hasFormulaColumn(): boolean;
42
+ get hasFormValueDrivenDataScopeColumn(): boolean;
38
43
  onInit(options: any): void;
39
44
  afterAddAsSubModel(): Promise<void>;
40
45
  getColumnProps(): TableColumnProps;
@@ -0,0 +1,59 @@
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 { FlowContext } from '@nocobase/flow-engine';
10
+ import { type FieldIndexEntry, type NamePath } from './formValueDeps';
11
+ export type FilterTargetKey = string | string[] | null | undefined;
12
+ export type RowIdentity = string;
13
+ export type RowScopedFieldIndexEntry = FieldIndexEntry & {
14
+ filterTargetKey?: FilterTargetKey;
15
+ };
16
+ export type RowScope = {
17
+ entries: RowScopedFieldIndexEntry[];
18
+ tailPath: NamePath;
19
+ identityTailPaths: NamePath[];
20
+ };
21
+ export type DataScopeValuePath = {
22
+ path: NamePath;
23
+ rowScope?: RowScope;
24
+ };
25
+ export type DataScopeStructuralPath = {
26
+ path: NamePath;
27
+ kind: 'index' | 'length';
28
+ rowScope?: RowScope;
29
+ };
30
+ export type DataScopeTriggerPath = {
31
+ path: NamePath;
32
+ includeChildren: boolean;
33
+ };
34
+ export type DataScopeClearDeps = {
35
+ wildcard: boolean;
36
+ valuePaths: DataScopeValuePath[];
37
+ structuralPaths: DataScopeStructuralPath[];
38
+ triggerPaths: DataScopeTriggerPath[];
39
+ };
40
+ export type DataScopeSnapshotValue = {
41
+ value: unknown;
42
+ rowIdentities?: Array<RowIdentity | null>;
43
+ rowDetached?: boolean;
44
+ };
45
+ export type DataScopeClearSnapshot = {
46
+ complete: boolean;
47
+ rowDetached: boolean;
48
+ rowMissing: boolean;
49
+ values: Map<string, DataScopeSnapshotValue>;
50
+ structures: Map<string, DataScopeSnapshotValue>;
51
+ };
52
+ export type DataScopeClearChangeStatus = {
53
+ status: 'changed' | 'unchanged' | 'unknown';
54
+ snapshot: DataScopeClearSnapshot | null;
55
+ };
56
+ export declare function applyDataScopeFieldIndexTargetKeys(ctx: FlowContext, entries: FieldIndexEntry[]): RowScopedFieldIndexEntry[];
57
+ export declare function createDataScopeRowScope(entries: RowScopedFieldIndexEntry[], parentDepth: number, tailPath: NamePath): RowScope | undefined;
58
+ export declare function buildDepsSnapshot(deps: DataScopeClearDeps, formBlock: any, payload?: unknown): DataScopeClearSnapshot | null;
59
+ export declare function getDepsChangeStatus(deps: DataScopeClearDeps, formBlock: any, payload: unknown, snapshot: DataScopeClearSnapshot | null): DataScopeClearChangeStatus;
@@ -0,0 +1,32 @@
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 { FlowContext } from '@nocobase/flow-engine';
10
+ export type NamePath = Array<string | number>;
11
+ export type FieldIndexEntry = {
12
+ name: string;
13
+ index: number;
14
+ };
15
+ export declare function isSameNamePath(a: NamePath, b: NamePath): boolean;
16
+ export declare function isNamePathPrefix(prefix: NamePath, path: NamePath): boolean;
17
+ export declare function dedupeNamePaths(paths: NamePath[]): NamePath[];
18
+ export declare function minimizeNamePaths(paths: NamePath[]): NamePath[];
19
+ export declare function parseFieldIndexEntries(fieldIndex: unknown): FieldIndexEntry[];
20
+ export declare function getFieldIndexEntriesFromContext(ctx: FlowContext | {
21
+ model?: unknown;
22
+ fieldIndex?: unknown;
23
+ }): FieldIndexEntry[];
24
+ export declare function buildItemRowPath(entries: FieldIndexEntry[], parentDepth: number): NamePath | null;
25
+ export declare function buildItemListRootPath(entries: FieldIndexEntry[], parentDepth: number): NamePath | null;
26
+ export declare function parseDependencyPath(subPath: string): NamePath;
27
+ export declare function parsePathKey(pathKey: string): NamePath;
28
+ export declare function getChangedPathsFromPayload(payload: unknown, options?: {
29
+ includeArrayChangedValues?: boolean;
30
+ }): NamePath[];
31
+ export declare function isFormValueChangeSource(model: unknown): boolean;
32
+ export declare function findFormValueChangeSource(ctx: FlowContext): unknown | null;