nkk-flow 0.1.0
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.
- package/LICENSE +21 -0
- package/README.md +180 -0
- package/dist/index.cjs +226 -0
- package/dist/index.js +5682 -0
- package/dist/style.css +2 -0
- package/dist/types/components/ui/cascader/Cascader.vue.d.ts +44 -0
- package/dist/types/components/ui/cascader/index.d.ts +2 -0
- package/dist/types/components/ui/cascader/types.d.ts +27 -0
- package/dist/types/components/ui/checkbox/Checkbox.vue.d.ts +24 -0
- package/dist/types/components/ui/checkbox/index.d.ts +1 -0
- package/dist/types/components/ui/date/DatePanel.vue.d.ts +11 -0
- package/dist/types/components/ui/date/DatePicker.vue.d.ts +21 -0
- package/dist/types/components/ui/date/index.d.ts +2 -0
- package/dist/types/components/ui/date/useFloatingPanel.d.ts +18 -0
- package/dist/types/components/ui/date-time/DateTimePicker.vue.d.ts +18 -0
- package/dist/types/components/ui/date-time/index.d.ts +1 -0
- package/dist/types/components/ui/drawer/Drawer.vue.d.ts +40 -0
- package/dist/types/components/ui/drawer/index.d.ts +1 -0
- package/dist/types/components/ui/empty/Empty.vue.d.ts +11 -0
- package/dist/types/components/ui/empty/index.d.ts +1 -0
- package/dist/types/components/ui/input/Input.vue.d.ts +20 -0
- package/dist/types/components/ui/input/index.d.ts +1 -0
- package/dist/types/components/ui/input-number/InputNumber.vue.d.ts +23 -0
- package/dist/types/components/ui/input-number/index.d.ts +1 -0
- package/dist/types/components/ui/loading/Loading.vue.d.ts +9 -0
- package/dist/types/components/ui/loading/LoadingMask.vue.d.ts +15 -0
- package/dist/types/components/ui/loading/index.d.ts +14 -0
- package/dist/types/components/ui/loading/service.d.ts +20 -0
- package/dist/types/components/ui/radio/Radio.vue.d.ts +26 -0
- package/dist/types/components/ui/radio/index.d.ts +1 -0
- package/dist/types/components/ui/scrollbar/Scrollbar.vue.d.ts +24 -0
- package/dist/types/components/ui/scrollbar/index.d.ts +1 -0
- package/dist/types/components/ui/segmented/Segmented.vue.d.ts +20 -0
- package/dist/types/components/ui/segmented/index.d.ts +2 -0
- package/dist/types/components/ui/segmented/types.d.ts +12 -0
- package/dist/types/components/ui/select/Select.vue.d.ts +34 -0
- package/dist/types/components/ui/select/index.d.ts +2 -0
- package/dist/types/components/ui/select-field/SelectField.vue.d.ts +33 -0
- package/dist/types/components/ui/select-field/index.d.ts +3 -0
- package/dist/types/components/ui/switch/Switch.vue.d.ts +15 -0
- package/dist/types/components/ui/switch/index.d.ts +1 -0
- package/dist/types/components/ui/tree-node/TreeNode.vue.d.ts +55 -0
- package/dist/types/components/ui/tree-node/TreeNodeRow.vue.d.ts +22 -0
- package/dist/types/components/ui/tree-node/context.d.ts +23 -0
- package/dist/types/components/ui/tree-node/index.d.ts +3 -0
- package/dist/types/components/ui/tree-node/types.d.ts +15 -0
- package/dist/types/components/ui/tree-node/utils.d.ts +41 -0
- package/dist/types/hooks/logicflow/adapter.d.ts +17 -0
- package/dist/types/hooks/logicflow/components/add-node-dialog/index.vue.d.ts +18 -0
- package/dist/types/hooks/logicflow/components/index.d.ts +3 -0
- package/dist/types/hooks/logicflow/components/node-config/ApprovalNodeConfig.vue.d.ts +4 -0
- package/dist/types/hooks/logicflow/components/node-config/CcNodeConfig.vue.d.ts +4 -0
- package/dist/types/hooks/logicflow/components/node-config/ConditionNodeConfig.vue.d.ts +4 -0
- package/dist/types/hooks/logicflow/components/node-config/StartNodeConfig.vue.d.ts +4 -0
- package/dist/types/hooks/logicflow/components/node-config/TimerNodeConfig.vue.d.ts +4 -0
- package/dist/types/hooks/logicflow/components/node-config/index.d.ts +19 -0
- package/dist/types/hooks/logicflow/components/node-config/index.vue.d.ts +43 -0
- package/dist/types/hooks/logicflow/components/node-config/types.d.ts +28 -0
- package/dist/types/hooks/logicflow/components/primitives/pickers/NodeConfigAssigneePicker.vue.d.ts +56 -0
- package/dist/types/hooks/logicflow/components/primitives/pickers/NodeConfigAssigneeTags.vue.d.ts +12 -0
- package/dist/types/hooks/logicflow/components/primitives/pickers/NodeConfigInitiatorPicker.vue.d.ts +30 -0
- package/dist/types/hooks/logicflow/components/primitives/ui/NodeConfigAddButton.vue.d.ts +12 -0
- package/dist/types/hooks/logicflow/components/primitives/ui/NodeConfigRadioCard.vue.d.ts +14 -0
- package/dist/types/hooks/logicflow/components/primitives/ui/NodeConfigSectionTitle.vue.d.ts +9 -0
- package/dist/types/hooks/logicflow/defaults.d.ts +9 -0
- package/dist/types/hooks/logicflow/edges/index.d.ts +1 -0
- package/dist/types/hooks/logicflow/edges/process/FlowProcessEdge.d.ts +34 -0
- package/dist/types/hooks/logicflow/edges/process/index.d.ts +1 -0
- package/dist/types/hooks/logicflow/index.d.ts +31 -0
- package/dist/types/hooks/logicflow/nodes/process/FlowProcessNode.d.ts +93 -0
- package/dist/types/hooks/logicflow/nodes/process/index.d.ts +1 -0
- package/dist/types/hooks/logicflow/register.d.ts +2 -0
- package/dist/types/hooks/logicflow/types/form.d.ts +26 -0
- package/dist/types/hooks/logicflow/types/index.d.ts +3 -0
- package/dist/types/hooks/logicflow/types/logicflow.d.ts +209 -0
- package/dist/types/hooks/logicflow/types/process/base.d.ts +52 -0
- package/dist/types/hooks/logicflow/types/process/endpoint.d.ts +19 -0
- package/dist/types/hooks/logicflow/types/process/router.d.ts +48 -0
- package/dist/types/hooks/logicflow/types/process/task.d.ts +86 -0
- package/dist/types/hooks/logicflow/types/process.d.ts +24 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +77 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { TreeNodeData } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
node: TreeNodeData;
|
|
4
|
+
depth: number;
|
|
5
|
+
};
|
|
6
|
+
declare var __VLS_9: {
|
|
7
|
+
node: TreeNodeData;
|
|
8
|
+
}, __VLS_19: string, __VLS_20: any;
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
[K in NonNullable<typeof __VLS_19>]?: (props: typeof __VLS_20) => any;
|
|
11
|
+
} & {
|
|
12
|
+
label?: (props: typeof __VLS_9) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
15
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ComputedRef, InjectionKey } from 'vue';
|
|
2
|
+
import type { TreeNodeData, TreeCheckState } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* TreeNode 根组件通过 provide 向递归行组件传递的上下文
|
|
5
|
+
*/
|
|
6
|
+
export interface TreeContext {
|
|
7
|
+
/** 是否展示勾选框(checkable 模式支持级联全选/半选) */
|
|
8
|
+
checkable: ComputedRef<boolean>;
|
|
9
|
+
/** 是否展示节点类型图标 */
|
|
10
|
+
showIcon: ComputedRef<boolean>;
|
|
11
|
+
/** 导航模式下的高亮节点 key */
|
|
12
|
+
activeId: ComputedRef<string | null>;
|
|
13
|
+
keyOf: (node: TreeNodeData) => string;
|
|
14
|
+
labelOf: (node: TreeNodeData) => string;
|
|
15
|
+
childrenOf: (node: TreeNodeData) => TreeNodeData[];
|
|
16
|
+
isExpanded: (key: string) => boolean;
|
|
17
|
+
toggleExpand: (key: string) => void;
|
|
18
|
+
/** checkable 模式下节点的勾选状态(checked / indeterminate / unchecked) */
|
|
19
|
+
stateOf: (node: TreeNodeData) => TreeCheckState;
|
|
20
|
+
/** 行点击:checkable → 级联切换勾选;否则 → 更新 activeId */
|
|
21
|
+
onRowClick: (node: TreeNodeData) => void;
|
|
22
|
+
}
|
|
23
|
+
export declare const treeContextKey: InjectionKey<TreeContext>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as TreeNode } from './TreeNode.vue';
|
|
2
|
+
export type { TreeNodeData, TreeCheckState } from './types';
|
|
3
|
+
export { childrenOf, collectAllKeys, collectSubtreeKeys, computeMinimalKeys, expandCheckedKeys, findNodeByKey, getNodeState, keyOf, toggleNodeCheck, } from './utils';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TreeNode 数据结构(宽松结构,通过 nodeKey/labelKey/childrenKey 适配任意树数据)
|
|
3
|
+
*/
|
|
4
|
+
export interface TreeNodeData {
|
|
5
|
+
/** 节点唯一标识(默认取 id 字段) */
|
|
6
|
+
id?: string;
|
|
7
|
+
/** 节点文案(默认取 name 字段) */
|
|
8
|
+
name?: string;
|
|
9
|
+
/** 节点类型,用于图标展示:company / department / team */
|
|
10
|
+
type?: string;
|
|
11
|
+
children?: TreeNodeData[];
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
/** 勾选状态:全选 / 半选(部分子节点选中)/ 未选 */
|
|
15
|
+
export type TreeCheckState = 'checked' | 'indeterminate' | 'unchecked';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TreeNode 纯函数工具集:受控选中模型 + 级联全选/半选推导
|
|
3
|
+
*
|
|
4
|
+
* 选中模型(受控):
|
|
5
|
+
* - 外部持有 checkedKeys(最小化集合:父级全选时只存父级 key,子级省略)
|
|
6
|
+
* - expandCheckedKeys:把 checkedKeys 展开为“有效选中集合”(命中节点的整棵子树都视为选中),
|
|
7
|
+
* 因此回显时无论存的是父级 key 还是全部叶子 key,展示都正确
|
|
8
|
+
* - getNodeState:基于有效集合推导每个节点 checked / indeterminate / unchecked
|
|
9
|
+
* - toggleNodeCheck:切换某节点勾选后,重新归一化有效集合并输出最小化 keys
|
|
10
|
+
*/
|
|
11
|
+
import type { TreeNodeData, TreeCheckState } from './types';
|
|
12
|
+
export declare function keyOf(node: TreeNodeData, nodeKey?: string): string;
|
|
13
|
+
export declare function childrenOf(node: TreeNodeData, childrenKey?: string): TreeNodeData[];
|
|
14
|
+
/** 收集节点自身 + 全部后代 key */
|
|
15
|
+
export declare function collectSubtreeKeys(node: TreeNodeData, childrenKey?: string): string[];
|
|
16
|
+
/** 收集整棵树全部 key */
|
|
17
|
+
export declare function collectAllKeys(data: TreeNodeData[], childrenKey?: string): string[];
|
|
18
|
+
/** 按 key 查找节点(DFS) */
|
|
19
|
+
export declare function findNodeByKey(data: TreeNodeData[], targetKey: string, childrenKey?: string): TreeNodeData | null;
|
|
20
|
+
/**
|
|
21
|
+
* 展开选中 keys:命中节点的整棵子树都视为选中。
|
|
22
|
+
* 支持只存父级 key 的回显(父级选中 → 全部后代有效选中)。
|
|
23
|
+
*/
|
|
24
|
+
export declare function expandCheckedKeys(data: TreeNodeData[], keys: string[], childrenKey?: string): Set<string>;
|
|
25
|
+
/**
|
|
26
|
+
* 推导节点勾选状态(后序递归):
|
|
27
|
+
* - 叶子:在有效集合中 → checked
|
|
28
|
+
* - 父节点:子节点全部 checked → checked;部分选中 → indeterminate
|
|
29
|
+
*/
|
|
30
|
+
export declare function getNodeState(node: TreeNodeData, effective: Set<string>, childrenKey?: string): TreeCheckState;
|
|
31
|
+
/**
|
|
32
|
+
* 最小化 keys:只保留“最近的选中祖先”(父级已全选时省略子级),便于存储与回显。
|
|
33
|
+
*/
|
|
34
|
+
export declare function computeMinimalKeys(data: TreeNodeData[], effective: Set<string>, childrenKey?: string): string[];
|
|
35
|
+
/**
|
|
36
|
+
* 切换某节点勾选(级联):
|
|
37
|
+
* - 勾选:节点 + 全部后代加入有效集合
|
|
38
|
+
* - 取消:节点 + 全部后代移出有效集合
|
|
39
|
+
* 归一化后输出最小化 keys。
|
|
40
|
+
*/
|
|
41
|
+
export declare function toggleNodeCheck(data: TreeNodeData[], currentKeys: string[], targetKey: string, checked: boolean, childrenKey?: string): string[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FlowGraphData, FlowDesignerStats, FlowNodeKind, FlowProcessNodeFactory, FlowProcessJson, FlowProcessNodeType, FlowProcessNode } from './types';
|
|
2
|
+
export declare function addRouterBranch(source: FlowProcessJson, routerNodeKey: string): boolean;
|
|
3
|
+
export declare function insertNodeAfter(source: FlowProcessJson, targetNodeKey: string, nodeType: FlowProcessNodeType, nodeFactories?: Partial<Record<FlowProcessNodeType, FlowProcessNodeFactory>>): boolean;
|
|
4
|
+
export declare function deleteFlowNode(source: FlowProcessJson, targetNodeKey: string): boolean;
|
|
5
|
+
export declare function updateFlowNodeTitle(source: FlowProcessJson, targetNodeKey: string, title: string): boolean;
|
|
6
|
+
export declare function updateFlowNodeConfig(source: FlowProcessJson, targetNodeKey: string, patch: Record<string, unknown>): boolean;
|
|
7
|
+
export declare function createFlowNodeKey(prefix: string): string;
|
|
8
|
+
export declare function createNodeByType(type: FlowProcessNodeType, nextNode?: FlowProcessNode | null, nodeFactories?: Partial<Record<FlowProcessNodeType, FlowProcessNodeFactory>>): FlowProcessNode;
|
|
9
|
+
export declare function convertFlowProcessToGraphData(source: FlowProcessJson): FlowGraphData;
|
|
10
|
+
/**
|
|
11
|
+
* 提交前清理:内部用空对象 childNode: {} 作为"无后续节点"哨兵,
|
|
12
|
+
* 提交给后端前移除这些空 childNode,避免输出冗余字段
|
|
13
|
+
* (后端模型校验会把空对象当作 nodeKey/nodeName/type 缺失的节点)。
|
|
14
|
+
*/
|
|
15
|
+
export declare function sanitizeFlowSourceForSubmit(source: FlowProcessJson): FlowProcessJson;
|
|
16
|
+
export declare function getFlowDesignerStats(source: FlowProcessJson): FlowDesignerStats;
|
|
17
|
+
export declare function getFlowNodeKindLabel(kind: FlowNodeKind): FlowNodeKind;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { FlowFlowNodePickerOption, FlowProcessNodeType } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
modelValue: boolean;
|
|
4
|
+
options: FlowFlowNodePickerOption[];
|
|
5
|
+
position: {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
11
|
+
select: (nodeType: FlowProcessNodeType) => any;
|
|
12
|
+
close: () => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
14
|
+
onSelect?: ((nodeType: FlowProcessNodeType) => any) | undefined;
|
|
15
|
+
onClose?: (() => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
|
+
declare const _default: typeof __VLS_export;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FlowNodeConfigFormProps, FlowNodeConfigFormExpose } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<FlowNodeConfigFormProps, FlowNodeConfigFormExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FlowNodeConfigFormProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FlowNodeConfigFormProps, FlowNodeConfigFormExpose } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<FlowNodeConfigFormProps, FlowNodeConfigFormExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FlowNodeConfigFormProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FlowNodeConfigFormProps, FlowNodeConfigFormExpose } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<FlowNodeConfigFormProps, FlowNodeConfigFormExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FlowNodeConfigFormProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FlowNodeConfigFormProps, FlowNodeConfigFormExpose } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<FlowNodeConfigFormProps, FlowNodeConfigFormExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FlowNodeConfigFormProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FlowNodeConfigFormExpose, FlowNodeConfigFormProps } from './types';
|
|
2
|
+
declare const __VLS_export: import("vue").DefineComponent<FlowNodeConfigFormProps, FlowNodeConfigFormExpose, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FlowNodeConfigFormProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
3
|
+
declare const _default: typeof __VLS_export;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { FlowFlowNodeActionPayload, FlowNodeConfigDefinition, FlowProcessNodeType } from '../../types';
|
|
2
|
+
import ApprovalNodeConfig from './ApprovalNodeConfig.vue';
|
|
3
|
+
import CcNodeConfig from './CcNodeConfig.vue';
|
|
4
|
+
import ConditionNodeConfig from './ConditionNodeConfig.vue';
|
|
5
|
+
import NodeConfigAddButton from '../primitives/ui/NodeConfigAddButton.vue';
|
|
6
|
+
import NodeConfigAssigneeTags from '../primitives/pickers/NodeConfigAssigneeTags.vue';
|
|
7
|
+
import NodeConfigInitiatorPicker from '../primitives/pickers/NodeConfigInitiatorPicker.vue';
|
|
8
|
+
import NodeConfigRadioCard from '../primitives/ui/NodeConfigRadioCard.vue';
|
|
9
|
+
import NodeConfigSectionTitle from '../primitives/ui/NodeConfigSectionTitle.vue';
|
|
10
|
+
import StartNodeConfig from './StartNodeConfig.vue';
|
|
11
|
+
import TimerNodeConfig from './TimerNodeConfig.vue';
|
|
12
|
+
export declare const builtInFlowNodeConfigDefinitions: FlowNodeConfigDefinition[];
|
|
13
|
+
export declare const flowNodeConfigDefinitions: Partial<Record<FlowProcessNodeType, FlowNodeConfigDefinition>>;
|
|
14
|
+
export declare function createFlowNodeConfigRegistry(customDefinitions?: FlowNodeConfigDefinition[]): Partial<Record<FlowProcessNodeType, FlowNodeConfigDefinition>>;
|
|
15
|
+
export declare function getFlowNodeConfigDefinition(payload: FlowFlowNodeActionPayload | null | undefined, registry?: Partial<Record<FlowProcessNodeType, FlowNodeConfigDefinition>>): FlowNodeConfigDefinition | null;
|
|
16
|
+
export declare function isFlowNodeConfigSupported(payload: FlowFlowNodeActionPayload | null | undefined, registry?: Partial<Record<FlowProcessNodeType, FlowNodeConfigDefinition>>): boolean;
|
|
17
|
+
export { ApprovalNodeConfig, CcNodeConfig, ConditionNodeConfig, NodeConfigAddButton, NodeConfigAssigneeTags, NodeConfigInitiatorPicker, NodeConfigRadioCard, NodeConfigSectionTitle, StartNodeConfig, TimerNodeConfig, };
|
|
18
|
+
export type { FlowNodeConfigContext, FlowNodeConfigFormExpose, FlowNodeConfigFormProps, } from './types';
|
|
19
|
+
export type { FlowNodeConfigDefinition } from '../../types';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { FlowFlowNodeActionPayload, FlowFlowNodeDrawerChoiceOption, FlowFlowNodeDrawerOrgNode, FlowFlowNodeDrawerRoleOption, FlowFlowNodeDrawerSavePayload, FlowFlowNodeTitleChangePayload, FlowNodeConfigDefinition, FlowProcessAssignee, FlowProcessNodeType } from '../../types';
|
|
2
|
+
import type { FlowFieldMeta } from '../../types';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
modelValue: boolean;
|
|
5
|
+
payload: FlowFlowNodeActionPayload | null;
|
|
6
|
+
roles: FlowFlowNodeDrawerRoleOption[];
|
|
7
|
+
/** 组织架构树(供审批人员选择器使用) */
|
|
8
|
+
orgTree: FlowFlowNodeDrawerOrgNode[];
|
|
9
|
+
/** 人员列表(扁平) */
|
|
10
|
+
people: FlowProcessAssignee[];
|
|
11
|
+
approvalPersonTypes: FlowFlowNodeDrawerChoiceOption[];
|
|
12
|
+
approvalModes: FlowFlowNodeDrawerChoiceOption[];
|
|
13
|
+
samePersonModes: FlowFlowNodeDrawerChoiceOption[];
|
|
14
|
+
approvalRejectStrategies: FlowFlowNodeDrawerChoiceOption[];
|
|
15
|
+
conditionFields: FlowFlowNodeDrawerChoiceOption[];
|
|
16
|
+
conditionOperators: FlowFlowNodeDrawerChoiceOption[];
|
|
17
|
+
/** 元表单字段快照(metaForm.fields 原样数据) */
|
|
18
|
+
metaFormFields?: FlowFieldMeta[];
|
|
19
|
+
nodeConfigRegistry: Partial<Record<FlowProcessNodeType, FlowNodeConfigDefinition>>;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
"update:modelValue": (value: boolean) => any;
|
|
23
|
+
save: (payload: FlowFlowNodeDrawerSavePayload) => any;
|
|
24
|
+
"title-change": (payload: FlowFlowNodeTitleChangePayload) => any;
|
|
25
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
26
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
27
|
+
onSave?: ((payload: FlowFlowNodeDrawerSavePayload) => any) | undefined;
|
|
28
|
+
"onTitle-change"?: ((payload: FlowFlowNodeTitleChangePayload) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
roles: FlowFlowNodeDrawerRoleOption[];
|
|
31
|
+
orgTree: FlowFlowNodeDrawerOrgNode[];
|
|
32
|
+
people: FlowProcessAssignee[];
|
|
33
|
+
approvalPersonTypes: FlowFlowNodeDrawerChoiceOption[];
|
|
34
|
+
approvalModes: FlowFlowNodeDrawerChoiceOption[];
|
|
35
|
+
samePersonModes: FlowFlowNodeDrawerChoiceOption[];
|
|
36
|
+
approvalRejectStrategies: FlowFlowNodeDrawerChoiceOption[];
|
|
37
|
+
conditionFields: FlowFlowNodeDrawerChoiceOption[];
|
|
38
|
+
conditionOperators: FlowFlowNodeDrawerChoiceOption[];
|
|
39
|
+
metaFormFields: FlowFieldMeta[];
|
|
40
|
+
nodeConfigRegistry: Partial<Record<FlowProcessNodeType, FlowNodeConfigDefinition>>;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Component } from 'vue';
|
|
2
|
+
import type { FlowNodeConfigDefinition as BaseFlowNodeConfigDefinition, FlowFlowNodeActionPayload, FlowFlowNodeDrawerChoiceOption, FlowFlowNodeDrawerOrgNode, FlowFlowNodeDrawerRoleOption, FlowProcessAssignee } from '../../types';
|
|
3
|
+
import type { FlowFieldMeta } from '../../types';
|
|
4
|
+
export interface FlowNodeConfigContext {
|
|
5
|
+
roles: FlowFlowNodeDrawerRoleOption[];
|
|
6
|
+
/** 组织架构树(供审批人员选择器 type=1/4 使用) */
|
|
7
|
+
orgTree: FlowFlowNodeDrawerOrgNode[];
|
|
8
|
+
/** 人员列表(扁平,供审批人员选择器 type=1/4 使用) */
|
|
9
|
+
people: FlowProcessAssignee[];
|
|
10
|
+
approvalPersonTypes: FlowFlowNodeDrawerChoiceOption[];
|
|
11
|
+
approvalModes: FlowFlowNodeDrawerChoiceOption[];
|
|
12
|
+
samePersonModes: FlowFlowNodeDrawerChoiceOption[];
|
|
13
|
+
approvalRejectStrategies: FlowFlowNodeDrawerChoiceOption[];
|
|
14
|
+
conditionFields: FlowFlowNodeDrawerChoiceOption[];
|
|
15
|
+
conditionOperators: FlowFlowNodeDrawerChoiceOption[];
|
|
16
|
+
/** 元表单字段快照(metaForm.fields 原样数据,供条件分支节点字段下拉使用) */
|
|
17
|
+
metaFormFields: FlowFieldMeta[];
|
|
18
|
+
}
|
|
19
|
+
export interface FlowNodeConfigFormProps {
|
|
20
|
+
payload: FlowFlowNodeActionPayload;
|
|
21
|
+
context: FlowNodeConfigContext;
|
|
22
|
+
}
|
|
23
|
+
export interface FlowNodeConfigFormExpose {
|
|
24
|
+
getPatch: () => Record<string, unknown> | null;
|
|
25
|
+
}
|
|
26
|
+
export type FlowNodeConfigDefinition = BaseFlowNodeConfigDefinition & {
|
|
27
|
+
component: Component;
|
|
28
|
+
};
|
package/dist/types/hooks/logicflow/components/primitives/pickers/NodeConfigAssigneePicker.vue.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { FlowFlowNodeDrawerChoiceOption, FlowFlowNodeDrawerOrgNode, FlowFlowNodeDrawerRoleOption, FlowProcessAssignee } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 4 种审批人员类型 */
|
|
4
|
+
items?: FlowFlowNodeDrawerChoiceOption[];
|
|
5
|
+
/** 角色列表(供 type=3 使用) */
|
|
6
|
+
roles?: FlowFlowNodeDrawerRoleOption[];
|
|
7
|
+
/** 组织架构树(供 type=1/4 使用) */
|
|
8
|
+
orgTree?: FlowFlowNodeDrawerOrgNode[];
|
|
9
|
+
/** 人员列表(扁平,供 type=1/4 使用) */
|
|
10
|
+
people?: FlowProcessAssignee[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** 已选中类型 —— 只用于按钮旁边的 label 显示 */
|
|
14
|
+
modelValue?: string | number | null;
|
|
15
|
+
leaderLevel?: number | null;
|
|
16
|
+
selectedRoleIds?: string[];
|
|
17
|
+
selectedPeople?: FlowProcessAssignee[];
|
|
18
|
+
};
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
20
|
+
"update:modelValue": (value: string | number | null) => any;
|
|
21
|
+
confirm: (payload: {
|
|
22
|
+
type: string | number;
|
|
23
|
+
item: FlowFlowNodeDrawerChoiceOption;
|
|
24
|
+
leaderLevel?: number | null;
|
|
25
|
+
roleIds?: string[];
|
|
26
|
+
people?: FlowProcessAssignee[];
|
|
27
|
+
}) => any;
|
|
28
|
+
"update:leaderLevel": (value: number | null) => any;
|
|
29
|
+
"update:selectedRoleIds": (value: string[]) => any;
|
|
30
|
+
"update:selectedPeople": (value: FlowProcessAssignee[]) => any;
|
|
31
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
32
|
+
"onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
|
|
33
|
+
onConfirm?: ((payload: {
|
|
34
|
+
type: string | number;
|
|
35
|
+
item: FlowFlowNodeDrawerChoiceOption;
|
|
36
|
+
leaderLevel?: number | null;
|
|
37
|
+
roleIds?: string[];
|
|
38
|
+
people?: FlowProcessAssignee[];
|
|
39
|
+
}) => any) | undefined;
|
|
40
|
+
"onUpdate:leaderLevel"?: ((value: number | null) => any) | undefined;
|
|
41
|
+
"onUpdate:selectedRoleIds"?: ((value: string[]) => any) | undefined;
|
|
42
|
+
"onUpdate:selectedPeople"?: ((value: FlowProcessAssignee[]) => any) | undefined;
|
|
43
|
+
}>, {
|
|
44
|
+
modelValue: string | number | null;
|
|
45
|
+
disabled: boolean;
|
|
46
|
+
placeholder: string;
|
|
47
|
+
items: FlowFlowNodeDrawerChoiceOption[];
|
|
48
|
+
roles: FlowFlowNodeDrawerRoleOption[];
|
|
49
|
+
orgTree: FlowFlowNodeDrawerOrgNode[];
|
|
50
|
+
people: FlowProcessAssignee[];
|
|
51
|
+
leaderLevel: number | null;
|
|
52
|
+
selectedRoleIds: string[];
|
|
53
|
+
selectedPeople: FlowProcessAssignee[];
|
|
54
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
declare const _default: typeof __VLS_export;
|
|
56
|
+
export default _default;
|
package/dist/types/hooks/logicflow/components/primitives/pickers/NodeConfigAssigneeTags.vue.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FlowProcessAssignee } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
items: FlowProcessAssignee[];
|
|
4
|
+
removeLabel?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
remove: (id: string) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onRemove?: ((id: string) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
package/dist/types/hooks/logicflow/components/primitives/pickers/NodeConfigInitiatorPicker.vue.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FlowFlowNodeDrawerChoiceOption, FlowFlowNodeDrawerOrgNode, FlowFlowNodeDrawerRoleOption, FlowProcessAssignee } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 3 种发起人限制类型(默认:指定成员/指定部门/指定角色) */
|
|
4
|
+
items?: FlowFlowNodeDrawerChoiceOption[];
|
|
5
|
+
/** 角色列表(供指定角色使用) */
|
|
6
|
+
roles?: FlowFlowNodeDrawerRoleOption[];
|
|
7
|
+
/** 组织架构树(供指定成员/指定部门使用) */
|
|
8
|
+
orgTree?: FlowFlowNodeDrawerOrgNode[];
|
|
9
|
+
/** 人员列表(扁平,供指定成员使用) */
|
|
10
|
+
people?: FlowProcessAssignee[];
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
/** 已选条目(含 actorType),打开弹窗时用于回显 */
|
|
14
|
+
selectedEntries?: FlowProcessAssignee[];
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
confirm: (entries: FlowProcessAssignee[]) => any;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
19
|
+
onConfirm?: ((entries: FlowProcessAssignee[]) => any) | undefined;
|
|
20
|
+
}>, {
|
|
21
|
+
disabled: boolean;
|
|
22
|
+
placeholder: string;
|
|
23
|
+
items: FlowFlowNodeDrawerChoiceOption[];
|
|
24
|
+
roles: FlowFlowNodeDrawerRoleOption[];
|
|
25
|
+
orgTree: FlowFlowNodeDrawerOrgNode[];
|
|
26
|
+
people: FlowProcessAssignee[];
|
|
27
|
+
selectedEntries: FlowProcessAssignee[];
|
|
28
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
29
|
+
declare const _default: typeof __VLS_export;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
label?: string;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
5
|
+
click: (event: MouseEvent) => any;
|
|
6
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
7
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
label: string;
|
|
10
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
active: boolean;
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
};
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
click: (event: MouseEvent) => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
description: string;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title: string;
|
|
3
|
+
sticky?: boolean;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
sticky: boolean;
|
|
7
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FlowFlowNodeDrawerChoiceOption, FlowFlowNodePickerOption } from './types';
|
|
2
|
+
export declare const defaultNodePickerOptions: FlowFlowNodePickerOption[];
|
|
3
|
+
export declare const defaultApprovalPersonTypes: FlowFlowNodeDrawerChoiceOption[];
|
|
4
|
+
export declare const defaultApprovalModes: FlowFlowNodeDrawerChoiceOption[];
|
|
5
|
+
export declare const defaultSamePersonModes: FlowFlowNodeDrawerChoiceOption[];
|
|
6
|
+
export declare const defaultApprovalRejectStrategies: FlowFlowNodeDrawerChoiceOption[];
|
|
7
|
+
export declare const defaultConditionOperators: FlowFlowNodeDrawerChoiceOption[];
|
|
8
|
+
export declare const defaultConditionFields: FlowFlowNodeDrawerChoiceOption[];
|
|
9
|
+
export declare const builtInNodeTypes: (0 | 1 | -1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 23 | 30 | 31)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FlowProcessEdge, FlowProcessEdgeModel, FlowProcessEdgeView, } from './process/FlowProcessEdge';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PolylineEdge, PolylineEdgeModel } from '@logicflow/core';
|
|
2
|
+
/**
|
|
3
|
+
* 审批流边。
|
|
4
|
+
* 这个边的核心目标是:
|
|
5
|
+
* 1. 保持 LogicFlow 的折线能力
|
|
6
|
+
* 2. 在每条线上稳定展示一个 "+" 入口
|
|
7
|
+
* 3. 为后续 npm 扩展预留边点击事件
|
|
8
|
+
*/
|
|
9
|
+
export declare class FlowProcessEdgeModel extends PolylineEdgeModel {
|
|
10
|
+
initEdgeData(data: Parameters<PolylineEdgeModel['initEdgeData']>[0]): void;
|
|
11
|
+
setAttributes(): void;
|
|
12
|
+
getEdgeStyle(): {
|
|
13
|
+
stroke: string;
|
|
14
|
+
strokeWidth: number;
|
|
15
|
+
fill?: string | undefined;
|
|
16
|
+
radius?: number | undefined;
|
|
17
|
+
rx?: number | undefined;
|
|
18
|
+
ry?: number | undefined;
|
|
19
|
+
width?: number | undefined;
|
|
20
|
+
height?: number | undefined;
|
|
21
|
+
path?: string | undefined;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export declare class FlowProcessEdgeView extends PolylineEdge {
|
|
25
|
+
getAppend(): ReturnType<PolylineEdge['getAppend']>;
|
|
26
|
+
private renderPlus;
|
|
27
|
+
getEdge(): ReturnType<PolylineEdge['getEdge']>;
|
|
28
|
+
}
|
|
29
|
+
declare const _default: {
|
|
30
|
+
type: string;
|
|
31
|
+
model: typeof FlowProcessEdgeModel;
|
|
32
|
+
view: typeof FlowProcessEdgeView;
|
|
33
|
+
};
|
|
34
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as FlowProcessEdge, FlowProcessEdgeModel, FlowProcessEdgeView, } from './FlowProcessEdge';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import LogicFlow from '@logicflow/core';
|
|
2
|
+
import type { FlowFlowOptions, FlowProcessJson, FlowProcessNodeType } from './types';
|
|
3
|
+
import type { FlowFieldMeta } from './types';
|
|
4
|
+
export type { FlowFlowEdgePlusPayload, FlowFlowEventHandlers, FlowFlowOptions, FlowFlowRouterBranchPayload, FlowFlowNodeActionPayload, FlowFlowNodeTitleChangePayload, FlowGraphData, FlowProcessJson, } from './types';
|
|
5
|
+
export type * from './types';
|
|
6
|
+
export interface UseFlowResult {
|
|
7
|
+
lf: LogicFlow;
|
|
8
|
+
render: (nextSource?: FlowProcessJson) => void;
|
|
9
|
+
addRouterBranch: (routerNodeKey: string) => boolean;
|
|
10
|
+
insertNodeAfter: (targetNodeKey: string, nodeType: FlowProcessNodeType) => boolean;
|
|
11
|
+
deleteNode: (nodeKey: string) => boolean;
|
|
12
|
+
updateNodeTitle: (nodeKey: string, title: string) => boolean;
|
|
13
|
+
updateNodeConfig: (nodeKey: string, patch: Record<string, unknown>) => boolean;
|
|
14
|
+
/** 更新元表单字段快照(metaForm.fields 原样透传,供条件分支节点字段下拉使用) */
|
|
15
|
+
setMetaFormFields: (fields: FlowFieldMeta[]) => void;
|
|
16
|
+
getData: () => LogicFlow.GraphData | unknown;
|
|
17
|
+
destroy: () => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 初始化 LogicFlow 审批流画布。
|
|
21
|
+
*
|
|
22
|
+
* 这个入口是整个扩展包未来发布到 npm 时的主 API:
|
|
23
|
+
* - element 只负责挂载容器
|
|
24
|
+
* - flowJson 只负责业务流程数据
|
|
25
|
+
* - options 只负责画布配置和节点交互策略
|
|
26
|
+
*/
|
|
27
|
+
export declare function useFlow(element: HTMLElement, flowJson: FlowProcessJson, options?: FlowFlowOptions): UseFlowResult;
|
|
28
|
+
export { addRouterBranch, convertFlowProcessToGraphData, createFlowNodeKey, createNodeByType, deleteFlowNode, getFlowDesignerStats, getFlowNodeKindLabel, insertNodeAfter, updateFlowNodeConfig, updateFlowNodeTitle, } from './adapter';
|
|
29
|
+
export { createFlowNodeConfigRegistry, getFlowNodeConfigDefinition, isFlowNodeConfigSupported, builtInFlowNodeConfigDefinitions, flowNodeConfigDefinitions, type FlowNodeConfigContext, type FlowNodeConfigFormExpose, type FlowNodeConfigFormProps, type FlowNodeConfigDefinition, } from './components';
|
|
30
|
+
export { builtInNodeTypes, defaultApprovalModes, defaultApprovalPersonTypes, defaultApprovalRejectStrategies, defaultConditionFields, defaultConditionOperators, defaultNodePickerOptions, defaultSamePersonModes, } from './defaults';
|
|
31
|
+
export { registerFlowNodes } from './register';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import LogicFlow, { HtmlNode, HtmlNodeModel } from '@logicflow/core';
|
|
2
|
+
import type { FlowNodeKind, FlowNodeSize } from '../../types';
|
|
3
|
+
export declare function getFlowNodeSize(kind: FlowNodeKind): FlowNodeSize;
|
|
4
|
+
/**
|
|
5
|
+
* 把外部传入的 kind 规范化成内部统一枚举。
|
|
6
|
+
* 这样 adapter / 节点渲染 / 文档不会因为来源字符串不一致而分叉。
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeFlowNodeKind(kind: string): FlowNodeKind;
|
|
9
|
+
/**
|
|
10
|
+
* FlowProcessNodeModel 只负责节点的尺寸、文本和交互控制。
|
|
11
|
+
* 它不处理业务 JSON 解析,业务解析留在 adapter 里。
|
|
12
|
+
*/
|
|
13
|
+
export declare class FlowProcessNodeModel extends HtmlNodeModel {
|
|
14
|
+
private isEditable;
|
|
15
|
+
/**
|
|
16
|
+
* 节点进入画布后的最终尺寸。
|
|
17
|
+
* 这里与视觉层保持固定值,不允许被业务 JSON 任意改写。
|
|
18
|
+
*/
|
|
19
|
+
getFlowDisplayMeta(): {
|
|
20
|
+
kind: FlowNodeKind;
|
|
21
|
+
nodeType: import("../..").FlowProcessNodeType | undefined;
|
|
22
|
+
title: string;
|
|
23
|
+
content: string;
|
|
24
|
+
subtitle: string;
|
|
25
|
+
badge: string;
|
|
26
|
+
gatewayRole: "split" | "merge";
|
|
27
|
+
routerType: "condition" | "parallel" | "inclusive";
|
|
28
|
+
branchRole: "normal" | "default";
|
|
29
|
+
priority: number;
|
|
30
|
+
description: string;
|
|
31
|
+
assignees: string[];
|
|
32
|
+
nodeAssigneeList: import("../..").FlowProcessAssignee[] | undefined;
|
|
33
|
+
conditions: string[];
|
|
34
|
+
setType: number | undefined;
|
|
35
|
+
examineMode: string | number | undefined;
|
|
36
|
+
directorLevel: number | undefined;
|
|
37
|
+
directorMode: number | undefined;
|
|
38
|
+
selectMode: string | number | undefined;
|
|
39
|
+
termMode: number | undefined;
|
|
40
|
+
typeOfApprove: number | undefined;
|
|
41
|
+
approveSelf: string | number | undefined;
|
|
42
|
+
rejectStrategy: 1 | 2 | 3 | 4 | undefined;
|
|
43
|
+
allowTransfer: boolean | undefined;
|
|
44
|
+
allowCc: boolean | undefined;
|
|
45
|
+
delayTime: number | null | undefined;
|
|
46
|
+
delayUnit: "day" | "hour" | "minute" | undefined;
|
|
47
|
+
conditionList: import("../..").FlowProcessConditionRule[][] | undefined;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* 统一在 model 层锁定文本行为。
|
|
51
|
+
* 审批流预览场景里,节点标题不应被直接拖拽或编辑。
|
|
52
|
+
*/
|
|
53
|
+
setAttributes(): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* FlowProcessNodeView 使用 HTML 节点渲染。
|
|
57
|
+
* 这样可以用 Tailwind 直接复刻审批流卡片风格,后续也更容易拆分为 npm 包。
|
|
58
|
+
*/
|
|
59
|
+
export declare class FlowProcessNodeView extends HtmlNode {
|
|
60
|
+
private getFlowOptions;
|
|
61
|
+
private canDelete;
|
|
62
|
+
private emitNodeAction;
|
|
63
|
+
private emitNodeTitleChange;
|
|
64
|
+
private restoreTitleEditor;
|
|
65
|
+
private enterTitleEditMode;
|
|
66
|
+
private canEditTitle;
|
|
67
|
+
private renderEditButton;
|
|
68
|
+
private renderDeleteButton;
|
|
69
|
+
private renderConditionDeleteButton;
|
|
70
|
+
private renderKindIcon;
|
|
71
|
+
private toAttrs;
|
|
72
|
+
/**
|
|
73
|
+
* 拼出节点头部的文案。
|
|
74
|
+
* 参考项目中不同节点的 title 颜色和语义标签,这里统一收敛在一个函数里。
|
|
75
|
+
*/
|
|
76
|
+
private renderHeader;
|
|
77
|
+
/**
|
|
78
|
+
* 节点说明区只展示业务上最重要的一行。
|
|
79
|
+
* 避免卡片内容过长后挤压布局。
|
|
80
|
+
*/
|
|
81
|
+
private renderBody;
|
|
82
|
+
/**
|
|
83
|
+
* 节点根容器样式。
|
|
84
|
+
* start 节点使用更轻的样式,审批/抄送节点使用更明确的卡片样式。
|
|
85
|
+
*/
|
|
86
|
+
private renderCard;
|
|
87
|
+
setHtml(rootEl: SVGForeignObjectElement): void;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* 注册流程节点类型。
|
|
91
|
+
* 这里仍然只注册一个逻辑节点 type,因为视觉差异由 properties.kind 驱动。
|
|
92
|
+
*/
|
|
93
|
+
export declare function registerFlowProcessNode(lf: LogicFlow): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FlowProcessNodeModel, FlowProcessNodeView, getFlowNodeSize, normalizeFlowNodeKind, registerFlowProcessNode, } from './FlowProcessNode';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 表单字段元数据(对应后端 FlowFieldMeta)
|
|
3
|
+
*
|
|
4
|
+
* 由宿主通过 `useFlow` 的 `setMetaFormFields` 注入,作为条件分支节点字段下拉的数据源。
|
|
5
|
+
* 库本身不发起任何表单字段请求,元数据由宿主侧获取后注入。
|
|
6
|
+
*/
|
|
7
|
+
export interface FlowFieldMeta {
|
|
8
|
+
/** 字段编码,条件分支和表单渲染时作为唯一标识 */
|
|
9
|
+
fieldKey: string;
|
|
10
|
+
/** 字段展示名称 */
|
|
11
|
+
fieldName?: string;
|
|
12
|
+
/** 字段类型 */
|
|
13
|
+
fieldType?: string;
|
|
14
|
+
/** 字段路径,支持对象或数组嵌套路径,为空时默认等于 fieldKey */
|
|
15
|
+
fieldPath?: string;
|
|
16
|
+
/** 是否必填,0 否 1 是 */
|
|
17
|
+
required?: number;
|
|
18
|
+
/** 选项列表 JSON,select/multi_select/radio/checkbox 类型字段使用 */
|
|
19
|
+
optionsJson?: string;
|
|
20
|
+
/** 排序值 */
|
|
21
|
+
sort?: number;
|
|
22
|
+
/** 备注 */
|
|
23
|
+
remark?: string;
|
|
24
|
+
/** 扩展字段,预留 */
|
|
25
|
+
extra?: Record<string, unknown>;
|
|
26
|
+
}
|