From 9f53c7571665cf0f41bff1664746b9e9abdeb0c4 Mon Sep 17 00:00:00 2001 From: Md Afiq Iskandar Date: Mon, 21 Jul 2025 12:06:45 +0800 Subject: [PATCH] Enhance Custom Node Components with Shape Class and Style Updates - Added a computed property for dynamic shape classes in custom node components (ApiNode, BusinessRuleNode, FormNode, GatewayNode, HtmlNode, NotificationNode, ScriptNode, SubprocessNode) to support various shapes. - Updated the class bindings in the template to include the new shape classes, improving visual representation of nodes based on their defined shapes. - Adjusted styles in `nodeStyles.js` to accommodate new shape types (hexagon, trapezoid) and ensure proper rendering without conflicting base styles. - Enhanced the process builder interface by refining node styles and ensuring consistent behavior across different node types. --- components/process-flow/custom/ApiNode.vue | 8 +- .../process-flow/custom/BusinessRuleNode.vue | 8 +- components/process-flow/custom/FormNode.vue | 8 +- .../process-flow/custom/GatewayNode.vue | 38 +- components/process-flow/custom/HtmlNode.vue | 8 +- .../process-flow/custom/NotificationNode.vue | 8 +- components/process-flow/custom/ScriptNode.vue | 119 +-- .../process-flow/custom/SubprocessNode.vue | 8 +- composables/nodeStyles.js | 376 +++++++++- docs/vue-flow-process-builder-system-guide.md | 703 ++++++++++++++++++ pages/process-builder/index.vue | 4 +- stores/processBuilder.js | 2 +- 12 files changed, 1192 insertions(+), 98 deletions(-) create mode 100644 docs/vue-flow-process-builder-system-guide.md diff --git a/components/process-flow/custom/ApiNode.vue b/components/process-flow/custom/ApiNode.vue index 1e5a734..ce66b3e 100644 --- a/components/process-flow/custom/ApiNode.vue +++ b/components/process-flow/custom/ApiNode.vue @@ -43,6 +43,12 @@ const nodeStyle = computed(() => { } }) +// Computed for shape class +const shapeClass = computed(() => { + const shape = props.data?.shape || 'rectangle' + return `shape-${shape}` +}) + // Handle node click event const emit = defineEmits(['node-click']) const onClick = () => { @@ -52,7 +58,7 @@ const onClick = () => {