verben-workflow-ui 0.7.9 → 0.8.2
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/esm2022/public-api.mjs +3 -1
- package/esm2022/src/lib/components/file-render/excel-parser.util.mjs +239 -0
- package/esm2022/src/lib/components/file-render/file-preview.component.mjs +361 -0
- package/esm2022/src/lib/components/file-render/file-render.component.mjs +78 -10
- package/esm2022/src/lib/components/file-render/file-render.module.mjs +11 -7
- package/esm2022/src/lib/components/file-render/public-api.mjs +2 -1
- package/esm2022/src/lib/components/file-upload/file-upload.component.mjs +37 -3
- package/esm2022/src/lib/components/form-control/form-control.component.mjs +1 -1
- package/esm2022/src/lib/components/task-history/task-history.component.mjs +5 -4
- package/esm2022/src/lib/components/task-history/task-history.module.mjs +19 -4
- package/esm2022/src/lib/components/workflow-designer/designer-canvas/designer-canvas.component.mjs +15 -5
- package/esm2022/src/lib/components/workflow-designer/workflow-designer.component.mjs +2 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-file-render.mjs +681 -17
- package/fesm2022/verben-workflow-ui-src-lib-components-file-render.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-file-upload.mjs +36 -2
- package/fesm2022/verben-workflow-ui-src-lib-components-file-upload.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-form-control.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs +22 -6
- package/fesm2022/verben-workflow-ui-src-lib-components-task-history.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs +15 -4
- package/fesm2022/verben-workflow-ui-src-lib-components-workflow-designer.mjs.map +1 -1
- package/fesm2022/verben-workflow-ui.mjs +2 -0
- package/fesm2022/verben-workflow-ui.mjs.map +1 -1
- package/package.json +46 -46
- package/public-api.d.ts +2 -0
- package/src/lib/components/file-render/excel-parser.util.d.ts +12 -0
- package/src/lib/components/file-render/file-preview.component.d.ts +66 -0
- package/src/lib/components/file-render/file-render.component.d.ts +17 -4
- package/src/lib/components/file-render/file-render.module.d.ts +5 -4
- package/src/lib/components/file-render/public-api.d.ts +1 -0
- package/src/lib/components/file-upload/file-upload.component.d.ts +7 -1
- package/src/lib/components/task-history/task-history.module.d.ts +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verben-workflow-ui-src-lib-components-task-history.mjs","sources":["../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.service.ts","../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.component.ts","../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.component.html","../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.module.ts","../../../projects/verben-workflow-ui/src/lib/components/task-history/verben-workflow-ui-src-lib-components-task-history.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ActionHistory } from 'verben-workflow-ui/src/lib/models';\nimport { EnvironmentService, HttpWebRequestService } from 'verben-workflow-ui/src/lib/services';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TaskHistoryService {\n constructor(\n private httpService: HttpWebRequestService,\n private envSvc: EnvironmentService\n ) { }\n\n getTaskHistory(taskCode: string): Promise<any> {\n const url = `GetTaskHistory/${taskCode}`;\n return this.httpService.get(url) as Promise<ActionHistory[]>;\n }\n\n saveActionHistory(actionHistory: ActionHistory[]): Promise<any> {\n const url = `SaveActionHistories`;\n return this.httpService.post(url, actionHistory);\n }\n\n uploadFiles(files: any[]): Promise<any> {\n const url = `SaveFiles`;\n return this.httpService.post(\n url,\n files,\n this.envSvc.environment.FILE_BASE_URL\n );\n }\n}\n","import { Location } from '@angular/common';\nimport {\n ChangeDetectorRef,\n Component,\n input,\n OnInit,\n QueryList,\n ViewChildren,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { EditorConfig, EditorMode } from 'verben-reporting-ui';\nimport {\n ActionHistory,\n ActionType,\n Actor,\n ErrorResponse,\n File as FileData,\n Form,\n ObjectState,\n OperationType,\n Paged,\n Workflow,\n WorkflowAction,\n} from 'verben-workflow-ui/src/lib/models';\nimport {\n EnvironmentService,\n HttpWebRequestService,\n resolveHistoryForm,\n UtilService,\n} from 'verben-workflow-ui/src/lib/services';\nimport { TaskHistoryService } from './task-history.service';\nimport { VerbenPopUpComponent } from 'verben-ng-ui';\n\n@Component({\n selector: 'lib-task-history',\n templateUrl: './task-history.component.html',\n styleUrl: './task-history.component.css',\n})\nexport class TaskHistoryComponent implements OnInit {\n taskCode = input.required<string>();\n operationType = OperationType;\n active: number = 0;\n showCommentBox: boolean = false;\n newComment: string = '';\n isRichEditor: boolean = false;\n editorMode: EditorMode = EditorMode.Designer;\n editorConfig: EditorConfig = {\n editable: true,\n height: '240px',\n width: '100%',\n showToolbar: true,\n menuItems: [],\n };\n selectedFiles: FileData[] = [];\n activeForm: Form | null = null;\n // ActionType = ActionType;\n isFormViewerVisible: boolean = false;\n private workflowActionsCache = new Map<string, WorkflowAction[]>();\n\n constructor(\n private _location: Location,\n private service: TaskHistoryService,\n private envSvc: EnvironmentService,\n private utilService: UtilService,\n private server: HttpWebRequestService,\n private sanitizer: DomSanitizer,\n private cdr: ChangeDetectorRef,\n ) {}\n // singleHistory: TimelineEvent[] = [\n // {\n // Date: '4:05 PM',\n // Operation: OperationType.Comment,\n // Details: {},\n // Actions: [\n // { Label: 'View Comments', Type: 'button', Action: 'viewComments' },\n // ],\n // },\n // {\n // Date: 'Yesterday',\n // Operation: OperationType.Comment,\n // Details: {},\n // Actions: [\n // { Label: 'View Comments', Type: 'button', Action: 'viewComments' },\n // ],\n // },\n // {\n // Date: 'Mar 2',\n // Operation: OperationType.Forms,\n // Details: {\n // FilledBy: 'Anonymous',\n // },\n // Actions: [{ Label: 'View Form', Type: 'button', Action: 'viewForm' }],\n // },\n // {\n // Date: 'Nov 4',\n // Operation: OperationType.Assignment,\n // Details: {\n // From: 'John Doe',\n // To: 'Jane Doe',\n // },\n // Actions: [],\n // },\n // {\n // Date: 'Nov 6',\n // Operation: OperationType.Comment,\n // Details: {},\n // Actions: [\n // { Label: 'View Comments', Type: 'button', Action: 'viewComments' },\n // ],\n // },\n // ];\n\n history: ActionHistory[] = [];\n activeFormattedComment: SafeHtml = '';\n activeDecodedComment: string = '';\n isActiveHtml: boolean = false;\n\n private formattedCommentCache = new Map<string, SafeHtml>();\n private decodedCommentCache = new Map<string, string>();\n private isHtmlCache = new Map<string, boolean>();\n\n ngOnInit(): void {\n this.service.getTaskHistory(this.taskCode()).then((res) => {\n this.history = res;\n this.updateActiveComment();\n });\n }\n\n goBack() {\n this._location.back();\n }\n\n setActive(i: number) {\n this.active = i;\n this.updateActiveComment();\n }\n\n updateActiveComment() {\n if (this.active >= 0 && this.history && this.history[this.active]) {\n const raw = this.history[this.active].Description;\n this.activeDecodedComment = this.decodeComment(raw);\n this.isActiveHtml = this.isHtml(raw);\n this.activeFormattedComment = this.isActiveHtml\n ? this.getFormattedComment(raw)\n : '';\n } else {\n this.activeDecodedComment = '';\n this.isActiveHtml = false;\n this.activeFormattedComment = '';\n }\n this.cdr.markForCheck();\n }\n\n getTagsFromActor(actor: Actor) {\n return actor.Tags.map((tag) => tag.Name).join(', ');\n }\n\n setEditorMode(rich: boolean) {\n if (this.isRichEditor === rich) return;\n this.isRichEditor = rich;\n this.newComment = '';\n }\n\n isCommentValid(): boolean {\n if (!this.newComment) return false;\n const stripped = this.newComment\n .replace(/<[^>]*>/g, '')\n .replace(/ /g, ' ')\n .trim();\n if (\n this.newComment.includes('<table') ||\n this.newComment.includes('<img')\n ) {\n return true;\n }\n return stripped.length > 0;\n }\n\n copyStatusText: string = 'Copy';\n\n decodeComment(content: string | null | undefined): string {\n if (!content) return '';\n const cached = this.decodedCommentCache.get(content);\n if (cached !== undefined) return cached;\n let result = content;\n try {\n while (/%[0-9A-Fa-f]{2}/.test(result)) {\n const decoded = decodeURIComponent(result);\n if (decoded === result) break;\n result = decoded;\n }\n } catch {\n try {\n result = result.replace(/%([0-9A-Fa-f]{2})/g, (_, hex) => {\n try {\n return decodeURIComponent('%' + hex);\n } catch {\n return '%' + hex;\n }\n });\n } catch {\n result = content;\n }\n }\n this.decodedCommentCache.set(content, result);\n return result;\n }\n\n isHtml(content: string | null | undefined): boolean {\n if (!content) return false;\n const cached = this.isHtmlCache.get(content);\n if (cached !== undefined) return cached;\n const decoded = this.decodeComment(content).trim();\n const res = /<\\s*(p|div|span|table|tr|td|th|tbody|thead|tfoot|strong|em|b|i|u|s|strike|ul|ol|li|h[1-6]|br|hr|img|a|blockquote|pre|code)(\\s+[^>]*)?>/i.test(\n decoded,\n );\n this.isHtmlCache.set(content, res);\n return res;\n }\n\n getFormattedComment(content: string | null | undefined): SafeHtml {\n if (!content) return '';\n const cached = this.formattedCommentCache.get(content);\n if (cached !== undefined) return cached;\n const decoded = this.decodeComment(content);\n const safe = this.sanitizer.bypassSecurityTrustHtml(decoded);\n this.formattedCommentCache.set(content, safe);\n return safe;\n }\n\n async copyCommentText(content: string | null | undefined) {\n if (!content) return;\n const decoded = this.decodeComment(content);\n const textToCopy = this.isHtml(decoded)\n ? decoded\n .replace(/<[^>]*>/g, '')\n .replace(/ /g, ' ')\n .trim()\n : decoded;\n\n try {\n if (navigator.clipboard && navigator.clipboard.writeText) {\n await navigator.clipboard.writeText(textToCopy);\n } else {\n const textarea = document.createElement('textarea');\n textarea.value = textToCopy;\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n }\n this.copyStatusText = 'Copied!';\n setTimeout(() => {\n this.copyStatusText = 'Copy';\n }, 2000);\n this.utilService.showSuccess('Comment copied to clipboard');\n } catch {\n this.utilService.showError('Could not copy comment');\n }\n }\n\n addComment() {\n this.showCommentBox = !this.showCommentBox;\n if (!this.showCommentBox) {\n this.newComment = '';\n this.isRichEditor = false;\n this.selectedFiles = [];\n }\n }\n\n async saveComment() {\n if (!this.isCommentValid() && this.selectedFiles.length === 0) {\n return;\n }\n\n let uploadedFiles: string[] = [];\n if (this.selectedFiles.length > 0) {\n try {\n this.utilService.sendBI(true);\n const res = await this.service.uploadFiles(this.selectedFiles);\n if (res) {\n uploadedFiles = res;\n }\n } catch (error) {\n this.utilService.sendBI(false);\n return;\n } finally {\n this.utilService.sendBI(false);\n }\n }\n\n const actionHistory = {\n TaskCode: this.taskCode() ?? '',\n Description: this.newComment,\n ActionType: ActionType.Comment,\n DataState: ObjectState.New,\n Files: uploadedFiles,\n // Actor: {\n // Id: this.selectedDetail.ActorId,\n // Name: this.selectedDetail.ActorName,\n // Tags: this.selectedDetail.Tags,\n // },\n Workflow: '',\n FromStage: '',\n ToStage: '',\n Code: '',\n TenantId: '',\n } as ActionHistory;\n\n this.service.saveActionHistory([actionHistory]).then(() => {\n this.newComment = '';\n this.isRichEditor = false;\n this.selectedFiles = [];\n this.showCommentBox = false;\n this.service.getTaskHistory(this.taskCode()).then((res) => {\n this.history = res;\n this.setActive(0);\n });\n });\n }\n\n onFileSelect(data: any): void {\n const files: any = data;\n\n if (!files || files.length === 0) return;\n\n const fileArray: FileData[] = [];\n const readers: Promise<void>[] = [];\n\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const reader = new FileReader();\n\n const promise = new Promise<void>((resolve, reject) => {\n reader.onload = () => {\n const base64 = reader.result as string;\n fileArray.push({\n Extension: file.name.split('.').pop(),\n Name: this.generateRandomCode(),\n Data: base64,\n DataState: ObjectState.New,\n });\n resolve();\n };\n\n reader.onerror = (error) => reject(error);\n reader.readAsDataURL(file);\n });\n\n readers.push(promise);\n }\n\n Promise.all(readers).then(() => {\n this.selectedFiles = fileArray;\n });\n }\n\n private generateRandomCode(length: number = 10): string {\n const chars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return result;\n }\n\n getFileExtension(fileUrl: string): string {\n const parts = fileUrl.split('.');\n return parts[parts.length - 1].toLowerCase();\n }\n\n setPreview(val: string): string {\n if (!val) return '';\n const first = val.split(',')[0].trim();\n\n if (first.startsWith('http') || first.startsWith('data:')) {\n return first;\n }\n return `${this.envSvc.environment.FILE_URL}/${first}`;\n }\n\n showFromAndTo(actionType: ActionType): boolean {\n switch (actionType) {\n case ActionType.PassOn:\n case ActionType.PassBack:\n case ActionType.SkipForward:\n case ActionType.SkipBackward:\n return true;\n case ActionType.Comment:\n case ActionType.FormFilling:\n case ActionType.StatusChange:\n return false;\n }\n }\n\n getFileName(fileUrl: string): string {\n if (!fileUrl) return '';\n return fileUrl.split('/').pop() || '';\n }\n\n openFile(fileUrl: string) {\n if (!fileUrl) {\n return;\n }\n window.open(`${this.envSvc.environment.FILE_URL}${fileUrl}`, '_blank');\n // this.utilService.openFullRouteInNewWindow(\n // `${this.envSvc.environment.FILE_BASE_URL}${fileUrl}`\n // );\n }\n\n async loadFormIfExists(\n stage: string | undefined,\n historyItem?: ActionHistory,\n ) {\n if (!this.taskCode || !stage) {\n return;\n }\n this.utilService.sendBI(true);\n const res = await this.server.get(\n `GetCurrentFormsForTask/${this.taskCode()}/${stage}`,\n );\n this.utilService.sendBI(false);\n if (res instanceof ErrorResponse) {\n this.activeForm = null;\n this.utilService.showInfo('Could not load form for selected stage');\n return;\n }\n\n const result = (res as Form[]) || [];\n if (result.length > 0) {\n const workflowCode =\n historyItem?.Workflow || this.history?.[0]?.Workflow;\n const workflowActions = await this.getWorkflowActions(workflowCode);\n const resolvedForm = resolveHistoryForm(\n historyItem,\n stage,\n workflowActions,\n result,\n );\n if (resolvedForm) {\n this.activeForm = resolvedForm;\n this.isFormViewerVisible = true;\n } else {\n this.activeForm = null;\n }\n } else {\n this.activeForm = null;\n }\n this.cdr.markForCheck();\n }\n\n private async getWorkflowActions(\n workflowCode?: string,\n ): Promise<WorkflowAction[]> {\n if (!workflowCode) {\n return [];\n }\n const cached = this.workflowActionsCache.get(workflowCode);\n if (cached) {\n return cached;\n }\n const res = await this.server.get<Paged<Workflow>>(\n `GetWorkflowsWithParam/${workflowCode}/0/1/CreatedAt/Asc`,\n );\n if (!(res instanceof ErrorResponse)) {\n const actions = res?.Result?.[0]?.Actions || [];\n this.workflowActionsCache.set(workflowCode, actions);\n return actions;\n }\n return [];\n }\n\n onFormViewerOpen() {}\n\n onFormViewerClose() {\n this.isFormViewerVisible = false;\n this.activeForm = null;\n }\n}\n","<div class=\"bg-[var(--vbn-color-surface-alt)]\">\n <header\n class=\"mx-8 rounded-lg shadow-lg flex justify-between items-center px-6 py-2 bg-[#D4A00773]\"\n >\n <h4 class=\"font-semibold\">{{ taskCode() }}</h4>\n <div class=\"flex gap-4 items-center\">\n <verbena-button\n (click)=\"addComment()\"\n text=\"+ Add Comment\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n <verben-svg\n (click)=\"goBack()\"\n class=\"cursor-pointer\"\n [width]=\"17\"\n [height]=\"17\"\n [icon]=\"'go-back'\"\n ></verben-svg>\n </div>\n </header>\n <section class=\"grid grid-cols-12 gap-6 min-h-[calc(100vh-80px)]\">\n <div\n class=\"timeline-section bg-[var(--vbn-color-surface)] col-span-12 lg:col-span-5 px-3 sm:px-6 pt-8 relative\"\n >\n <div\n *ngIf=\"showCommentBox\"\n class=\"mb-6 p-4 sm:p-5 bg-white border border-gray-200 rounded-lg shadow-sm\"\n >\n <div class=\"flex items-center justify-between mb-3\">\n <h4 class=\"font-bold text-base text-gray-800\">Add Comment</h4>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setEditorMode(false)\"\n [ngClass]=\"\n !isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2.5 py-1 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setEditorMode(true)\"\n [ngClass]=\"\n isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2.5 py-1 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"newComment\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div *ngIf=\"isRichEditor\" class=\"workflow-comment-editor w-full\">\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"newComment\"\n ></lib-editor>\n </div>\n\n <div class=\"mt-4\">\n <file-upload\n (selectedFilesChange)=\"onFileSelect($event)\"\n [multiple]=\"true\"\n label=\"Attach Files\"\n >\n </file-upload>\n <div\n *ngIf=\"selectedFiles.length > 0\"\n class=\"flex flex-wrap gap-3 mt-3\"\n >\n <div *ngFor=\"let file of selectedFiles\">\n <ng-container [ngSwitch]=\"file.Extension\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"file.Data\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"file.Data\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"file.Data\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"file.Data\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"flex justify-end gap-2 mt-4 pt-2 border-t border-gray-100\">\n <verbena-button\n (click)=\"addComment()\"\n text=\"Cancel\"\n styleType=\"ylw-outline\"\n ></verbena-button>\n <verbena-button\n (click)=\"saveComment()\"\n text=\"Save\"\n [disable]=\"!isCommentValid() && selectedFiles.length === 0\"\n bgColor=\"var(--vbn-color-primary)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n pd=\"10px 20px\"\n width=\"114px\"\n height=\"39px\"\n ></verbena-button>\n </div>\n </div>\n <div class=\"timeline-list flex flex-col w-full\">\n <div\n *ngFor=\"let timeline of history; let i = index; let isLast = last; let isFirst = first\"\n class=\"timeline-row flex group relative\"\n >\n <!-- Left: Timestamp -->\n <div\n class=\"w-[75px] sm:w-[90px] flex-shrink-0 pt-1 text-right pr-3 cursor-pointer select-none\"\n (click)=\"setActive(i)\"\n >\n <span class=\"text-xs font-semibold text-gray-700 block leading-tight\">\n {{ timeline?.CreatedAt | date: 'mediumDate' }}\n </span>\n <span class=\"text-[11px] text-[var(--vbn-color-text-muted)] block font-mono mt-0.5\">\n {{ timeline?.CreatedAt | date: 'shortTime' }}\n </span>\n </div>\n\n <!-- Center: Timeline Rail (Connector line + Milestone Dot) -->\n <div class=\"flex flex-col items-center flex-shrink-0 w-5 self-stretch\">\n <!-- Top connector line -->\n <div\n class=\"w-0.5\"\n [ngClass]=\"isFirst ? 'h-2 bg-transparent' : 'h-2 bg-gray-200 group-hover:bg-gray-300'\"\n ></div>\n\n <!-- Milestone Dot -->\n <div\n (click)=\"setActive(i)\"\n class=\"w-3.5 h-3.5 rounded-full border-2 transition-all duration-200 cursor-pointer z-10 flex items-center justify-center flex-shrink-0\"\n [ngClass]=\"active === i\n ? 'bg-[var(--vbn-color-primary,#d4a007)] border-white shadow-sm ring-4 ring-amber-100 scale-110'\n : 'bg-white border-gray-300 group-hover:border-gray-400 group-hover:scale-105'\"\n [title]=\"timeline.ActionName || timeline.ActionType\"\n >\n <span *ngIf=\"active === i\" class=\"w-1 h-1 rounded-full bg-white block\"></span>\n </div>\n\n <!-- Bottom connector line that dynamically extends with card height -->\n <div\n *ngIf=\"!isLast\"\n class=\"w-0.5 flex-1 bg-gray-200 group-hover:bg-gray-300 min-h-[24px]\"\n ></div>\n </div>\n\n <!-- Right: Card -->\n <div class=\"flex-1 min-w-0 pl-3 pb-6\">\n <div\n class=\"w-full cursor-pointer p-4 rounded-lg border-l-4 transition-all duration-150\"\n [ngClass]=\"{\n 'bg-[#FEFAF1] border-l-[var(--vbn-color-primary)]': active === i,\n 'bg-transparent border-l-transparent hover:bg-[var(--vbn-color-surface-alt)]':\n active !== i\n }\"\n (click)=\"setActive(i)\"\n >\n <!-- ActionName as primary heading -->\n <h4 class=\"font-bold text-base text-[var(--vbn-color-text)] mb-2 leading-snug\">\n {{ timeline.ActionName || timeline.ActionType }}\n </h4>\n\n <!-- Actor information with tooltip -->\n <div class=\"mb-3\">\n <verben-tooltip\n [top]=\"'0px'\"\n [left]=\"'0px'\"\n [padding]=\"'0px'\"\n [backgroundColor]=\"'transparent'\"\n [border]=\"'none'\"\n [borderRadius]=\"'0px'\"\n [tooltipContent]=\"actorTooltipTemplate\"\n >\n <p\n class=\"text-sm text-[var(--vbn-color-text-muted)] cursor-help inline-flex items-center gap-2\"\n >\n <verben-svg\n [width]=\"14\"\n [height]=\"14\"\n [icon]=\"'user'\"\n stroke=\"var(--vbn-color-text-muted)\"\n ></verben-svg>\n <span class=\"font-medium text-[var(--vbn-color-text)]\">{{\n timeline?.Actor?.Name\n }}</span>\n </p>\n </verben-tooltip>\n\n <ng-template #actorTooltipTemplate>\n <div\n class=\"bg-white border border-[var(--vbn-color-border)] rounded-lg p-4 shadow-lg w-[280px]\"\n >\n <div class=\"flex gap-3 items-start\">\n <div\n class=\"w-[40px] h-[40px] rounded-full bg-gradient-to-r from-[#D9AEAE] via-[#E3C79F] to-[var(--vbn-color-primary)] flex-shrink-0\"\n ></div>\n <div class=\"flex-1 min-w-0\">\n <p\n class=\"font-bold text-sm text-[var(--vbn-color-text)] mb-1\"\n >\n {{ timeline?.Actor?.Name }}\n </p>\n <p\n class=\"text-xs text-[var(--vbn-color-text-muted)] break-words flex items-start gap-1\"\n >\n <verben-svg\n [width]=\"12\"\n [height]=\"12\"\n [icon]=\"'mail'\"\n stroke=\"var(--vbn-color-text-muted)\"\n ></verben-svg>\n <span>{{ timeline?.Actor?.Identifier }}</span>\n </p>\n <p\n *ngIf=\"\n timeline.Actor && getTagsFromActor(timeline.Actor)\n \"\n class=\"text-xs text-[var(--vbn-color-text-muted)] mt-2\"\n >\n <span class=\"font-medium\">Tags:</span>\n {{ getTagsFromActor(timeline.Actor) }}\n </p>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n\n <!-- Action Type (if different from ActionName) -->\n <p\n *ngIf=\"timeline.ActionName\"\n class=\"text-sm text-[var(--vbn-color-text-muted)] mb-2\"\n >\n <span class=\"font-medium\">Operation:</span>\n {{ timeline.ActionType }}\n </p>\n\n <!-- Stage information for transfer actions -->\n @if (showFromAndTo(timeline.ActionType)) {\n <div\n class=\"bg-[var(--vbn-color-surface-alt)] rounded-md p-3 mt-2 space-y-1.5\"\n >\n <p class=\"text-sm flex items-center gap-2\">\n <span class=\"text-[var(--vbn-color-text-muted)] font-medium\"\n >From:</span\n >\n <span\n class=\"text-[var(--vbn-color-border-focus)] font-mono text-xs\"\n >{{ timeline.FromStage }}</span\n >\n </p>\n <p class=\"text-sm flex items-center gap-2\">\n <span class=\"text-[var(--vbn-color-text-muted)] font-medium\"\n >To:</span\n >\n <span\n class=\"text-[var(--vbn-color-border-focus)] font-mono text-xs\"\n >{{ timeline.ToStage }}</span\n >\n </p>\n </div>\n }\n\n <!-- Action buttons -->\n <div class=\"flex gap-3 items-center mt-3 pt-2 border-t border-gray-100\">\n <button\n (click)=\"\n loadFormIfExists(timeline.FromStage, timeline);\n $event.stopPropagation()\n \"\n class=\"flex gap-2 items-center w-fit text-[var(--vbn-color-text-muted)] text-sm border px-3 py-1.5 rounded-lg bg-[var(--vbn-color-surface-alt)] border-[var(--vbn-color-border)] hover:bg-[var(--vbn-color-surface-alt)] hover:border-[var(--vbn-color-border)] transition-colors cursor-pointer\"\n >\n <verben-svg\n [width]=\"15\"\n [height]=\"15\"\n [icon]=\"'chat'\"\n ></verben-svg>\n Load Stage Form\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"col-span-12 lg:col-span-7 pt-12 pr-6 lg:pr-10 pl-4 sticky top-4 self-start\"\n >\n <div\n *ngIf=\"\n active >= 0 && !!history && history.length > 0;\n else noActiveSelection\n \"\n class=\"w-full\"\n >\n <div class=\"flex items-center justify-between mb-3\">\n <div class=\"flex items-center gap-3\">\n <h1 class=\"font-bold text-lg text-gray-800\">Comments</h1>\n <button\n *ngIf=\"history[active]?.Description\"\n type=\"button\"\n (click)=\"copyCommentText(history[active].Description)\"\n class=\"text-xs px-2.5 py-1 rounded bg-gray-100 hover:bg-gray-200 text-gray-700 transition-colors cursor-pointer flex items-center gap-1.5 border border-gray-200 select-none\"\n title=\"Copy comment to clipboard\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect>\n <path\n d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"\n ></path>\n </svg>\n <span>{{ copyStatusText }}</span>\n </button>\n </div>\n <p class=\"text-xs text-[var(--vbn-color-text-muted)]\">\n {{ history[active].CreatedAt | date: \"medium\" }}\n </p>\n </div>\n\n <div\n class=\"comment-card bg-[var(--vbn-color-surface)] text-[var(--vbn-color-text)] leading-relaxed p-6 lg:p-8 shadow-md rounded-lg w-full border border-gray-100 select-text\"\n >\n <!-- Comment Description rendered presentably (HTML or plain text) -->\n <div\n *ngIf=\"isActiveHtml; else plainComment\"\n class=\"comment-html-content w-full overflow-x-auto\"\n [innerHTML]=\"activeFormattedComment\"\n ></div>\n <ng-template #plainComment>\n <p\n *ngIf=\"activeDecodedComment; else emptyComment\"\n class=\"whitespace-pre-wrap break-words text-sm leading-relaxed\"\n >\n {{ activeDecodedComment }}\n </p>\n <ng-template #emptyComment>\n <p\n class=\"text-xs italic text-[var(--vbn-color-text-muted)] py-4 text-center\"\n >\n No comment recorded for this action.\n </p>\n </ng-template>\n </ng-template>\n\n <div\n *ngIf=\"history[active]?.Files?.length\"\n class=\"mt-6 border-t border-gray-100 pt-4\"\n >\n <h5\n class=\"font-bold text-xs uppercase tracking-wider text-gray-500 mb-3\"\n >\n Attachments\n </h5>\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-2\">\n <div\n *ngFor=\"let file of history[active]?.Files\"\n class=\"file-container p-2.5 flex items-center justify-between gap-3 border rounded-lg bg-gray-50/80 hover:bg-gray-100/80 transition-colors\"\n >\n <div\n class=\"text-xs font-medium truncate\"\n [title]=\"getFileName(file)\"\n >\n {{ getFileName(file) }}\n </div>\n <span\n (click)=\"openFile(file)\"\n class=\"cursor-pointer text-gray-500 hover:text-primary transition-colors flex-shrink-0\"\n title=\"Download\"\n >\n <verben-svg\n [icon]=\"'download-icon'\"\n [width]=\"18\"\n [height]=\"18\"\n ></verben-svg>\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template #noActiveSelection>\n <div\n class=\"w-full pt-16 flex flex-col items-center justify-center text-center text-[var(--vbn-color-text-muted)]\"\n >\n <verben-svg\n [icon]=\"'chat'\"\n [width]=\"40\"\n [height]=\"40\"\n class=\"opacity-30 mb-3\"\n ></verben-svg>\n <p class=\"text-sm font-medium\">\n Select a stage from the timeline to view details\n </p>\n </div>\n </ng-template>\n </div>\n </section>\n</div>\n\n<app-form-viewer\n [form]=\"activeForm\"\n [isVisible]=\"isFormViewerVisible\"\n (onOpen)=\"onFormViewerOpen()\"\n (onClose)=\"onFormViewerClose()\"\n></app-form-viewer>\n","import { NgModule } from '@angular/core';\nimport { TooltipModule } from 'verben-ng-ui';\nimport { FileUploadModule } from 'verben-workflow-ui/src/lib/components/file-upload';\nimport { SharedModule } from 'verben-workflow-ui/src/lib/shared';\nimport { TaskHistoryComponent } from './task-history.component';\nimport { FormViewerLibModule } from 'verben-workflow-ui/src/lib/components/form-viewer';\n@NgModule({\n declarations: [TaskHistoryComponent],\n imports: [SharedModule, FileUploadModule, TooltipModule, FormViewerLibModule],\n exports: [TaskHistoryComponent],\n})\nexport class TaskHistoryModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2.TaskHistoryService"],"mappings":";;;;;;;;;;;;;;;;;;MAOa,kBAAkB,CAAA;AAEnB,IAAA,WAAA,CAAA;AACA,IAAA,MAAA,CAAA;IAFV,WACU,CAAA,WAAkC,EAClC,MAA0B,EAAA;QAD1B,IAAW,CAAA,WAAA,GAAX,WAAW,CAAuB;QAClC,IAAM,CAAA,MAAA,GAAN,MAAM,CAAoB;KAC/B;AAEL,IAAA,cAAc,CAAC,QAAgB,EAAA;AAC7B,QAAA,MAAM,GAAG,GAAG,CAAkB,eAAA,EAAA,QAAQ,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAA6B,CAAC;KAC9D;AAED,IAAA,iBAAiB,CAAC,aAA8B,EAAA;QAC9C,MAAM,GAAG,GAAG,CAAA,mBAAA,CAAqB,CAAC;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;KAClD;AAED,IAA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AA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;4FD/aa,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBALhC,SAAS;+BACE,kBAAkB,EAAA,QAAA,EAAA,i+kBAAA,EAAA,MAAA,EAAA,CAAA,42NAAA,CAAA,EAAA,CAAA;;;MEvBjB,iBAAiB,CAAA;wGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAjB,iBAAiB,EAAA,YAAA,EAAA,CAJb,oBAAoB,CAAA,EAAA,OAAA,EAAA,CACzB,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,CAAA,EAAA,OAAA,EAAA,CAClE,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAEnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAHlB,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,CAAA,EAAA,CAAA,CAAA;;4FAGjE,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;oBACpC,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,CAAC;oBAC7E,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAChC,iBAAA,CAAA;;;ACVD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"verben-workflow-ui-src-lib-components-task-history.mjs","sources":["../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.service.ts","../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.component.ts","../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.component.html","../../../projects/verben-workflow-ui/src/lib/components/task-history/task-history.module.ts","../../../projects/verben-workflow-ui/src/lib/components/task-history/verben-workflow-ui-src-lib-components-task-history.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { ActionHistory } from 'verben-workflow-ui/src/lib/models';\nimport { EnvironmentService, HttpWebRequestService } from 'verben-workflow-ui/src/lib/services';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class TaskHistoryService {\n constructor(\n private httpService: HttpWebRequestService,\n private envSvc: EnvironmentService\n ) { }\n\n getTaskHistory(taskCode: string): Promise<any> {\n const url = `GetTaskHistory/${taskCode}`;\n return this.httpService.get(url) as Promise<ActionHistory[]>;\n }\n\n saveActionHistory(actionHistory: ActionHistory[]): Promise<any> {\n const url = `SaveActionHistories`;\n return this.httpService.post(url, actionHistory);\n }\n\n uploadFiles(files: any[]): Promise<any> {\n const url = `SaveFiles`;\n return this.httpService.post(\n url,\n files,\n this.envSvc.environment.FILE_BASE_URL\n );\n }\n}\n","import { Location } from '@angular/common';\nimport {\n ChangeDetectorRef,\n Component,\n input,\n OnInit,\n QueryList,\n ViewChildren,\n} from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\nimport { EditorConfig, EditorMode } from 'verben-reporting-ui';\nimport {\n ActionHistory,\n ActionType,\n Actor,\n ErrorResponse,\n File as FileData,\n Form,\n ObjectState,\n OperationType,\n Paged,\n Workflow,\n WorkflowAction,\n} from 'verben-workflow-ui/src/lib/models';\nimport {\n EnvironmentService,\n HttpWebRequestService,\n resolveHistoryForm,\n UtilService,\n} from 'verben-workflow-ui/src/lib/services';\nimport { TaskHistoryService } from './task-history.service';\nimport { VerbenPopUpComponent } from 'verben-ng-ui';\n\n@Component({\n selector: 'lib-task-history',\n templateUrl: './task-history.component.html',\n styleUrl: './task-history.component.css',\n})\nexport class TaskHistoryComponent implements OnInit {\n taskCode = input.required<string>();\n operationType = OperationType;\n active: number = 0;\n showCommentBox: boolean = false;\n newComment: string = '';\n isRichEditor: boolean = false;\n editorMode: EditorMode = EditorMode.Designer;\n editorConfig: EditorConfig = {\n editable: true,\n height: '240px',\n width: '100%',\n showToolbar: true,\n menuItems: [],\n };\n selectedFiles: FileData[] = [];\n activeForm: Form | null = null;\n // ActionType = ActionType;\n isFormViewerVisible: boolean = false;\n private workflowActionsCache = new Map<string, WorkflowAction[]>();\n\n constructor(\n private _location: Location,\n private service: TaskHistoryService,\n private envSvc: EnvironmentService,\n private utilService: UtilService,\n private server: HttpWebRequestService,\n private sanitizer: DomSanitizer,\n private cdr: ChangeDetectorRef,\n ) {}\n // singleHistory: TimelineEvent[] = [\n // {\n // Date: '4:05 PM',\n // Operation: OperationType.Comment,\n // Details: {},\n // Actions: [\n // { Label: 'View Comments', Type: 'button', Action: 'viewComments' },\n // ],\n // },\n // {\n // Date: 'Yesterday',\n // Operation: OperationType.Comment,\n // Details: {},\n // Actions: [\n // { Label: 'View Comments', Type: 'button', Action: 'viewComments' },\n // ],\n // },\n // {\n // Date: 'Mar 2',\n // Operation: OperationType.Forms,\n // Details: {\n // FilledBy: 'Anonymous',\n // },\n // Actions: [{ Label: 'View Form', Type: 'button', Action: 'viewForm' }],\n // },\n // {\n // Date: 'Nov 4',\n // Operation: OperationType.Assignment,\n // Details: {\n // From: 'John Doe',\n // To: 'Jane Doe',\n // },\n // Actions: [],\n // },\n // {\n // Date: 'Nov 6',\n // Operation: OperationType.Comment,\n // Details: {},\n // Actions: [\n // { Label: 'View Comments', Type: 'button', Action: 'viewComments' },\n // ],\n // },\n // ];\n\n history: ActionHistory[] = [];\n activeFormattedComment: SafeHtml = '';\n activeDecodedComment: string = '';\n isActiveHtml: boolean = false;\n\n private formattedCommentCache = new Map<string, SafeHtml>();\n private decodedCommentCache = new Map<string, string>();\n private isHtmlCache = new Map<string, boolean>();\n\n ngOnInit(): void {\n this.service.getTaskHistory(this.taskCode()).then((res) => {\n this.history = res;\n this.updateActiveComment();\n });\n }\n\n goBack() {\n this._location.back();\n }\n\n setActive(i: number) {\n this.active = i;\n this.updateActiveComment();\n }\n\n updateActiveComment() {\n if (this.active >= 0 && this.history && this.history[this.active]) {\n const raw = this.history[this.active].Description;\n this.activeDecodedComment = this.decodeComment(raw);\n this.isActiveHtml = this.isHtml(raw);\n this.activeFormattedComment = this.isActiveHtml\n ? this.getFormattedComment(raw)\n : '';\n } else {\n this.activeDecodedComment = '';\n this.isActiveHtml = false;\n this.activeFormattedComment = '';\n }\n this.cdr.markForCheck();\n }\n\n getTagsFromActor(actor: Actor) {\n return actor.Tags.map((tag) => tag.Name).join(', ');\n }\n\n setEditorMode(rich: boolean) {\n if (this.isRichEditor === rich) return;\n this.isRichEditor = rich;\n this.newComment = '';\n }\n\n isCommentValid(): boolean {\n if (!this.newComment) return false;\n const stripped = this.newComment\n .replace(/<[^>]*>/g, '')\n .replace(/ /g, ' ')\n .trim();\n if (\n this.newComment.includes('<table') ||\n this.newComment.includes('<img')\n ) {\n return true;\n }\n return stripped.length > 0;\n }\n\n copyStatusText: string = 'Copy';\n\n decodeComment(content: string | null | undefined): string {\n if (!content) return '';\n const cached = this.decodedCommentCache.get(content);\n if (cached !== undefined) return cached;\n let result = content;\n try {\n while (/%[0-9A-Fa-f]{2}/.test(result)) {\n const decoded = decodeURIComponent(result);\n if (decoded === result) break;\n result = decoded;\n }\n } catch {\n try {\n result = result.replace(/%([0-9A-Fa-f]{2})/g, (_, hex) => {\n try {\n return decodeURIComponent('%' + hex);\n } catch {\n return '%' + hex;\n }\n });\n } catch {\n result = content;\n }\n }\n this.decodedCommentCache.set(content, result);\n return result;\n }\n\n isHtml(content: string | null | undefined): boolean {\n if (!content) return false;\n const cached = this.isHtmlCache.get(content);\n if (cached !== undefined) return cached;\n const decoded = this.decodeComment(content).trim();\n const res = /<\\s*(p|div|span|table|tr|td|th|tbody|thead|tfoot|strong|em|b|i|u|s|strike|ul|ol|li|h[1-6]|br|hr|img|a|blockquote|pre|code)(\\s+[^>]*)?>/i.test(\n decoded,\n );\n this.isHtmlCache.set(content, res);\n return res;\n }\n\n getFormattedComment(content: string | null | undefined): SafeHtml {\n if (!content) return '';\n const cached = this.formattedCommentCache.get(content);\n if (cached !== undefined) return cached;\n const decoded = this.decodeComment(content);\n const safe = this.sanitizer.bypassSecurityTrustHtml(decoded);\n this.formattedCommentCache.set(content, safe);\n return safe;\n }\n\n async copyCommentText(content: string | null | undefined) {\n if (!content) return;\n const decoded = this.decodeComment(content);\n const textToCopy = this.isHtml(decoded)\n ? decoded\n .replace(/<[^>]*>/g, '')\n .replace(/ /g, ' ')\n .trim()\n : decoded;\n\n try {\n if (navigator.clipboard && navigator.clipboard.writeText) {\n await navigator.clipboard.writeText(textToCopy);\n } else {\n const textarea = document.createElement('textarea');\n textarea.value = textToCopy;\n document.body.appendChild(textarea);\n textarea.select();\n document.execCommand('copy');\n document.body.removeChild(textarea);\n }\n this.copyStatusText = 'Copied!';\n setTimeout(() => {\n this.copyStatusText = 'Copy';\n }, 2000);\n this.utilService.showSuccess('Comment copied to clipboard');\n } catch {\n this.utilService.showError('Could not copy comment');\n }\n }\n\n addComment() {\n this.showCommentBox = !this.showCommentBox;\n if (!this.showCommentBox) {\n this.newComment = '';\n this.isRichEditor = false;\n this.selectedFiles = [];\n }\n }\n\n async saveComment() {\n if (!this.isCommentValid() && this.selectedFiles.length === 0) {\n return;\n }\n\n let uploadedFiles: string[] = [];\n if (this.selectedFiles.length > 0) {\n try {\n this.utilService.sendBI(true);\n const res = await this.service.uploadFiles(this.selectedFiles);\n if (res) {\n uploadedFiles = res;\n }\n } catch (error) {\n this.utilService.sendBI(false);\n return;\n } finally {\n this.utilService.sendBI(false);\n }\n }\n\n const actionHistory = {\n TaskCode: this.taskCode() ?? '',\n Description: this.newComment,\n ActionType: ActionType.Comment,\n DataState: ObjectState.New,\n Files: uploadedFiles,\n // Actor: {\n // Id: this.selectedDetail.ActorId,\n // Name: this.selectedDetail.ActorName,\n // Tags: this.selectedDetail.Tags,\n // },\n Workflow: '',\n FromStage: '',\n ToStage: '',\n Code: '',\n TenantId: '',\n } as ActionHistory;\n\n this.service.saveActionHistory([actionHistory]).then(() => {\n this.newComment = '';\n this.isRichEditor = false;\n this.selectedFiles = [];\n this.showCommentBox = false;\n this.service.getTaskHistory(this.taskCode()).then((res) => {\n this.history = res;\n this.setActive(0);\n });\n });\n }\n\n onFileSelect(data: any): void {\n const files: any = data;\n\n if (!files || files.length === 0) return;\n\n const fileArray: FileData[] = [];\n const readers: Promise<void>[] = [];\n\n for (let i = 0; i < files.length; i++) {\n const file = files[i];\n const reader = new FileReader();\n\n const promise = new Promise<void>((resolve, reject) => {\n reader.onload = () => {\n const base64 = reader.result as string;\n fileArray.push({\n Extension: file.name.split('.').pop(),\n Name: this.generateRandomCode(),\n Data: base64,\n DataState: ObjectState.New,\n });\n resolve();\n };\n\n reader.onerror = (error) => reject(error);\n reader.readAsDataURL(file);\n });\n\n readers.push(promise);\n }\n\n Promise.all(readers).then(() => {\n this.selectedFiles = fileArray;\n });\n }\n\n private generateRandomCode(length: number = 10): string {\n const chars =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let result = '';\n for (let i = 0; i < length; i++) {\n result += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return result;\n }\n\n getFileExtension(fileUrl: string): string {\n const parts = fileUrl.split('.');\n return parts[parts.length - 1].toLowerCase();\n }\n\n setPreview(val: string): string {\n if (!val) return '';\n const first = val.split(',')[0].trim();\n\n if (first.startsWith('http') || first.startsWith('data:')) {\n return first;\n }\n return `${this.envSvc.environment.FILE_URL}/${first}`;\n }\n\n showFromAndTo(actionType: ActionType): boolean {\n switch (actionType) {\n case ActionType.PassOn:\n case ActionType.PassBack:\n case ActionType.SkipForward:\n case ActionType.SkipBackward:\n return true;\n case ActionType.Comment:\n case ActionType.FormFilling:\n case ActionType.StatusChange:\n return false;\n }\n }\n\n getFileName(fileUrl: string): string {\n if (!fileUrl) return '';\n return fileUrl.split('/').pop() || '';\n }\n\n openFile(fileUrl: string) {\n if (!fileUrl) {\n return;\n }\n window.open(`${this.envSvc.environment.FILE_URL}${fileUrl}`, '_blank');\n // this.utilService.openFullRouteInNewWindow(\n // `${this.envSvc.environment.FILE_BASE_URL}${fileUrl}`\n // );\n }\n\n async loadFormIfExists(\n stage: string | undefined,\n historyItem?: ActionHistory,\n ) {\n if (!this.taskCode || !stage) {\n return;\n }\n this.utilService.sendBI(true);\n const res = await this.server.get(\n `GetCurrentFormsForTask/${this.taskCode()}/${stage}`,\n );\n this.utilService.sendBI(false);\n if (res instanceof ErrorResponse) {\n this.activeForm = null;\n this.utilService.showInfo('Could not load form for selected stage');\n return;\n }\n\n const result = (res as Form[]) || [];\n if (result.length > 0) {\n const workflowCode =\n historyItem?.Workflow || this.history?.[0]?.Workflow;\n const workflowActions = await this.getWorkflowActions(workflowCode);\n const resolvedForm = resolveHistoryForm(\n historyItem,\n stage,\n workflowActions,\n result,\n );\n if (resolvedForm) {\n this.activeForm = resolvedForm;\n this.isFormViewerVisible = true;\n } else {\n this.activeForm = null;\n }\n } else {\n this.activeForm = null;\n }\n this.cdr.markForCheck();\n }\n\n private async getWorkflowActions(\n workflowCode?: string,\n ): Promise<WorkflowAction[]> {\n if (!workflowCode) {\n return [];\n }\n const cached = this.workflowActionsCache.get(workflowCode);\n if (cached) {\n return cached;\n }\n const res = await this.server.get<Paged<Workflow>>(\n `GetWorkflowsWithParam/${workflowCode}/0/1/CreatedAt/Asc`,\n );\n if (!(res instanceof ErrorResponse)) {\n const actions = res?.Result?.[0]?.Actions || [];\n this.workflowActionsCache.set(workflowCode, actions);\n return actions;\n }\n return [];\n }\n\n onFormViewerOpen() {}\n\n onFormViewerClose() {\n this.isFormViewerVisible = false;\n this.activeForm = null;\n }\n}\n","<div class=\"bg-[var(--vbn-color-surface-alt)]\">\n <header\n class=\"mx-8 rounded-lg shadow-lg flex justify-between items-center px-6 py-2 bg-[#D4A00773]\"\n >\n <h4 class=\"font-semibold\">{{ taskCode() }}</h4>\n <div class=\"flex gap-4 items-center\">\n <verbena-button\n (click)=\"addComment()\"\n text=\"+ Add Comment\"\n styleType=\"ylw-outline\"\n class=\"ml-auto\"\n ></verbena-button>\n <verben-svg\n (click)=\"goBack()\"\n class=\"cursor-pointer\"\n [width]=\"17\"\n [height]=\"17\"\n [icon]=\"'go-back'\"\n ></verben-svg>\n </div>\n </header>\n <section class=\"grid grid-cols-12 gap-6 min-h-[calc(100vh-80px)]\">\n <div\n class=\"timeline-section bg-[var(--vbn-color-surface)] col-span-12 lg:col-span-5 px-3 sm:px-6 pt-8 relative\"\n >\n <div\n *ngIf=\"showCommentBox\"\n class=\"mb-6 p-4 sm:p-5 bg-white border border-gray-200 rounded-lg shadow-sm\"\n >\n <div class=\"flex items-center justify-between mb-3\">\n <h4 class=\"font-bold text-base text-gray-800\">Add Comment</h4>\n\n <!-- Mode Switch Pill -->\n <div\n class=\"inline-flex items-center bg-gray-100 p-0.5 rounded-md border border-gray-200\"\n >\n <button\n type=\"button\"\n (click)=\"setEditorMode(false)\"\n [ngClass]=\"\n !isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2.5 py-1 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Simple textarea\"\n >\n <span>Simple</span>\n </button>\n <button\n type=\"button\"\n (click)=\"setEditorMode(true)\"\n [ngClass]=\"\n isRichEditor\n ? 'bg-white text-gray-800 shadow-xs font-medium'\n : 'text-gray-500 hover:text-gray-700'\n \"\n class=\"px-2.5 py-1 text-xs rounded transition-all cursor-pointer flex items-center gap-1\"\n title=\"Rich text editor with formatting & tables\"\n >\n <svg\n width=\"11\"\n height=\"11\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <path d=\"M4 7V4h16v3M9 20h6M12 4v16\" />\n </svg>\n <span>Rich / Tables</span>\n </button>\n </div>\n </div>\n\n <!-- Simple Textarea Mode -->\n <div *ngIf=\"!isRichEditor\" class=\"w-full\">\n <verbena-textarea\n [(ngModel)]=\"newComment\"\n [rows]=\"4\"\n width=\"100%\"\n border=\"1px solid #cbd5e1\"\n borderRadius=\"6px\"\n ></verbena-textarea>\n </div>\n\n <!-- Rich Reporting Editor Mode -->\n <div *ngIf=\"isRichEditor\" class=\"workflow-comment-editor w-full\">\n <lib-editor\n [editorConfig]=\"editorConfig\"\n [editorMode]=\"editorMode\"\n [(ngModel)]=\"newComment\"\n ></lib-editor>\n </div>\n\n <div class=\"mt-4\">\n <file-upload\n (selectedFilesChange)=\"onFileSelect($event)\"\n [multiple]=\"true\"\n label=\"Attach Files\"\n >\n </file-upload>\n <div\n *ngIf=\"selectedFiles.length > 0\"\n class=\"flex flex-wrap gap-3 mt-3\"\n >\n <div *ngFor=\"let file of selectedFiles\">\n <ng-container [ngSwitch]=\"file.Extension\">\n <img\n *ngSwitchCase=\"'jpg'\"\n [src]=\"file.Data\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <img\n *ngSwitchCase=\"'png'\"\n [src]=\"file.Data\"\n class=\"w-[100px] h-[100px] object-cover rounded-md border\"\n />\n <video\n *ngSwitchCase=\"'mp4'\"\n [src]=\"file.Data\"\n class=\"w-[150px] rounded-md shadow\"\n controls\n ></video>\n <audio\n *ngSwitchCase=\"'mp3'\"\n [src]=\"file.Data\"\n controls\n class=\"w-[150px]\"\n ></audio>\n </ng-container>\n </div>\n </div>\n </div>\n <div class=\"flex justify-end gap-2 mt-4 pt-2 border-t border-gray-100\">\n <verbena-button\n (click)=\"addComment()\"\n text=\"Cancel\"\n styleType=\"ylw-outline\"\n ></verbena-button>\n <verbena-button\n (click)=\"saveComment()\"\n text=\"Save\"\n [disable]=\"!isCommentValid() && selectedFiles.length === 0\"\n bgColor=\"var(--vbn-color-primary)\"\n textColor=\"var(--vbn-color-on-primary)\"\n borderRadius=\"10px\"\n pd=\"10px 20px\"\n width=\"114px\"\n height=\"39px\"\n ></verbena-button>\n </div>\n </div>\n <div class=\"timeline-list flex flex-col w-full\">\n <div\n *ngFor=\"let timeline of history; let i = index; let isLast = last; let isFirst = first\"\n class=\"timeline-row flex group relative\"\n >\n <!-- Left: Timestamp -->\n <div\n class=\"w-[75px] sm:w-[90px] flex-shrink-0 pt-1 text-right pr-3 cursor-pointer select-none\"\n (click)=\"setActive(i)\"\n >\n <span class=\"text-xs font-semibold text-gray-700 block leading-tight\">\n {{ timeline?.CreatedAt | date: 'mediumDate' }}\n </span>\n <span class=\"text-[11px] text-[var(--vbn-color-text-muted)] block font-mono mt-0.5\">\n {{ timeline?.CreatedAt | date: 'shortTime' }}\n </span>\n </div>\n\n <!-- Center: Timeline Rail (Connector line + Milestone Dot) -->\n <div class=\"flex flex-col items-center flex-shrink-0 w-5 self-stretch\">\n <!-- Top connector line -->\n <div\n class=\"w-0.5\"\n [ngClass]=\"isFirst ? 'h-2 bg-transparent' : 'h-2 bg-gray-200 group-hover:bg-gray-300'\"\n ></div>\n\n <!-- Milestone Dot -->\n <div\n (click)=\"setActive(i)\"\n class=\"w-3.5 h-3.5 rounded-full border-2 transition-all duration-200 cursor-pointer z-10 flex items-center justify-center flex-shrink-0\"\n [ngClass]=\"active === i\n ? 'bg-[var(--vbn-color-primary,#d4a007)] border-white shadow-sm ring-4 ring-amber-100 scale-110'\n : 'bg-white border-gray-300 group-hover:border-gray-400 group-hover:scale-105'\"\n [title]=\"timeline.ActionName || timeline.ActionType\"\n >\n <span *ngIf=\"active === i\" class=\"w-1 h-1 rounded-full bg-white block\"></span>\n </div>\n\n <!-- Bottom connector line that dynamically extends with card height -->\n <div\n *ngIf=\"!isLast\"\n class=\"w-0.5 flex-1 bg-gray-200 group-hover:bg-gray-300 min-h-[24px]\"\n ></div>\n </div>\n\n <!-- Right: Card -->\n <div class=\"flex-1 min-w-0 pl-3 pb-6\">\n <div\n class=\"w-full cursor-pointer p-4 rounded-lg border-l-4 transition-all duration-150\"\n [ngClass]=\"{\n 'bg-[#FEFAF1] border-l-[var(--vbn-color-primary)]': active === i,\n 'bg-transparent border-l-transparent hover:bg-[var(--vbn-color-surface-alt)]':\n active !== i\n }\"\n (click)=\"setActive(i)\"\n >\n <!-- ActionName as primary heading -->\n <h4 class=\"font-bold text-base text-[var(--vbn-color-text)] mb-2 leading-snug\">\n {{ timeline.ActionName || timeline.ActionType }}\n </h4>\n\n <!-- Actor information with tooltip -->\n <div class=\"mb-3\">\n <verben-tooltip\n [top]=\"'0px'\"\n [left]=\"'0px'\"\n [padding]=\"'0px'\"\n [backgroundColor]=\"'transparent'\"\n [border]=\"'none'\"\n [borderRadius]=\"'0px'\"\n [tooltipContent]=\"actorTooltipTemplate\"\n >\n <p\n class=\"text-sm text-[var(--vbn-color-text-muted)] cursor-help inline-flex items-center gap-2\"\n >\n <verben-svg\n [width]=\"14\"\n [height]=\"14\"\n [icon]=\"'user'\"\n stroke=\"var(--vbn-color-text-muted)\"\n ></verben-svg>\n <span class=\"font-medium text-[var(--vbn-color-text)]\">{{\n timeline?.Actor?.Name\n }}</span>\n </p>\n </verben-tooltip>\n\n <ng-template #actorTooltipTemplate>\n <div\n class=\"bg-white border border-[var(--vbn-color-border)] rounded-lg p-4 shadow-lg w-[280px]\"\n >\n <div class=\"flex gap-3 items-start\">\n <div\n class=\"w-[40px] h-[40px] rounded-full bg-gradient-to-r from-[#D9AEAE] via-[#E3C79F] to-[var(--vbn-color-primary)] flex-shrink-0\"\n ></div>\n <div class=\"flex-1 min-w-0\">\n <p\n class=\"font-bold text-sm text-[var(--vbn-color-text)] mb-1\"\n >\n {{ timeline?.Actor?.Name }}\n </p>\n <p\n class=\"text-xs text-[var(--vbn-color-text-muted)] break-words flex items-start gap-1\"\n >\n <verben-svg\n [width]=\"12\"\n [height]=\"12\"\n [icon]=\"'mail'\"\n stroke=\"var(--vbn-color-text-muted)\"\n ></verben-svg>\n <span>{{ timeline?.Actor?.Identifier }}</span>\n </p>\n <p\n *ngIf=\"\n timeline.Actor && getTagsFromActor(timeline.Actor)\n \"\n class=\"text-xs text-[var(--vbn-color-text-muted)] mt-2\"\n >\n <span class=\"font-medium\">Tags:</span>\n {{ getTagsFromActor(timeline.Actor) }}\n </p>\n </div>\n </div>\n </div>\n </ng-template>\n </div>\n\n <!-- Action Type (if different from ActionName) -->\n <p\n *ngIf=\"timeline.ActionName\"\n class=\"text-sm text-[var(--vbn-color-text-muted)] mb-2\"\n >\n <span class=\"font-medium\">Operation:</span>\n {{ timeline.ActionType }}\n </p>\n\n <!-- Stage information for transfer actions -->\n @if (showFromAndTo(timeline.ActionType)) {\n <div\n class=\"bg-[var(--vbn-color-surface-alt)] rounded-md p-3 mt-2 space-y-1.5\"\n >\n <p class=\"text-sm flex items-center gap-2\">\n <span class=\"text-[var(--vbn-color-text-muted)] font-medium\"\n >From:</span\n >\n <span\n class=\"text-[var(--vbn-color-border-focus)] font-mono text-xs\"\n >{{ timeline.FromStage }}</span\n >\n </p>\n <p class=\"text-sm flex items-center gap-2\">\n <span class=\"text-[var(--vbn-color-text-muted)] font-medium\"\n >To:</span\n >\n <span\n class=\"text-[var(--vbn-color-border-focus)] font-mono text-xs\"\n >{{ timeline.ToStage }}</span\n >\n </p>\n </div>\n }\n\n <!-- Action buttons -->\n <div class=\"flex gap-3 items-center mt-3 pt-2 border-t border-gray-100\">\n <button\n (click)=\"\n loadFormIfExists(timeline.FromStage, timeline);\n $event.stopPropagation()\n \"\n class=\"flex gap-2 items-center w-fit text-[var(--vbn-color-text-muted)] text-sm border px-3 py-1.5 rounded-lg bg-[var(--vbn-color-surface-alt)] border-[var(--vbn-color-border)] hover:bg-[var(--vbn-color-surface-alt)] hover:border-[var(--vbn-color-border)] transition-colors cursor-pointer\"\n >\n <verben-svg\n [width]=\"15\"\n [height]=\"15\"\n [icon]=\"'chat'\"\n ></verben-svg>\n Load Stage Form\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"col-span-12 lg:col-span-7 pt-12 pr-6 lg:pr-10 pl-4 sticky top-4 self-start\"\n >\n <div\n *ngIf=\"\n active >= 0 && !!history && history.length > 0;\n else noActiveSelection\n \"\n class=\"w-full\"\n >\n <div class=\"flex items-center justify-between mb-3\">\n <div class=\"flex items-center gap-3\">\n <h1 class=\"font-bold text-lg text-gray-800\">Comments</h1>\n <button\n *ngIf=\"history[active]?.Description\"\n type=\"button\"\n (click)=\"copyCommentText(history[active].Description)\"\n class=\"text-xs px-2.5 py-1 rounded bg-gray-100 hover:bg-gray-200 text-gray-700 transition-colors cursor-pointer flex items-center gap-1.5 border border-gray-200 select-none\"\n title=\"Copy comment to clipboard\"\n >\n <svg\n width=\"12\"\n height=\"12\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n >\n <rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect>\n <path\n d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"\n ></path>\n </svg>\n <span>{{ copyStatusText }}</span>\n </button>\n </div>\n <p class=\"text-xs text-[var(--vbn-color-text-muted)]\">\n {{ history[active].CreatedAt | date: \"medium\" }}\n </p>\n </div>\n\n <div\n class=\"comment-card bg-[var(--vbn-color-surface)] text-[var(--vbn-color-text)] leading-relaxed p-6 lg:p-8 shadow-md rounded-lg w-full border border-gray-100 select-text\"\n >\n <!-- Comment Description rendered presentably (HTML or plain text) -->\n <div\n *ngIf=\"isActiveHtml; else plainComment\"\n class=\"comment-html-content w-full overflow-x-auto\"\n [innerHTML]=\"activeFormattedComment\"\n ></div>\n <ng-template #plainComment>\n <p\n *ngIf=\"activeDecodedComment; else emptyComment\"\n class=\"whitespace-pre-wrap break-words text-sm leading-relaxed\"\n >\n {{ activeDecodedComment }}\n </p>\n <ng-template #emptyComment>\n <p\n class=\"text-xs italic text-[var(--vbn-color-text-muted)] py-4 text-center\"\n >\n No comment recorded for this action.\n </p>\n </ng-template>\n </ng-template>\n\n <div\n *ngIf=\"history[active]?.Files?.length\"\n class=\"mt-6 border-t border-gray-100 pt-4\"\n >\n <h5\n class=\"font-bold text-xs uppercase tracking-wider text-gray-500 mb-3\"\n >\n Attachments\n </h5>\n <div class=\"grid grid-cols-1 sm:grid-cols-2 gap-2\">\n <verben-file-render\n *ngFor=\"let file of history[active]?.Files\"\n [fileUrl]=\"file\"\n ></verben-file-render>\n </div>\n </div>\n </div>\n </div>\n\n <ng-template #noActiveSelection>\n <div\n class=\"w-full pt-16 flex flex-col items-center justify-center text-center text-[var(--vbn-color-text-muted)]\"\n >\n <verben-svg\n [icon]=\"'chat'\"\n [width]=\"40\"\n [height]=\"40\"\n class=\"opacity-30 mb-3\"\n ></verben-svg>\n <p class=\"text-sm font-medium\">\n Select a stage from the timeline to view details\n </p>\n </div>\n </ng-template>\n </div>\n </section>\n</div>\n\n<app-form-viewer\n [form]=\"activeForm\"\n [isVisible]=\"isFormViewerVisible\"\n (onOpen)=\"onFormViewerOpen()\"\n (onClose)=\"onFormViewerClose()\"\n></app-form-viewer>\n","import { NgModule } from '@angular/core';\nimport { TooltipModule } from 'verben-ng-ui';\nimport { FileUploadModule } from 'verben-workflow-ui/src/lib/components/file-upload';\nimport { FileRenderModule } from 'verben-workflow-ui/src/lib/components/file-render';\nimport { SharedModule } from 'verben-workflow-ui/src/lib/shared';\nimport { TaskHistoryComponent } from './task-history.component';\nimport { FormViewerLibModule } from 'verben-workflow-ui/src/lib/components/form-viewer';\n@NgModule({\n declarations: [TaskHistoryComponent],\n imports: [\n SharedModule,\n FileUploadModule,\n FileRenderModule,\n TooltipModule,\n FormViewerLibModule,\n ],\n exports: [TaskHistoryComponent],\n})\nexport class TaskHistoryModule {}\n","/**\n * Generated bundle index. Do not edit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wGAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;yGAAjB,iBAAiB,EAAA,YAAA,EAAA,CAVb,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAEjC,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,aAAa;AACb,YAAA,mBAAmB,aAEX,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAEnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAR1B,YAAY;YACZ,gBAAgB;YAChB,gBAAgB;YAChB,aAAa;YACb,mBAAmB,CAAA,EAAA,CAAA,CAAA;;4FAIV,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAX7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,oBAAoB,CAAC;AACpC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,gBAAgB;wBAChB,gBAAgB;wBAChB,aAAa;wBACb,mBAAmB;AACpB,qBAAA;oBACD,OAAO,EAAE,CAAC,oBAAoB,CAAC;AAChC,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
|
@@ -3123,8 +3123,17 @@ class DesignerCanvasComponent {
|
|
|
3123
3123
|
this.onActionDialogClosed();
|
|
3124
3124
|
}
|
|
3125
3125
|
updateCanvasSize() {
|
|
3126
|
-
const
|
|
3127
|
-
|
|
3126
|
+
const swimlaneHeightTotal = (this.state.swimlanes.length + 1) * this.swimlaneHeight;
|
|
3127
|
+
let maxRight = 0;
|
|
3128
|
+
let maxBottom = swimlaneHeightTotal;
|
|
3129
|
+
this.state.swimlanes.forEach((swimlane, laneIdx) => {
|
|
3130
|
+
(swimlane.nodes || []).forEach((node) => {
|
|
3131
|
+
maxRight = Math.max(maxRight, node.x + node.width);
|
|
3132
|
+
maxBottom = Math.max(maxBottom, node.y + laneIdx * this.swimlaneHeight + node.height);
|
|
3133
|
+
});
|
|
3134
|
+
});
|
|
3135
|
+
this.canvasWidth = Math.max(3000, Math.ceil(maxRight + 300));
|
|
3136
|
+
this.canvasHeight = Math.max(2000, Math.ceil(maxBottom + 120));
|
|
3128
3137
|
// Update all the swimlane clip paths when size changes
|
|
3129
3138
|
setTimeout(() => {
|
|
3130
3139
|
this.state.swimlanes.forEach((swimlane, index) => {
|
|
@@ -4062,6 +4071,7 @@ class DesignerCanvasComponent {
|
|
|
4062
4071
|
if (signature !== this.lastLabelLayoutSignature) {
|
|
4063
4072
|
this.lastLabelLayoutSignature = signature;
|
|
4064
4073
|
this.connectionLayoutCache.clear();
|
|
4074
|
+
this.updateCanvasSize();
|
|
4065
4075
|
const STAGE_MARGIN = 12;
|
|
4066
4076
|
const segHitsStage = (x1, y1, x2, y2, excludeIds) => {
|
|
4067
4077
|
const minX = Math.min(x1, x2);
|
|
@@ -4480,11 +4490,11 @@ class DesignerCanvasComponent {
|
|
|
4480
4490
|
});
|
|
4481
4491
|
}
|
|
4482
4492
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignerCanvasComponent, deps: [{ token: WorkflowDesignerState }, { token: WorkflowDataService }], target: i0.ɵɵFactoryTarget.Component });
|
|
4483
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignerCanvasComponent, selector: "lib-designer-canvas", inputs: { selectedTool: "selectedTool" }, outputs: { clickedPosition: "clickedPosition", subflowSelected: "subflowSelected", stagePropertiesUpdated: "stagePropertiesUpdated", actionPropertiesUpdated: "actionPropertiesUpdated" }, host: { listeners: { "window:mouseup": "onWindowMouseUp($event)" } }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"canvas-container\">\n <svg #canvas [attr.width]=\"canvasWidth\" [attr.height]=\"canvasHeight\" class=\"designer-canvas\"\n (click)=\"onCanvasClick($event)\">\n <defs>\n <!-- Grid pattern definition -->\n\n <pattern id=\"grid\" [attr.width]=\"gridSize\" [attr.height]=\"gridSize\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M 20 0 L 0 0 0 20\" fill=\"none\" stroke=\"#e2e8f0\" stroke-width=\"0.5\" />\n </pattern>\n\n <!-- Arrow head marker definition -->\n <marker id=\"arrowhead\" markerWidth=\"10\" markerHeight=\"7\" refX=\"9\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"#D36CFF\" />\n </marker>\n\n <!-- Connection point: outer transparent ring expands the hit target so a\n connection drag can be started without pixel-precise aim. The visible\n circle stays at r=5. The hit ring extends inward up to the node's\n drag-handle edge so clicks near the edge fall to the connection point\n (rendered topmost) rather than to the drag handle beneath. -->\n <g id=\"connection-point-template\">\n <circle r=\"12\" fill=\"transparent\" />\n <circle r=\"5\" fill=\"#D36CFF\" stroke=\"#FFFFFF\" stroke-width=\"1\" />\n </g>\n\n <!-- Dashed line style for connection preview -->\n <pattern id=\"dashed-line\" width=\"10\" height=\"10\" patternUnits=\"userSpaceOnUse\">\n <line x1=\"0\" y1=\"5\" x2=\"10\" y2=\"5\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" />\n </pattern>\n\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <clipPath [attr.id]=\"'swimlane-clip-' + swimlane.order\">\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" height=\"263\" />\n </clipPath>\n }\n </defs>\n\n <!-- Background grid -->\n <rect width=\"100%\" height=\"100%\" fill=\"url(#grid)\" />\n\n <!-- Display a message when no swimlanes exist -->\n @if (state.swimlanes.length === 0) {\n <text x=\"50%\" y=\"50%\" font-family=\"sans-serif\" font-size=\"16\" fill=\"#94a3b8\" text-anchor=\"middle\">\n Select the Swimlane tool and click on the canvas to add a swimlane\n </text>\n }\n\n <!-- This is where workflow elements will be added later -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- <g\n [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\"\n [attr.clip-path]=\"'url(#swimlane-clip-' + swimlane.order + ')'\"\n >\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n [attr.height]=\"263\"\n fill=\"#ffffff\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n height=\"40\"\n fill=\"#f8fafc\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <text\n x=\"20\"\n y=\"25\"\n font-family=\"sans-serif\"\n font-size=\"14\"\n fill=\"#333333\"\n font-weight=\"bold\"\n >\n {{ swimlane.label }}\n </text>\n\n <g\n class=\"edit-swimlane-button\"\n [attr.transform]=\"'translate(100, 20)'\"\n (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \"\n >\n <rect\n x=\"-5\"\n y=\"-15\"\n width=\"40\"\n height=\"20\"\n fill=\"#f3e8ff\"\n rx=\"3\"\n ry=\"3\"\n stroke=\"#d8b4fe\"\n stroke-width=\"1\"\n ></rect>\n <text\n x=\"15\"\n y=\"0\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#7e22ce\"\n text-anchor=\"middle\"\n >\n Edit\n </text>\n </g>\n\n <g [attr.transform]=\"'translate(200, 20)'\">\n @for (tag of swimlane.tags.slice(0, 3); track tag.Name; let i = $index)\n {\n <text\n [attr.x]=\"i * 100\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n {{ tag.Name }}\n </text>\n } @if (swimlane.tags.length > 3) {\n <text\n [attr.x]=\"3 * 100 + 10\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n +{{ swimlane.tags.length - 3 }} more\n </text>\n }\n </g>\n </g> -->\n\n <g [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\">\n <!-- Swimlane container - remove stroke to make it purely background -->\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" [attr.height]=\"263\"\n [attr.fill]=\"swimlane.order % 2 === 0 ? '#FCF3FF' : '#ECFFF5'\" stroke=\"none\"></rect>\n\n <!-- Vertical swimlane label on the left -->\n <g class=\"swimlane-label\">\n <!-- Purple background for the label -->\n <rect x=\"0.5\" y=\"0.5\" width=\"43\" height=\"215\" rx=\"10.5\" fill=\"white\" stroke=\"#D36CFF\"></rect>\n\n <!-- Plus button at the top -->\n <g (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \">\n <rect x=\"12.5\" y=\"10\" width=\"18\" height=\"18\" fill=\"transparent\" style=\"cursor: pointer\"></rect>\n\n <path d=\"M22.52 12.174V17.08H27.47V18.51H22.52V23.394H21.2V18.51H16.25V17.08H21.2V12.174H22.52Z\"\n fill=\"#0000FF\" class=\"plus-icon\" style=\"cursor: pointer\"></path>\n </g>\n\n <!-- Swimlane label -->\n <text x=\"22\" y=\"106\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#333333\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 100)\">\n {{\n swimlane.label.length > 12\n ? swimlane.label.substring(0, 10) + \"...\"\n : swimlane.label\n }}\n </text>\n\n <!-- Tag count indicator at the bottom -->\n <rect x=\"11.5\" y=\"187\" width=\"21\" height=\"19\" rx=\"9.5\" fill=\"#9E9E9E\"></rect>\n <text x=\"24\" y=\"206\" font-family=\"sans-serif\" font-size=\"12\" fill=\"black\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 200)\">\n {{ swimlane.tags.length }}\n </text>\n </g>\n </g>\n\n }\n\n <!-- Nodes -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- Render nodes in this swimlane -->\n @for (node of swimlane.nodes; track node.id) {\n <g class=\"node-element\" [attr.transform]=\"\n 'translate(' + node.x + ',' + (node.y + swimlane.order * 263) + ')'\"\n (mouseenter)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseleave)=\"hideConnectionPoints(node.id)\">\n <!-- Start node indicator (circle and arrow) for the first node -->\n @if (node.isStartNode) {\n <!-- Circle -->\n <circle cx=\"-50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\"></circle>\n <!-- Form icon for start node -->\n <svg:g (click)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order)\n \" class=\"stage-icon\" transform=\"translate(-45, 42)\" style=\"cursor: pointer; pointer-events: all\">\n <!-- Transparent rectangle to capture clicks -->\n <svg:rect x=\"-2\" y=\"-2\" width=\"24\" height=\"24\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path\n d=\"M16.5 20.475V17.475H13.5V16.475H16.5V13.475H17.5V16.475H20.5V17.475H17.5V20.475H16.5ZM3.5 17.5V16.5H4.5V17.5H3.5ZM6.5 17.5V16.5H11.517C11.5057 16.6767 11.5043 16.845 11.513 17.005C11.521 17.165 11.531 17.33 11.543 17.5H6.5ZM3.5 13.5V12.5H4.5V13.5H3.5ZM6.5 13.5V12.5H13.804C13.6127 12.6387 13.4333 12.7913 13.266 12.958C13.0993 13.1247 12.9377 13.3053 12.781 13.5H6.5ZM3.5 9.5V8.5H4.5V9.5H3.5ZM6.5 9.5V8.5H18.5V9.5H6.5ZM3.5 5.5V4.5H4.5V5.5H3.5ZM6.5 5.5V4.5H18.5V5.5H6.5Z\"\n [attr.fill]=\"state.workflowFormId ? '#D36CFF' : 'black'\" transform=\"scale(0.7)\" />\n </svg:g>\n <!-- Arrow from circle to node -->\n <path d=\"M -20 50 L 0 50\" stroke=\"#D36CFF\" stroke-width=\"1\" marker-end=\"url(#arrowhead)\"></path>\n }\n\n <!-- Exit point indicator (circle and arrow) -->\n @if (node.stageData?.IsExitPoint) {\n <!-- Arrow from node to circle -->\n <path [attr.d]=\"'M ' + node.width + ' 50 L ' + (node.width + 20) + ' 50'\" stroke=\"#D36CFF\" stroke-width=\"1\"\n marker-end=\"url(#arrowhead)\"></path>\n <!-- Circle -->\n <circle [attr.cx]=\"node.width + 50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"2\"></circle>\n }\n\n <!-- Inner drag-handle: inset 12px so the node edge ring stays drag-free.\n Rendered BEFORE the node shapes/icons so the clickable icons paint on\n top of it and win pointer events; the node body still falls through to\n this handle because its shape/label use pointer-events:none.\n Connection point <use> elements are rendered after everything so they\n stay topmost and win pointer events at the node edges. -->\n <rect class=\"node-drag-handle\"\n [attr.x]=\"12\" [attr.y]=\"12\"\n [attr.width]=\"node.width - 24\" [attr.height]=\"node.height - 24\"\n fill=\"transparent\"\n [style.cursor]=\"getCursorForNode(node.id)\"\n (mousedown)=\"onNodeMouseDown($event, node, swimlane.order)\" />\n\n <!-- Stage node -->\n @if (node.type === 'stage') {\n <!-- <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"node.width\"\n [attr.height]=\"node.height\"\n fill=\"none\"\n stroke=\"#D36CFF\"\n stroke-width=\"1\"\n ></rect> -->\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Decision node -->\n @if (node.type === 'decision') {\n <path [attr.d]=\"\n 'M 0 ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' 0' +\n ' L ' +\n node.width +\n ' ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' ' +\n node.height +\n ' Z'\n \" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\" style=\"pointer-events: none\"></path>\n\n <!-- Decision node condition indicator icon -->\n <svg:g (click)=\"showDecisionConditionsPopup($event, node, swimlane.order)\" class=\"decision-condition-icon\"\n [attr.transform]=\"\n 'translate(' +\n (node.width / 2 - 10) +\n ',' +\n (node.height / 2 - 10) +\n ')'\n \">\n <svg:rect x=\"-5\" y=\"-5\" width=\"30\" height=\"30\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path d=\"M10 0H20V2H10V0ZM10 8H20V10H10V8ZM10 4H20V6H10V4ZM0 0H8V2H0V0ZM0 8H8V10H0V8ZM0 4H8V6H0V4Z\"\n fill=\"#D36CFF\" />\n </svg:g>\n }\n\n <!-- Form node -->\n @if (node.type === 'form') {\n <path\n d=\"M95.0625 50.5591V95.0625C95.0625 97.9716 93.9069 100.762 91.8498 102.819C89.7928 104.876 87.0028 106.031 84.0938 106.031H32.9062C29.9972 106.031 27.2072 104.876 25.1502 102.819C23.0931 100.762 21.9375 97.9716 21.9375 95.0625V21.9375C21.9375 19.0284 23.0931 16.2385 25.1502 14.1814C27.2072 12.1244 29.9972 10.9688 32.9062 10.9688H55.4722C57.4109 10.969 59.2701 11.7392 60.6412 13.1099L92.9213 45.3901C94.292 46.7611 95.0622 48.6204 95.0625 50.5591Z\"\n transform=\"scale(0.7)\" fill=\"none\" stroke=\"#D36CFF\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <path\n d=\"M58.5 12.7969V40.2188C58.5 42.1581 59.2704 44.0181 60.6418 45.3895C62.0131 46.7608 63.8731 47.5312 65.8125 47.5312H93.2344\"\n transform=\"scale(0.7)\" stroke=\"#D36CFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <text x=\"50%\" y=\"50%\" text-anchor=\"middle\" dominant-baseline=\"middle\" font-family=\"sans-serif\" font-size=\"14\"\n fill=\"#D36CFF\" style=\"pointer-events: none\">\n Form\n </text>\n }\n\n <!-- Subflow node -->\n @if (node.type === 'subflow') {\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\" [isSubflow]=\"true\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Connection points for this node (rendered last = topmost) -->\n @for (point of node.connectionPoints || []; track point.id) {\n @if (isConnectionPointVisible(node.id)) {\n <use class=\"connection-point\" [attr.href]=\"'#connection-point-template'\" [attr.x]=\"point.x\" [attr.y]=\"point.y\"\n [attr.id]=\"point.id\" (mousedown)=\"startConnectionDrag($event, point, swimlane.order)\" />\n }\n }\n </g>\n <!-- A transparent hover area for improved hover detection -->\n <rect [attr.x]=\"node.x - 10\" [attr.y]=\"node.y - 10\" [attr.width]=\"node.width + 20\" [attr.height]=\"node.height + 20\"\n fill=\"transparent\" (mouseover)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseout)=\"hideConnectionPoints(node.id)\" style=\"pointer-events: none\" />\n } }\n\n <!-- Connections -->\n @for (connection of state.connections; track connection.id) {\n <g class=\"connection-element\">\n <path [attr.d]=\"getConnectionPathForSavedConnection(connection)\" stroke=\"#D36CFF\" stroke-width=\"2\" fill=\"none\"\n marker-end=\"url(#arrowhead)\"></path>\n\n <!-- Connection Label -->\n @if (connection.sourceNodeId && connection.targetNodeId) {\n <foreignObject [attr.x]=\"getLabelPosition(connection).x\" [attr.y]=\"getLabelPosition(connection).y\" width=\"150\"\n height=\"40\" style=\"overflow: visible; pointer-events: all;\" [attr.transform]=\"'translate(-75, -10)'\">\n <wf-label-editor [label]=\"connection.label || 'New Action'\" [x]=\"0\" [y]=\"0\" [isConnection]=\"true\"\n [hasForm]=\"!!(connection.form && connection.form.trim().length > 0)\"\n (labelChange)=\"saveConnectionLabel(connection, $event)\" (openDialog)=\"onShowActionDialog(connection)\" />\n </foreignObject>\n }\n </g>\n }\n\n <!-- Connection preview line -->\n @if (state.isConnectionDragging()) {\n <g>\n <path [attr.d]=\"getConnectionPath()\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" fill=\"none\"></path>\n </g>\n }\n </svg>\n\n <div *ngIf=\"popupVisible\" [style.position]=\"'absolute'\" [style.left.px]=\"popupX\" [style.top.px]=\"popupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '99' }\" [enableMouseLeave]=\"false\"\n (dropdownOpenChange)=\"$event ? null : hideConnectionPopup()\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md\" dropdown-content>\n <h4 class=\"mb-2 font-medium\">Create Connection</h4>\n <div class=\"flex flex-col gap-2\">\n <ng-container *ngFor=\"let type of allowedNodeTypes\">\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"createNodeConnection(type)\">\n Create {{ type | titlecase }}\n </button>\n </ng-container>\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"hideConnectionPopup()\">\n Cancel\n </button>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showStartNodeFormPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"startNodeFormPopupX\"\n [style.top.px]=\"startNodeFormPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow Form</h4>\n <div *ngIf=\"isLoadingStartNodeForms\" class=\"text-center py-2\">\n Loading forms...\n </div>\n <div *ngIf=\"!isLoadingStartNodeForms\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div class=\"mb-3\">\n <button\n class=\"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectStartNodeForm(null)\">\n Clear form selection\n </button>\n </div>\n <div *ngFor=\"let form of startNodeFormsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n [ngClass]=\"{ 'bg-blue-50 !border-blue-500 !border-2 font-semibold': form?.Code === activeNodeForFormSelection?.stageData?.formId}\"\n (click)=\"selectStartNodeForm(form)\">\n {{ form.Name }}\n </button>\n </div>\n <div *ngIf=\"startNodeFormsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No forms available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showSubflowPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"subflowPopupX\"\n [style.top.px]=\"subflowPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow</h4>\n <div *ngIf=\"isLoadingWorkflows\" class=\"text-center py-2\">\n Loading workflows...\n </div>\n <div *ngIf=\"!isLoadingWorkflows\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div *ngFor=\"let workflow of workflowsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectSubflowWorkflow(workflow)\">\n {{ workflow.Name }}\n </button>\n </div>\n <div *ngIf=\"workflowsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No workflows available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <lib-conditions-popup [visible]=\"showDecisionConditionDialog\" [decisionNodeId]=\"activeDecisionNodeId\"\n [newConnectionId]=\"activeConnectionId\" [popupX]=\"decisionConditionPopupX\" [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\" (saved)=\"onDecisionConditionSaved($event)\"></lib-conditions-popup>\n\n <!-- <lib-decision-popup\n [visible]=\"showConditionsDialog\"\n [decisionNodeId]=\"activeDecisionNodeId\"\n [popupX]=\"decisionConditionPopupX\"\n [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\"\n ></lib-decision-popup> -->\n\n <lib-stage-dialog [visible]=\"showStageDialogLocal\" [stageData]=\"activeStageData || {}\"\n (closed)=\"onStageDialogClosed()\" (saved)=\"onStageDialogSaved($event)\"></lib-stage-dialog>\n\n <lib-action-dialog [visible]=\"showActionDialogLocal\" [actionData]=\"activeActionData\" (closed)=\"onActionDialogClosed()\"\n (saved)=\"onActionDialogSaved($event)\" (deleted)=\"onActionDialogDeleted($event)\"></lib-action-dialog>\n\n\n <lib-escalation-dialog [visible]=\"showEscalationDialogLocal\" [type]=\"activeEscalationType()!\"\n [stageCode]=\"activeStageCode() || ''\" [workflowCode]=\"state.workflow?.Code || ''\"\n (closed)=\"onEscalationDialogClosed()\"></lib-escalation-dialog>\n</div>\n", styles: [".canvas-container{flex:1;overflow:auto;background-color:#fff}.designer-canvas{min-width:100%;min-height:100%;cursor:default}.designer-canvas:focus{outline:none}.edit-swimlane-button{cursor:pointer}.edit-swimlane-button:hover rect{fill:#ddd6fe}.decision-condition-icon{cursor:pointer}.decision-condition-icon:hover path{fill:#c084fc}.swimlane-label{z-index:10;cursor:default}.plus-icon:hover{fill:#d36cff}.swimlane-container{pointer-events:none}.swimlane-container>*{pointer-events:auto}.node-element{z-index:10}.connection-element{z-index:5}.node-drag-handle{pointer-events:all;-webkit-user-select:none;user-select:none}.connection-point{cursor:crosshair}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.VerbenPopUpComponent, selector: "verben-pop-Up", inputs: ["dropdownOpen", "dropdownWidth", "color", "customStyles", "popUpClass", "border", "borderRadius", "enableMouseLeave", "cdkPosition"], outputs: ["dropdownOpenChange", "close"] }, { kind: "component", type: i5$1.LabelEditorComponent, selector: "wf-label-editor", inputs: ["label", "x", "y", "isConnection", "hasForm", "isSwimlane"], outputs: ["labelChange", "openDialog"] }, { kind: "component", type: StageNodeComponent, selector: "svg:g[lib-stage-node]", inputs: ["node", "isStartNode", "isSubflow", "stageData"], outputs: ["stagePropertiesUpdated", "parallelExecutionToggled", "showShieldDialog", "showEscalationDialog", "showFormDialog"] }, { kind: "component", type: StageDialogComponent, selector: "lib-stage-dialog", inputs: ["visible", "stageData"], outputs: ["closed", "saved"] }, { kind: "component", type: ConditionsPopupComponent, selector: "lib-conditions-popup", inputs: ["visible", "decisionNodeId", "newConnectionId", "popupX", "popupY"], outputs: ["closed", "saved"] }, { kind: "component", type: EscalationDialogComponent, selector: "lib-escalation-dialog", inputs: ["visible", "workflowCode", "stageCode", "type"], outputs: ["closed", "created"] }, { kind: "component", type: ActionDialogComponent, selector: "lib-action-dialog", inputs: ["visible", "actionData"], outputs: ["closed", "saved", "deleted"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }] });
|
|
4493
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DesignerCanvasComponent, selector: "lib-designer-canvas", inputs: { selectedTool: "selectedTool" }, outputs: { clickedPosition: "clickedPosition", subflowSelected: "subflowSelected", stagePropertiesUpdated: "stagePropertiesUpdated", actionPropertiesUpdated: "actionPropertiesUpdated" }, host: { listeners: { "window:mouseup": "onWindowMouseUp($event)" } }, viewQueries: [{ propertyName: "canvasRef", first: true, predicate: ["canvas"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"canvas-container\">\n <svg #canvas [attr.width]=\"canvasWidth\" [attr.height]=\"canvasHeight\" class=\"designer-canvas\"\n (click)=\"onCanvasClick($event)\">\n <defs>\n <!-- Grid pattern definition -->\n\n <pattern id=\"grid\" [attr.width]=\"gridSize\" [attr.height]=\"gridSize\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M 20 0 L 0 0 0 20\" fill=\"none\" stroke=\"#e2e8f0\" stroke-width=\"0.5\" />\n </pattern>\n\n <!-- Arrow head marker definition -->\n <marker id=\"arrowhead\" markerWidth=\"10\" markerHeight=\"7\" refX=\"9\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"#D36CFF\" />\n </marker>\n\n <!-- Connection point: outer transparent ring expands the hit target so a\n connection drag can be started without pixel-precise aim. The visible\n circle stays at r=5. The hit ring extends inward up to the node's\n drag-handle edge so clicks near the edge fall to the connection point\n (rendered topmost) rather than to the drag handle beneath. -->\n <g id=\"connection-point-template\">\n <circle r=\"12\" fill=\"transparent\" />\n <circle r=\"5\" fill=\"#D36CFF\" stroke=\"#FFFFFF\" stroke-width=\"1\" />\n </g>\n\n <!-- Dashed line style for connection preview -->\n <pattern id=\"dashed-line\" width=\"10\" height=\"10\" patternUnits=\"userSpaceOnUse\">\n <line x1=\"0\" y1=\"5\" x2=\"10\" y2=\"5\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" />\n </pattern>\n\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <clipPath [attr.id]=\"'swimlane-clip-' + swimlane.order\">\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" height=\"263\" />\n </clipPath>\n }\n </defs>\n\n <!-- Background grid -->\n <rect width=\"100%\" height=\"100%\" fill=\"url(#grid)\" />\n\n <!-- Display a message when no swimlanes exist -->\n @if (state.swimlanes.length === 0) {\n <text x=\"50%\" y=\"50%\" font-family=\"sans-serif\" font-size=\"16\" fill=\"#94a3b8\" text-anchor=\"middle\">\n Select the Swimlane tool and click on the canvas to add a swimlane\n </text>\n }\n\n <!-- This is where workflow elements will be added later -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- <g\n [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\"\n [attr.clip-path]=\"'url(#swimlane-clip-' + swimlane.order + ')'\"\n >\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n [attr.height]=\"263\"\n fill=\"#ffffff\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n height=\"40\"\n fill=\"#f8fafc\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <text\n x=\"20\"\n y=\"25\"\n font-family=\"sans-serif\"\n font-size=\"14\"\n fill=\"#333333\"\n font-weight=\"bold\"\n >\n {{ swimlane.label }}\n </text>\n\n <g\n class=\"edit-swimlane-button\"\n [attr.transform]=\"'translate(100, 20)'\"\n (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \"\n >\n <rect\n x=\"-5\"\n y=\"-15\"\n width=\"40\"\n height=\"20\"\n fill=\"#f3e8ff\"\n rx=\"3\"\n ry=\"3\"\n stroke=\"#d8b4fe\"\n stroke-width=\"1\"\n ></rect>\n <text\n x=\"15\"\n y=\"0\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#7e22ce\"\n text-anchor=\"middle\"\n >\n Edit\n </text>\n </g>\n\n <g [attr.transform]=\"'translate(200, 20)'\">\n @for (tag of swimlane.tags.slice(0, 3); track tag.Name; let i = $index)\n {\n <text\n [attr.x]=\"i * 100\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n {{ tag.Name }}\n </text>\n } @if (swimlane.tags.length > 3) {\n <text\n [attr.x]=\"3 * 100 + 10\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n +{{ swimlane.tags.length - 3 }} more\n </text>\n }\n </g>\n </g> -->\n\n <g [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\">\n <!-- Swimlane container - remove stroke to make it purely background -->\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" [attr.height]=\"263\"\n [attr.fill]=\"swimlane.order % 2 === 0 ? '#FCF3FF' : '#ECFFF5'\" stroke=\"none\"></rect>\n\n <!-- Vertical swimlane label on the left -->\n <g class=\"swimlane-label\">\n <!-- Purple background for the label -->\n <rect x=\"0.5\" y=\"0.5\" width=\"43\" height=\"215\" rx=\"10.5\" fill=\"white\" stroke=\"#D36CFF\"></rect>\n\n <!-- Plus button at the top -->\n <g (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \">\n <rect x=\"12.5\" y=\"10\" width=\"18\" height=\"18\" fill=\"transparent\" style=\"cursor: pointer\"></rect>\n\n <path d=\"M22.52 12.174V17.08H27.47V18.51H22.52V23.394H21.2V18.51H16.25V17.08H21.2V12.174H22.52Z\"\n fill=\"#0000FF\" class=\"plus-icon\" style=\"cursor: pointer\"></path>\n </g>\n\n <!-- Swimlane label -->\n <text x=\"22\" y=\"106\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#333333\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 100)\">\n {{\n swimlane.label.length > 12\n ? swimlane.label.substring(0, 10) + \"...\"\n : swimlane.label\n }}\n </text>\n\n <!-- Tag count indicator at the bottom -->\n <rect x=\"11.5\" y=\"187\" width=\"21\" height=\"19\" rx=\"9.5\" fill=\"#9E9E9E\"></rect>\n <text x=\"24\" y=\"206\" font-family=\"sans-serif\" font-size=\"12\" fill=\"black\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 200)\">\n {{ swimlane.tags.length }}\n </text>\n </g>\n </g>\n\n }\n\n <!-- Nodes -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- Render nodes in this swimlane -->\n @for (node of swimlane.nodes; track node.id) {\n <g class=\"node-element\" [attr.transform]=\"\n 'translate(' + node.x + ',' + (node.y + swimlane.order * 263) + ')'\"\n (mouseenter)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseleave)=\"hideConnectionPoints(node.id)\">\n <!-- Start node indicator (circle and arrow) for the first node -->\n @if (node.isStartNode) {\n <!-- Circle -->\n <circle cx=\"-50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\"></circle>\n <!-- Form icon for start node -->\n <svg:g (click)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order)\n \" class=\"stage-icon\" transform=\"translate(-45, 42)\" style=\"cursor: pointer; pointer-events: all\">\n <!-- Transparent rectangle to capture clicks -->\n <svg:rect x=\"-2\" y=\"-2\" width=\"24\" height=\"24\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path\n d=\"M16.5 20.475V17.475H13.5V16.475H16.5V13.475H17.5V16.475H20.5V17.475H17.5V20.475H16.5ZM3.5 17.5V16.5H4.5V17.5H3.5ZM6.5 17.5V16.5H11.517C11.5057 16.6767 11.5043 16.845 11.513 17.005C11.521 17.165 11.531 17.33 11.543 17.5H6.5ZM3.5 13.5V12.5H4.5V13.5H3.5ZM6.5 13.5V12.5H13.804C13.6127 12.6387 13.4333 12.7913 13.266 12.958C13.0993 13.1247 12.9377 13.3053 12.781 13.5H6.5ZM3.5 9.5V8.5H4.5V9.5H3.5ZM6.5 9.5V8.5H18.5V9.5H6.5ZM3.5 5.5V4.5H4.5V5.5H3.5ZM6.5 5.5V4.5H18.5V5.5H6.5Z\"\n [attr.fill]=\"state.workflowFormId ? '#D36CFF' : 'black'\" transform=\"scale(0.7)\" />\n </svg:g>\n <!-- Arrow from circle to node -->\n <path d=\"M -20 50 L 0 50\" stroke=\"#D36CFF\" stroke-width=\"1\" marker-end=\"url(#arrowhead)\"></path>\n }\n\n <!-- Exit point indicator (circle and arrow) -->\n @if (node.stageData?.IsExitPoint) {\n <!-- Arrow from node to circle -->\n <path [attr.d]=\"'M ' + node.width + ' 50 L ' + (node.width + 20) + ' 50'\" stroke=\"#D36CFF\" stroke-width=\"1\"\n marker-end=\"url(#arrowhead)\"></path>\n <!-- Circle -->\n <circle [attr.cx]=\"node.width + 50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"2\"></circle>\n }\n\n <!-- Inner drag-handle: inset 12px so the node edge ring stays drag-free.\n Rendered BEFORE the node shapes/icons so the clickable icons paint on\n top of it and win pointer events; the node body still falls through to\n this handle because its shape/label use pointer-events:none.\n Connection point <use> elements are rendered after everything so they\n stay topmost and win pointer events at the node edges. -->\n <rect class=\"node-drag-handle\"\n [attr.x]=\"12\" [attr.y]=\"12\"\n [attr.width]=\"node.width - 24\" [attr.height]=\"node.height - 24\"\n fill=\"transparent\"\n [style.cursor]=\"getCursorForNode(node.id)\"\n (mousedown)=\"onNodeMouseDown($event, node, swimlane.order)\" />\n\n <!-- Stage node -->\n @if (node.type === 'stage') {\n <!-- <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"node.width\"\n [attr.height]=\"node.height\"\n fill=\"none\"\n stroke=\"#D36CFF\"\n stroke-width=\"1\"\n ></rect> -->\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Decision node -->\n @if (node.type === 'decision') {\n <path [attr.d]=\"\n 'M 0 ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' 0' +\n ' L ' +\n node.width +\n ' ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' ' +\n node.height +\n ' Z'\n \" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\" style=\"pointer-events: none\"></path>\n\n <!-- Decision node condition indicator icon -->\n <svg:g (click)=\"showDecisionConditionsPopup($event, node, swimlane.order)\" class=\"decision-condition-icon\"\n [attr.transform]=\"\n 'translate(' +\n (node.width / 2 - 10) +\n ',' +\n (node.height / 2 - 10) +\n ')'\n \">\n <svg:rect x=\"-5\" y=\"-5\" width=\"30\" height=\"30\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path d=\"M10 0H20V2H10V0ZM10 8H20V10H10V8ZM10 4H20V6H10V4ZM0 0H8V2H0V0ZM0 8H8V10H0V8ZM0 4H8V6H0V4Z\"\n fill=\"#D36CFF\" />\n </svg:g>\n }\n\n <!-- Form node -->\n @if (node.type === 'form') {\n <path\n d=\"M95.0625 50.5591V95.0625C95.0625 97.9716 93.9069 100.762 91.8498 102.819C89.7928 104.876 87.0028 106.031 84.0938 106.031H32.9062C29.9972 106.031 27.2072 104.876 25.1502 102.819C23.0931 100.762 21.9375 97.9716 21.9375 95.0625V21.9375C21.9375 19.0284 23.0931 16.2385 25.1502 14.1814C27.2072 12.1244 29.9972 10.9688 32.9062 10.9688H55.4722C57.4109 10.969 59.2701 11.7392 60.6412 13.1099L92.9213 45.3901C94.292 46.7611 95.0622 48.6204 95.0625 50.5591Z\"\n transform=\"scale(0.7)\" fill=\"none\" stroke=\"#D36CFF\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <path\n d=\"M58.5 12.7969V40.2188C58.5 42.1581 59.2704 44.0181 60.6418 45.3895C62.0131 46.7608 63.8731 47.5312 65.8125 47.5312H93.2344\"\n transform=\"scale(0.7)\" stroke=\"#D36CFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <text x=\"50%\" y=\"50%\" text-anchor=\"middle\" dominant-baseline=\"middle\" font-family=\"sans-serif\" font-size=\"14\"\n fill=\"#D36CFF\" style=\"pointer-events: none\">\n Form\n </text>\n }\n\n <!-- Subflow node -->\n @if (node.type === 'subflow') {\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\" [isSubflow]=\"true\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Connection points for this node (rendered last = topmost) -->\n @for (point of node.connectionPoints || []; track point.id) {\n @if (isConnectionPointVisible(node.id)) {\n <use class=\"connection-point\" [attr.href]=\"'#connection-point-template'\" [attr.x]=\"point.x\" [attr.y]=\"point.y\"\n [attr.id]=\"point.id\" (mousedown)=\"startConnectionDrag($event, point, swimlane.order)\" />\n }\n }\n </g>\n <!-- A transparent hover area for improved hover detection -->\n <rect [attr.x]=\"node.x - 10\" [attr.y]=\"node.y - 10\" [attr.width]=\"node.width + 20\" [attr.height]=\"node.height + 20\"\n fill=\"transparent\" (mouseover)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseout)=\"hideConnectionPoints(node.id)\" style=\"pointer-events: none\" />\n } }\n\n <!-- Connections -->\n @for (connection of state.connections; track connection.id) {\n <g class=\"connection-element\">\n <path [attr.d]=\"getConnectionPathForSavedConnection(connection)\" stroke=\"#D36CFF\" stroke-width=\"2\" fill=\"none\"\n marker-end=\"url(#arrowhead)\"></path>\n\n <!-- Connection Label -->\n @if (connection.sourceNodeId && connection.targetNodeId) {\n <foreignObject [attr.x]=\"getLabelPosition(connection).x\" [attr.y]=\"getLabelPosition(connection).y\" width=\"150\"\n height=\"40\" style=\"overflow: visible; pointer-events: all;\" [attr.transform]=\"'translate(-75, -10)'\">\n <wf-label-editor [label]=\"connection.label || 'New Action'\" [x]=\"0\" [y]=\"0\" [isConnection]=\"true\"\n [hasForm]=\"!!(connection.form && connection.form.trim().length > 0)\"\n (labelChange)=\"saveConnectionLabel(connection, $event)\" (openDialog)=\"onShowActionDialog(connection)\" />\n </foreignObject>\n }\n </g>\n }\n\n <!-- Connection preview line -->\n @if (state.isConnectionDragging()) {\n <g>\n <path [attr.d]=\"getConnectionPath()\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" fill=\"none\"></path>\n </g>\n }\n </svg>\n\n <div *ngIf=\"popupVisible\" [style.position]=\"'absolute'\" [style.left.px]=\"popupX\" [style.top.px]=\"popupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '99' }\" [enableMouseLeave]=\"false\"\n (dropdownOpenChange)=\"$event ? null : hideConnectionPopup()\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md\" dropdown-content>\n <h4 class=\"mb-2 font-medium\">Create Connection</h4>\n <div class=\"flex flex-col gap-2\">\n <ng-container *ngFor=\"let type of allowedNodeTypes\">\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"createNodeConnection(type)\">\n Create {{ type | titlecase }}\n </button>\n </ng-container>\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"hideConnectionPopup()\">\n Cancel\n </button>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showStartNodeFormPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"startNodeFormPopupX\"\n [style.top.px]=\"startNodeFormPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow Form</h4>\n <div *ngIf=\"isLoadingStartNodeForms\" class=\"text-center py-2\">\n Loading forms...\n </div>\n <div *ngIf=\"!isLoadingStartNodeForms\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div class=\"mb-3\">\n <button\n class=\"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectStartNodeForm(null)\">\n Clear form selection\n </button>\n </div>\n <div *ngFor=\"let form of startNodeFormsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n [ngClass]=\"{ 'bg-blue-50 !border-blue-500 !border-2 font-semibold': form?.Code === activeNodeForFormSelection?.stageData?.formId}\"\n (click)=\"selectStartNodeForm(form)\">\n {{ form.Name }}\n </button>\n </div>\n <div *ngIf=\"startNodeFormsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No forms available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showSubflowPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"subflowPopupX\"\n [style.top.px]=\"subflowPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow</h4>\n <div *ngIf=\"isLoadingWorkflows\" class=\"text-center py-2\">\n Loading workflows...\n </div>\n <div *ngIf=\"!isLoadingWorkflows\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div *ngFor=\"let workflow of workflowsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectSubflowWorkflow(workflow)\">\n {{ workflow.Name }}\n </button>\n </div>\n <div *ngIf=\"workflowsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No workflows available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <lib-conditions-popup [visible]=\"showDecisionConditionDialog\" [decisionNodeId]=\"activeDecisionNodeId\"\n [newConnectionId]=\"activeConnectionId\" [popupX]=\"decisionConditionPopupX\" [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\" (saved)=\"onDecisionConditionSaved($event)\"></lib-conditions-popup>\n\n <!-- <lib-decision-popup\n [visible]=\"showConditionsDialog\"\n [decisionNodeId]=\"activeDecisionNodeId\"\n [popupX]=\"decisionConditionPopupX\"\n [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\"\n ></lib-decision-popup> -->\n\n <lib-stage-dialog [visible]=\"showStageDialogLocal\" [stageData]=\"activeStageData || {}\"\n (closed)=\"onStageDialogClosed()\" (saved)=\"onStageDialogSaved($event)\"></lib-stage-dialog>\n\n <lib-action-dialog [visible]=\"showActionDialogLocal\" [actionData]=\"activeActionData\" (closed)=\"onActionDialogClosed()\"\n (saved)=\"onActionDialogSaved($event)\" (deleted)=\"onActionDialogDeleted($event)\"></lib-action-dialog>\n\n\n <lib-escalation-dialog [visible]=\"showEscalationDialogLocal\" [type]=\"activeEscalationType()!\"\n [stageCode]=\"activeStageCode() || ''\" [workflowCode]=\"state.workflow?.Code || ''\"\n (closed)=\"onEscalationDialogClosed()\"></lib-escalation-dialog>\n</div>\n", styles: [":host{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;width:100%}.canvas-container{flex:1;min-height:0;min-width:0;overflow:auto;background-color:#fff}.designer-canvas{display:block;min-width:100%;min-height:100%;cursor:default}.designer-canvas:focus{outline:none}.edit-swimlane-button{cursor:pointer}.edit-swimlane-button:hover rect{fill:#ddd6fe}.decision-condition-icon{cursor:pointer}.decision-condition-icon:hover path{fill:#c084fc}.swimlane-label{z-index:10;cursor:default}.plus-icon:hover{fill:#d36cff}.swimlane-container{pointer-events:none}.swimlane-container>*{pointer-events:auto}.node-element{z-index:10}.connection-element{z-index:5}.node-drag-handle{pointer-events:all;-webkit-user-select:none;user-select:none}.connection-point{cursor:crosshair}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.VerbenPopUpComponent, selector: "verben-pop-Up", inputs: ["dropdownOpen", "dropdownWidth", "color", "customStyles", "popUpClass", "border", "borderRadius", "enableMouseLeave", "cdkPosition"], outputs: ["dropdownOpenChange", "close"] }, { kind: "component", type: i5$1.LabelEditorComponent, selector: "wf-label-editor", inputs: ["label", "x", "y", "isConnection", "hasForm", "isSwimlane"], outputs: ["labelChange", "openDialog"] }, { kind: "component", type: StageNodeComponent, selector: "svg:g[lib-stage-node]", inputs: ["node", "isStartNode", "isSubflow", "stageData"], outputs: ["stagePropertiesUpdated", "parallelExecutionToggled", "showShieldDialog", "showEscalationDialog", "showFormDialog"] }, { kind: "component", type: StageDialogComponent, selector: "lib-stage-dialog", inputs: ["visible", "stageData"], outputs: ["closed", "saved"] }, { kind: "component", type: ConditionsPopupComponent, selector: "lib-conditions-popup", inputs: ["visible", "decisionNodeId", "newConnectionId", "popupX", "popupY"], outputs: ["closed", "saved"] }, { kind: "component", type: EscalationDialogComponent, selector: "lib-escalation-dialog", inputs: ["visible", "workflowCode", "stageCode", "type"], outputs: ["closed", "created"] }, { kind: "component", type: ActionDialogComponent, selector: "lib-action-dialog", inputs: ["visible", "actionData"], outputs: ["closed", "saved", "deleted"] }, { kind: "pipe", type: i3.TitleCasePipe, name: "titlecase" }] });
|
|
4484
4494
|
}
|
|
4485
4495
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DesignerCanvasComponent, decorators: [{
|
|
4486
4496
|
type: Component,
|
|
4487
|
-
args: [{ selector: 'lib-designer-canvas', template: "<div class=\"canvas-container\">\n <svg #canvas [attr.width]=\"canvasWidth\" [attr.height]=\"canvasHeight\" class=\"designer-canvas\"\n (click)=\"onCanvasClick($event)\">\n <defs>\n <!-- Grid pattern definition -->\n\n <pattern id=\"grid\" [attr.width]=\"gridSize\" [attr.height]=\"gridSize\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M 20 0 L 0 0 0 20\" fill=\"none\" stroke=\"#e2e8f0\" stroke-width=\"0.5\" />\n </pattern>\n\n <!-- Arrow head marker definition -->\n <marker id=\"arrowhead\" markerWidth=\"10\" markerHeight=\"7\" refX=\"9\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"#D36CFF\" />\n </marker>\n\n <!-- Connection point: outer transparent ring expands the hit target so a\n connection drag can be started without pixel-precise aim. The visible\n circle stays at r=5. The hit ring extends inward up to the node's\n drag-handle edge so clicks near the edge fall to the connection point\n (rendered topmost) rather than to the drag handle beneath. -->\n <g id=\"connection-point-template\">\n <circle r=\"12\" fill=\"transparent\" />\n <circle r=\"5\" fill=\"#D36CFF\" stroke=\"#FFFFFF\" stroke-width=\"1\" />\n </g>\n\n <!-- Dashed line style for connection preview -->\n <pattern id=\"dashed-line\" width=\"10\" height=\"10\" patternUnits=\"userSpaceOnUse\">\n <line x1=\"0\" y1=\"5\" x2=\"10\" y2=\"5\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" />\n </pattern>\n\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <clipPath [attr.id]=\"'swimlane-clip-' + swimlane.order\">\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" height=\"263\" />\n </clipPath>\n }\n </defs>\n\n <!-- Background grid -->\n <rect width=\"100%\" height=\"100%\" fill=\"url(#grid)\" />\n\n <!-- Display a message when no swimlanes exist -->\n @if (state.swimlanes.length === 0) {\n <text x=\"50%\" y=\"50%\" font-family=\"sans-serif\" font-size=\"16\" fill=\"#94a3b8\" text-anchor=\"middle\">\n Select the Swimlane tool and click on the canvas to add a swimlane\n </text>\n }\n\n <!-- This is where workflow elements will be added later -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- <g\n [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\"\n [attr.clip-path]=\"'url(#swimlane-clip-' + swimlane.order + ')'\"\n >\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n [attr.height]=\"263\"\n fill=\"#ffffff\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n height=\"40\"\n fill=\"#f8fafc\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <text\n x=\"20\"\n y=\"25\"\n font-family=\"sans-serif\"\n font-size=\"14\"\n fill=\"#333333\"\n font-weight=\"bold\"\n >\n {{ swimlane.label }}\n </text>\n\n <g\n class=\"edit-swimlane-button\"\n [attr.transform]=\"'translate(100, 20)'\"\n (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \"\n >\n <rect\n x=\"-5\"\n y=\"-15\"\n width=\"40\"\n height=\"20\"\n fill=\"#f3e8ff\"\n rx=\"3\"\n ry=\"3\"\n stroke=\"#d8b4fe\"\n stroke-width=\"1\"\n ></rect>\n <text\n x=\"15\"\n y=\"0\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#7e22ce\"\n text-anchor=\"middle\"\n >\n Edit\n </text>\n </g>\n\n <g [attr.transform]=\"'translate(200, 20)'\">\n @for (tag of swimlane.tags.slice(0, 3); track tag.Name; let i = $index)\n {\n <text\n [attr.x]=\"i * 100\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n {{ tag.Name }}\n </text>\n } @if (swimlane.tags.length > 3) {\n <text\n [attr.x]=\"3 * 100 + 10\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n +{{ swimlane.tags.length - 3 }} more\n </text>\n }\n </g>\n </g> -->\n\n <g [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\">\n <!-- Swimlane container - remove stroke to make it purely background -->\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" [attr.height]=\"263\"\n [attr.fill]=\"swimlane.order % 2 === 0 ? '#FCF3FF' : '#ECFFF5'\" stroke=\"none\"></rect>\n\n <!-- Vertical swimlane label on the left -->\n <g class=\"swimlane-label\">\n <!-- Purple background for the label -->\n <rect x=\"0.5\" y=\"0.5\" width=\"43\" height=\"215\" rx=\"10.5\" fill=\"white\" stroke=\"#D36CFF\"></rect>\n\n <!-- Plus button at the top -->\n <g (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \">\n <rect x=\"12.5\" y=\"10\" width=\"18\" height=\"18\" fill=\"transparent\" style=\"cursor: pointer\"></rect>\n\n <path d=\"M22.52 12.174V17.08H27.47V18.51H22.52V23.394H21.2V18.51H16.25V17.08H21.2V12.174H22.52Z\"\n fill=\"#0000FF\" class=\"plus-icon\" style=\"cursor: pointer\"></path>\n </g>\n\n <!-- Swimlane label -->\n <text x=\"22\" y=\"106\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#333333\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 100)\">\n {{\n swimlane.label.length > 12\n ? swimlane.label.substring(0, 10) + \"...\"\n : swimlane.label\n }}\n </text>\n\n <!-- Tag count indicator at the bottom -->\n <rect x=\"11.5\" y=\"187\" width=\"21\" height=\"19\" rx=\"9.5\" fill=\"#9E9E9E\"></rect>\n <text x=\"24\" y=\"206\" font-family=\"sans-serif\" font-size=\"12\" fill=\"black\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 200)\">\n {{ swimlane.tags.length }}\n </text>\n </g>\n </g>\n\n }\n\n <!-- Nodes -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- Render nodes in this swimlane -->\n @for (node of swimlane.nodes; track node.id) {\n <g class=\"node-element\" [attr.transform]=\"\n 'translate(' + node.x + ',' + (node.y + swimlane.order * 263) + ')'\"\n (mouseenter)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseleave)=\"hideConnectionPoints(node.id)\">\n <!-- Start node indicator (circle and arrow) for the first node -->\n @if (node.isStartNode) {\n <!-- Circle -->\n <circle cx=\"-50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\"></circle>\n <!-- Form icon for start node -->\n <svg:g (click)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order)\n \" class=\"stage-icon\" transform=\"translate(-45, 42)\" style=\"cursor: pointer; pointer-events: all\">\n <!-- Transparent rectangle to capture clicks -->\n <svg:rect x=\"-2\" y=\"-2\" width=\"24\" height=\"24\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path\n d=\"M16.5 20.475V17.475H13.5V16.475H16.5V13.475H17.5V16.475H20.5V17.475H17.5V20.475H16.5ZM3.5 17.5V16.5H4.5V17.5H3.5ZM6.5 17.5V16.5H11.517C11.5057 16.6767 11.5043 16.845 11.513 17.005C11.521 17.165 11.531 17.33 11.543 17.5H6.5ZM3.5 13.5V12.5H4.5V13.5H3.5ZM6.5 13.5V12.5H13.804C13.6127 12.6387 13.4333 12.7913 13.266 12.958C13.0993 13.1247 12.9377 13.3053 12.781 13.5H6.5ZM3.5 9.5V8.5H4.5V9.5H3.5ZM6.5 9.5V8.5H18.5V9.5H6.5ZM3.5 5.5V4.5H4.5V5.5H3.5ZM6.5 5.5V4.5H18.5V5.5H6.5Z\"\n [attr.fill]=\"state.workflowFormId ? '#D36CFF' : 'black'\" transform=\"scale(0.7)\" />\n </svg:g>\n <!-- Arrow from circle to node -->\n <path d=\"M -20 50 L 0 50\" stroke=\"#D36CFF\" stroke-width=\"1\" marker-end=\"url(#arrowhead)\"></path>\n }\n\n <!-- Exit point indicator (circle and arrow) -->\n @if (node.stageData?.IsExitPoint) {\n <!-- Arrow from node to circle -->\n <path [attr.d]=\"'M ' + node.width + ' 50 L ' + (node.width + 20) + ' 50'\" stroke=\"#D36CFF\" stroke-width=\"1\"\n marker-end=\"url(#arrowhead)\"></path>\n <!-- Circle -->\n <circle [attr.cx]=\"node.width + 50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"2\"></circle>\n }\n\n <!-- Inner drag-handle: inset 12px so the node edge ring stays drag-free.\n Rendered BEFORE the node shapes/icons so the clickable icons paint on\n top of it and win pointer events; the node body still falls through to\n this handle because its shape/label use pointer-events:none.\n Connection point <use> elements are rendered after everything so they\n stay topmost and win pointer events at the node edges. -->\n <rect class=\"node-drag-handle\"\n [attr.x]=\"12\" [attr.y]=\"12\"\n [attr.width]=\"node.width - 24\" [attr.height]=\"node.height - 24\"\n fill=\"transparent\"\n [style.cursor]=\"getCursorForNode(node.id)\"\n (mousedown)=\"onNodeMouseDown($event, node, swimlane.order)\" />\n\n <!-- Stage node -->\n @if (node.type === 'stage') {\n <!-- <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"node.width\"\n [attr.height]=\"node.height\"\n fill=\"none\"\n stroke=\"#D36CFF\"\n stroke-width=\"1\"\n ></rect> -->\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Decision node -->\n @if (node.type === 'decision') {\n <path [attr.d]=\"\n 'M 0 ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' 0' +\n ' L ' +\n node.width +\n ' ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' ' +\n node.height +\n ' Z'\n \" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\" style=\"pointer-events: none\"></path>\n\n <!-- Decision node condition indicator icon -->\n <svg:g (click)=\"showDecisionConditionsPopup($event, node, swimlane.order)\" class=\"decision-condition-icon\"\n [attr.transform]=\"\n 'translate(' +\n (node.width / 2 - 10) +\n ',' +\n (node.height / 2 - 10) +\n ')'\n \">\n <svg:rect x=\"-5\" y=\"-5\" width=\"30\" height=\"30\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path d=\"M10 0H20V2H10V0ZM10 8H20V10H10V8ZM10 4H20V6H10V4ZM0 0H8V2H0V0ZM0 8H8V10H0V8ZM0 4H8V6H0V4Z\"\n fill=\"#D36CFF\" />\n </svg:g>\n }\n\n <!-- Form node -->\n @if (node.type === 'form') {\n <path\n d=\"M95.0625 50.5591V95.0625C95.0625 97.9716 93.9069 100.762 91.8498 102.819C89.7928 104.876 87.0028 106.031 84.0938 106.031H32.9062C29.9972 106.031 27.2072 104.876 25.1502 102.819C23.0931 100.762 21.9375 97.9716 21.9375 95.0625V21.9375C21.9375 19.0284 23.0931 16.2385 25.1502 14.1814C27.2072 12.1244 29.9972 10.9688 32.9062 10.9688H55.4722C57.4109 10.969 59.2701 11.7392 60.6412 13.1099L92.9213 45.3901C94.292 46.7611 95.0622 48.6204 95.0625 50.5591Z\"\n transform=\"scale(0.7)\" fill=\"none\" stroke=\"#D36CFF\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <path\n d=\"M58.5 12.7969V40.2188C58.5 42.1581 59.2704 44.0181 60.6418 45.3895C62.0131 46.7608 63.8731 47.5312 65.8125 47.5312H93.2344\"\n transform=\"scale(0.7)\" stroke=\"#D36CFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <text x=\"50%\" y=\"50%\" text-anchor=\"middle\" dominant-baseline=\"middle\" font-family=\"sans-serif\" font-size=\"14\"\n fill=\"#D36CFF\" style=\"pointer-events: none\">\n Form\n </text>\n }\n\n <!-- Subflow node -->\n @if (node.type === 'subflow') {\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\" [isSubflow]=\"true\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Connection points for this node (rendered last = topmost) -->\n @for (point of node.connectionPoints || []; track point.id) {\n @if (isConnectionPointVisible(node.id)) {\n <use class=\"connection-point\" [attr.href]=\"'#connection-point-template'\" [attr.x]=\"point.x\" [attr.y]=\"point.y\"\n [attr.id]=\"point.id\" (mousedown)=\"startConnectionDrag($event, point, swimlane.order)\" />\n }\n }\n </g>\n <!-- A transparent hover area for improved hover detection -->\n <rect [attr.x]=\"node.x - 10\" [attr.y]=\"node.y - 10\" [attr.width]=\"node.width + 20\" [attr.height]=\"node.height + 20\"\n fill=\"transparent\" (mouseover)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseout)=\"hideConnectionPoints(node.id)\" style=\"pointer-events: none\" />\n } }\n\n <!-- Connections -->\n @for (connection of state.connections; track connection.id) {\n <g class=\"connection-element\">\n <path [attr.d]=\"getConnectionPathForSavedConnection(connection)\" stroke=\"#D36CFF\" stroke-width=\"2\" fill=\"none\"\n marker-end=\"url(#arrowhead)\"></path>\n\n <!-- Connection Label -->\n @if (connection.sourceNodeId && connection.targetNodeId) {\n <foreignObject [attr.x]=\"getLabelPosition(connection).x\" [attr.y]=\"getLabelPosition(connection).y\" width=\"150\"\n height=\"40\" style=\"overflow: visible; pointer-events: all;\" [attr.transform]=\"'translate(-75, -10)'\">\n <wf-label-editor [label]=\"connection.label || 'New Action'\" [x]=\"0\" [y]=\"0\" [isConnection]=\"true\"\n [hasForm]=\"!!(connection.form && connection.form.trim().length > 0)\"\n (labelChange)=\"saveConnectionLabel(connection, $event)\" (openDialog)=\"onShowActionDialog(connection)\" />\n </foreignObject>\n }\n </g>\n }\n\n <!-- Connection preview line -->\n @if (state.isConnectionDragging()) {\n <g>\n <path [attr.d]=\"getConnectionPath()\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" fill=\"none\"></path>\n </g>\n }\n </svg>\n\n <div *ngIf=\"popupVisible\" [style.position]=\"'absolute'\" [style.left.px]=\"popupX\" [style.top.px]=\"popupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '99' }\" [enableMouseLeave]=\"false\"\n (dropdownOpenChange)=\"$event ? null : hideConnectionPopup()\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md\" dropdown-content>\n <h4 class=\"mb-2 font-medium\">Create Connection</h4>\n <div class=\"flex flex-col gap-2\">\n <ng-container *ngFor=\"let type of allowedNodeTypes\">\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"createNodeConnection(type)\">\n Create {{ type | titlecase }}\n </button>\n </ng-container>\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"hideConnectionPopup()\">\n Cancel\n </button>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showStartNodeFormPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"startNodeFormPopupX\"\n [style.top.px]=\"startNodeFormPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow Form</h4>\n <div *ngIf=\"isLoadingStartNodeForms\" class=\"text-center py-2\">\n Loading forms...\n </div>\n <div *ngIf=\"!isLoadingStartNodeForms\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div class=\"mb-3\">\n <button\n class=\"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectStartNodeForm(null)\">\n Clear form selection\n </button>\n </div>\n <div *ngFor=\"let form of startNodeFormsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n [ngClass]=\"{ 'bg-blue-50 !border-blue-500 !border-2 font-semibold': form?.Code === activeNodeForFormSelection?.stageData?.formId}\"\n (click)=\"selectStartNodeForm(form)\">\n {{ form.Name }}\n </button>\n </div>\n <div *ngIf=\"startNodeFormsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No forms available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showSubflowPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"subflowPopupX\"\n [style.top.px]=\"subflowPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow</h4>\n <div *ngIf=\"isLoadingWorkflows\" class=\"text-center py-2\">\n Loading workflows...\n </div>\n <div *ngIf=\"!isLoadingWorkflows\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div *ngFor=\"let workflow of workflowsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectSubflowWorkflow(workflow)\">\n {{ workflow.Name }}\n </button>\n </div>\n <div *ngIf=\"workflowsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No workflows available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <lib-conditions-popup [visible]=\"showDecisionConditionDialog\" [decisionNodeId]=\"activeDecisionNodeId\"\n [newConnectionId]=\"activeConnectionId\" [popupX]=\"decisionConditionPopupX\" [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\" (saved)=\"onDecisionConditionSaved($event)\"></lib-conditions-popup>\n\n <!-- <lib-decision-popup\n [visible]=\"showConditionsDialog\"\n [decisionNodeId]=\"activeDecisionNodeId\"\n [popupX]=\"decisionConditionPopupX\"\n [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\"\n ></lib-decision-popup> -->\n\n <lib-stage-dialog [visible]=\"showStageDialogLocal\" [stageData]=\"activeStageData || {}\"\n (closed)=\"onStageDialogClosed()\" (saved)=\"onStageDialogSaved($event)\"></lib-stage-dialog>\n\n <lib-action-dialog [visible]=\"showActionDialogLocal\" [actionData]=\"activeActionData\" (closed)=\"onActionDialogClosed()\"\n (saved)=\"onActionDialogSaved($event)\" (deleted)=\"onActionDialogDeleted($event)\"></lib-action-dialog>\n\n\n <lib-escalation-dialog [visible]=\"showEscalationDialogLocal\" [type]=\"activeEscalationType()!\"\n [stageCode]=\"activeStageCode() || ''\" [workflowCode]=\"state.workflow?.Code || ''\"\n (closed)=\"onEscalationDialogClosed()\"></lib-escalation-dialog>\n</div>\n", styles: [".canvas-container{flex:1;overflow:auto;background-color:#fff}.designer-canvas{min-width:100%;min-height:100%;cursor:default}.designer-canvas:focus{outline:none}.edit-swimlane-button{cursor:pointer}.edit-swimlane-button:hover rect{fill:#ddd6fe}.decision-condition-icon{cursor:pointer}.decision-condition-icon:hover path{fill:#c084fc}.swimlane-label{z-index:10;cursor:default}.plus-icon:hover{fill:#d36cff}.swimlane-container{pointer-events:none}.swimlane-container>*{pointer-events:auto}.node-element{z-index:10}.connection-element{z-index:5}.node-drag-handle{pointer-events:all;-webkit-user-select:none;user-select:none}.connection-point{cursor:crosshair}\n"] }]
|
|
4497
|
+
args: [{ selector: 'lib-designer-canvas', template: "<div class=\"canvas-container\">\n <svg #canvas [attr.width]=\"canvasWidth\" [attr.height]=\"canvasHeight\" class=\"designer-canvas\"\n (click)=\"onCanvasClick($event)\">\n <defs>\n <!-- Grid pattern definition -->\n\n <pattern id=\"grid\" [attr.width]=\"gridSize\" [attr.height]=\"gridSize\" patternUnits=\"userSpaceOnUse\">\n <path d=\"M 20 0 L 0 0 0 20\" fill=\"none\" stroke=\"#e2e8f0\" stroke-width=\"0.5\" />\n </pattern>\n\n <!-- Arrow head marker definition -->\n <marker id=\"arrowhead\" markerWidth=\"10\" markerHeight=\"7\" refX=\"9\" refY=\"3.5\" orient=\"auto\">\n <polygon points=\"0 0, 10 3.5, 0 7\" fill=\"#D36CFF\" />\n </marker>\n\n <!-- Connection point: outer transparent ring expands the hit target so a\n connection drag can be started without pixel-precise aim. The visible\n circle stays at r=5. The hit ring extends inward up to the node's\n drag-handle edge so clicks near the edge fall to the connection point\n (rendered topmost) rather than to the drag handle beneath. -->\n <g id=\"connection-point-template\">\n <circle r=\"12\" fill=\"transparent\" />\n <circle r=\"5\" fill=\"#D36CFF\" stroke=\"#FFFFFF\" stroke-width=\"1\" />\n </g>\n\n <!-- Dashed line style for connection preview -->\n <pattern id=\"dashed-line\" width=\"10\" height=\"10\" patternUnits=\"userSpaceOnUse\">\n <line x1=\"0\" y1=\"5\" x2=\"10\" y2=\"5\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" />\n </pattern>\n\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <clipPath [attr.id]=\"'swimlane-clip-' + swimlane.order\">\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" height=\"263\" />\n </clipPath>\n }\n </defs>\n\n <!-- Background grid -->\n <rect width=\"100%\" height=\"100%\" fill=\"url(#grid)\" />\n\n <!-- Display a message when no swimlanes exist -->\n @if (state.swimlanes.length === 0) {\n <text x=\"50%\" y=\"50%\" font-family=\"sans-serif\" font-size=\"16\" fill=\"#94a3b8\" text-anchor=\"middle\">\n Select the Swimlane tool and click on the canvas to add a swimlane\n </text>\n }\n\n <!-- This is where workflow elements will be added later -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- <g\n [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\"\n [attr.clip-path]=\"'url(#swimlane-clip-' + swimlane.order + ')'\"\n >\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n [attr.height]=\"263\"\n fill=\"#ffffff\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"canvasWidth\"\n height=\"40\"\n fill=\"#f8fafc\"\n stroke=\"#e2e8f0\"\n stroke-width=\"1\"\n ></rect>\n\n <text\n x=\"20\"\n y=\"25\"\n font-family=\"sans-serif\"\n font-size=\"14\"\n fill=\"#333333\"\n font-weight=\"bold\"\n >\n {{ swimlane.label }}\n </text>\n\n <g\n class=\"edit-swimlane-button\"\n [attr.transform]=\"'translate(100, 20)'\"\n (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \"\n >\n <rect\n x=\"-5\"\n y=\"-15\"\n width=\"40\"\n height=\"20\"\n fill=\"#f3e8ff\"\n rx=\"3\"\n ry=\"3\"\n stroke=\"#d8b4fe\"\n stroke-width=\"1\"\n ></rect>\n <text\n x=\"15\"\n y=\"0\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#7e22ce\"\n text-anchor=\"middle\"\n >\n Edit\n </text>\n </g>\n\n <g [attr.transform]=\"'translate(200, 20)'\">\n @for (tag of swimlane.tags.slice(0, 3); track tag.Name; let i = $index)\n {\n <text\n [attr.x]=\"i * 100\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n {{ tag.Name }}\n </text>\n } @if (swimlane.tags.length > 3) {\n <text\n [attr.x]=\"3 * 100 + 10\"\n y=\"5\"\n font-family=\"sans-serif\"\n font-size=\"12\"\n fill=\"#666666\"\n >\n +{{ swimlane.tags.length - 3 }} more\n </text>\n }\n </g>\n </g> -->\n\n <g [attr.transform]=\"'translate(0,' + swimlane.order * 263 + ')'\">\n <!-- Swimlane container - remove stroke to make it purely background -->\n <rect x=\"0\" y=\"0\" [attr.width]=\"canvasWidth\" [attr.height]=\"263\"\n [attr.fill]=\"swimlane.order % 2 === 0 ? '#FCF3FF' : '#ECFFF5'\" stroke=\"none\"></rect>\n\n <!-- Vertical swimlane label on the left -->\n <g class=\"swimlane-label\">\n <!-- Purple background for the label -->\n <rect x=\"0.5\" y=\"0.5\" width=\"43\" height=\"215\" rx=\"10.5\" fill=\"white\" stroke=\"#D36CFF\"></rect>\n\n <!-- Plus button at the top -->\n <g (click)=\"\n onEditSwimlane($event, swimlane, swimlane.order);\n $event.stopPropagation()\n \">\n <rect x=\"12.5\" y=\"10\" width=\"18\" height=\"18\" fill=\"transparent\" style=\"cursor: pointer\"></rect>\n\n <path d=\"M22.52 12.174V17.08H27.47V18.51H22.52V23.394H21.2V18.51H16.25V17.08H21.2V12.174H22.52Z\"\n fill=\"#0000FF\" class=\"plus-icon\" style=\"cursor: pointer\"></path>\n </g>\n\n <!-- Swimlane label -->\n <text x=\"22\" y=\"106\" font-family=\"sans-serif\" font-size=\"14\" fill=\"#333333\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 100)\">\n {{\n swimlane.label.length > 12\n ? swimlane.label.substring(0, 10) + \"...\"\n : swimlane.label\n }}\n </text>\n\n <!-- Tag count indicator at the bottom -->\n <rect x=\"11.5\" y=\"187\" width=\"21\" height=\"19\" rx=\"9.5\" fill=\"#9E9E9E\"></rect>\n <text x=\"24\" y=\"206\" font-family=\"sans-serif\" font-size=\"12\" fill=\"black\" text-anchor=\"middle\"\n transform=\"rotate(-90, 22, 200)\">\n {{ swimlane.tags.length }}\n </text>\n </g>\n </g>\n\n }\n\n <!-- Nodes -->\n @for (swimlane of state.swimlanes; track swimlane.order) {\n <!-- Render nodes in this swimlane -->\n @for (node of swimlane.nodes; track node.id) {\n <g class=\"node-element\" [attr.transform]=\"\n 'translate(' + node.x + ',' + (node.y + swimlane.order * 263) + ')'\"\n (mouseenter)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseleave)=\"hideConnectionPoints(node.id)\">\n <!-- Start node indicator (circle and arrow) for the first node -->\n @if (node.isStartNode) {\n <!-- Circle -->\n <circle cx=\"-50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\"></circle>\n <!-- Form icon for start node -->\n <svg:g (click)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order)\n \" class=\"stage-icon\" transform=\"translate(-45, 42)\" style=\"cursor: pointer; pointer-events: all\">\n <!-- Transparent rectangle to capture clicks -->\n <svg:rect x=\"-2\" y=\"-2\" width=\"24\" height=\"24\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path\n d=\"M16.5 20.475V17.475H13.5V16.475H16.5V13.475H17.5V16.475H20.5V17.475H17.5V20.475H16.5ZM3.5 17.5V16.5H4.5V17.5H3.5ZM6.5 17.5V16.5H11.517C11.5057 16.6767 11.5043 16.845 11.513 17.005C11.521 17.165 11.531 17.33 11.543 17.5H6.5ZM3.5 13.5V12.5H4.5V13.5H3.5ZM6.5 13.5V12.5H13.804C13.6127 12.6387 13.4333 12.7913 13.266 12.958C13.0993 13.1247 12.9377 13.3053 12.781 13.5H6.5ZM3.5 9.5V8.5H4.5V9.5H3.5ZM6.5 9.5V8.5H18.5V9.5H6.5ZM3.5 5.5V4.5H4.5V5.5H3.5ZM6.5 5.5V4.5H18.5V5.5H6.5Z\"\n [attr.fill]=\"state.workflowFormId ? '#D36CFF' : 'black'\" transform=\"scale(0.7)\" />\n </svg:g>\n <!-- Arrow from circle to node -->\n <path d=\"M -20 50 L 0 50\" stroke=\"#D36CFF\" stroke-width=\"1\" marker-end=\"url(#arrowhead)\"></path>\n }\n\n <!-- Exit point indicator (circle and arrow) -->\n @if (node.stageData?.IsExitPoint) {\n <!-- Arrow from node to circle -->\n <path [attr.d]=\"'M ' + node.width + ' 50 L ' + (node.width + 20) + ' 50'\" stroke=\"#D36CFF\" stroke-width=\"1\"\n marker-end=\"url(#arrowhead)\"></path>\n <!-- Circle -->\n <circle [attr.cx]=\"node.width + 50\" cy=\"50\" r=\"30\" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"2\"></circle>\n }\n\n <!-- Inner drag-handle: inset 12px so the node edge ring stays drag-free.\n Rendered BEFORE the node shapes/icons so the clickable icons paint on\n top of it and win pointer events; the node body still falls through to\n this handle because its shape/label use pointer-events:none.\n Connection point <use> elements are rendered after everything so they\n stay topmost and win pointer events at the node edges. -->\n <rect class=\"node-drag-handle\"\n [attr.x]=\"12\" [attr.y]=\"12\"\n [attr.width]=\"node.width - 24\" [attr.height]=\"node.height - 24\"\n fill=\"transparent\"\n [style.cursor]=\"getCursorForNode(node.id)\"\n (mousedown)=\"onNodeMouseDown($event, node, swimlane.order)\" />\n\n <!-- Stage node -->\n @if (node.type === 'stage') {\n <!-- <rect\n x=\"0\"\n y=\"0\"\n [attr.width]=\"node.width\"\n [attr.height]=\"node.height\"\n fill=\"none\"\n stroke=\"#D36CFF\"\n stroke-width=\"1\"\n ></rect> -->\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Decision node -->\n @if (node.type === 'decision') {\n <path [attr.d]=\"\n 'M 0 ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' 0' +\n ' L ' +\n node.width +\n ' ' +\n node.height / 2 +\n ' L ' +\n node.width / 2 +\n ' ' +\n node.height +\n ' Z'\n \" fill=\"none\" stroke=\"#D36CFF\" stroke-width=\"1\" style=\"pointer-events: none\"></path>\n\n <!-- Decision node condition indicator icon -->\n <svg:g (click)=\"showDecisionConditionsPopup($event, node, swimlane.order)\" class=\"decision-condition-icon\"\n [attr.transform]=\"\n 'translate(' +\n (node.width / 2 - 10) +\n ',' +\n (node.height / 2 - 10) +\n ')'\n \">\n <svg:rect x=\"-5\" y=\"-5\" width=\"30\" height=\"30\" fill=\"transparent\" style=\"cursor: pointer\" />\n <svg:path d=\"M10 0H20V2H10V0ZM10 8H20V10H10V8ZM10 4H20V6H10V4ZM0 0H8V2H0V0ZM0 8H8V10H0V8ZM0 4H8V6H0V4Z\"\n fill=\"#D36CFF\" />\n </svg:g>\n }\n\n <!-- Form node -->\n @if (node.type === 'form') {\n <path\n d=\"M95.0625 50.5591V95.0625C95.0625 97.9716 93.9069 100.762 91.8498 102.819C89.7928 104.876 87.0028 106.031 84.0938 106.031H32.9062C29.9972 106.031 27.2072 104.876 25.1502 102.819C23.0931 100.762 21.9375 97.9716 21.9375 95.0625V21.9375C21.9375 19.0284 23.0931 16.2385 25.1502 14.1814C27.2072 12.1244 29.9972 10.9688 32.9062 10.9688H55.4722C57.4109 10.969 59.2701 11.7392 60.6412 13.1099L92.9213 45.3901C94.292 46.7611 95.0622 48.6204 95.0625 50.5591Z\"\n transform=\"scale(0.7)\" fill=\"none\" stroke=\"#D36CFF\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <path\n d=\"M58.5 12.7969V40.2188C58.5 42.1581 59.2704 44.0181 60.6418 45.3895C62.0131 46.7608 63.8731 47.5312 65.8125 47.5312H93.2344\"\n transform=\"scale(0.7)\" stroke=\"#D36CFF\" stroke-linecap=\"round\" stroke-linejoin=\"round\" style=\"pointer-events: none\" />\n <text x=\"50%\" y=\"50%\" text-anchor=\"middle\" dominant-baseline=\"middle\" font-family=\"sans-serif\" font-size=\"14\"\n fill=\"#D36CFF\" style=\"pointer-events: none\">\n Form\n </text>\n }\n\n <!-- Subflow node -->\n @if (node.type === 'subflow') {\n <svg:g lib-stage-node [node]=\"node\" [isStartNode]=\"node.isStartNode\" [isSubflow]=\"true\"\n (stagePropertiesUpdated)=\"onStagePropertiesUpdated($event)\" (showShieldDialog)=\"onShowShieldDialog($event)\"\n (showEscalationDialog)=\"onShowEscalationDialog($event)\" (showFormDialog)=\"\n toggleStartNodeFormPopup($event, node.x, node.y, swimlane.order, node)\n \"></svg:g>\n }\n\n <!-- Connection points for this node (rendered last = topmost) -->\n @for (point of node.connectionPoints || []; track point.id) {\n @if (isConnectionPointVisible(node.id)) {\n <use class=\"connection-point\" [attr.href]=\"'#connection-point-template'\" [attr.x]=\"point.x\" [attr.y]=\"point.y\"\n [attr.id]=\"point.id\" (mousedown)=\"startConnectionDrag($event, point, swimlane.order)\" />\n }\n }\n </g>\n <!-- A transparent hover area for improved hover detection -->\n <rect [attr.x]=\"node.x - 10\" [attr.y]=\"node.y - 10\" [attr.width]=\"node.width + 20\" [attr.height]=\"node.height + 20\"\n fill=\"transparent\" (mouseover)=\"showConnectionPoints(node.id, swimlane.order)\"\n (mouseout)=\"hideConnectionPoints(node.id)\" style=\"pointer-events: none\" />\n } }\n\n <!-- Connections -->\n @for (connection of state.connections; track connection.id) {\n <g class=\"connection-element\">\n <path [attr.d]=\"getConnectionPathForSavedConnection(connection)\" stroke=\"#D36CFF\" stroke-width=\"2\" fill=\"none\"\n marker-end=\"url(#arrowhead)\"></path>\n\n <!-- Connection Label -->\n @if (connection.sourceNodeId && connection.targetNodeId) {\n <foreignObject [attr.x]=\"getLabelPosition(connection).x\" [attr.y]=\"getLabelPosition(connection).y\" width=\"150\"\n height=\"40\" style=\"overflow: visible; pointer-events: all;\" [attr.transform]=\"'translate(-75, -10)'\">\n <wf-label-editor [label]=\"connection.label || 'New Action'\" [x]=\"0\" [y]=\"0\" [isConnection]=\"true\"\n [hasForm]=\"!!(connection.form && connection.form.trim().length > 0)\"\n (labelChange)=\"saveConnectionLabel(connection, $event)\" (openDialog)=\"onShowActionDialog(connection)\" />\n </foreignObject>\n }\n </g>\n }\n\n <!-- Connection preview line -->\n @if (state.isConnectionDragging()) {\n <g>\n <path [attr.d]=\"getConnectionPath()\" stroke=\"#D36CFF\" stroke-width=\"2\" stroke-dasharray=\"5,5\" fill=\"none\"></path>\n </g>\n }\n </svg>\n\n <div *ngIf=\"popupVisible\" [style.position]=\"'absolute'\" [style.left.px]=\"popupX\" [style.top.px]=\"popupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '99' }\" [enableMouseLeave]=\"false\"\n (dropdownOpenChange)=\"$event ? null : hideConnectionPopup()\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md\" dropdown-content>\n <h4 class=\"mb-2 font-medium\">Create Connection</h4>\n <div class=\"flex flex-col gap-2\">\n <ng-container *ngFor=\"let type of allowedNodeTypes\">\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"createNodeConnection(type)\">\n Create {{ type | titlecase }}\n </button>\n </ng-container>\n <button class=\"px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50\"\n (click)=\"hideConnectionPopup()\">\n Cancel\n </button>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showStartNodeFormPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"startNodeFormPopupX\"\n [style.top.px]=\"startNodeFormPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow Form</h4>\n <div *ngIf=\"isLoadingStartNodeForms\" class=\"text-center py-2\">\n Loading forms...\n </div>\n <div *ngIf=\"!isLoadingStartNodeForms\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div class=\"mb-3\">\n <button\n class=\"w-full px-3 py-2 bg-gray-50 border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectStartNodeForm(null)\">\n Clear form selection\n </button>\n </div>\n <div *ngFor=\"let form of startNodeFormsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n [ngClass]=\"{ 'bg-blue-50 !border-blue-500 !border-2 font-semibold': form?.Code === activeNodeForFormSelection?.stageData?.formId}\"\n (click)=\"selectStartNodeForm(form)\">\n {{ form.Name }}\n </button>\n </div>\n <div *ngIf=\"startNodeFormsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No forms available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <div *ngIf=\"showSubflowPopup\" [style.position]=\"'absolute'\" [style.left.px]=\"subflowPopupX\"\n [style.top.px]=\"subflowPopupY\">\n <verben-pop-Up [dropdownOpen]=\"true\" [customStyles]=\"{ 'z-index': '100' }\">\n <div dropdown-trigger style=\"display: none\">\n <!-- Hidden trigger element -->\n </div>\n <div class=\"p-3 bg-white border border-gray-200 rounded shadow-md w-64\" dropdown-content\n style=\"background-color: white; z-index: 1000\">\n <h4 class=\"mb-2 font-medium\">Select Workflow</h4>\n <div *ngIf=\"isLoadingWorkflows\" class=\"text-center py-2\">\n Loading workflows...\n </div>\n <div *ngIf=\"!isLoadingWorkflows\" class=\"max-h-48 overflow-y-auto\" style=\"max-height: 192px; overflow-y: auto;\">\n <div *ngFor=\"let workflow of workflowsList\" class=\"mb-1\">\n <button class=\"w-full px-3 py-2 bg-white border border-gray-200 rounded text-sm hover:bg-gray-50 text-left\"\n (click)=\"selectSubflowWorkflow(workflow)\">\n {{ workflow.Name }}\n </button>\n </div>\n <div *ngIf=\"workflowsList.length === 0\" class=\"text-center py-2 text-gray-500\">\n No workflows available\n </div>\n </div>\n </div>\n </verben-pop-Up>\n </div>\n\n <lib-conditions-popup [visible]=\"showDecisionConditionDialog\" [decisionNodeId]=\"activeDecisionNodeId\"\n [newConnectionId]=\"activeConnectionId\" [popupX]=\"decisionConditionPopupX\" [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\" (saved)=\"onDecisionConditionSaved($event)\"></lib-conditions-popup>\n\n <!-- <lib-decision-popup\n [visible]=\"showConditionsDialog\"\n [decisionNodeId]=\"activeDecisionNodeId\"\n [popupX]=\"decisionConditionPopupX\"\n [popupY]=\"decisionConditionPopupY\"\n (closed)=\"onDecisionConditionCancelled()\"\n ></lib-decision-popup> -->\n\n <lib-stage-dialog [visible]=\"showStageDialogLocal\" [stageData]=\"activeStageData || {}\"\n (closed)=\"onStageDialogClosed()\" (saved)=\"onStageDialogSaved($event)\"></lib-stage-dialog>\n\n <lib-action-dialog [visible]=\"showActionDialogLocal\" [actionData]=\"activeActionData\" (closed)=\"onActionDialogClosed()\"\n (saved)=\"onActionDialogSaved($event)\" (deleted)=\"onActionDialogDeleted($event)\"></lib-action-dialog>\n\n\n <lib-escalation-dialog [visible]=\"showEscalationDialogLocal\" [type]=\"activeEscalationType()!\"\n [stageCode]=\"activeStageCode() || ''\" [workflowCode]=\"state.workflow?.Code || ''\"\n (closed)=\"onEscalationDialogClosed()\"></lib-escalation-dialog>\n</div>\n", styles: [":host{display:flex;flex-direction:column;flex:1;min-height:0;min-width:0;width:100%}.canvas-container{flex:1;min-height:0;min-width:0;overflow:auto;background-color:#fff}.designer-canvas{display:block;min-width:100%;min-height:100%;cursor:default}.designer-canvas:focus{outline:none}.edit-swimlane-button{cursor:pointer}.edit-swimlane-button:hover rect{fill:#ddd6fe}.decision-condition-icon{cursor:pointer}.decision-condition-icon:hover path{fill:#c084fc}.swimlane-label{z-index:10;cursor:default}.plus-icon:hover{fill:#d36cff}.swimlane-container{pointer-events:none}.swimlane-container>*{pointer-events:auto}.node-element{z-index:10}.connection-element{z-index:5}.node-drag-handle{pointer-events:all;-webkit-user-select:none;user-select:none}.connection-point{cursor:crosshair}\n"] }]
|
|
4488
4498
|
}], ctorParameters: () => [{ type: WorkflowDesignerState }, { type: WorkflowDataService }], propDecorators: { selectedTool: [{
|
|
4489
4499
|
type: Input
|
|
4490
4500
|
}], clickedPosition: [{
|
|
@@ -5012,6 +5022,7 @@ class WorkflowDesignerComponent {
|
|
|
5012
5022
|
}
|
|
5013
5023
|
});
|
|
5014
5024
|
this.ensureHorizontalArrowClearance();
|
|
5025
|
+
this.canvasRef?.updateCanvasSize();
|
|
5015
5026
|
}
|
|
5016
5027
|
}
|
|
5017
5028
|
ensureHorizontalArrowClearance() {
|