@nocobase/plugin-kanban 2.1.0-beta.2 → 2.1.0-beta.20

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,121 @@
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 { CollectionBlockModel } from '@nocobase/client';
10
+ import { MultiRecordResource } from '@nocobase/flow-engine';
11
+ import React from 'react';
12
+ import { type KanbanGroupOption } from './utils';
13
+ declare class KanbanBlockResource extends MultiRecordResource {
14
+ refresh(): Promise<void>;
15
+ }
16
+ export declare class KanbanBlockModel extends CollectionBlockModel<{
17
+ subModels: {
18
+ item: any;
19
+ actions?: any[];
20
+ cardViewAction?: any;
21
+ quickCreateAction?: any;
22
+ };
23
+ }> {
24
+ static scene: any;
25
+ isManualRefresh: boolean;
26
+ defaultProps: {
27
+ dragEnabled: boolean;
28
+ quickCreateEnabled: boolean;
29
+ styleVariant: string;
30
+ };
31
+ _defaultCustomModelClasses: {
32
+ CollectionActionGroupModel: string;
33
+ RecordActionGroupModel: string;
34
+ TableColumnModel: string;
35
+ TableAssociationFieldGroupModel: string;
36
+ TableCustomColumnModel: string;
37
+ };
38
+ static filterCollection(collection: any): boolean;
39
+ get resource(): MultiRecordResource<any>;
40
+ getGroupFieldCandidates(): any;
41
+ getSortFieldCandidates(groupFieldOrName?: any): any;
42
+ getDefaultGroupFieldName(): any;
43
+ getGroupField(): import("@nocobase/flow-engine").CollectionField;
44
+ getInlineGroupOptions(field?: import("@nocobase/flow-engine").CollectionField): KanbanGroupOption[];
45
+ getConfiguredGroupOptions(): KanbanGroupOption[];
46
+ getGroupTitleFieldName(field?: import("@nocobase/flow-engine").CollectionField): string | undefined;
47
+ getGroupColorFieldName(field?: import("@nocobase/flow-engine").CollectionField): string | undefined;
48
+ getRelationOptionFieldCandidates(field?: import("@nocobase/flow-engine").CollectionField): Array<{
49
+ label: string;
50
+ value: string;
51
+ }>;
52
+ loadRelationGroupOptions(field?: import("@nocobase/flow-engine").CollectionField, options?: {
53
+ titleFieldName?: string;
54
+ colorFieldName?: string;
55
+ savedOptions?: Array<Partial<KanbanGroupOption>>;
56
+ }): Promise<KanbanGroupOption[]>;
57
+ getPageSize(): any;
58
+ getColumnWidth(): any;
59
+ getConfiguredSortFieldName(): string;
60
+ getConfiguredGlobalSort(): any;
61
+ getConfiguredDragSortFieldName(): string;
62
+ getCompatibleSortFieldName(sortFieldName?: string, groupFieldOrName?: any): any;
63
+ getSortFieldName(groupFieldOrName?: any): any;
64
+ getDragSortFieldName(groupFieldOrName?: any): any;
65
+ getEffectiveSortFieldName(groupFieldOrName?: any): any;
66
+ getDragEnabled(): boolean;
67
+ getCardOpenMode(): "dialog" | "embed" | "drawer";
68
+ getCardPopupSize(): "large" | "medium" | "small";
69
+ getCardPopupTemplateUid(): string;
70
+ getCardPopupPageModelClass(): any;
71
+ getQuickCreateEnabled(): boolean;
72
+ getPopupMode(): "dialog" | "embed" | "drawer";
73
+ getPopupSize(): "large" | "medium" | "small";
74
+ getPopupTemplateUid(): string;
75
+ getPopupPageModelClass(): any;
76
+ getPopupTargetUid(): string;
77
+ getCardPopupTargetUid(): string;
78
+ getStyleVariant(): "default" | "filled";
79
+ isCardClickable(): boolean;
80
+ canDragSort(): boolean;
81
+ canCrossColumnDrag(): boolean;
82
+ getDataLoadingMode(): 'auto' | 'manual';
83
+ createResource(): KanbanBlockResource;
84
+ onActive(forceRefresh?: boolean): void;
85
+ renderConfigureActions(): React.JSX.Element;
86
+ renderActions(): React.JSX.Element;
87
+ getPopupActionUid(): string;
88
+ getQuickCreateActionUid(): string;
89
+ syncPopupAction(action: any, options: {
90
+ mode: string;
91
+ size: string;
92
+ popupTemplateUid?: string;
93
+ uid?: string;
94
+ pageModelClass?: string;
95
+ }): Promise<void>;
96
+ syncCardViewAction(action: any): Promise<void>;
97
+ ensureCardViewAction(): Promise<any>;
98
+ getQuickCreateAction(): any;
99
+ ensureQuickCreateAction(): Promise<any>;
100
+ syncQuickCreateAction(action: any): Promise<void>;
101
+ openEmptyPopupShell(options: {
102
+ mode?: string;
103
+ size?: string;
104
+ title?: string;
105
+ }): Promise<boolean>;
106
+ buildQuickCreateFormData(column?: {
107
+ value?: string;
108
+ isUnknown?: boolean;
109
+ }): {
110
+ [x: number]: string | {
111
+ [x: number]: string;
112
+ };
113
+ };
114
+ openQuickCreate(column?: {
115
+ value?: string;
116
+ isUnknown?: boolean;
117
+ }): Promise<void>;
118
+ openCard(record: any): Promise<void>;
119
+ renderComponent(): React.JSX.Element;
120
+ }
121
+ export {};
@@ -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
+ import { DetailsGridModel } from '@nocobase/client';
10
+ import { FlowModel } from '@nocobase/flow-engine';
11
+ import React from 'react';
12
+ type KanbanCardItemStructure = {
13
+ subModels: {
14
+ grid: DetailsGridModel;
15
+ };
16
+ };
17
+ export declare class KanbanCardItemModel extends FlowModel<KanbanCardItemStructure> {
18
+ render(): React.JSX.Element;
19
+ }
20
+ export {};
@@ -0,0 +1,13 @@
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 { ActionGroupModel } from '@nocobase/client';
10
+ import { type FlowModelContext } from '@nocobase/flow-engine';
11
+ export declare class KanbanCollectionActionGroupModel extends ActionGroupModel {
12
+ static defineChildren(ctx: FlowModelContext): Promise<any[]>;
13
+ }
@@ -0,0 +1,23 @@
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 { AddNewActionModel, ViewActionModel } from '@nocobase/client';
10
+ export declare const createKanbanQuickCreateActionOptions: (uid?: string) => {
11
+ uid: string;
12
+ use: string;
13
+ };
14
+ export declare const createKanbanCardViewActionOptions: (uid?: string) => {
15
+ uid: string;
16
+ use: string;
17
+ };
18
+ export declare class KanbanQuickCreateActionModel extends AddNewActionModel {
19
+ defaultPopupTitle: string;
20
+ }
21
+ export declare class KanbanCardViewActionModel extends ViewActionModel {
22
+ defaultPopupTitle: string;
23
+ }
@@ -0,0 +1,13 @@
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 React from 'react';
10
+ import type { KanbanBlockModel } from '../KanbanBlockModel';
11
+ export declare const KanbanBlockView: React.MemoExoticComponent<import("@formily/reactive-react").ReactFC<{
12
+ model: KanbanBlockModel;
13
+ }>>;
@@ -0,0 +1,40 @@
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 React from 'react';
10
+ type SortFieldOption = {
11
+ label: string;
12
+ value: string;
13
+ scopeKey?: string;
14
+ uiSchema?: {
15
+ title?: string;
16
+ };
17
+ };
18
+ type CollectionFieldMetadata = {
19
+ name: string;
20
+ interface?: string;
21
+ foreignKey?: string;
22
+ scopeKey?: string;
23
+ uiSchema?: {
24
+ title?: string;
25
+ };
26
+ };
27
+ type GroupFieldOption = {
28
+ label: string;
29
+ value: string;
30
+ };
31
+ export declare const upsertKanbanCollectionFieldOptions: (fields?: Record<string, any>[], fieldData?: Record<string, any>) => Record<string, any>[];
32
+ export declare const KanbanCreateSortFieldSelect: (props: {
33
+ [key: string]: any;
34
+ sortFields?: SortFieldOption[];
35
+ collectionFields?: CollectionFieldMetadata[];
36
+ groupField?: GroupFieldOption;
37
+ collectionName?: string;
38
+ dataSource?: string;
39
+ }) => React.JSX.Element;
40
+ export {};
@@ -0,0 +1,21 @@
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 React from 'react';
10
+ import type { KanbanBlockModel } from '../KanbanBlockModel';
11
+ import { type KanbanGroupOption } from '../utils';
12
+ type GroupOptionsValue = KanbanGroupOption[];
13
+ export declare const KanbanGroupOptionsTable: React.MemoExoticComponent<import("@formily/react").ReactFC<{
14
+ value?: GroupOptionsValue;
15
+ onChange?: (value: GroupOptionsValue) => void;
16
+ groupFieldName?: string;
17
+ model?: KanbanBlockModel;
18
+ collection?: any;
19
+ dataSourceKey?: string;
20
+ }>>;
21
+ export {};
@@ -0,0 +1,18 @@
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 React from 'react';
10
+ import type { KanbanBlockModel } from '../KanbanBlockModel';
11
+ import { type KanbanGroupOption, type KanbanGroupingValue } from '../utils';
12
+ export declare const KanbanGroupingSelector: React.MemoExoticComponent<import("@formily/react").ReactFC<{
13
+ value?: KanbanGroupOption[] | KanbanGroupingValue;
14
+ onChange?: (value: KanbanGroupOption[]) => void;
15
+ model?: KanbanBlockModel;
16
+ collection?: any;
17
+ dataSourceKey?: string;
18
+ }>>;
@@ -0,0 +1,31 @@
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 React from 'react';
10
+ import type { KanbanBlockModel } from '../../KanbanBlockModel';
11
+ import { type KanbanRuntimeRecord } from './shared';
12
+ export declare const CardPlaceholder: () => React.JSX.Element;
13
+ type LazyCardRendererProps = {
14
+ model: KanbanBlockModel;
15
+ record: any;
16
+ index: number;
17
+ columnKey: string;
18
+ enableDesignSettings?: boolean;
19
+ };
20
+ export declare const LazyCardRenderer: React.MemoExoticComponent<({ model, record, index, columnKey, enableDesignSettings }: LazyCardRendererProps) => React.JSX.Element>;
21
+ type DraggableKanbanCardProps = {
22
+ model: KanbanBlockModel;
23
+ record: KanbanRuntimeRecord;
24
+ index: number;
25
+ columnKey: string;
26
+ dragEnabled: boolean;
27
+ dragInteractionEnabled: boolean;
28
+ enableDesignSettings?: boolean;
29
+ };
30
+ export declare const DraggableKanbanCard: React.MemoExoticComponent<({ model, record, index, columnKey, dragEnabled, dragInteractionEnabled, enableDesignSettings, }: DraggableKanbanCardProps) => React.JSX.Element>;
31
+ export {};
@@ -0,0 +1,26 @@
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 React from 'react';
10
+ import type { KanbanBlockModel } from '../../KanbanBlockModel';
11
+ import { type ColumnRefreshMeta, type ColumnState, type KanbanDesignSettingsHost, type KanbanRuntimeRecord, type RuntimeColumn } from './shared';
12
+ type ColumnPanelProps = {
13
+ model: KanbanBlockModel;
14
+ column: RuntimeColumn;
15
+ state: ColumnState | undefined;
16
+ displayItems: KanbanRuntimeRecord[];
17
+ setState: React.Dispatch<React.SetStateAction<Record<string, ColumnState>>>;
18
+ refreshMeta?: ColumnRefreshMeta;
19
+ designSettingsHost?: KanbanDesignSettingsHost | null;
20
+ fixedHeight: boolean;
21
+ dragEnabled: boolean;
22
+ dragInteractionEnabled: boolean;
23
+ hidden?: boolean;
24
+ };
25
+ export declare const ColumnPanel: React.MemoExoticComponent<({ model, column, state, displayItems, setState, refreshMeta, designSettingsHost, fixedHeight, dragEnabled, dragInteractionEnabled, hidden, }: ColumnPanelProps) => React.JSX.Element>;
26
+ export {};
@@ -0,0 +1,127 @@
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 { MultiRecordResource } from '@nocobase/flow-engine';
10
+ import type { KanbanBlockModel } from '../../KanbanBlockModel';
11
+ export type DropResult = {
12
+ source: {
13
+ droppableId: string;
14
+ index: number;
15
+ };
16
+ destination?: {
17
+ droppableId: string;
18
+ index: number;
19
+ } | null;
20
+ };
21
+ export type ColumnState = {
22
+ items: any[];
23
+ page: number;
24
+ hasNext: boolean;
25
+ count?: number;
26
+ loading: boolean;
27
+ error?: string;
28
+ loadedRefreshToken: number;
29
+ };
30
+ export type RuntimeColumn = {
31
+ key: string;
32
+ value: string;
33
+ label: string;
34
+ color: string;
35
+ isUnknown?: boolean;
36
+ };
37
+ export type KanbanDesignSettingsHost = {
38
+ columnKey: string;
39
+ recordKey?: string;
40
+ index: number;
41
+ };
42
+ export type ColumnRefreshMeta = {
43
+ token: number;
44
+ reason: 'global' | 'drag';
45
+ activeRecordKey?: string;
46
+ };
47
+ export type KanbanRuntimeRecord = {
48
+ id?: string | number;
49
+ __kanbanRecordKey?: string;
50
+ __kanbanRecordKeyValue?: any;
51
+ __kanbanColumnKey?: string;
52
+ [key: string]: any;
53
+ };
54
+ export declare const createInitialColumnState: (loading?: boolean) => ColumnState;
55
+ export declare const getRuntimeRecordKey: (record: KanbanRuntimeRecord, collection?: {
56
+ filterTargetKey?: string | string[];
57
+ getFilterByTK?: (record: any) => any;
58
+ }) => string;
59
+ export declare const normalizeKanbanRuntimeRecord: (record: any, collection?: {
60
+ filterTargetKey?: string | string[];
61
+ getFilterByTK?: (record: any) => any;
62
+ }) => KanbanRuntimeRecord;
63
+ export declare const dedupeColumnItemsByRecordKey: (items: KanbanRuntimeRecord[], collection?: {
64
+ filterTargetKey?: string | string[];
65
+ getFilterByTK?: (record: any) => any;
66
+ }) => KanbanRuntimeRecord[];
67
+ export declare const getKanbanCardRenderKey: (options: {
68
+ columnKey: string;
69
+ record: any;
70
+ index: number;
71
+ }) => string;
72
+ export declare const getKanbanDesignSettingsHost: (options: {
73
+ enabled: boolean;
74
+ columns: RuntimeColumn[];
75
+ itemsByColumn: Record<string, KanbanRuntimeRecord[]>;
76
+ collection?: {
77
+ filterTargetKey?: string | string[];
78
+ getFilterByTK?: (record: any) => any;
79
+ };
80
+ }) => KanbanDesignSettingsHost | null;
81
+ export declare const shouldMountUnknownColumn: (options: {
82
+ state?: ColumnState;
83
+ refreshMeta?: ColumnRefreshMeta;
84
+ displayItems?: KanbanRuntimeRecord[];
85
+ }) => boolean;
86
+ export declare const shouldHideUnknownColumn: (options: {
87
+ state?: ColumnState;
88
+ refreshMeta?: ColumnRefreshMeta;
89
+ displayItems?: KanbanRuntimeRecord[];
90
+ }) => boolean;
91
+ export declare const isKanbanDesignSettingsHost: (options: {
92
+ host: KanbanDesignSettingsHost | null | undefined;
93
+ columnKey: string;
94
+ record: KanbanRuntimeRecord;
95
+ index: number;
96
+ collection?: {
97
+ filterTargetKey?: string | string[];
98
+ getFilterByTK?: (record: any) => any;
99
+ };
100
+ }) => boolean;
101
+ export declare const removeKanbanColumnOverride: (record: KanbanRuntimeRecord) => KanbanRuntimeRecord;
102
+ export declare const applyKanbanColumnOverride: (options: {
103
+ record: KanbanRuntimeRecord;
104
+ sourceColumnKey: string;
105
+ targetColumnKey: string;
106
+ }) => KanbanRuntimeRecord;
107
+ export declare const moveKanbanRecordByCoordinates: (options: {
108
+ itemsByColumn: Record<string, KanbanRuntimeRecord[]>;
109
+ sourceColumnKey: string;
110
+ sourceIndex: number;
111
+ targetColumnKey: string;
112
+ targetIndex: number;
113
+ }) => Record<string, KanbanRuntimeRecord[]>;
114
+ export declare const areKanbanRecordListsEqual: (left?: KanbanRuntimeRecord[], right?: KanbanRuntimeRecord[], collection?: {
115
+ filterTargetKey?: string | string[];
116
+ getFilterByTK?: (record: any) => any;
117
+ }) => boolean;
118
+ export declare const reuseKanbanRecordReferences: (options: {
119
+ previousItems?: KanbanRuntimeRecord[];
120
+ nextItems?: KanbanRuntimeRecord[];
121
+ collection?: {
122
+ filterTargetKey?: string | string[];
123
+ getFilterByTK?: (record: any) => any;
124
+ };
125
+ skipRecordKeys?: Array<string | undefined>;
126
+ }) => KanbanRuntimeRecord[];
127
+ export declare const createColumnResource: (model: KanbanBlockModel, column: RuntimeColumn, page: number, pageSize?: number) => MultiRecordResource<unknown>;
@@ -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
+ export * from './utils';
10
+ export * from './KanbanBlockModel';
11
+ export * from './KanbanCardItemModel';
12
+ export * from './KanbanCollectionActionGroupModel';
13
+ export * from './actions/KanbanPopupModels';
14
+ export * from './components/KanbanGroupingSelector';
15
+ export * from './components/KanbanGroupOptionsTable';
16
+ export * from './components/KanbanCreateSortFieldSelect';
@@ -0,0 +1,11 @@
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 normalizeKanbanPopupTargetUid: (value?: string) => string;
10
+ export declare const normalizeKanbanPopupTemplateUid: (value?: string) => string;
11
+ export declare const resolveKanbanOpenViewDefaultParams: (ctx: any) => Promise<any>;