ngx-histaff-alpha 5.2.2 → 5.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/fesm2022/{ngx-histaff-alpha-core-form-design.component-DkGU3mLc.mjs → ngx-histaff-alpha-core-form-design.component-DUH4SkB7.mjs} +29 -11
  2. package/fesm2022/ngx-histaff-alpha-core-form-design.component-DUH4SkB7.mjs.map +1 -0
  3. package/fesm2022/ngx-histaff-alpha-core-workflow-consume.component-5bEZHFsi.mjs +64 -0
  4. package/fesm2022/ngx-histaff-alpha-core-workflow-consume.component-5bEZHFsi.mjs.map +1 -0
  5. package/fesm2022/ngx-histaff-alpha-live-form.component-Cl8EQ7M8.mjs +36 -0
  6. package/fesm2022/ngx-histaff-alpha-live-form.component-Cl8EQ7M8.mjs.map +1 -0
  7. package/fesm2022/{ngx-histaff-alpha-ngx-histaff-alpha-DG1v69l1.mjs → ngx-histaff-alpha-ngx-histaff-alpha-B6dYCMll.mjs} +278 -94
  8. package/fesm2022/ngx-histaff-alpha-ngx-histaff-alpha-B6dYCMll.mjs.map +1 -0
  9. package/fesm2022/{ngx-histaff-alpha-wf-basic-info.component-GP8my3qI.mjs → ngx-histaff-alpha-wf-basic-info.component-BL7fXjKU.mjs} +2 -2
  10. package/fesm2022/{ngx-histaff-alpha-wf-basic-info.component-GP8my3qI.mjs.map → ngx-histaff-alpha-wf-basic-info.component-BL7fXjKU.mjs.map} +1 -1
  11. package/fesm2022/{ngx-histaff-alpha-wf-form-assign.component-BuqyHWhW.mjs → ngx-histaff-alpha-wf-form-assign.component-BzsIRon0.mjs} +2 -2
  12. package/fesm2022/{ngx-histaff-alpha-wf-form-assign.component-BuqyHWhW.mjs.map → ngx-histaff-alpha-wf-form-assign.component-BzsIRon0.mjs.map} +1 -1
  13. package/fesm2022/ngx-histaff-alpha-wf-process-design.component-CQxxRCqC.mjs +1439 -0
  14. package/fesm2022/ngx-histaff-alpha-wf-process-design.component-CQxxRCqC.mjs.map +1 -0
  15. package/fesm2022/ngx-histaff-alpha.mjs +1 -1
  16. package/lib/app/libraries/core-button-group-vns/core-button-group-vns/EnumCoreButtonVNSCode.d.ts +2 -1
  17. package/lib/app/libraries/core-form/core-form/core-form.component.d.ts +2 -1
  18. package/lib/app/libraries/core-form-control-seeker/core-form-control-seeker/core-form-control-seeker.component.d.ts +3 -2
  19. package/lib/app/libraries/core-form-design/core-form-design.component.d.ts +2 -0
  20. package/lib/app/libraries/core-form-design/core-form-design.service.d.ts +2 -0
  21. package/lib/app/libraries/core-form-design/field-setting/mandatory-props/mandatory-props.component.d.ts +2 -0
  22. package/lib/app/libraries/core-form-design/form-metadata/form-metadata.component.d.ts +3 -1
  23. package/lib/app/libraries/core-form-design/live-form/live-form.component.d.ts +18 -0
  24. package/lib/app/libraries/core-header-params/enum-and-interfaces.d.ts +1 -1
  25. package/lib/app/libraries/core-radio-group/core-radio-group/core-radio-group.component.d.ts +8 -3
  26. package/lib/app/libraries/core-rule-tree/core-rule-tree.component.d.ts +1 -1
  27. package/lib/app/libraries/core-workflow-builder/constants/INITIAL_PROCESS_DEFINITION.d.ts +2 -0
  28. package/lib/app/libraries/core-workflow-builder/core-workflow-consume/core-workflow-consume.component.d.ts +9 -0
  29. package/lib/app/libraries/core-workflow-builder/core-workflow-list/core-workflow-list.component.d.ts +6 -4
  30. package/lib/app/libraries/core-workflow-builder/core-workflow.service.d.ts +13 -2
  31. package/lib/app/libraries/core-workflow-builder/enums/EnumActorSourceType.d.ts +10 -0
  32. package/lib/app/libraries/core-workflow-builder/interfaces/IActorAssignment.d.ts +7 -0
  33. package/lib/app/libraries/core-workflow-builder/interfaces/IStepConfig.d.ts +37 -4
  34. package/lib/app/libraries/core-workflow-builder/interfaces/IWfWorkflow.d.ts +3 -0
  35. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-node/wf-node.component.d.ts +3 -1
  36. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-process-design.component.d.ts +12 -3
  37. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-step-config-shell/wf-actor-selector/wf-actor-selector.component.d.ts +40 -0
  38. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-step-config-shell/wf-approver-config/wf-approver-config.component.d.ts +5 -0
  39. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-step-config-shell/wf-cc-config/wf-cc-config.component.d.ts +5 -0
  40. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-step-config-shell/wf-end-config/wf-end-config.component.d.ts +5 -0
  41. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-step-config-shell/wf-handler-config/wf-handler-config.component.d.ts +5 -0
  42. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-step-config-shell/wf-step-config-shell.component.d.ts +4 -5
  43. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-step-config-shell/wf-submit-config/wf-submit-config.component.d.ts +5 -0
  44. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-steps-preview/wf-steps-preview.component.d.ts +8 -0
  45. package/lib/app/libraries/core-workflow-builder/wf-process-design/wf-workflow-canvas.component.d.ts +32 -3
  46. package/package.json +1 -1
  47. package/fesm2022/ngx-histaff-alpha-core-form-design.component-DkGU3mLc.mjs.map +0 -1
  48. package/fesm2022/ngx-histaff-alpha-ngx-histaff-alpha-DG1v69l1.mjs.map +0 -1
  49. package/fesm2022/ngx-histaff-alpha-wf-process-design.component-D9Ba7Fkx.mjs +0 -1068
  50. package/fesm2022/ngx-histaff-alpha-wf-process-design.component-D9Ba7Fkx.mjs.map +0 -1
@@ -1,1068 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, inject, ElementRef, ViewChild, Output, Component, Renderer2, Input, input, ChangeDetectionStrategy, output, signal, computed, effect, viewChild, ChangeDetectorRef, Injectable, Directive, ViewChildren } from '@angular/core';
3
- import { AsyncPipe, NgTemplateOutlet, LowerCasePipe } from '@angular/common';
4
- import { f as BaseComponent, w as CoreWorkflowService, z as EnumWorkflowStepType, M as MultiLanguageService, G as DomService, i as CoreDropdownComponent, p as CoreChecklistComponent, s as CoreDatePickerComponent, q as CoreFormControlSeekerComponent, v as CoreCurrencyInputComponent, j as TooltipDirective, m as TableCellPipe, T as TranslatePipe, b as EnumCoreButtonVNSCode, c as CorePageHeaderComponent } from './ngx-histaff-alpha-ngx-histaff-alpha-DG1v69l1.mjs';
5
- import * as i1 from '@angular/forms';
6
- import { ReactiveFormsModule, FormGroup, FormArray, FormControl, FormsModule } from '@angular/forms';
7
-
8
- class WfInsertMenuComponent extends BaseComponent {
9
- constructor(mls, renderer, domService) {
10
- super(mls);
11
- this.mls = mls;
12
- this.renderer = renderer;
13
- this.domService = domService;
14
- this.insert = new EventEmitter();
15
- this.coreWorkflowService = inject(CoreWorkflowService);
16
- this.elRef = inject(ElementRef);
17
- this.enumType = EnumWorkflowStepType;
18
- }
19
- onInsert(type) {
20
- this.insert.emit({
21
- type,
22
- index: this.coreWorkflowService.insertContext$.value.index,
23
- branchId: this.coreWorkflowService.insertContext$.value.branchId ?? 'root'
24
- });
25
- this.coreWorkflowService.insertContext$.next(null);
26
- }
27
- ngAfterViewInit() {
28
- setTimeout(() => {
29
- this.listenerFn = this.renderer.listen('window', 'click', (e) => {
30
- e.stopPropagation();
31
- if (this.container && !!!this.container.nativeElement.contains(e.target)) {
32
- this.coreWorkflowService.insertContext$.next(null);
33
- }
34
- });
35
- const rect = this.coreWorkflowService.insertAnchorPoint$.value;
36
- const menuEl = this.elRef.nativeElement;
37
- if (!rect)
38
- return;
39
- const menuHeight = menuEl.offsetHeight;
40
- const zIndex = this.domService.getMaxZIndex() + 1;
41
- menuEl.style.position = 'fixed';
42
- menuEl.style.left = `${rect.right + 8}px`;
43
- menuEl.style.top = `${rect.top}px`;
44
- menuEl.style.zIndex = `${zIndex}`;
45
- });
46
- }
47
- onCancelClicked() {
48
- this.coreWorkflowService.insertContext$.next(null);
49
- }
50
- ngOnDestroy() {
51
- this.subscriptions.forEach(x => x?.unsubscribe());
52
- if (this.listenerFn)
53
- this.listenerFn();
54
- }
55
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfInsertMenuComponent, deps: [{ token: MultiLanguageService }, { token: i0.Renderer2 }, { token: DomService }], target: i0.ɵɵFactoryTarget.Component }); }
56
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WfInsertMenuComponent, isStandalone: true, selector: "wf-insert-menu", outputs: { insert: "insert" }, viewQueries: [{ propertyName: "container", first: true, predicate: ["container"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"wf-insert-menu-container\" #container>\r\n\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.Approval)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83D\uDFE7</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Approver</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.CC)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83D\uDFE6</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>CC</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.Handle)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83D\uDFEA</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Handler</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.ConditionalBranch)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83C\uDF3F</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Conditional Branch</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onCancelClicked()\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\u274C</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Cancel</div>\r\n </div>\r\n </div>\r\n</div>", styles: [".wf-insert-menu-container{width:220px;display:block;position:fixed;z-index:99;background:beige;padding:8px;box-shadow:.4rem 0 2rem #0000002e}.wf-insert-menu-container .menu-item{display:flex;align-items:center;justify-content:flex-start;cursor:pointer}.wf-insert-menu-container .menu-item .menu-item-icon-wrapper{width:24px;height:24px;display:flex}.wf-insert-menu-container .menu-item .menu-item-text{display:flex;align-items:center}.wf-insert-menu-container .insert-menu div{padding:6px 12px;cursor:pointer}.wf-insert-menu-container .insert-menu div:hover{background-color:#f3f4f6}.wf-insert-menu-container .cancel{color:red}.wf-insert-menu-overlay{position:absolute;top:0;left:0;z-index:99;pointer-events:none}\n"] }); }
57
- }
58
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfInsertMenuComponent, decorators: [{
59
- type: Component,
60
- args: [{ selector: 'wf-insert-menu', imports: [], template: "<div class=\"wf-insert-menu-container\" #container>\r\n\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.Approval)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83D\uDFE7</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Approver</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.CC)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83D\uDFE6</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>CC</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.Handle)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83D\uDFEA</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Handler</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onInsert(enumType.ConditionalBranch)\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\uD83C\uDF3F</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Conditional Branch</div>\r\n </div>\r\n </div>\r\n <div class=\"menu-item\" (click)=\"onCancelClicked()\">\r\n <div class=\"menu-item-icon-wrapper\">\r\n <div class=\"menu-item-icon\">\u274C</div>\r\n </div>\r\n <div class=\"menu-item-text\">\r\n <div>Cancel</div>\r\n </div>\r\n </div>\r\n</div>", styles: [".wf-insert-menu-container{width:220px;display:block;position:fixed;z-index:99;background:beige;padding:8px;box-shadow:.4rem 0 2rem #0000002e}.wf-insert-menu-container .menu-item{display:flex;align-items:center;justify-content:flex-start;cursor:pointer}.wf-insert-menu-container .menu-item .menu-item-icon-wrapper{width:24px;height:24px;display:flex}.wf-insert-menu-container .menu-item .menu-item-text{display:flex;align-items:center}.wf-insert-menu-container .insert-menu div{padding:6px 12px;cursor:pointer}.wf-insert-menu-container .insert-menu div:hover{background-color:#f3f4f6}.wf-insert-menu-container .cancel{color:red}.wf-insert-menu-overlay{position:absolute;top:0;left:0;z-index:99;pointer-events:none}\n"] }]
61
- }], ctorParameters: () => [{ type: MultiLanguageService }, { type: i0.Renderer2 }, { type: DomService }], propDecorators: { insert: [{
62
- type: Output
63
- }], container: [{
64
- type: ViewChild,
65
- args: ['container']
66
- }] } });
67
-
68
- class WfBottomVInsertComponent extends BaseComponent {
69
- constructor() {
70
- super(...arguments);
71
- this.insertStep = new EventEmitter();
72
- this.shouldShowInsert = false;
73
- this.coreWorkflowService = inject(CoreWorkflowService);
74
- this.el = inject(ElementRef);
75
- this.renderer = inject(Renderer2);
76
- this.observer = null;
77
- }
78
- ngOnInit() {
79
- this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
80
- this.subscriptions.push(this.coreWorkflowService.insertContext$
81
- .subscribe(ctx => {
82
- this.shouldShowInsert = !!ctx &&
83
- ctx.branchId === this.currentContext.branchId &&
84
- ctx.index === this.currentContext.index;
85
- }));
86
- }
87
- onShowInsert(e) {
88
- const insertContext = {
89
- branchId: this.currentContext.branchId,
90
- index: this.currentContext.index
91
- };
92
- const triggerEl = e.currentTarget;
93
- const rect = triggerEl.getBoundingClientRect();
94
- this.coreWorkflowService.insertContext$.next(insertContext);
95
- this.coreWorkflowService.insertAnchorPoint$.next(rect);
96
- }
97
- ngAfterViewInit() {
98
- setTimeout(() => {
99
- });
100
- }
101
- ngOnDestroy() {
102
- this.subscriptions.forEach(x => x?.unsubscribe());
103
- this.observer?.disconnect();
104
- }
105
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfBottomVInsertComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
106
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: WfBottomVInsertComponent, isStandalone: true, selector: "wf-bottom-v-insert", inputs: { currentContext: "currentContext", currentStep: "currentStep" }, outputs: { insertStep: "insertStep" }, viewQueries: [{ propertyName: "plusContainer", first: true, predicate: ["plusContainer"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"wf-bottom-v-insert-container\" \r\n [class.shorter]=\"(!!currentStep.isPseudo && !!currentStep.isInFallbackBranch!) || !!currentStep.config\"\r\n [class.insert-context]=\"(coreWorkflowService.insertContext$ | async)?.branchId === currentContext.branchId && (coreWorkflowService.insertContext$ | async)?.index === currentContext.index\"\r\n>\r\n <div class=\"vertical-line\"></div>\r\n\r\n <div class=\"plus-container\" #plusContainer>\r\n <button class=\"plus-btn\" (click)=\"onShowInsert($event)\">\uFF0B</button>\r\n </div>\r\n\r\n <div class=\"arrow-down-container\">\r\n <div class=\"arrow-down\"></div>\r\n </div>\r\n\r\n</div>", styles: [".wf-workflow-canvas-container{--standard-connector-height: 90px;padding-top:50px;padding-bottom:50px;background-color:#f2f3f5}.wf-workflow-canvas-container .canvas{display:flex;flex-direction:column;align-items:center}.wf-workflow-canvas-container .step{text-align:center;position:relative}.workflow-box{width:220px;min-height:85px;max-height:100px;padding:0 4px 4px;box-shadow:0 0 4px #0000000d}.workflow-box.submit,.workflow-box.end{background-color:#a9b4cd}.workflow-box.approval{background-color:#f80}.workflow-box.cc{background-color:#3370ff}.workflow-box.handle{background-color:#935af6}.connector{font-size:24px;color:#888}.plus-btn{font-size:18px;background:#fff;border:1px solid #ccc;border-radius:9999px;width:28px;height:28px;cursor:pointer}.insert-menu{background:#fff;border:1px solid #ddd;border-radius:6px;padding:8px;margin-top:6px;box-shadow:0 2px 8px #0000001a;display:flex;flex-direction:column;gap:6px;z-index:10}.insert-menu div{cursor:pointer;font-size:14px;padding:2px 6px}.insert-menu .cancel{color:red}.branch-column{position:relative}.branch-column .branch-column-inner{width:100%;display:flex;flex-direction:column;align-items:center}.wf-branch-group-container,.wf-branch-group-container .branch-group{position:relative}.wf-branch-group-container .branch-group .branch-column{display:table-cell;min-width:220px;vertical-align:top;padding:0 12px}.wf-branch-group-container .branch-group .branch-column .vertical-bridge-line{position:absolute;width:2px;background-color:#d9d9d9;z-index:2;pointer-events:none}.wf-branch-group-container .branch-group .horizontal-bridge-line{position:absolute;height:2px;background-color:#d9d9d9;pointer-events:none;z-index:1}.wf-branch-group-container:after{content:\"\";display:block;position:absolute;height:2px;width:calc(100% - 244px);left:122px;bottom:102px}.branch-title{font-weight:700;font-size:14px;margin-bottom:8px}.branch-group-header{display:flex;justify-content:center;margin:12px 0}.add-branch-btn{position:absolute;top:0;width:175px;left:calc(50% - 87.5px);z-index:2;background:#fff;color:#0f172a;border:1px solid #ccc;padding:4px 12px;border-radius:9999px;font-weight:500;cursor:pointer;box-shadow:0 2px 4px #0000000f;text-wrap:nowrap}.workflow-box.submit{background-color:#e0f7fa;border-left:4px solid #00bcd4}.workflow-box.end{background-color:#ede7f6;border-left:4px solid #673ab7}.box.special{font-style:italic;opacity:.9}.bottom-v-container{min-height:65px;width:220px}.wf-bottom-v-insert-container{position:relative;display:flex;flex-direction:column;align-items:center;height:var(--standard-connector-height);width:100%;margin:0}.wf-bottom-v-insert-container .vertical-line{position:absolute;top:0;height:100%;width:2px;background-color:#d9d9d9;z-index:0}.wf-bottom-v-insert-container .plus-container{display:block;position:absolute;border-radius:50%;top:calc(var(--standard-connector-height) / 2 - 16px)}.wf-bottom-v-insert-container .plus-btn{width:32px;height:32px;border-radius:50%;border:none;background:#fff;color:#3b82f6;font-size:20px;box-shadow:.4rem 0 2rem #0000002e;cursor:pointer;display:flex;align-items:center;justify-content:center}.wf-bottom-v-insert-container .plus-btn:hover{background:#f0f8ff;box-shadow:0 0 0 4px #3b82f633}.wf-bottom-v-insert-container.shorter{height:calc(var(--standard-connector-height) - 15px)}.wf-bottom-v-insert-container.shorter .plus-container{display:block;position:absolute;top:calc((var(--standard-connector-height) - 18px) / 2 - 16px)}.wf-bottom-v-insert-container.insert-context .plus-container{outline:#2eb795 solid 2px}.add-branch-inline{position:relative;height:35px;margin-bottom:calc(var(--standard-connector-height) - 17.5px)}.arrow-down-container{display:block;position:absolute;z-index:1;bottom:0}.arrow-down-container .arrow-down{margin-top:5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid #d9d9d9}.branch-card-wrapper{position:relative}.branch-card-wrapper .arrow-down-container{top:-12px;left:calc(50% - 5px)}.wf-step-container .step-header{position:relative;display:flex;align-items:center;justify-content:space-between;height:43px;font-size:12px;border-bottom:1px solid #f6f6f7}.wf-step-container .step-header .input-wrapper{padding-top:4px}.wf-step-container .step-header .step-name-wrapper{display:flex;align-items:center;justify-content:flex-start;padding-right:8px}.wf-step-container .step-header .step-name-wrapper .step-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:140px;padding-left:4px}.wf-step-container .step-header .step-name-wrapper i{margin-left:2px}.wf-step-container .step-header .step-delete{color:gray;display:none}.wf-step-container .step-header .step-delete i{font-size:24px}.wf-step-container .step-header:hover .step-name-wrapper:after{content:\"\\e95a\";font-family:feather}.wf-step-container .step-header:hover .branch-priority{display:none}.wf-step-container .step-header:hover .step-delete,.wf-step-container .step-header.edit-mode{display:block}.wf-step-container .step-set-config{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;padding:7px 4px;font-size:14px;background-color:#fff;color:gray}.wf-step-container .step-set-config .step-subtext{width:100%;text-align:left}.wf-step-container .step-set-config .step-subtext.configurated{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container{background-color:#fff}.wf-step-container.wf-branch-card-container .branch-header{color:#2eb795;border-bottom:1px solid #f6f6f7}.wf-step-container.wf-branch-card-container .branch-header:before{content:\"\";display:block;position:absolute;height:var(--standard-connector-height);width:2px;background-color:#d9d9d9;left:50%;top:calc(var(--standard-connector-height) * -1)}.wf-step-container.wf-branch-card-container .branch-set-condition{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;color:#3e4759;padding:7px 4px;font-size:14px}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext{width:100%;text-align:left}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext.fallback{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header,.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-set-condition{color:gray}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header .branch-priority{padding-right:4px}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-priority{display:block}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-delete{display:none}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-name-wrapper:after{content:\"\"}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }] }); }
107
- }
108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfBottomVInsertComponent, decorators: [{
109
- type: Component,
110
- args: [{ selector: 'wf-bottom-v-insert', imports: [
111
- AsyncPipe,
112
- WfInsertMenuComponent
113
- ], template: "<div class=\"wf-bottom-v-insert-container\" \r\n [class.shorter]=\"(!!currentStep.isPseudo && !!currentStep.isInFallbackBranch!) || !!currentStep.config\"\r\n [class.insert-context]=\"(coreWorkflowService.insertContext$ | async)?.branchId === currentContext.branchId && (coreWorkflowService.insertContext$ | async)?.index === currentContext.index\"\r\n>\r\n <div class=\"vertical-line\"></div>\r\n\r\n <div class=\"plus-container\" #plusContainer>\r\n <button class=\"plus-btn\" (click)=\"onShowInsert($event)\">\uFF0B</button>\r\n </div>\r\n\r\n <div class=\"arrow-down-container\">\r\n <div class=\"arrow-down\"></div>\r\n </div>\r\n\r\n</div>", styles: [".wf-workflow-canvas-container{--standard-connector-height: 90px;padding-top:50px;padding-bottom:50px;background-color:#f2f3f5}.wf-workflow-canvas-container .canvas{display:flex;flex-direction:column;align-items:center}.wf-workflow-canvas-container .step{text-align:center;position:relative}.workflow-box{width:220px;min-height:85px;max-height:100px;padding:0 4px 4px;box-shadow:0 0 4px #0000000d}.workflow-box.submit,.workflow-box.end{background-color:#a9b4cd}.workflow-box.approval{background-color:#f80}.workflow-box.cc{background-color:#3370ff}.workflow-box.handle{background-color:#935af6}.connector{font-size:24px;color:#888}.plus-btn{font-size:18px;background:#fff;border:1px solid #ccc;border-radius:9999px;width:28px;height:28px;cursor:pointer}.insert-menu{background:#fff;border:1px solid #ddd;border-radius:6px;padding:8px;margin-top:6px;box-shadow:0 2px 8px #0000001a;display:flex;flex-direction:column;gap:6px;z-index:10}.insert-menu div{cursor:pointer;font-size:14px;padding:2px 6px}.insert-menu .cancel{color:red}.branch-column{position:relative}.branch-column .branch-column-inner{width:100%;display:flex;flex-direction:column;align-items:center}.wf-branch-group-container,.wf-branch-group-container .branch-group{position:relative}.wf-branch-group-container .branch-group .branch-column{display:table-cell;min-width:220px;vertical-align:top;padding:0 12px}.wf-branch-group-container .branch-group .branch-column .vertical-bridge-line{position:absolute;width:2px;background-color:#d9d9d9;z-index:2;pointer-events:none}.wf-branch-group-container .branch-group .horizontal-bridge-line{position:absolute;height:2px;background-color:#d9d9d9;pointer-events:none;z-index:1}.wf-branch-group-container:after{content:\"\";display:block;position:absolute;height:2px;width:calc(100% - 244px);left:122px;bottom:102px}.branch-title{font-weight:700;font-size:14px;margin-bottom:8px}.branch-group-header{display:flex;justify-content:center;margin:12px 0}.add-branch-btn{position:absolute;top:0;width:175px;left:calc(50% - 87.5px);z-index:2;background:#fff;color:#0f172a;border:1px solid #ccc;padding:4px 12px;border-radius:9999px;font-weight:500;cursor:pointer;box-shadow:0 2px 4px #0000000f;text-wrap:nowrap}.workflow-box.submit{background-color:#e0f7fa;border-left:4px solid #00bcd4}.workflow-box.end{background-color:#ede7f6;border-left:4px solid #673ab7}.box.special{font-style:italic;opacity:.9}.bottom-v-container{min-height:65px;width:220px}.wf-bottom-v-insert-container{position:relative;display:flex;flex-direction:column;align-items:center;height:var(--standard-connector-height);width:100%;margin:0}.wf-bottom-v-insert-container .vertical-line{position:absolute;top:0;height:100%;width:2px;background-color:#d9d9d9;z-index:0}.wf-bottom-v-insert-container .plus-container{display:block;position:absolute;border-radius:50%;top:calc(var(--standard-connector-height) / 2 - 16px)}.wf-bottom-v-insert-container .plus-btn{width:32px;height:32px;border-radius:50%;border:none;background:#fff;color:#3b82f6;font-size:20px;box-shadow:.4rem 0 2rem #0000002e;cursor:pointer;display:flex;align-items:center;justify-content:center}.wf-bottom-v-insert-container .plus-btn:hover{background:#f0f8ff;box-shadow:0 0 0 4px #3b82f633}.wf-bottom-v-insert-container.shorter{height:calc(var(--standard-connector-height) - 15px)}.wf-bottom-v-insert-container.shorter .plus-container{display:block;position:absolute;top:calc((var(--standard-connector-height) - 18px) / 2 - 16px)}.wf-bottom-v-insert-container.insert-context .plus-container{outline:#2eb795 solid 2px}.add-branch-inline{position:relative;height:35px;margin-bottom:calc(var(--standard-connector-height) - 17.5px)}.arrow-down-container{display:block;position:absolute;z-index:1;bottom:0}.arrow-down-container .arrow-down{margin-top:5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid #d9d9d9}.branch-card-wrapper{position:relative}.branch-card-wrapper .arrow-down-container{top:-12px;left:calc(50% - 5px)}.wf-step-container .step-header{position:relative;display:flex;align-items:center;justify-content:space-between;height:43px;font-size:12px;border-bottom:1px solid #f6f6f7}.wf-step-container .step-header .input-wrapper{padding-top:4px}.wf-step-container .step-header .step-name-wrapper{display:flex;align-items:center;justify-content:flex-start;padding-right:8px}.wf-step-container .step-header .step-name-wrapper .step-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:140px;padding-left:4px}.wf-step-container .step-header .step-name-wrapper i{margin-left:2px}.wf-step-container .step-header .step-delete{color:gray;display:none}.wf-step-container .step-header .step-delete i{font-size:24px}.wf-step-container .step-header:hover .step-name-wrapper:after{content:\"\\e95a\";font-family:feather}.wf-step-container .step-header:hover .branch-priority{display:none}.wf-step-container .step-header:hover .step-delete,.wf-step-container .step-header.edit-mode{display:block}.wf-step-container .step-set-config{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;padding:7px 4px;font-size:14px;background-color:#fff;color:gray}.wf-step-container .step-set-config .step-subtext{width:100%;text-align:left}.wf-step-container .step-set-config .step-subtext.configurated{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container{background-color:#fff}.wf-step-container.wf-branch-card-container .branch-header{color:#2eb795;border-bottom:1px solid #f6f6f7}.wf-step-container.wf-branch-card-container .branch-header:before{content:\"\";display:block;position:absolute;height:var(--standard-connector-height);width:2px;background-color:#d9d9d9;left:50%;top:calc(var(--standard-connector-height) * -1)}.wf-step-container.wf-branch-card-container .branch-set-condition{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;color:#3e4759;padding:7px 4px;font-size:14px}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext{width:100%;text-align:left}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext.fallback{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header,.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-set-condition{color:gray}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header .branch-priority{padding-right:4px}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-priority{display:block}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-delete{display:none}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-name-wrapper:after{content:\"\"}\n"] }]
114
- }], propDecorators: { currentContext: [{
115
- type: Input,
116
- args: [{ required: true }]
117
- }], currentStep: [{
118
- type: Input,
119
- args: [{ required: true }]
120
- }], insertStep: [{
121
- type: Output
122
- }], plusContainer: [{
123
- type: ViewChild,
124
- args: ['plusContainer']
125
- }] } });
126
-
127
- class CoreControlValueOnlyComponent {
128
- constructor() {
129
- this.$control = input.required();
130
- this.$form = input.required();
131
- this.$fieldName = input();
132
- }
133
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreControlValueOnlyComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
134
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: CoreControlValueOnlyComponent, isStandalone: true, selector: "core-control-value-only", inputs: { $control: { classPropertyName: "$control", publicName: "$control", isSignal: true, isRequired: true, transformFunction: null }, $form: { classPropertyName: "$form", publicName: "$form", isSignal: true, isRequired: true, transformFunction: null }, $fieldName: { classPropertyName: "$fieldName", publicName: "$fieldName", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [formGroup]=\"$form()\">\r\n @switch ($control().controlType) {\r\n @case ('TEXTBOX') {\r\n <input class=\"form-control\" [formControlName]=\"$fieldName() || $control().field\" [type]=\"$control().type || 'text'\"\r\n [placeholder]=\"$control().placeholder || ''\" [readonly]=\"$control().readonly\" />\r\n }\r\n @case ('CURRENCY') {\r\n <core-currency-input [formControlName]=\"$fieldName() || $control().field\"\r\n [placeholder]=\"$control().placeholder || ''\">\r\n </core-currency-input>\r\n }\r\n @case ('DROPDOWN') {\r\n @if ($control().dropdownOptions$) {\r\n <core-dropdown [formControlName]=\"$fieldName() || $control().field\" [options$]=\"$control().dropdownOptions$!\">\r\n </core-dropdown>\r\n }\r\n }\r\n @case ('CHECKLIST') {\r\n @if ($control().checklistOptions$) {\r\n <core-checklist [formControlName]=\"$fieldName() || $control().field\" [options$]=\"$control().checklistOptions$!\">\r\n </core-checklist>\r\n }\r\n }\r\n @case ('DATEPICKER') {\r\n <core-date-picker [formControlName]=\"$fieldName() || $control().field\" [rangeLimit]=\"$control().rangeLimit!\"\r\n [popupAlign]=\"$control().popupAlign!\" [placeholder]=\"$control().placeholder || ''\"\r\n [readonly]=\"$control().readonly!\">\r\n </core-date-picker>\r\n }\r\n @case ('SEEKER') {\r\n <core-form-control-seeker [formControlName]=\"$fieldName() || $control().field\"\r\n [seekerSourceType]=\"$control().seekerSourceType!\" [shownFrom]=\"$control().shownFrom!\"\r\n [boundFrom]=\"$control().boundFrom!\" [objectList$]=\"$control().objectList$!\">\r\n </core-form-control-seeker>\r\n }\r\n @default {\r\n <input class=\"form-control\" [formControlName]=\"$fieldName() || $control().field\" type=\"text\"\r\n [placeholder]=\"$control().placeholder || ''\" [readonly]=\"$control().readonly\" />\r\n }\r\n }\r\n</div>", styles: [":host{display:block}input.form-control,core-dropdown,core-checklist,core-date-picker,core-currency-input,core-form-control-seeker{width:100%}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: CoreDropdownComponent, selector: "core-dropdown", inputs: ["getByIdObject$", "paramMode", "shownFrom", "options$", "height", "placeholder", "loading", "warningDisable", "clearDisable", "fitHeightWithItemCount", "itemHeight"] }, { kind: "component", type: CoreChecklistComponent, selector: "core-checklist", inputs: ["paramMode", "getByIdObject$", "shownFrom", "options$", "height", "placeholder", "loading", "readonly", "disabled"] }, { kind: "component", type: CoreDatePickerComponent, selector: "core-date-picker", inputs: ["enableTimeZoneConverter", "showPlaceholder", "popupWidth", "popupXPadding", "popupAlign", "rangeLimit", "placeholder", "readonly", "disabled"] }, { kind: "component", type: CoreFormControlSeekerComponent, selector: "core-form-control-seeker", inputs: ["title", "showPageHeader", "preDefinedOuterParam$", "preDefinedOuterFilter$", "click$", "getByIdObject$", "getByIdApi", "paramMode", "multiMode", "objectList$", "useTheseColumns", "hideOrgTree", "excludedColumns", "excludeExistingList", "placeholder", "sourceSpaceHeight", "indirectBinding", "bindGridIdTo", "multiModeExtendedColumns", "multiModeExtendedSections", "editBufferData$", "multiModeTableHeight", "multiModeRowHeight", "seekerSourceType", "boundFrom", "shownFrom", "alsoBindTo", "seekerVerifyIgnore"], outputs: ["onDoubleClick"] }, { kind: "component", type: CoreCurrencyInputComponent, selector: "core-currency-input", inputs: ["currencySign", "placeholder"], outputs: ["onLeftFocus"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
135
- }
136
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreControlValueOnlyComponent, decorators: [{
137
- type: Component,
138
- args: [{ selector: 'core-control-value-only', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
139
- ReactiveFormsModule,
140
- CoreDropdownComponent,
141
- CoreChecklistComponent,
142
- CoreDatePickerComponent,
143
- CoreFormControlSeekerComponent,
144
- CoreCurrencyInputComponent
145
- ], template: "<div [formGroup]=\"$form()\">\r\n @switch ($control().controlType) {\r\n @case ('TEXTBOX') {\r\n <input class=\"form-control\" [formControlName]=\"$fieldName() || $control().field\" [type]=\"$control().type || 'text'\"\r\n [placeholder]=\"$control().placeholder || ''\" [readonly]=\"$control().readonly\" />\r\n }\r\n @case ('CURRENCY') {\r\n <core-currency-input [formControlName]=\"$fieldName() || $control().field\"\r\n [placeholder]=\"$control().placeholder || ''\">\r\n </core-currency-input>\r\n }\r\n @case ('DROPDOWN') {\r\n @if ($control().dropdownOptions$) {\r\n <core-dropdown [formControlName]=\"$fieldName() || $control().field\" [options$]=\"$control().dropdownOptions$!\">\r\n </core-dropdown>\r\n }\r\n }\r\n @case ('CHECKLIST') {\r\n @if ($control().checklistOptions$) {\r\n <core-checklist [formControlName]=\"$fieldName() || $control().field\" [options$]=\"$control().checklistOptions$!\">\r\n </core-checklist>\r\n }\r\n }\r\n @case ('DATEPICKER') {\r\n <core-date-picker [formControlName]=\"$fieldName() || $control().field\" [rangeLimit]=\"$control().rangeLimit!\"\r\n [popupAlign]=\"$control().popupAlign!\" [placeholder]=\"$control().placeholder || ''\"\r\n [readonly]=\"$control().readonly!\">\r\n </core-date-picker>\r\n }\r\n @case ('SEEKER') {\r\n <core-form-control-seeker [formControlName]=\"$fieldName() || $control().field\"\r\n [seekerSourceType]=\"$control().seekerSourceType!\" [shownFrom]=\"$control().shownFrom!\"\r\n [boundFrom]=\"$control().boundFrom!\" [objectList$]=\"$control().objectList$!\">\r\n </core-form-control-seeker>\r\n }\r\n @default {\r\n <input class=\"form-control\" [formControlName]=\"$fieldName() || $control().field\" type=\"text\"\r\n [placeholder]=\"$control().placeholder || ''\" [readonly]=\"$control().readonly\" />\r\n }\r\n }\r\n</div>", styles: [":host{display:block}input.form-control,core-dropdown,core-checklist,core-date-picker,core-currency-input,core-form-control-seeker{width:100%}\n"] }]
146
- }] });
147
-
148
- var EnumCoreRuleTreeOparator;
149
- (function (EnumCoreRuleTreeOparator) {
150
- EnumCoreRuleTreeOparator["EQUAL"] = "EQUAL";
151
- EnumCoreRuleTreeOparator["GREATER_THAN"] = "GREATER_THAN";
152
- EnumCoreRuleTreeOparator["LESS_THAN"] = "LESS_THAN";
153
- EnumCoreRuleTreeOparator["GREATER_OR_EQUAL_THAN"] = "GREATER_OR_EQUAL_THAN";
154
- EnumCoreRuleTreeOparator["LESS_OR_EQUAL_THAN"] = "LESS_OR_EQUAL_THAN";
155
- EnumCoreRuleTreeOparator["STARTS_WITH"] = "STARTS_WITH";
156
- EnumCoreRuleTreeOparator["ENDS_WITH"] = "ENDS_WITH";
157
- EnumCoreRuleTreeOparator["CONTAINS"] = "CONTAINS";
158
- EnumCoreRuleTreeOparator["IN"] = "IN";
159
- EnumCoreRuleTreeOparator["NOT_EQUAL"] = "NOT_EQUAL";
160
- EnumCoreRuleTreeOparator["NOT_STARTS_WITH"] = "NOT_STARTS_WITH";
161
- EnumCoreRuleTreeOparator["NOT_ENDS_WITH"] = "NOT_ENDS_WITH";
162
- EnumCoreRuleTreeOparator["NOT_CONTAINS"] = "NOT_CONTAINS";
163
- EnumCoreRuleTreeOparator["NOT_IN"] = "NOT_IN";
164
- })(EnumCoreRuleTreeOparator || (EnumCoreRuleTreeOparator = {}));
165
- class CoreRuleTreeComponent extends BaseComponent {
166
- toggleCollapse(group) {
167
- const current = this.collapsedGroups.get(group) || false;
168
- this.collapsedGroups.set(group, !current);
169
- }
170
- isCollapsed(group) {
171
- return this.collapsedGroups.get(group) || false;
172
- }
173
- field() {
174
- return new FormGroup({
175
- name: new FormControl(null),
176
- type: new FormControl(null),
177
- value: new FormControl(null),
178
- relationalOperator: new FormControl('EQUAL'),
179
- filters: new FormArray([])
180
- });
181
- }
182
- filter() {
183
- return new FormGroup({
184
- logicalOperator: new FormControl('AND'),
185
- filters: new FormArray([])
186
- });
187
- }
188
- constructor(mls, cdr) {
189
- super(mls);
190
- this.mls = mls;
191
- this.cdr = cdr;
192
- // Inputs
193
- this.$totalCols = input([]);
194
- this.$mainForm = input(new FormGroup({
195
- logicalOperator: new FormControl('AND'),
196
- filters: new FormArray([
197
- this.trueLeaf()
198
- ])
199
- }));
200
- this.$filterStringInput = input();
201
- this.$expressionInput = input();
202
- // Outputs
203
- this.$jsonEmitter = output();
204
- this.$expressionEmitter = output();
205
- // Internal signals
206
- this.$filterString = signal('()');
207
- this.$filterFormJsonString = signal('{}');
208
- this.$formValue = signal(null); // Manual form value signal
209
- this.$rawValue = computed(() => JSON.stringify(this.$mainForm().getRawValue(), null, 2));
210
- // Track collapsed groups manually
211
- this.collapsedGroups = new WeakMap();
212
- this.operatorFriendlyMap = {
213
- [EnumCoreRuleTreeOparator.EQUAL]: 'Equals (=)',
214
- [EnumCoreRuleTreeOparator.NOT_EQUAL]: 'Does not equal (≠)',
215
- [EnumCoreRuleTreeOparator.STARTS_WITH]: 'Starts with (→)',
216
- [EnumCoreRuleTreeOparator.ENDS_WITH]: 'Ends with (←)',
217
- [EnumCoreRuleTreeOparator.CONTAINS]: 'Contains (∈)',
218
- [EnumCoreRuleTreeOparator.NOT_STARTS_WITH]: 'Does NOT start with (↛)',
219
- [EnumCoreRuleTreeOparator.NOT_ENDS_WITH]: 'Does NOT end with (↚)',
220
- [EnumCoreRuleTreeOparator.NOT_CONTAINS]: 'Does NOT contain (∉)',
221
- [EnumCoreRuleTreeOparator.GREATER_THAN]: 'Greater than (>)',
222
- [EnumCoreRuleTreeOparator.LESS_THAN]: 'Less than (<)',
223
- [EnumCoreRuleTreeOparator.GREATER_OR_EQUAL_THAN]: 'Greater or equal (≥)',
224
- [EnumCoreRuleTreeOparator.LESS_OR_EQUAL_THAN]: 'Less or equal (≤)',
225
- [EnumCoreRuleTreeOparator.IN]: 'In list (∈)',
226
- [EnumCoreRuleTreeOparator.NOT_IN]: 'Not in list (∉)',
227
- };
228
- this.relationalOperator = Object.values(EnumCoreRuleTreeOparator);
229
- effect((onCleanup) => {
230
- const form = this.$mainForm();
231
- if (!!form) {
232
- const sub = form.valueChanges.subscribe(value => {
233
- this.$formValue.set(value);
234
- //this.cdr.markForCheck();
235
- });
236
- onCleanup(() => sub.unsubscribe()); // Unsubscribe if form changes
237
- }
238
- });
239
- // ➡️ Separate reaction effect for serialization
240
- effect(() => {
241
- const formValue = this.$formValue();
242
- if (!formValue)
243
- return;
244
- const cleaned = this.cleanEmptyFilters(formValue); // 👈 apply cleaning here
245
- const expr = this.getFilterString(cleaned);
246
- const json = JSON.stringify(cleaned, null, 2);
247
- this.$filterString.set(expr);
248
- this.$filterFormJsonString.set(json.trim());
249
- this.$expressionEmitter.emit(expr);
250
- this.$jsonEmitter.emit(json);
251
- });
252
- // Reaction effect: whenever form value changes
253
- /*
254
- effect(() => {
255
- const formValue = this.$formValue();
256
-
257
- if (!formValue) return;
258
-
259
- const expr = this.getFilterString(formValue);
260
- const json = JSON.stringify(this.$mainForm().getRawValue(), null, 2);
261
-
262
- this.$filterString.set(expr);
263
- this.$filterFormJsonString.set(json.trim());
264
-
265
- this.$expressionEmitter.emit(expr);
266
- this.$jsonEmitter.emit(json);
267
- });
268
- */
269
- // Initialize immediately based on initial form
270
- this.$formValue.set(this.$mainForm().getRawValue());
271
- }
272
- cleanEmptyFilters(node) {
273
- if (!node || typeof node !== 'object')
274
- return node;
275
- // If it's a group with filters
276
- if (Array.isArray(node.filters)) {
277
- node.filters = node.filters
278
- .map(f => this.cleanEmptyFilters(f))
279
- .filter(f => f !== null); // optional: skip nulls
280
- if (node.filters.length === 0) {
281
- delete node.filters; // ← Clean!
282
- }
283
- }
284
- return node;
285
- }
286
- getFilterString(filter) {
287
- if (!filter || Object.keys(filter).length === 0)
288
- return '()';
289
- if (filter.filters?.length === 1 && filter.filters[0]?.name === 'TRUE') {
290
- return '(TRUE)';
291
- }
292
- // Special handling if only TRUE exists
293
- if (filter.filters?.length === 1 && filter.filters[0].name === 'TRUE') {
294
- return '(TRUE)';
295
- }
296
- let str = '(';
297
- for (let i = 0; i < filter.filters?.length; i++) {
298
- if (i > 0)
299
- str += ` ${filter.logicalOperator} `;
300
- if (filter.filters[i]?.filters?.length) {
301
- str += this.getFilterString(filter.filters[i]);
302
- }
303
- else {
304
- str += `${filter.filters[i].name} ${filter.filters[i].relationalOperator} ${filter.filters[i].value}`;
305
- }
306
- }
307
- return str + ')';
308
- }
309
- addGroup(groupForm) {
310
- const filtersArray = groupForm.get('filters');
311
- if (filtersArray) {
312
- const newGroup = this.filter(); // 🛠 use your existing filter() factory method
313
- filtersArray.push(newGroup);
314
- }
315
- }
316
- removeGroup(groupForm, index) {
317
- const filtersArray = groupForm.get('filters');
318
- if (filtersArray && filtersArray.length > index) {
319
- setTimeout(() => filtersArray.removeAt(index));
320
- }
321
- }
322
- addCondition(groupForm) {
323
- const filtersArray = groupForm.get('filters');
324
- if (filtersArray) {
325
- // Check if currently only TRUE node
326
- if (filtersArray.length === 1 && filtersArray.at(0).value.name === 'TRUE') {
327
- filtersArray.clear();
328
- }
329
- const newCondition = this.field();
330
- filtersArray.push(newCondition);
331
- }
332
- }
333
- removeCondition(filterGroup, index) {
334
- const filtersArray = filterGroup.get('filters');
335
- if (filtersArray && filtersArray.length > index) {
336
- setTimeout(() => filtersArray.removeAt(index));
337
- }
338
- }
339
- resolveControl(fieldName) {
340
- const cols = this.$totalCols();
341
- if (!cols || !fieldName)
342
- return undefined;
343
- const tryfind = cols.find(x => x.field === fieldName);
344
- if (!!tryfind) {
345
- // switch (tryfind.controlType) {
346
- // case EnumFormBaseContolType.DATEPICKER:
347
- // tryfind.rangeLimit = {
348
- // minDate: new Date(1900, 0, 1),
349
- // maxDate: new Date(9999, 11, 31),
350
- // }
351
- // break;
352
- // }
353
- }
354
- return tryfind;
355
- }
356
- trueLeaf() {
357
- return new FormGroup({
358
- name: new FormControl('TRUE'),
359
- // type: new FormControl(null),
360
- // value: new FormControl(null),
361
- // relationalOperator: new FormControl('EQUAL'),
362
- // filters: new FormArray([])
363
- });
364
- }
365
- safeStringify(obj) {
366
- const seen = new WeakSet();
367
- return JSON.stringify(obj, (key, value) => {
368
- if (typeof value === 'object' && value !== null) {
369
- if (seen.has(value)) {
370
- return undefined; // ✋ Skip circular reference
371
- }
372
- seen.add(value);
373
- }
374
- return value;
375
- });
376
- }
377
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreRuleTreeComponent, deps: [{ token: MultiLanguageService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
378
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: CoreRuleTreeComponent, isStandalone: true, selector: "core-rule-tree", inputs: { $totalCols: { classPropertyName: "$totalCols", publicName: "$totalCols", isSignal: true, isRequired: false, transformFunction: null }, $mainForm: { classPropertyName: "$mainForm", publicName: "$mainForm", isSignal: true, isRequired: false, transformFunction: null }, $filterStringInput: { classPropertyName: "$filterStringInput", publicName: "$filterStringInput", isSignal: true, isRequired: false, transformFunction: null }, $expressionInput: { classPropertyName: "$expressionInput", publicName: "$expressionInput", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { $jsonEmitter: "$jsonEmitter", $expressionEmitter: "$expressionEmitter" }, usesInheritance: true, ngImport: i0, template: "<div class=\"core-rule-tree-container\">\r\n\r\n <form [formGroup]=\"$mainForm()\" (ngSubmit)=\"null\" class=\"core-rule-tree-form\">\r\n\r\n <!-- Top Controls -->\r\n <div class=\"top-bar\">\r\n <div class=\"expression-box\">\r\n Expression = {{ $filterString() || '()' }}\r\n </div>\r\n \r\n <!-- <div class=\"button-group\">\r\n <button type=\"button\" class=\"btn btn-success btn-sm feather-file-plus\"\r\n (click)=\"addCondition($mainForm())\"\r\n [appTooltip]=\"'Add Condition'\">\r\n </button>\r\n <button type=\"button\" class=\"btn btn-success btn-sm feather-folder-plus\"\r\n (click)=\"addGroup($mainForm())\"\r\n [appTooltip]=\"'Add Group'\">\r\n </button>\r\n </div> -->\r\n </div>\r\n \r\n <!-- Query Builder -->\r\n <div class=\"query-builder\">\r\n <ng-template #queryTemplate let-filter=\"filter\" let-groupToRemove=\"groupToRemove\">\r\n \r\n <div class=\"group-card\">\r\n\r\n <div class=\"group-header\">\r\n\r\n <!-- Logical Operator -->\r\n <div class=\"logical-operator\">\r\n\r\n @if (filter === $mainForm()) {\r\n <div class=\"logical-operator-label\">\r\n AND\r\n </div>\r\n } @else {\r\n <select class=\"form-control pointer\" [formControl]=\"filter.get('logicalOperator')\">\r\n <option value=\"AND\">AND</option>\r\n <option value=\"OR\">OR</option>\r\n </select>\r\n }\r\n\r\n <!-- Collapse/Expand Button -->\r\n @if (!!filter.value.filters?.length) {\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary\"\r\n (click)=\"toggleCollapse(filter)\"\r\n [appTooltip]=\"isCollapsed(filter) ? 'Expand Group' : 'Collapse Group'\">\r\n <i class=\"feather\" [class.feather-plus]=\"isCollapsed(filter)\" [class.feather-minus]=\"!isCollapsed(filter)\"></i>\r\n </button>\r\n }\r\n <div class=\"local-action-buttons\">\r\n <button type=\"button\" class=\"btn btn-xs btn-success feather-file-plus\"\r\n (click)=\"addCondition(filter)\"\r\n [appTooltip]=\"'Add Condition to this Group'\" [position]=\"'top'\">\r\n </button>\r\n <button type=\"button\" class=\"btn btn-xs btn-success feather-folder-plus\"\r\n (click)=\"addGroup(filter)\"\r\n [appTooltip]=\"'Add Subgroup to this Group'\" [position]=\"'top'\">\r\n </button>\r\n @if (!!groupToRemove) {\r\n <button type=\"button\" class=\"btn btn-xs btn-danger feather-trash\"\r\n (click)=\"removeGroup(groupToRemove.group, groupToRemove.index)\"\r\n [appTooltip]=\"'Remove Group'\" [position]=\"'top'\">\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"group-content\">\r\n \r\n <!-- Filter List (only shown when expanded) -->\r\n\r\n @if (!isCollapsed(filter)) {\r\n\r\n @if (!!filter.value.filters?.length) {\r\n <div class=\"filter-list\" formArrayName=\"filters\">\r\n @for (childFilter of filter.get('filters').controls; track $index; let idx = $index) {\r\n <div class=\"filter-row\" [formGroup]=\"childFilter\">\r\n \r\n @if (!childFilter.value.logicalOperator) {\r\n <div class=\"field-cell\">\r\n <select class=\"form-control\" formControlName=\"name\">\r\n @for (col of $totalCols(); track $index) {\r\n <option [value]=\"col.field\">\r\n {{ col.label || col.field }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n <div class=\"operator-cell\">\r\n <select class=\"form-control\" formControlName=\"relationalOperator\">\r\n @for (op of relationalOperator; track $index) {\r\n <option [value]=\"op\">\r\n {{ operatorFriendlyMap[op] || op }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n <div class=\"value-cell\">\r\n <!-- <input class=\"form-control\" formControlName=\"value\" /> -->\r\n <core-control-value-only\r\n [$control]=\"resolveControl(childFilter.value.name)!\"\r\n [$form]=\"childFilter\"\r\n [$fieldName]=\"'value'\"\r\n >\r\n </core-control-value-only>\r\n </div>\r\n <div class=\"action-cell\">\r\n <button type=\"button\" class=\"btn btn-danger btn-sm feather-trash-2\"\r\n (click)=\"removeCondition(filter, idx)\"\r\n [appTooltip]=\"'Remove Condition'\">\r\n </button>\r\n </div>\r\n } @else {\r\n <!-- Recursive nested groups -->\r\n <ng-container *ngTemplateOutlet=\"queryTemplate; context: { filter: childFilter, groupToRemove: { group: filter, index: idx } }\"></ng-container>\r\n }\r\n \r\n </div>\r\n }\r\n </div>\r\n }\r\n \r\n\r\n }\r\n\r\n </div>\r\n\r\n </div>\r\n \r\n </ng-template>\r\n \r\n <ng-container\r\n *ngTemplateOutlet=\"queryTemplate; context: { filter: $mainForm(), groupToRemove: null }\">\r\n </ng-container>\r\n \r\n </div>\r\n \r\n </form>\r\n \r\n <div class=\"dev-json-view\">\r\n <pre class=\"json-preview\">{{ $filterFormJsonString() | tableCell : 'TRIM' : lang }}</pre>\r\n </div>\r\n <div class=\"dev-json-view\">\r\n <pre class=\"json-preview\">{{ $rawValue() | tableCell : 'TRIM' : lang }}</pre>\r\n </div>\r\n \r\n </div>\r\n", styles: [".core-rule-tree-container{display:flex;flex-direction:column;height:100vh;width:100%;overflow-y:auto}.core-rule-tree-container button{border-radius:0}.expression-box{background:#e0f2fe;padding:6px 12px;font-weight:500;font-size:14px}.top-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;padding:8px}.expression-display{background-color:#e0f2fe;padding:8px 16px;font-family:monospace;font-size:14px;color:#0369a1}.query-builder{flex-grow:1;overflow-y:visible}.json-preview{background-color:#fff;color:#333;padding:1rem 1.5rem;border-radius:10px;box-shadow:0 2px 6px #00000014;font-family:Fira Code,monospace;font-size:.85rem;word-break:keep-all;overflow-x:auto;line-height:1.5;margin-top:15px}.core-rule-tree-form{display:flex;flex-direction:column;gap:16px}.top-bar{display:flex;justify-content:space-between;align-items:center}.expression-box{background:#e0f2fe;padding:6px 12px;font-weight:500;font-size:14px;margin-right:8px}.query-builder{display:flex;flex-direction:column;gap:16px}.group-card{padding:15px;background:#f9f9f9;display:flex;flex-direction:column;gap:8px;position:relative}.group-card .group-header{display:block;position:relative}.group-card .logical-operator{display:flex;align-items:center;align-self:flex-start;gap:8px}.group-card .logical-operator select{width:57px;background-color:#fff4ce}.group-card .logical-operator .local-action-buttons{margin-left:auto;display:flex;gap:4px}.group-card .logical-operator:hover .local-action-buttons{display:flex}.filter-list{display:flex;flex-direction:column;gap:8px}.filter-row{display:flex;align-items:center;gap:8px}.field-cell,.operator-cell,.value-cell{flex:1}.action-cell{flex-shrink:0}.btn-xs{padding:2px 6px;font-size:10px}.rule-group-container:hover{background-color:#f9f9f9}.group-content{pointer-events:none}.group-content>*{pointer-events:auto}.logical-operator-label{display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;border:1px solid #ced4da;background-color:#fff4ce;color:#495057;font-size:14px;font-weight:500;min-width:100px;width:57px;-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "component", type: CoreControlValueOnlyComponent, selector: "core-control-value-only", inputs: ["$control", "$form", "$fieldName"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "pipe", type: TableCellPipe, name: "tableCell" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
379
- }
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreRuleTreeComponent, decorators: [{
381
- type: Component,
382
- args: [{ selector: 'core-rule-tree', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
383
- FormsModule,
384
- ReactiveFormsModule,
385
- CoreControlValueOnlyComponent,
386
- NgTemplateOutlet,
387
- CoreDropdownComponent,
388
- TooltipDirective,
389
- TableCellPipe,
390
- TranslatePipe
391
- ], template: "<div class=\"core-rule-tree-container\">\r\n\r\n <form [formGroup]=\"$mainForm()\" (ngSubmit)=\"null\" class=\"core-rule-tree-form\">\r\n\r\n <!-- Top Controls -->\r\n <div class=\"top-bar\">\r\n <div class=\"expression-box\">\r\n Expression = {{ $filterString() || '()' }}\r\n </div>\r\n \r\n <!-- <div class=\"button-group\">\r\n <button type=\"button\" class=\"btn btn-success btn-sm feather-file-plus\"\r\n (click)=\"addCondition($mainForm())\"\r\n [appTooltip]=\"'Add Condition'\">\r\n </button>\r\n <button type=\"button\" class=\"btn btn-success btn-sm feather-folder-plus\"\r\n (click)=\"addGroup($mainForm())\"\r\n [appTooltip]=\"'Add Group'\">\r\n </button>\r\n </div> -->\r\n </div>\r\n \r\n <!-- Query Builder -->\r\n <div class=\"query-builder\">\r\n <ng-template #queryTemplate let-filter=\"filter\" let-groupToRemove=\"groupToRemove\">\r\n \r\n <div class=\"group-card\">\r\n\r\n <div class=\"group-header\">\r\n\r\n <!-- Logical Operator -->\r\n <div class=\"logical-operator\">\r\n\r\n @if (filter === $mainForm()) {\r\n <div class=\"logical-operator-label\">\r\n AND\r\n </div>\r\n } @else {\r\n <select class=\"form-control pointer\" [formControl]=\"filter.get('logicalOperator')\">\r\n <option value=\"AND\">AND</option>\r\n <option value=\"OR\">OR</option>\r\n </select>\r\n }\r\n\r\n <!-- Collapse/Expand Button -->\r\n @if (!!filter.value.filters?.length) {\r\n <button type=\"button\" class=\"btn btn-sm btn-outline-secondary\"\r\n (click)=\"toggleCollapse(filter)\"\r\n [appTooltip]=\"isCollapsed(filter) ? 'Expand Group' : 'Collapse Group'\">\r\n <i class=\"feather\" [class.feather-plus]=\"isCollapsed(filter)\" [class.feather-minus]=\"!isCollapsed(filter)\"></i>\r\n </button>\r\n }\r\n <div class=\"local-action-buttons\">\r\n <button type=\"button\" class=\"btn btn-xs btn-success feather-file-plus\"\r\n (click)=\"addCondition(filter)\"\r\n [appTooltip]=\"'Add Condition to this Group'\" [position]=\"'top'\">\r\n </button>\r\n <button type=\"button\" class=\"btn btn-xs btn-success feather-folder-plus\"\r\n (click)=\"addGroup(filter)\"\r\n [appTooltip]=\"'Add Subgroup to this Group'\" [position]=\"'top'\">\r\n </button>\r\n @if (!!groupToRemove) {\r\n <button type=\"button\" class=\"btn btn-xs btn-danger feather-trash\"\r\n (click)=\"removeGroup(groupToRemove.group, groupToRemove.index)\"\r\n [appTooltip]=\"'Remove Group'\" [position]=\"'top'\">\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div class=\"group-content\">\r\n \r\n <!-- Filter List (only shown when expanded) -->\r\n\r\n @if (!isCollapsed(filter)) {\r\n\r\n @if (!!filter.value.filters?.length) {\r\n <div class=\"filter-list\" formArrayName=\"filters\">\r\n @for (childFilter of filter.get('filters').controls; track $index; let idx = $index) {\r\n <div class=\"filter-row\" [formGroup]=\"childFilter\">\r\n \r\n @if (!childFilter.value.logicalOperator) {\r\n <div class=\"field-cell\">\r\n <select class=\"form-control\" formControlName=\"name\">\r\n @for (col of $totalCols(); track $index) {\r\n <option [value]=\"col.field\">\r\n {{ col.label || col.field }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n <div class=\"operator-cell\">\r\n <select class=\"form-control\" formControlName=\"relationalOperator\">\r\n @for (op of relationalOperator; track $index) {\r\n <option [value]=\"op\">\r\n {{ operatorFriendlyMap[op] || op }}\r\n </option>\r\n }\r\n </select>\r\n </div>\r\n <div class=\"value-cell\">\r\n <!-- <input class=\"form-control\" formControlName=\"value\" /> -->\r\n <core-control-value-only\r\n [$control]=\"resolveControl(childFilter.value.name)!\"\r\n [$form]=\"childFilter\"\r\n [$fieldName]=\"'value'\"\r\n >\r\n </core-control-value-only>\r\n </div>\r\n <div class=\"action-cell\">\r\n <button type=\"button\" class=\"btn btn-danger btn-sm feather-trash-2\"\r\n (click)=\"removeCondition(filter, idx)\"\r\n [appTooltip]=\"'Remove Condition'\">\r\n </button>\r\n </div>\r\n } @else {\r\n <!-- Recursive nested groups -->\r\n <ng-container *ngTemplateOutlet=\"queryTemplate; context: { filter: childFilter, groupToRemove: { group: filter, index: idx } }\"></ng-container>\r\n }\r\n \r\n </div>\r\n }\r\n </div>\r\n }\r\n \r\n\r\n }\r\n\r\n </div>\r\n\r\n </div>\r\n \r\n </ng-template>\r\n \r\n <ng-container\r\n *ngTemplateOutlet=\"queryTemplate; context: { filter: $mainForm(), groupToRemove: null }\">\r\n </ng-container>\r\n \r\n </div>\r\n \r\n </form>\r\n \r\n <div class=\"dev-json-view\">\r\n <pre class=\"json-preview\">{{ $filterFormJsonString() | tableCell : 'TRIM' : lang }}</pre>\r\n </div>\r\n <div class=\"dev-json-view\">\r\n <pre class=\"json-preview\">{{ $rawValue() | tableCell : 'TRIM' : lang }}</pre>\r\n </div>\r\n \r\n </div>\r\n", styles: [".core-rule-tree-container{display:flex;flex-direction:column;height:100vh;width:100%;overflow-y:auto}.core-rule-tree-container button{border-radius:0}.expression-box{background:#e0f2fe;padding:6px 12px;font-weight:500;font-size:14px}.top-controls{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px;padding:8px}.expression-display{background-color:#e0f2fe;padding:8px 16px;font-family:monospace;font-size:14px;color:#0369a1}.query-builder{flex-grow:1;overflow-y:visible}.json-preview{background-color:#fff;color:#333;padding:1rem 1.5rem;border-radius:10px;box-shadow:0 2px 6px #00000014;font-family:Fira Code,monospace;font-size:.85rem;word-break:keep-all;overflow-x:auto;line-height:1.5;margin-top:15px}.core-rule-tree-form{display:flex;flex-direction:column;gap:16px}.top-bar{display:flex;justify-content:space-between;align-items:center}.expression-box{background:#e0f2fe;padding:6px 12px;font-weight:500;font-size:14px;margin-right:8px}.query-builder{display:flex;flex-direction:column;gap:16px}.group-card{padding:15px;background:#f9f9f9;display:flex;flex-direction:column;gap:8px;position:relative}.group-card .group-header{display:block;position:relative}.group-card .logical-operator{display:flex;align-items:center;align-self:flex-start;gap:8px}.group-card .logical-operator select{width:57px;background-color:#fff4ce}.group-card .logical-operator .local-action-buttons{margin-left:auto;display:flex;gap:4px}.group-card .logical-operator:hover .local-action-buttons{display:flex}.filter-list{display:flex;flex-direction:column;gap:8px}.filter-row{display:flex;align-items:center;gap:8px}.field-cell,.operator-cell,.value-cell{flex:1}.action-cell{flex-shrink:0}.btn-xs{padding:2px 6px;font-size:10px}.rule-group-container:hover{background-color:#f9f9f9}.group-content{pointer-events:none}.group-content>*{pointer-events:auto}.logical-operator-label{display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;border:1px solid #ced4da;background-color:#fff4ce;color:#495057;font-size:14px;font-weight:500;min-width:100px;width:57px;-webkit-user-select:none;user-select:none}\n"] }]
392
- }], ctorParameters: () => [{ type: MultiLanguageService }, { type: i0.ChangeDetectorRef }] });
393
-
394
- class WfStepConfigShellComponent {
395
- constructor(coreWorkflowService, domService) {
396
- this.coreWorkflowService = coreWorkflowService;
397
- this.domService = domService;
398
- this.$container = viewChild('container');
399
- this.renderer = inject(Renderer2);
400
- this.cdr = inject(ChangeDetectorRef);
401
- this.$stepFormGroup = computed(() => {
402
- const step = this.coreWorkflowService.$currentStep();
403
- if (!step) {
404
- return new FormGroup({
405
- logicalOperator: new FormControl('AND'),
406
- filters: new FormArray([])
407
- });
408
- }
409
- return this.buildFormGroupFromStep(step.config);
410
- });
411
- this.$isBranchCard = computed(() => {
412
- const step = this.coreWorkflowService.$currentStep();
413
- console.log(step?.type);
414
- console.log(step?.type === EnumWorkflowStepType.BranchCard);
415
- return !!step && step.type === EnumWorkflowStepType.BranchCard;
416
- });
417
- this.$canRenderRuleTree = computed(() => {
418
- const form = this.$stepFormGroup();
419
- const cols = this.coreWorkflowService.$availableCols();
420
- const isBranchCard = this.$isBranchCard();
421
- if (!form || !cols || !isBranchCard)
422
- return false;
423
- if (cols.length === 0)
424
- return false;
425
- return form.valid;
426
- });
427
- effect(() => {
428
- const containerRef = this.$container();
429
- if (containerRef) {
430
- containerRef.nativeElement.style.zIndex = this.domService.getMaxZIndex() + 1;
431
- }
432
- });
433
- }
434
- ngAfterViewInit() {
435
- setTimeout(() => {
436
- this.listenerFn = this.renderer.listen('window', 'click', (e) => {
437
- const container = this.$container();
438
- const target = e.target;
439
- if (!!container &&
440
- !container.nativeElement.contains(target) &&
441
- !target.closest('.step-subtext')) {
442
- this.coreWorkflowService.$showStepConfig.set(false);
443
- }
444
- this.cdr.markForCheck();
445
- });
446
- });
447
- }
448
- buildFormGroupFromStep(config) {
449
- if (!config) {
450
- return new FormGroup({
451
- logicalOperator: new FormControl('AND'),
452
- filters: new FormArray([])
453
- });
454
- }
455
- return new FormGroup({
456
- logicalOperator: new FormControl(config.logicalOperator ?? 'AND'),
457
- filters: new FormArray([]) // You could map config.filters to prefilled controls
458
- });
459
- }
460
- close() {
461
- this.coreWorkflowService.$showStepConfig.set(false); // example method
462
- }
463
- save() {
464
- // handle save logic
465
- }
466
- ngOnDestroy() {
467
- if (!!this.listenerFn)
468
- this.listenerFn();
469
- }
470
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfStepConfigShellComponent, deps: [{ token: CoreWorkflowService }, { token: DomService }], target: i0.ɵɵFactoryTarget.Component }); }
471
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: WfStepConfigShellComponent, isStandalone: true, selector: "wf-step-config-shell", viewQueries: [{ propertyName: "$container", first: true, predicate: ["container"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"wf-step-config-shell-container\" #container [class.shown]=\"coreWorkflowService.$showStepConfig()\">\r\n \r\n <div class=\"wf-step-config-header\">\r\n <div class=\"panel-title\">\r\n {{ coreWorkflowService.$currentStep()?.type || 'Step' }} Configuration\r\n </div>\r\n <div class=\"close-wrapper\" (click)=\"close()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </div>\r\n \r\n <div class=\"wf-step-config-content\">\r\n @if (!!$canRenderRuleTree()) {\r\n <core-rule-tree \r\n [$totalCols]=\"coreWorkflowService.$availableCols()\" \r\n [$mainForm]=\"$stepFormGroup()\">\r\n </core-rule-tree> \r\n } @else {\r\n <div class=\"loading-placeholder\">\r\n Loading Step Configuration...\r\n </div>\r\n }\r\n </div>\r\n \r\n</div>", styles: [".wf-step-config-shell-container{display:block;position:fixed;top:0;right:-532px;width:532px;height:100vh;background-color:#fff;transition:right .2s ease-out;box-shadow:var(--decoration-box-shadow);overflow-y:auto}.wf-step-config-header{display:flex;align-items:center;justify-content:space-between;padding:16px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;font-weight:700;font-size:18px;color:#1f2937}.panel-title{flex-grow:1}.close-wrapper{display:flex;align-items:center;justify-content:center;background-color:#f1f5f9;width:32px;height:32px;border-radius:50%;cursor:pointer;transition:background-color .2s}.close-wrapper:hover{background-color:#e2e8f0}.wf-step-config-content{flex-grow:1;padding:16px;overflow-y:auto}.loading-placeholder{display:flex;align-items:center;justify-content:center;height:100%;color:#94a3b8;font-size:14px}.wf-step-config-shell-container.shown{right:0}\n"], dependencies: [{ kind: "component", type: CoreRuleTreeComponent, selector: "core-rule-tree", inputs: ["$totalCols", "$mainForm", "$filterStringInput", "$expressionInput"], outputs: ["$jsonEmitter", "$expressionEmitter"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
472
- }
473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfStepConfigShellComponent, decorators: [{
474
- type: Component,
475
- args: [{ selector: 'wf-step-config-shell', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
476
- CoreRuleTreeComponent,
477
- CoreDatePickerComponent
478
- ], template: "<div class=\"wf-step-config-shell-container\" #container [class.shown]=\"coreWorkflowService.$showStepConfig()\">\r\n \r\n <div class=\"wf-step-config-header\">\r\n <div class=\"panel-title\">\r\n {{ coreWorkflowService.$currentStep()?.type || 'Step' }} Configuration\r\n </div>\r\n <div class=\"close-wrapper\" (click)=\"close()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </div>\r\n \r\n <div class=\"wf-step-config-content\">\r\n @if (!!$canRenderRuleTree()) {\r\n <core-rule-tree \r\n [$totalCols]=\"coreWorkflowService.$availableCols()\" \r\n [$mainForm]=\"$stepFormGroup()\">\r\n </core-rule-tree> \r\n } @else {\r\n <div class=\"loading-placeholder\">\r\n Loading Step Configuration...\r\n </div>\r\n }\r\n </div>\r\n \r\n</div>", styles: [".wf-step-config-shell-container{display:block;position:fixed;top:0;right:-532px;width:532px;height:100vh;background-color:#fff;transition:right .2s ease-out;box-shadow:var(--decoration-box-shadow);overflow-y:auto}.wf-step-config-header{display:flex;align-items:center;justify-content:space-between;padding:16px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;font-weight:700;font-size:18px;color:#1f2937}.panel-title{flex-grow:1}.close-wrapper{display:flex;align-items:center;justify-content:center;background-color:#f1f5f9;width:32px;height:32px;border-radius:50%;cursor:pointer;transition:background-color .2s}.close-wrapper:hover{background-color:#e2e8f0}.wf-step-config-content{flex-grow:1;padding:16px;overflow-y:auto}.loading-placeholder{display:flex;align-items:center;justify-content:center;height:100%;color:#94a3b8;font-size:14px}.wf-step-config-shell-container.shown{right:0}\n"] }]
479
- }], ctorParameters: () => [{ type: CoreWorkflowService }, { type: DomService }] });
480
-
481
- const ROOT_BRANCH_ID = 'root';
482
-
483
- class BridgeLineService {
484
- constructor() {
485
- this.coreWorkflowService = inject(CoreWorkflowService);
486
- this.colorRadius = 10;
487
- }
488
- adjustBridgeLines(branchGroupEl, topBridgeLineEl, bottomBridgeLineEl, branchColumnEls) {
489
- const columns = Array.from(branchGroupEl.querySelectorAll(':scope > .branch-column'));
490
- if (columns.length < 2)
491
- return;
492
- // Helper: get the last .arrow-down inside a column
493
- // ':scope > .arrow-down' only works if .arrow-down is a direct child of col.
494
- // Safely queries only arrows inside wf-bottom-v-insert
495
- // Uses .pop() to grab the last one, if any (safe fallback if there's more than one).
496
- // Ensures type safety with instanceof HTMLElement.
497
- const getLastArrow = (col) => {
498
- const arrow = Array.from(col.querySelectorAll('wf-bottom-v-insert .arrow-down')).pop();
499
- return arrow instanceof HTMLElement ? arrow : null;
500
- };
501
- const allArrows = columns
502
- .map(getLastArrow)
503
- .filter((el) => !!el);
504
- if (allArrows.length < 2)
505
- return;
506
- const r1 = allArrows[0].getBoundingClientRect();
507
- const r2 = allArrows[allArrows.length - 1].getBoundingClientRect();
508
- const containerRect = branchGroupEl.getBoundingClientRect();
509
- const left = r1.left + r1.width / 2 - containerRect.left;
510
- const right = r2.left + r2.width / 2 - containerRect.left;
511
- const maxArrowBottom = allArrows.reduce((max, el) => {
512
- const bottom = el.getBoundingClientRect().bottom;
513
- return Math.max(max, bottom);
514
- }, 0);
515
- const top = maxArrowBottom - containerRect.top - 1;
516
- // TOP bridge line
517
- topBridgeLineEl.style.top = `17.5px`;
518
- topBridgeLineEl.style.left = `${left}px`;
519
- topBridgeLineEl.style.width = `${right - left}px`;
520
- // BOTTOM bridge line
521
- bottomBridgeLineEl.style.top = `${top}px`;
522
- bottomBridgeLineEl.style.left = `${left}px`;
523
- bottomBridgeLineEl.style.width = `${right - left}px`;
524
- // Vertical lines
525
- branchColumnEls.forEach(col => {
526
- const lastArrow = getLastArrow(col);
527
- const vertical = col.querySelector(':scope > .vertical-bridge-line');
528
- if (!lastArrow || !vertical)
529
- return;
530
- const arrowRect = lastArrow.getBoundingClientRect();
531
- const colRect = col.getBoundingClientRect();
532
- const startY = arrowRect.bottom - colRect.top;
533
- const height = top - startY - this.coreWorkflowService.standardConnectorHeight - 17.5;
534
- vertical.style.top = `${startY}px`;
535
- vertical.style.left = `calc(50% - 1px)`;
536
- vertical.style.height = `${height}px`;
537
- vertical.style.display = height > 0 ? 'block' : 'none';
538
- //vertical.style.backgroundColor = `hsl(${this.colorRadius}, 100%, 50%)`;
539
- this.colorRadius += 10;
540
- });
541
- }
542
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BridgeLineService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
543
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BridgeLineService, providedIn: 'root' }); }
544
- }
545
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BridgeLineService, decorators: [{
546
- type: Injectable,
547
- args: [{
548
- providedIn: 'root'
549
- }]
550
- }] });
551
-
552
- class BridgeLineDirective {
553
- constructor(elRef, bridgeLineService, zone) {
554
- this.elRef = elRef;
555
- this.bridgeLineService = bridgeLineService;
556
- this.zone = zone;
557
- this.bridgeLinesAdjusted = new EventEmitter();
558
- }
559
- ngOnInit() {
560
- this.zone.runOutsideAngular(() => {
561
- this.resizeObserver = new ResizeObserver(() => {
562
- requestAnimationFrame(() => this.adjustBridgeLines());
563
- });
564
- this.resizeObserver.observe(this.elRef.nativeElement);
565
- this.mutationObserver = new MutationObserver(() => {
566
- this.adjustBridgeLines();
567
- });
568
- this.mutationObserver.observe(this.elRef.nativeElement, {
569
- childList: true,
570
- subtree: true
571
- });
572
- });
573
- // First adjustment
574
- requestAnimationFrame(() => this.adjustBridgeLines());
575
- }
576
- ngOnDestroy() {
577
- this.resizeObserver?.disconnect();
578
- this.mutationObserver?.disconnect();
579
- }
580
- adjustBridgeLines() {
581
- const branchGroupEl = this.elRef.nativeElement;
582
- const bridgeLines = branchGroupEl.querySelectorAll('.horizontal-bridge-line');
583
- const topBridgeLineEl = bridgeLines[0];
584
- const bottomBridgeLineEl = bridgeLines[1];
585
- const branchColumnEls = Array.from(branchGroupEl.querySelectorAll(':scope > .branch-column'));
586
- if (!topBridgeLineEl || !bottomBridgeLineEl || !branchColumnEls)
587
- return;
588
- this.bridgeLineService.adjustBridgeLines(this.elRef.nativeElement, topBridgeLineEl, bottomBridgeLineEl, branchColumnEls);
589
- this.bridgeLinesAdjusted.emit();
590
- }
591
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BridgeLineDirective, deps: [{ token: i0.ElementRef }, { token: BridgeLineService }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
592
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: BridgeLineDirective, isStandalone: true, selector: "[bridgeLine]", outputs: { bridgeLinesAdjusted: "bridgeLinesAdjusted" }, ngImport: i0 }); }
593
- }
594
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BridgeLineDirective, decorators: [{
595
- type: Directive,
596
- args: [{
597
- selector: '[bridgeLine]'
598
- }]
599
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: BridgeLineService }, { type: i0.NgZone }], propDecorators: { bridgeLinesAdjusted: [{
600
- type: Output
601
- }] } });
602
-
603
- class WfNodeComponent extends BaseComponent {
604
- constructor() {
605
- super(...arguments);
606
- this.stepGroup = []; // array that holds 'step'
607
- this.grandParentSteps = null; // The step array that owns the parent step of type ConditionalBranch
608
- this.isInFallbackBranch = false;
609
- //private observer!: MutationObserver;
610
- this.enumType = EnumWorkflowStepType;
611
- this.coreWorkflowService = inject(CoreWorkflowService);
612
- this.renderer = inject(Renderer2);
613
- this.bridgeLineService = inject(BridgeLineService);
614
- this.stepNameEditMode = false;
615
- }
616
- onInputBlur() {
617
- this.stepNameEditMode = false;
618
- }
619
- getBranchColumnElements() {
620
- return this.branchColumnRefs?.map(ref => ref?.nativeElement);
621
- }
622
- setupClickOutsideListener() {
623
- // Clean up any existing listener
624
- if (this.listenerFn) {
625
- this.listenerFn();
626
- this.listenerFn = null;
627
- }
628
- // Delay to ensure DOM has rendered
629
- setTimeout(() => {
630
- this.listenerFn = this.renderer.listen('document', 'click', (event) => {
631
- const clickedInside = this.branchHeader?.nativeElement.contains(event.target);
632
- if (!clickedInside) {
633
- this.stepNameEditMode = false;
634
- this.removeClickOutsideListener(); // optional: remove after 1 toggle
635
- }
636
- });
637
- });
638
- }
639
- removeClickOutsideListener() {
640
- if (this.listenerFn) {
641
- this.listenerFn();
642
- this.listenerFn = null;
643
- }
644
- }
645
- onLabelClicked() {
646
- this.coreWorkflowService.$showStepConfig.set(true);
647
- }
648
- switchToNameEditMode() {
649
- if (!!this.step.isPseudo && !!this.isInFallbackBranch)
650
- return;
651
- this.stepNameEditMode = true;
652
- setTimeout(() => this.input?.nativeElement.focus());
653
- this.setupClickOutsideListener();
654
- }
655
- adjustBridgeLines() {
656
- setTimeout(() => {
657
- if (!this.branchGroupRef || !this.topBridgeLineRef || !this.bottomBridgeLineRef) {
658
- console.warn('[DEBUG] Some ref was null');
659
- return;
660
- }
661
- console.log('[DEBUG] Triggering BridgeLineService');
662
- this.bridgeLineService.adjustBridgeLines(this.branchGroupRef.nativeElement, this.topBridgeLineRef.nativeElement, this.bottomBridgeLineRef.nativeElement, this.branchColumnRefs.map(ref => ref.nativeElement));
663
- }, 50);
664
- }
665
- onDeleteBranch(branchId) {
666
- if (!this.conditionalBranches)
667
- return;
668
- const index = this.conditionalBranches.findIndex(b => b.id === branchId);
669
- if (index === -1)
670
- return;
671
- // ❌ Remove the selected branch
672
- this.conditionalBranches.splice(index, 1);
673
- // ✅ Check if only fallback branch remains → delete the group step
674
- if (this.conditionalBranches.length === 1 && this.conditionalBranches[0].isFallback) {
675
- if (!this.grandParentSteps)
676
- return;
677
- const indexInGrandParentSteps = this.grandParentSteps.findIndex(x => x.branches?.some(y => y.id === this.conditionalBranches[0].id));
678
- if (indexInGrandParentSteps === -1)
679
- return;
680
- // 🧹 Remove the ConditionalBranch step (parent step)
681
- this.grandParentSteps.splice(indexInGrandParentSteps, 1);
682
- }
683
- else {
684
- this.coreWorkflowService.autoReassignPriorities(this.conditionalBranches);
685
- }
686
- }
687
- onDeleteStep() {
688
- if (!this.stepGroup)
689
- return;
690
- const index = this.stepGroup.findIndex(s => s.id === this.step.id);
691
- if (index === -1)
692
- return;
693
- // ❌ Remove the selected step
694
- this.stepGroup.splice(index, 1);
695
- }
696
- ngAfterViewInit() {
697
- setTimeout(() => {
698
- });
699
- }
700
- ngOnDestroy() {
701
- this.subscriptions.forEach(x => x?.unsubscribe());
702
- }
703
- openConditionEditor() {
704
- this.coreWorkflowService.$currentStep.set(this.step);
705
- this.coreWorkflowService.$showStepConfig.set(true);
706
- }
707
- openNoneBranchRelatedEditor() {
708
- this.coreWorkflowService.$currentStep.set(this.step);
709
- this.coreWorkflowService.$showStepConfig.set(true);
710
- }
711
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfNodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
712
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: WfNodeComponent, isStandalone: true, selector: "wf-node", inputs: { branchId: "branchId", step: "step", index: "index", branchPriority: "branchPriority", stepGroup: "stepGroup", conditionalBranches: "conditionalBranches", grandParentSteps: "grandParentSteps", isInFallbackBranch: "isInFallbackBranch" }, viewQueries: [{ propertyName: "branchHeader", first: true, predicate: ["branchHeader"], descendants: true }, { propertyName: "branchName", first: true, predicate: ["branchName"], descendants: true }, { propertyName: "input", first: true, predicate: ["input"], descendants: true }, { propertyName: "branchGroupRef", first: true, predicate: ["branchGroup"], descendants: true }, { propertyName: "topBridgeLineRef", first: true, predicate: ["topBridgeLine"], descendants: true }, { propertyName: "bottomBridgeLineRef", first: true, predicate: ["bottomBridgeLine"], descendants: true }, { propertyName: "branchColumnRefs", predicate: ["branchColumn"], descendants: true }], usesInheritance: true, ngImport: i0, template: "@switch (step.type) {\r\n\r\n @case (enumType.ConditionalBranch) {\r\n <div class=\"wf-branch-group-container\">\r\n <div \r\n class=\"branch-group\" \r\n #branchGroup \r\n bridgeLine\r\n (bridgeLinesAdjusted)=\"adjustBridgeLines()\"\r\n >\r\n <!-- \uD83D\uDD39 Top Bridge Line -->\r\n <div class=\"horizontal-bridge-line\" #topBridgeLine></div>\r\n\r\n <div class=\"add-branch-inline\">\r\n <button class=\"add-branch-btn\" (click)=\"coreWorkflowService.addBranchToStep(step.id)\">\r\n \uFF0B Add New Branch\r\n </button>\r\n </div>\r\n\r\n \r\n @for (branch of step.branches; track $index; let j = $index) {\r\n <div class=\"branch-column\" #branchColumn>\r\n <div class=\"branch-column-inner\">\r\n \r\n @for (bstep of branch.steps; track $index; let k = $index) {\r\n <wf-node\r\n [branchId]=\"branch.id\"\r\n [branchPriority]=\"branch.priority\"\r\n [step]=\"bstep\"\r\n [conditionalBranches]=\"step.branches || []\"\r\n [stepGroup]=\"branch.steps\"\r\n [grandParentSteps]=\"stepGroup\"\r\n [index]=\"k\"\r\n [isInFallbackBranch]=\"!!branch.isFallback\"\r\n ></wf-node>\r\n }\r\n \r\n </div>\r\n \r\n <div class=\"vertical-bridge-line\"></div>\r\n </div>\r\n }\r\n \r\n <!-- \uD83D\uDD39 Bottom Bridge Line -->\r\n <div class=\"horizontal-bridge-line\" #bottomBridgeLine></div>\r\n </div>\r\n </div>\r\n }\r\n \r\n @case (enumType.BranchCard) {\r\n <div class=\"wf-step-container wf-branch-card-container workflow-box\">\r\n <div class=\"step-wrapper branch-card-wrapper\" [class.fallback]=\"!!isInFallbackBranch\">\r\n <div class=\"arrow-down-container\">\r\n <div class=\"arrow-down\"></div>\r\n </div>\r\n \r\n <div class=\"step-header branch-header\" [class.edit-mode]=\"stepNameEditMode\" #branchHeader>\r\n @if (stepNameEditMode) {\r\n <div class=\"input-wrapper\">\r\n <input class=\"form-control\" (blur)=\"onInputBlur()\" [(ngModel)]=\"step.name\" #input>\r\n </div>\r\n } @else {\r\n <div class=\"step-name-wrapper branch-name-wrapper\">\r\n <div\r\n class=\"step-name branch-name\"\r\n [class.pointer]=\"!isInFallbackBranch\"\r\n (click)=\"switchToNameEditMode()\"\r\n #branchName>\r\n {{ step.name }}\r\n </div>\r\n \r\n @if (!!isInFallbackBranch) {\r\n <i class=\"ti-info-alt\"\r\n [appTooltip]=\"'This branch is created by default and will only be activated if none of the other branches can be executed.'\"\r\n [showAnyway]=\"true\" [position]=\"'above'\"></i>\r\n }\r\n </div>\r\n \r\n <div class=\"branch-priority\">Priority {{ branchPriority }}</div>\r\n <div class=\"step-delete branch-delete pointer\" (click)=\"onDeleteBranch(branchId)\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n }\r\n </div>\r\n \r\n <div class=\"step-set-config branch-set-condition\" [class.pointer]=\"!isInFallbackBranch\">\r\n @if (!!isInFallbackBranch) {\r\n <div class=\"branch-subtext fallback\"\r\n [appTooltip]=\"'If other branches are not met, the alternative branch will be executed'\"\r\n [showAnyway]=\"true\" [position]=\"'above'\">\r\n If other branches are not met, the alternative branch will be executed\r\n </div>\r\n } @else {\r\n <div class=\"step-subtext branch-subtext\" (click)=\"openConditionEditor()\">Set conditions</div>\r\n <div><i class=\"feather-chevron-right\"></i></div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n \r\n @default() {\r\n <div class=\"wf-step-container workflow-box {{ step.type.toLowerCase() }}\">\r\n\r\n <div class=\"step-wrapper\">\r\n \r\n <div class=\"step-header\" [class.edit-mode]=\"stepNameEditMode\">\r\n @if (stepNameEditMode) {\r\n <div class=\"input-wrapper\">\r\n <input class=\"form-control\" (blur)=\"onInputBlur()\" [(ngModel)]=\"step.name\" #input>\r\n </div>\r\n } @else {\r\n <div class=\"step-name-wrapper\">\r\n <div\r\n class=\"step-name pointer\"\r\n (click)=\"switchToNameEditMode()\"\r\n #stepName>\r\n {{ step.name }}\r\n </div>\r\n </div>\r\n \r\n <div class=\"step-delete pointer\" (click)=\"onDeleteStep()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n }\r\n </div>\r\n \r\n <div class=\"step-set-config pointer\" (click)=\"openNoneBranchRelatedEditor()\">\r\n <div class=\"step-subtext\" [class.configurated]=\"!!step.config\">{{ step.label }}</div>\r\n <div><i class=\"feather-chevron-right\"></i></div>\r\n </div>\r\n </div>\r\n\r\n <!-- <strong>{{ step.type }}</strong>\r\n <div (click)=\"onLabelClicked()\">{{ step.label }}</div> -->\r\n </div>\r\n }\r\n}\r\n \r\n@if (step.type !== enumType.End) {\r\n <wf-bottom-v-insert\r\n [currentContext]=\"{ branchId: step.branchId, index: index + 1 }\"\r\n [currentStep]=\"step\"\r\n ></wf-bottom-v-insert>\r\n}\r\n ", styles: [".wf-workflow-canvas-container{--standard-connector-height: 90px;padding-top:50px;padding-bottom:50px;background-color:#f2f3f5}.wf-workflow-canvas-container .canvas{display:flex;flex-direction:column;align-items:center}.wf-workflow-canvas-container .step{text-align:center;position:relative}.workflow-box{width:220px;min-height:85px;max-height:100px;padding:0 4px 4px;box-shadow:0 0 4px #0000000d}.workflow-box.submit,.workflow-box.end{background-color:#a9b4cd}.workflow-box.approval{background-color:#f80}.workflow-box.cc{background-color:#3370ff}.workflow-box.handle{background-color:#935af6}.connector{font-size:24px;color:#888}.plus-btn{font-size:18px;background:#fff;border:1px solid #ccc;border-radius:9999px;width:28px;height:28px;cursor:pointer}.insert-menu{background:#fff;border:1px solid #ddd;border-radius:6px;padding:8px;margin-top:6px;box-shadow:0 2px 8px #0000001a;display:flex;flex-direction:column;gap:6px;z-index:10}.insert-menu div{cursor:pointer;font-size:14px;padding:2px 6px}.insert-menu .cancel{color:red}.branch-column{position:relative}.branch-column .branch-column-inner{width:100%;display:flex;flex-direction:column;align-items:center}.wf-branch-group-container,.wf-branch-group-container .branch-group{position:relative}.wf-branch-group-container .branch-group .branch-column{display:table-cell;min-width:220px;vertical-align:top;padding:0 12px}.wf-branch-group-container .branch-group .branch-column .vertical-bridge-line{position:absolute;width:2px;background-color:#d9d9d9;z-index:2;pointer-events:none}.wf-branch-group-container .branch-group .horizontal-bridge-line{position:absolute;height:2px;background-color:#d9d9d9;pointer-events:none;z-index:1}.wf-branch-group-container:after{content:\"\";display:block;position:absolute;height:2px;width:calc(100% - 244px);left:122px;bottom:102px}.branch-title{font-weight:700;font-size:14px;margin-bottom:8px}.branch-group-header{display:flex;justify-content:center;margin:12px 0}.add-branch-btn{position:absolute;top:0;width:175px;left:calc(50% - 87.5px);z-index:2;background:#fff;color:#0f172a;border:1px solid #ccc;padding:4px 12px;border-radius:9999px;font-weight:500;cursor:pointer;box-shadow:0 2px 4px #0000000f;text-wrap:nowrap}.workflow-box.submit{background-color:#e0f7fa;border-left:4px solid #00bcd4}.workflow-box.end{background-color:#ede7f6;border-left:4px solid #673ab7}.box.special{font-style:italic;opacity:.9}.bottom-v-container{min-height:65px;width:220px}.wf-bottom-v-insert-container{position:relative;display:flex;flex-direction:column;align-items:center;height:var(--standard-connector-height);width:100%;margin:0}.wf-bottom-v-insert-container .vertical-line{position:absolute;top:0;height:100%;width:2px;background-color:#d9d9d9;z-index:0}.wf-bottom-v-insert-container .plus-container{display:block;position:absolute;border-radius:50%;top:calc(var(--standard-connector-height) / 2 - 16px)}.wf-bottom-v-insert-container .plus-btn{width:32px;height:32px;border-radius:50%;border:none;background:#fff;color:#3b82f6;font-size:20px;box-shadow:.4rem 0 2rem #0000002e;cursor:pointer;display:flex;align-items:center;justify-content:center}.wf-bottom-v-insert-container .plus-btn:hover{background:#f0f8ff;box-shadow:0 0 0 4px #3b82f633}.wf-bottom-v-insert-container.shorter{height:calc(var(--standard-connector-height) - 15px)}.wf-bottom-v-insert-container.shorter .plus-container{display:block;position:absolute;top:calc((var(--standard-connector-height) - 18px) / 2 - 16px)}.wf-bottom-v-insert-container.insert-context .plus-container{outline:#2eb795 solid 2px}.add-branch-inline{position:relative;height:35px;margin-bottom:calc(var(--standard-connector-height) - 17.5px)}.arrow-down-container{display:block;position:absolute;z-index:1;bottom:0}.arrow-down-container .arrow-down{margin-top:5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid #d9d9d9}.branch-card-wrapper{position:relative}.branch-card-wrapper .arrow-down-container{top:-12px;left:calc(50% - 5px)}.wf-step-container .step-header{position:relative;display:flex;align-items:center;justify-content:space-between;height:43px;font-size:12px;border-bottom:1px solid #f6f6f7}.wf-step-container .step-header .input-wrapper{padding-top:4px}.wf-step-container .step-header .step-name-wrapper{display:flex;align-items:center;justify-content:flex-start;padding-right:8px}.wf-step-container .step-header .step-name-wrapper .step-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:140px;padding-left:4px}.wf-step-container .step-header .step-name-wrapper i{margin-left:2px}.wf-step-container .step-header .step-delete{color:gray;display:none}.wf-step-container .step-header .step-delete i{font-size:24px}.wf-step-container .step-header:hover .step-name-wrapper:after{content:\"\\e95a\";font-family:feather}.wf-step-container .step-header:hover .branch-priority{display:none}.wf-step-container .step-header:hover .step-delete,.wf-step-container .step-header.edit-mode{display:block}.wf-step-container .step-set-config{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;padding:7px 4px;font-size:14px;background-color:#fff;color:gray}.wf-step-container .step-set-config .step-subtext{width:100%;text-align:left}.wf-step-container .step-set-config .step-subtext.configurated{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container{background-color:#fff}.wf-step-container.wf-branch-card-container .branch-header{color:#2eb795;border-bottom:1px solid #f6f6f7}.wf-step-container.wf-branch-card-container .branch-header:before{content:\"\";display:block;position:absolute;height:var(--standard-connector-height);width:2px;background-color:#d9d9d9;left:50%;top:calc(var(--standard-connector-height) * -1)}.wf-step-container.wf-branch-card-container .branch-set-condition{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;color:#3e4759;padding:7px 4px;font-size:14px}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext{width:100%;text-align:left}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext.fallback{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header,.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-set-condition{color:gray}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header .branch-priority{padding-right:4px}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-priority{display:block}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-delete{display:none}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-name-wrapper:after{content:\"\"}\n", ""], dependencies: [{ kind: "component", type: WfNodeComponent, selector: "wf-node", inputs: ["branchId", "step", "index", "branchPriority", "stepGroup", "conditionalBranches", "grandParentSteps", "isInFallbackBranch"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: BridgeLineDirective, selector: "[bridgeLine]", outputs: ["bridgeLinesAdjusted"] }, { kind: "component", type: WfBottomVInsertComponent, selector: "wf-bottom-v-insert", inputs: ["currentContext", "currentStep"], outputs: ["insertStep"] }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }] }); }
713
- }
714
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfNodeComponent, decorators: [{
715
- type: Component,
716
- args: [{ selector: 'wf-node', imports: [
717
- FormsModule,
718
- BridgeLineDirective,
719
- LowerCasePipe,
720
- WfBottomVInsertComponent,
721
- TooltipDirective,
722
- ], template: "@switch (step.type) {\r\n\r\n @case (enumType.ConditionalBranch) {\r\n <div class=\"wf-branch-group-container\">\r\n <div \r\n class=\"branch-group\" \r\n #branchGroup \r\n bridgeLine\r\n (bridgeLinesAdjusted)=\"adjustBridgeLines()\"\r\n >\r\n <!-- \uD83D\uDD39 Top Bridge Line -->\r\n <div class=\"horizontal-bridge-line\" #topBridgeLine></div>\r\n\r\n <div class=\"add-branch-inline\">\r\n <button class=\"add-branch-btn\" (click)=\"coreWorkflowService.addBranchToStep(step.id)\">\r\n \uFF0B Add New Branch\r\n </button>\r\n </div>\r\n\r\n \r\n @for (branch of step.branches; track $index; let j = $index) {\r\n <div class=\"branch-column\" #branchColumn>\r\n <div class=\"branch-column-inner\">\r\n \r\n @for (bstep of branch.steps; track $index; let k = $index) {\r\n <wf-node\r\n [branchId]=\"branch.id\"\r\n [branchPriority]=\"branch.priority\"\r\n [step]=\"bstep\"\r\n [conditionalBranches]=\"step.branches || []\"\r\n [stepGroup]=\"branch.steps\"\r\n [grandParentSteps]=\"stepGroup\"\r\n [index]=\"k\"\r\n [isInFallbackBranch]=\"!!branch.isFallback\"\r\n ></wf-node>\r\n }\r\n \r\n </div>\r\n \r\n <div class=\"vertical-bridge-line\"></div>\r\n </div>\r\n }\r\n \r\n <!-- \uD83D\uDD39 Bottom Bridge Line -->\r\n <div class=\"horizontal-bridge-line\" #bottomBridgeLine></div>\r\n </div>\r\n </div>\r\n }\r\n \r\n @case (enumType.BranchCard) {\r\n <div class=\"wf-step-container wf-branch-card-container workflow-box\">\r\n <div class=\"step-wrapper branch-card-wrapper\" [class.fallback]=\"!!isInFallbackBranch\">\r\n <div class=\"arrow-down-container\">\r\n <div class=\"arrow-down\"></div>\r\n </div>\r\n \r\n <div class=\"step-header branch-header\" [class.edit-mode]=\"stepNameEditMode\" #branchHeader>\r\n @if (stepNameEditMode) {\r\n <div class=\"input-wrapper\">\r\n <input class=\"form-control\" (blur)=\"onInputBlur()\" [(ngModel)]=\"step.name\" #input>\r\n </div>\r\n } @else {\r\n <div class=\"step-name-wrapper branch-name-wrapper\">\r\n <div\r\n class=\"step-name branch-name\"\r\n [class.pointer]=\"!isInFallbackBranch\"\r\n (click)=\"switchToNameEditMode()\"\r\n #branchName>\r\n {{ step.name }}\r\n </div>\r\n \r\n @if (!!isInFallbackBranch) {\r\n <i class=\"ti-info-alt\"\r\n [appTooltip]=\"'This branch is created by default and will only be activated if none of the other branches can be executed.'\"\r\n [showAnyway]=\"true\" [position]=\"'above'\"></i>\r\n }\r\n </div>\r\n \r\n <div class=\"branch-priority\">Priority {{ branchPriority }}</div>\r\n <div class=\"step-delete branch-delete pointer\" (click)=\"onDeleteBranch(branchId)\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n }\r\n </div>\r\n \r\n <div class=\"step-set-config branch-set-condition\" [class.pointer]=\"!isInFallbackBranch\">\r\n @if (!!isInFallbackBranch) {\r\n <div class=\"branch-subtext fallback\"\r\n [appTooltip]=\"'If other branches are not met, the alternative branch will be executed'\"\r\n [showAnyway]=\"true\" [position]=\"'above'\">\r\n If other branches are not met, the alternative branch will be executed\r\n </div>\r\n } @else {\r\n <div class=\"step-subtext branch-subtext\" (click)=\"openConditionEditor()\">Set conditions</div>\r\n <div><i class=\"feather-chevron-right\"></i></div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n }\r\n \r\n @default() {\r\n <div class=\"wf-step-container workflow-box {{ step.type.toLowerCase() }}\">\r\n\r\n <div class=\"step-wrapper\">\r\n \r\n <div class=\"step-header\" [class.edit-mode]=\"stepNameEditMode\">\r\n @if (stepNameEditMode) {\r\n <div class=\"input-wrapper\">\r\n <input class=\"form-control\" (blur)=\"onInputBlur()\" [(ngModel)]=\"step.name\" #input>\r\n </div>\r\n } @else {\r\n <div class=\"step-name-wrapper\">\r\n <div\r\n class=\"step-name pointer\"\r\n (click)=\"switchToNameEditMode()\"\r\n #stepName>\r\n {{ step.name }}\r\n </div>\r\n </div>\r\n \r\n <div class=\"step-delete pointer\" (click)=\"onDeleteStep()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n }\r\n </div>\r\n \r\n <div class=\"step-set-config pointer\" (click)=\"openNoneBranchRelatedEditor()\">\r\n <div class=\"step-subtext\" [class.configurated]=\"!!step.config\">{{ step.label }}</div>\r\n <div><i class=\"feather-chevron-right\"></i></div>\r\n </div>\r\n </div>\r\n\r\n <!-- <strong>{{ step.type }}</strong>\r\n <div (click)=\"onLabelClicked()\">{{ step.label }}</div> -->\r\n </div>\r\n }\r\n}\r\n \r\n@if (step.type !== enumType.End) {\r\n <wf-bottom-v-insert\r\n [currentContext]=\"{ branchId: step.branchId, index: index + 1 }\"\r\n [currentStep]=\"step\"\r\n ></wf-bottom-v-insert>\r\n}\r\n ", styles: [".wf-workflow-canvas-container{--standard-connector-height: 90px;padding-top:50px;padding-bottom:50px;background-color:#f2f3f5}.wf-workflow-canvas-container .canvas{display:flex;flex-direction:column;align-items:center}.wf-workflow-canvas-container .step{text-align:center;position:relative}.workflow-box{width:220px;min-height:85px;max-height:100px;padding:0 4px 4px;box-shadow:0 0 4px #0000000d}.workflow-box.submit,.workflow-box.end{background-color:#a9b4cd}.workflow-box.approval{background-color:#f80}.workflow-box.cc{background-color:#3370ff}.workflow-box.handle{background-color:#935af6}.connector{font-size:24px;color:#888}.plus-btn{font-size:18px;background:#fff;border:1px solid #ccc;border-radius:9999px;width:28px;height:28px;cursor:pointer}.insert-menu{background:#fff;border:1px solid #ddd;border-radius:6px;padding:8px;margin-top:6px;box-shadow:0 2px 8px #0000001a;display:flex;flex-direction:column;gap:6px;z-index:10}.insert-menu div{cursor:pointer;font-size:14px;padding:2px 6px}.insert-menu .cancel{color:red}.branch-column{position:relative}.branch-column .branch-column-inner{width:100%;display:flex;flex-direction:column;align-items:center}.wf-branch-group-container,.wf-branch-group-container .branch-group{position:relative}.wf-branch-group-container .branch-group .branch-column{display:table-cell;min-width:220px;vertical-align:top;padding:0 12px}.wf-branch-group-container .branch-group .branch-column .vertical-bridge-line{position:absolute;width:2px;background-color:#d9d9d9;z-index:2;pointer-events:none}.wf-branch-group-container .branch-group .horizontal-bridge-line{position:absolute;height:2px;background-color:#d9d9d9;pointer-events:none;z-index:1}.wf-branch-group-container:after{content:\"\";display:block;position:absolute;height:2px;width:calc(100% - 244px);left:122px;bottom:102px}.branch-title{font-weight:700;font-size:14px;margin-bottom:8px}.branch-group-header{display:flex;justify-content:center;margin:12px 0}.add-branch-btn{position:absolute;top:0;width:175px;left:calc(50% - 87.5px);z-index:2;background:#fff;color:#0f172a;border:1px solid #ccc;padding:4px 12px;border-radius:9999px;font-weight:500;cursor:pointer;box-shadow:0 2px 4px #0000000f;text-wrap:nowrap}.workflow-box.submit{background-color:#e0f7fa;border-left:4px solid #00bcd4}.workflow-box.end{background-color:#ede7f6;border-left:4px solid #673ab7}.box.special{font-style:italic;opacity:.9}.bottom-v-container{min-height:65px;width:220px}.wf-bottom-v-insert-container{position:relative;display:flex;flex-direction:column;align-items:center;height:var(--standard-connector-height);width:100%;margin:0}.wf-bottom-v-insert-container .vertical-line{position:absolute;top:0;height:100%;width:2px;background-color:#d9d9d9;z-index:0}.wf-bottom-v-insert-container .plus-container{display:block;position:absolute;border-radius:50%;top:calc(var(--standard-connector-height) / 2 - 16px)}.wf-bottom-v-insert-container .plus-btn{width:32px;height:32px;border-radius:50%;border:none;background:#fff;color:#3b82f6;font-size:20px;box-shadow:.4rem 0 2rem #0000002e;cursor:pointer;display:flex;align-items:center;justify-content:center}.wf-bottom-v-insert-container .plus-btn:hover{background:#f0f8ff;box-shadow:0 0 0 4px #3b82f633}.wf-bottom-v-insert-container.shorter{height:calc(var(--standard-connector-height) - 15px)}.wf-bottom-v-insert-container.shorter .plus-container{display:block;position:absolute;top:calc((var(--standard-connector-height) - 18px) / 2 - 16px)}.wf-bottom-v-insert-container.insert-context .plus-container{outline:#2eb795 solid 2px}.add-branch-inline{position:relative;height:35px;margin-bottom:calc(var(--standard-connector-height) - 17.5px)}.arrow-down-container{display:block;position:absolute;z-index:1;bottom:0}.arrow-down-container .arrow-down{margin-top:5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid #d9d9d9}.branch-card-wrapper{position:relative}.branch-card-wrapper .arrow-down-container{top:-12px;left:calc(50% - 5px)}.wf-step-container .step-header{position:relative;display:flex;align-items:center;justify-content:space-between;height:43px;font-size:12px;border-bottom:1px solid #f6f6f7}.wf-step-container .step-header .input-wrapper{padding-top:4px}.wf-step-container .step-header .step-name-wrapper{display:flex;align-items:center;justify-content:flex-start;padding-right:8px}.wf-step-container .step-header .step-name-wrapper .step-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:140px;padding-left:4px}.wf-step-container .step-header .step-name-wrapper i{margin-left:2px}.wf-step-container .step-header .step-delete{color:gray;display:none}.wf-step-container .step-header .step-delete i{font-size:24px}.wf-step-container .step-header:hover .step-name-wrapper:after{content:\"\\e95a\";font-family:feather}.wf-step-container .step-header:hover .branch-priority{display:none}.wf-step-container .step-header:hover .step-delete,.wf-step-container .step-header.edit-mode{display:block}.wf-step-container .step-set-config{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;padding:7px 4px;font-size:14px;background-color:#fff;color:gray}.wf-step-container .step-set-config .step-subtext{width:100%;text-align:left}.wf-step-container .step-set-config .step-subtext.configurated{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container{background-color:#fff}.wf-step-container.wf-branch-card-container .branch-header{color:#2eb795;border-bottom:1px solid #f6f6f7}.wf-step-container.wf-branch-card-container .branch-header:before{content:\"\";display:block;position:absolute;height:var(--standard-connector-height);width:2px;background-color:#d9d9d9;left:50%;top:calc(var(--standard-connector-height) * -1)}.wf-step-container.wf-branch-card-container .branch-set-condition{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;color:#3e4759;padding:7px 4px;font-size:14px}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext{width:100%;text-align:left}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext.fallback{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header,.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-set-condition{color:gray}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header .branch-priority{padding-right:4px}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-priority{display:block}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-delete{display:none}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-name-wrapper:after{content:\"\"}\n"] }]
723
- }], propDecorators: { branchId: [{
724
- type: Input,
725
- args: [{ required: true }]
726
- }], step: [{
727
- type: Input,
728
- args: [{ required: true }]
729
- }], index: [{
730
- type: Input,
731
- args: [{ required: true }]
732
- }], branchPriority: [{
733
- type: Input,
734
- args: [{ required: true }]
735
- }], stepGroup: [{
736
- type: Input,
737
- args: [{ required: true }]
738
- }], conditionalBranches: [{
739
- type: Input
740
- }], grandParentSteps: [{
741
- type: Input
742
- }], isInFallbackBranch: [{
743
- type: Input
744
- }], branchHeader: [{
745
- type: ViewChild,
746
- args: ['branchHeader']
747
- }], branchName: [{
748
- type: ViewChild,
749
- args: ['branchName']
750
- }], input: [{
751
- type: ViewChild,
752
- args: ['input']
753
- }], branchGroupRef: [{
754
- type: ViewChild,
755
- args: ['branchGroup']
756
- }], topBridgeLineRef: [{
757
- type: ViewChild,
758
- args: ['topBridgeLine']
759
- }], bottomBridgeLineRef: [{
760
- type: ViewChild,
761
- args: ['bottomBridgeLine']
762
- }], branchColumnRefs: [{
763
- type: ViewChildren,
764
- args: ['branchColumn']
765
- }] } });
766
-
767
- class WfWorkflowCanvasComponent extends BaseComponent {
768
- constructor(mls) {
769
- super(mls);
770
- this.mls = mls;
771
- this.$container = viewChild('container');
772
- this.enumType = EnumWorkflowStepType;
773
- this.ROOT_BRANCH_ID = ROOT_BRANCH_ID;
774
- this.coreWorkflowService = inject(CoreWorkflowService);
775
- this.$steps = signal([]);
776
- this.insertIndex = null;
777
- effect(() => {
778
- this.$container()?.nativeElement.style.setProperty('--standard-connector-height', this.coreWorkflowService.standardConnectorHeight + 'px');
779
- });
780
- effect(() => {
781
- this.$steps.set(this.coreWorkflowService.$currentSteps());
782
- });
783
- }
784
- findBranchById(branchId, steps = this.$steps()) {
785
- for (const step of steps) {
786
- if (step.type === EnumWorkflowStepType.ConditionalBranch && step.branches) {
787
- // ✅ step.branches is now just an array
788
- const found = step.branches.find(b => b.id === branchId);
789
- if (found)
790
- return found;
791
- // 🔁 Recurse into steps of each branch
792
- for (const branch of step.branches) {
793
- const deep = this.findBranchById(branchId, branch.steps);
794
- if (deep)
795
- return deep;
796
- }
797
- }
798
- }
799
- return undefined;
800
- }
801
- safeInsertStep(branchId, index, newStep) {
802
- if (branchId === null || branchId === ROOT_BRANCH_ID) {
803
- this.$steps.update(steps => {
804
- steps.splice(index, 0, newStep);
805
- return steps;
806
- });
807
- return;
808
- }
809
- const branch = this.findBranchById(branchId);
810
- if (!branch) {
811
- console.warn(`❗ Cannot insert: Branch with ID "${branchId}" not found.`);
812
- return;
813
- }
814
- branch.steps.splice(index, 0, newStep);
815
- }
816
- insertStep(event) {
817
- const { type, index, branchId } = event;
818
- if (!branchId) {
819
- console.error(`insertStep error: without branchId`);
820
- return;
821
- }
822
- ;
823
- let newStep;
824
- switch (type) {
825
- case EnumWorkflowStepType.Approval:
826
- newStep = this.coreWorkflowService.createStep(type, branchId, 'Set approver');
827
- break;
828
- case EnumWorkflowStepType.CC:
829
- newStep = this.coreWorkflowService.createStep(type, branchId, 'Set cc recipients');
830
- break;
831
- case EnumWorkflowStepType.Handle:
832
- newStep = this.coreWorkflowService.createStep(type, branchId, 'Set handler');
833
- break;
834
- case EnumWorkflowStepType.ConditionalBranch:
835
- newStep = this.coreWorkflowService.createConditionalBranchStep(branchId);
836
- break;
837
- default:
838
- return;
839
- }
840
- this.safeInsertStep(branchId, index, newStep);
841
- this.coreWorkflowService.insertContext$.next(null);
842
- }
843
- showInsertInBranch(context) {
844
- this.coreWorkflowService.insertContext$.next(context);
845
- }
846
- insertIntoBranch(event) {
847
- const { branchId, type, index } = event;
848
- if (!branchId) {
849
- console.error(`insertStep error: missing branchId`);
850
- return;
851
- }
852
- // 🔍 Find the branch that matches the given ID
853
- const branch = this.findBranchById(branchId);
854
- if (!branch) {
855
- console.warn(`Branch not found: ${branchId}`);
856
- return;
857
- }
858
- let newStep;
859
- switch (type) {
860
- case EnumWorkflowStepType.Approval:
861
- newStep = this.coreWorkflowService.createStep(type, branchId, 'Set approver');
862
- break;
863
- case EnumWorkflowStepType.CC:
864
- newStep = this.coreWorkflowService.createStep(type, branchId, 'Set cc recipients');
865
- break;
866
- case EnumWorkflowStepType.Handle:
867
- newStep = this.coreWorkflowService.createStep(type, branchId, 'Set handler');
868
- break;
869
- case EnumWorkflowStepType.ConditionalBranch:
870
- newStep = this.coreWorkflowService.createConditionalBranchStep(branchId);
871
- break;
872
- default:
873
- console.warn(`Unsupported step type: ${type}`);
874
- return;
875
- }
876
- // ✅ Insert into the correct step list
877
- branch.steps.splice(index, 0, newStep);
878
- // 🧹 Clear insert state
879
- this.coreWorkflowService.insertContext$.next(null);
880
- }
881
- findStepRecursive(steps, targetId) {
882
- for (const step of steps) {
883
- if (step.id === targetId)
884
- return step;
885
- // ✅ New model: step.branches is directly an array
886
- if (step.type === EnumWorkflowStepType.ConditionalBranch && step.branches) {
887
- for (const branch of step.branches) {
888
- const found = this.findStepRecursive(branch.steps, targetId);
889
- if (found)
890
- return found;
891
- }
892
- }
893
- }
894
- return null;
895
- }
896
- addBranchToConditional(conditionalStepId) {
897
- const conditional = this.findStepRecursive(this.$steps(), conditionalStepId);
898
- if (!conditional || conditional.type !== EnumWorkflowStepType.ConditionalBranch || !conditional.branches)
899
- return;
900
- const branches = conditional.branches;
901
- const newBranchId = crypto.randomUUID();
902
- const name = `Condition ${branches.length}`;
903
- const newBranch = {
904
- id: newBranchId,
905
- name,
906
- priority: branches.length + 1,
907
- steps: [
908
- {
909
- id: `pseudo-${newBranchId}`,
910
- name: `pseudo-${newBranchId}`,
911
- branchId: newBranchId,
912
- type: EnumWorkflowStepType.BranchCard,
913
- label: name,
914
- isPseudo: true
915
- },
916
- {
917
- id: crypto.randomUUID(),
918
- name: `default-approval-${branches.length + 1}`,
919
- branchId: newBranchId,
920
- type: EnumWorkflowStepType.Approval,
921
- label: `Approve ${branches.length + 1}`
922
- }
923
- ]
924
- };
925
- const fallbackIndex = branches.findIndex(b => b.isFallback);
926
- if (fallbackIndex !== -1) {
927
- branches.splice(fallbackIndex, 0, newBranch);
928
- }
929
- else {
930
- branches.push(newBranch);
931
- }
932
- this.coreWorkflowService.autoReassignPriorities(branches);
933
- }
934
- deleteBranchGroup(stepId) {
935
- const step = this.$steps().find(s => s.id === stepId);
936
- if (step?.type === EnumWorkflowStepType.ConditionalBranch) {
937
- const index = this.$steps().indexOf(step);
938
- if (index !== -1) {
939
- this.$steps.update(steps => {
940
- steps.splice(index, 1);
941
- return steps;
942
- });
943
- }
944
- }
945
- }
946
- tempOnLabelClicked() {
947
- this.coreWorkflowService.$showStepConfig.set(true);
948
- }
949
- onInsert(event) {
950
- // Delegate to CoreWorkflowService or your working tree logic
951
- this.insertStep(event);
952
- this.clearInsertContext(); // clean up
953
- }
954
- clearInsertContext() {
955
- this.coreWorkflowService.insertContext$.next(null);
956
- }
957
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfWorkflowCanvasComponent, deps: [{ token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
958
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: WfWorkflowCanvasComponent, isStandalone: true, selector: "wf-workflow-canvas", viewQueries: [{ propertyName: "$container", first: true, predicate: ["container"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"wf-workflow-canvas-container\" #container>\r\n\r\n <div class=\"canvas\">\r\n\r\n @for (step of $steps(); track $index; let i = $index) {\r\n <div class=\"step\">\r\n <wf-node\r\n [branchId]=\"'root'\"\r\n [branchPriority]=\"1\"\r\n [step]=\"step\"\r\n [stepGroup]=\"$steps()\"\r\n [index]=\"i\"\r\n ></wf-node>\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!(coreWorkflowService.insertContext$ | async)) {\r\n <wf-insert-menu (insert)=\"insertStep($event)\"></wf-insert-menu>\r\n }\r\n\r\n <wf-step-config-shell></wf-step-config-shell>\r\n\r\n</div>\r\n\r\n\r\n<!-- <div class=\"wf-workflow-canvas-container\">\r\n\r\n <div class=\"canvas\">\r\n\r\n @for (step of coreWorkflowService.currentSteps$ | async; track $index; let i = $index) {\r\n <div class=\"step\">\r\n\r\n @if (step.type === enumType.ConditionalBranch && step.branches?.length) {\r\n <div class=\"add-branch-inline\">\r\n <button class=\"add-branch-btn\" (click)=\"addBranchToConditional(step.id)\">\r\n \uFF0B Add New Branch\r\n </button>\r\n </div>\r\n\r\n <wf-node\r\n [branchId]=\"'root'\"\r\n [branchPriority]=\"1\"\r\n [step]=\"step\"\r\n [index]=\"i\"\r\n ></wf-node>\r\n\r\n }\r\n @else {\r\n <wf-node\r\n [branchId]=\"'root'\"\r\n [branchPriority]=\"1\"\r\n [step]=\"step\"\r\n [index]=\"i\"\r\n ></wf-node>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!(coreWorkflowService.insertContext$ | async)) {\r\n <wf-insert-menu (insert)=\"insertStep($event)\"></wf-insert-menu>\r\n }\r\n\r\n <wf-step-config-shell></wf-step-config-shell>\r\n \r\n</div> -->\r\n", styles: [".wf-workflow-canvas-container{--standard-connector-height: 90px;padding-top:50px;padding-bottom:50px;background-color:#f2f3f5}.wf-workflow-canvas-container .canvas{display:flex;flex-direction:column;align-items:center}.wf-workflow-canvas-container .step{text-align:center;position:relative}.workflow-box{width:220px;min-height:85px;max-height:100px;padding:0 4px 4px;box-shadow:0 0 4px #0000000d}.workflow-box.submit,.workflow-box.end{background-color:#a9b4cd}.workflow-box.approval{background-color:#f80}.workflow-box.cc{background-color:#3370ff}.workflow-box.handle{background-color:#935af6}.connector{font-size:24px;color:#888}.plus-btn{font-size:18px;background:#fff;border:1px solid #ccc;border-radius:9999px;width:28px;height:28px;cursor:pointer}.insert-menu{background:#fff;border:1px solid #ddd;border-radius:6px;padding:8px;margin-top:6px;box-shadow:0 2px 8px #0000001a;display:flex;flex-direction:column;gap:6px;z-index:10}.insert-menu div{cursor:pointer;font-size:14px;padding:2px 6px}.insert-menu .cancel{color:red}.branch-column{position:relative}.branch-column .branch-column-inner{width:100%;display:flex;flex-direction:column;align-items:center}.wf-branch-group-container,.wf-branch-group-container .branch-group{position:relative}.wf-branch-group-container .branch-group .branch-column{display:table-cell;min-width:220px;vertical-align:top;padding:0 12px}.wf-branch-group-container .branch-group .branch-column .vertical-bridge-line{position:absolute;width:2px;background-color:#d9d9d9;z-index:2;pointer-events:none}.wf-branch-group-container .branch-group .horizontal-bridge-line{position:absolute;height:2px;background-color:#d9d9d9;pointer-events:none;z-index:1}.wf-branch-group-container:after{content:\"\";display:block;position:absolute;height:2px;width:calc(100% - 244px);left:122px;bottom:102px}.branch-title{font-weight:700;font-size:14px;margin-bottom:8px}.branch-group-header{display:flex;justify-content:center;margin:12px 0}.add-branch-btn{position:absolute;top:0;width:175px;left:calc(50% - 87.5px);z-index:2;background:#fff;color:#0f172a;border:1px solid #ccc;padding:4px 12px;border-radius:9999px;font-weight:500;cursor:pointer;box-shadow:0 2px 4px #0000000f;text-wrap:nowrap}.workflow-box.submit{background-color:#e0f7fa;border-left:4px solid #00bcd4}.workflow-box.end{background-color:#ede7f6;border-left:4px solid #673ab7}.box.special{font-style:italic;opacity:.9}.bottom-v-container{min-height:65px;width:220px}.wf-bottom-v-insert-container{position:relative;display:flex;flex-direction:column;align-items:center;height:var(--standard-connector-height);width:100%;margin:0}.wf-bottom-v-insert-container .vertical-line{position:absolute;top:0;height:100%;width:2px;background-color:#d9d9d9;z-index:0}.wf-bottom-v-insert-container .plus-container{display:block;position:absolute;border-radius:50%;top:calc(var(--standard-connector-height) / 2 - 16px)}.wf-bottom-v-insert-container .plus-btn{width:32px;height:32px;border-radius:50%;border:none;background:#fff;color:#3b82f6;font-size:20px;box-shadow:.4rem 0 2rem #0000002e;cursor:pointer;display:flex;align-items:center;justify-content:center}.wf-bottom-v-insert-container .plus-btn:hover{background:#f0f8ff;box-shadow:0 0 0 4px #3b82f633}.wf-bottom-v-insert-container.shorter{height:calc(var(--standard-connector-height) - 15px)}.wf-bottom-v-insert-container.shorter .plus-container{display:block;position:absolute;top:calc((var(--standard-connector-height) - 18px) / 2 - 16px)}.wf-bottom-v-insert-container.insert-context .plus-container{outline:#2eb795 solid 2px}.add-branch-inline{position:relative;height:35px;margin-bottom:calc(var(--standard-connector-height) - 17.5px)}.arrow-down-container{display:block;position:absolute;z-index:1;bottom:0}.arrow-down-container .arrow-down{margin-top:5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid #d9d9d9}.branch-card-wrapper{position:relative}.branch-card-wrapper .arrow-down-container{top:-12px;left:calc(50% - 5px)}.wf-step-container .step-header{position:relative;display:flex;align-items:center;justify-content:space-between;height:43px;font-size:12px;border-bottom:1px solid #f6f6f7}.wf-step-container .step-header .input-wrapper{padding-top:4px}.wf-step-container .step-header .step-name-wrapper{display:flex;align-items:center;justify-content:flex-start;padding-right:8px}.wf-step-container .step-header .step-name-wrapper .step-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:140px;padding-left:4px}.wf-step-container .step-header .step-name-wrapper i{margin-left:2px}.wf-step-container .step-header .step-delete{color:gray;display:none}.wf-step-container .step-header .step-delete i{font-size:24px}.wf-step-container .step-header:hover .step-name-wrapper:after{content:\"\\e95a\";font-family:feather}.wf-step-container .step-header:hover .branch-priority{display:none}.wf-step-container .step-header:hover .step-delete,.wf-step-container .step-header.edit-mode{display:block}.wf-step-container .step-set-config{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;padding:7px 4px;font-size:14px;background-color:#fff;color:gray}.wf-step-container .step-set-config .step-subtext{width:100%;text-align:left}.wf-step-container .step-set-config .step-subtext.configurated{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container{background-color:#fff}.wf-step-container.wf-branch-card-container .branch-header{color:#2eb795;border-bottom:1px solid #f6f6f7}.wf-step-container.wf-branch-card-container .branch-header:before{content:\"\";display:block;position:absolute;height:var(--standard-connector-height);width:2px;background-color:#d9d9d9;left:50%;top:calc(var(--standard-connector-height) * -1)}.wf-step-container.wf-branch-card-container .branch-set-condition{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;color:#3e4759;padding:7px 4px;font-size:14px}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext{width:100%;text-align:left}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext.fallback{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header,.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-set-condition{color:gray}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header .branch-priority{padding-right:4px}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-priority{display:block}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-delete{display:none}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-name-wrapper:after{content:\"\"}\n"], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "component", type: WfInsertMenuComponent, selector: "wf-insert-menu", outputs: ["insert"] }, { kind: "component", type: WfStepConfigShellComponent, selector: "wf-step-config-shell" }, { kind: "component", type: WfNodeComponent, selector: "wf-node", inputs: ["branchId", "step", "index", "branchPriority", "stepGroup", "conditionalBranches", "grandParentSteps", "isInFallbackBranch"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
959
- }
960
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfWorkflowCanvasComponent, decorators: [{
961
- type: Component,
962
- args: [{ selector: 'wf-workflow-canvas', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
963
- AsyncPipe,
964
- NgTemplateOutlet,
965
- LowerCasePipe,
966
- WfInsertMenuComponent,
967
- WfBottomVInsertComponent,
968
- WfInsertMenuComponent,
969
- WfStepConfigShellComponent,
970
- WfNodeComponent
971
- ], template: "<div class=\"wf-workflow-canvas-container\" #container>\r\n\r\n <div class=\"canvas\">\r\n\r\n @for (step of $steps(); track $index; let i = $index) {\r\n <div class=\"step\">\r\n <wf-node\r\n [branchId]=\"'root'\"\r\n [branchPriority]=\"1\"\r\n [step]=\"step\"\r\n [stepGroup]=\"$steps()\"\r\n [index]=\"i\"\r\n ></wf-node>\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!(coreWorkflowService.insertContext$ | async)) {\r\n <wf-insert-menu (insert)=\"insertStep($event)\"></wf-insert-menu>\r\n }\r\n\r\n <wf-step-config-shell></wf-step-config-shell>\r\n\r\n</div>\r\n\r\n\r\n<!-- <div class=\"wf-workflow-canvas-container\">\r\n\r\n <div class=\"canvas\">\r\n\r\n @for (step of coreWorkflowService.currentSteps$ | async; track $index; let i = $index) {\r\n <div class=\"step\">\r\n\r\n @if (step.type === enumType.ConditionalBranch && step.branches?.length) {\r\n <div class=\"add-branch-inline\">\r\n <button class=\"add-branch-btn\" (click)=\"addBranchToConditional(step.id)\">\r\n \uFF0B Add New Branch\r\n </button>\r\n </div>\r\n\r\n <wf-node\r\n [branchId]=\"'root'\"\r\n [branchPriority]=\"1\"\r\n [step]=\"step\"\r\n [index]=\"i\"\r\n ></wf-node>\r\n\r\n }\r\n @else {\r\n <wf-node\r\n [branchId]=\"'root'\"\r\n [branchPriority]=\"1\"\r\n [step]=\"step\"\r\n [index]=\"i\"\r\n ></wf-node>\r\n }\r\n\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n @if (!!(coreWorkflowService.insertContext$ | async)) {\r\n <wf-insert-menu (insert)=\"insertStep($event)\"></wf-insert-menu>\r\n }\r\n\r\n <wf-step-config-shell></wf-step-config-shell>\r\n \r\n</div> -->\r\n", styles: [".wf-workflow-canvas-container{--standard-connector-height: 90px;padding-top:50px;padding-bottom:50px;background-color:#f2f3f5}.wf-workflow-canvas-container .canvas{display:flex;flex-direction:column;align-items:center}.wf-workflow-canvas-container .step{text-align:center;position:relative}.workflow-box{width:220px;min-height:85px;max-height:100px;padding:0 4px 4px;box-shadow:0 0 4px #0000000d}.workflow-box.submit,.workflow-box.end{background-color:#a9b4cd}.workflow-box.approval{background-color:#f80}.workflow-box.cc{background-color:#3370ff}.workflow-box.handle{background-color:#935af6}.connector{font-size:24px;color:#888}.plus-btn{font-size:18px;background:#fff;border:1px solid #ccc;border-radius:9999px;width:28px;height:28px;cursor:pointer}.insert-menu{background:#fff;border:1px solid #ddd;border-radius:6px;padding:8px;margin-top:6px;box-shadow:0 2px 8px #0000001a;display:flex;flex-direction:column;gap:6px;z-index:10}.insert-menu div{cursor:pointer;font-size:14px;padding:2px 6px}.insert-menu .cancel{color:red}.branch-column{position:relative}.branch-column .branch-column-inner{width:100%;display:flex;flex-direction:column;align-items:center}.wf-branch-group-container,.wf-branch-group-container .branch-group{position:relative}.wf-branch-group-container .branch-group .branch-column{display:table-cell;min-width:220px;vertical-align:top;padding:0 12px}.wf-branch-group-container .branch-group .branch-column .vertical-bridge-line{position:absolute;width:2px;background-color:#d9d9d9;z-index:2;pointer-events:none}.wf-branch-group-container .branch-group .horizontal-bridge-line{position:absolute;height:2px;background-color:#d9d9d9;pointer-events:none;z-index:1}.wf-branch-group-container:after{content:\"\";display:block;position:absolute;height:2px;width:calc(100% - 244px);left:122px;bottom:102px}.branch-title{font-weight:700;font-size:14px;margin-bottom:8px}.branch-group-header{display:flex;justify-content:center;margin:12px 0}.add-branch-btn{position:absolute;top:0;width:175px;left:calc(50% - 87.5px);z-index:2;background:#fff;color:#0f172a;border:1px solid #ccc;padding:4px 12px;border-radius:9999px;font-weight:500;cursor:pointer;box-shadow:0 2px 4px #0000000f;text-wrap:nowrap}.workflow-box.submit{background-color:#e0f7fa;border-left:4px solid #00bcd4}.workflow-box.end{background-color:#ede7f6;border-left:4px solid #673ab7}.box.special{font-style:italic;opacity:.9}.bottom-v-container{min-height:65px;width:220px}.wf-bottom-v-insert-container{position:relative;display:flex;flex-direction:column;align-items:center;height:var(--standard-connector-height);width:100%;margin:0}.wf-bottom-v-insert-container .vertical-line{position:absolute;top:0;height:100%;width:2px;background-color:#d9d9d9;z-index:0}.wf-bottom-v-insert-container .plus-container{display:block;position:absolute;border-radius:50%;top:calc(var(--standard-connector-height) / 2 - 16px)}.wf-bottom-v-insert-container .plus-btn{width:32px;height:32px;border-radius:50%;border:none;background:#fff;color:#3b82f6;font-size:20px;box-shadow:.4rem 0 2rem #0000002e;cursor:pointer;display:flex;align-items:center;justify-content:center}.wf-bottom-v-insert-container .plus-btn:hover{background:#f0f8ff;box-shadow:0 0 0 4px #3b82f633}.wf-bottom-v-insert-container.shorter{height:calc(var(--standard-connector-height) - 15px)}.wf-bottom-v-insert-container.shorter .plus-container{display:block;position:absolute;top:calc((var(--standard-connector-height) - 18px) / 2 - 16px)}.wf-bottom-v-insert-container.insert-context .plus-container{outline:#2eb795 solid 2px}.add-branch-inline{position:relative;height:35px;margin-bottom:calc(var(--standard-connector-height) - 17.5px)}.arrow-down-container{display:block;position:absolute;z-index:1;bottom:0}.arrow-down-container .arrow-down{margin-top:5px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:8px solid #d9d9d9}.branch-card-wrapper{position:relative}.branch-card-wrapper .arrow-down-container{top:-12px;left:calc(50% - 5px)}.wf-step-container .step-header{position:relative;display:flex;align-items:center;justify-content:space-between;height:43px;font-size:12px;border-bottom:1px solid #f6f6f7}.wf-step-container .step-header .input-wrapper{padding-top:4px}.wf-step-container .step-header .step-name-wrapper{display:flex;align-items:center;justify-content:flex-start;padding-right:8px}.wf-step-container .step-header .step-name-wrapper .step-name{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:140px;padding-left:4px}.wf-step-container .step-header .step-name-wrapper i{margin-left:2px}.wf-step-container .step-header .step-delete{color:gray;display:none}.wf-step-container .step-header .step-delete i{font-size:24px}.wf-step-container .step-header:hover .step-name-wrapper:after{content:\"\\e95a\";font-family:feather}.wf-step-container .step-header:hover .branch-priority{display:none}.wf-step-container .step-header:hover .step-delete,.wf-step-container .step-header.edit-mode{display:block}.wf-step-container .step-set-config{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;padding:7px 4px;font-size:14px;background-color:#fff;color:gray}.wf-step-container .step-set-config .step-subtext{width:100%;text-align:left}.wf-step-container .step-set-config .step-subtext.configurated{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container{background-color:#fff}.wf-step-container.wf-branch-card-container .branch-header{color:#2eb795;border-bottom:1px solid #f6f6f7}.wf-step-container.wf-branch-card-container .branch-header:before{content:\"\";display:block;position:absolute;height:var(--standard-connector-height);width:2px;background-color:#d9d9d9;left:50%;top:calc(var(--standard-connector-height) * -1)}.wf-step-container.wf-branch-card-container .branch-set-condition{display:flex;align-items:center;justify-content:space-between;min-height:38px;max-height:56px;color:#3e4759;padding:7px 4px;font-size:14px}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext{width:100%;text-align:left}.wf-step-container.wf-branch-card-container .branch-set-condition .branch-subtext.fallback{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:pre-line;word-break:break-word;line-height:1.5em;max-height:3em;overflow:hidden;cursor:default}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header,.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-set-condition{color:gray}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header .branch-priority{padding-right:4px}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-priority{display:block}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-delete{display:none}.wf-step-container.wf-branch-card-container .branch-card-wrapper.fallback .branch-header:hover .branch-name-wrapper:after{content:\"\"}\n"] }]
972
- }], ctorParameters: () => [{ type: MultiLanguageService }] });
973
-
974
- class WfProcessDesignComponent {
975
- constructor(coreWorkflowService) {
976
- this.coreWorkflowService = coreWorkflowService;
977
- }
978
- onCorePageHeaderButtonClicked(e) {
979
- if (e.code === EnumCoreButtonVNSCode.HEADER_RESET) {
980
- this.coreWorkflowService.$currentSteps.set([
981
- {
982
- id: 'submit',
983
- name: 'submit',
984
- branchId: 'root',
985
- type: EnumWorkflowStepType.Submit,
986
- label: 'Submitted by: All members',
987
- },
988
- {
989
- id: 'brancher',
990
- name: 'brancher',
991
- branchId: 'root',
992
- type: EnumWorkflowStepType.ConditionalBranch,
993
- label: 'Set branch logic',
994
- branches: [
995
- {
996
- id: 'b1',
997
- name: 'Condition 1',
998
- priority: 1,
999
- steps: [
1000
- {
1001
- id: 'pseudo-b1',
1002
- name: 'pseudo-b1',
1003
- branchId: 'b1',
1004
- type: EnumWorkflowStepType.BranchCard,
1005
- label: 'Condition 1',
1006
- isPseudo: true
1007
- },
1008
- {
1009
- id: 'a1',
1010
- name: 'a1',
1011
- branchId: 'b1',
1012
- type: EnumWorkflowStepType.Approval,
1013
- label: 'Approve A'
1014
- }
1015
- ]
1016
- },
1017
- {
1018
- id: 'b2',
1019
- isFallback: true,
1020
- name: 'Fallback',
1021
- priority: 2,
1022
- steps: [
1023
- {
1024
- id: 'pseudo-b2',
1025
- name: 'Fallback-b2',
1026
- branchId: 'b2',
1027
- type: EnumWorkflowStepType.BranchCard,
1028
- label: '[Fallback Branch]',
1029
- config: { isFallback: true },
1030
- isInFallbackBranch: true,
1031
- isPseudo: true
1032
- },
1033
- {
1034
- id: 'a2',
1035
- name: 'a2',
1036
- branchId: 'b2',
1037
- type: EnumWorkflowStepType.Approval,
1038
- label: 'Fallback Approver',
1039
- isInFallbackBranch: true
1040
- }
1041
- ]
1042
- }
1043
- ]
1044
- },
1045
- {
1046
- id: 'end',
1047
- name: 'end',
1048
- branchId: 'root',
1049
- type: EnumWorkflowStepType.End,
1050
- label: 'Workflow completed',
1051
- }
1052
- ]);
1053
- }
1054
- }
1055
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfProcessDesignComponent, deps: [{ token: CoreWorkflowService }], target: i0.ɵɵFactoryTarget.Component }); }
1056
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: WfProcessDesignComponent, isStandalone: true, selector: "wf-process-design", ngImport: i0, template: "<div class=\"wf-process-design-container\">\r\n <core-page-header title=\"UI.COMPONENT_TITLE.WORKFLOW_LIST\" (buttonClick)=\"onCorePageHeaderButtonClicked($event)\"></core-page-header>\r\n @if (!!coreWorkflowService.$currentFlow()) {\r\n <p>{{ coreWorkflowService.$currentFlow()!.name + ' > Process Design' }}</p>\r\n <wf-workflow-canvas></wf-workflow-canvas>\r\n }\r\n</div>", styles: [""], dependencies: [{ kind: "component", type: CorePageHeaderComponent, selector: "core-page-header", inputs: ["instanceNumber", "shownItems", "title", "hideButtonGroup"], outputs: ["buttonClick"] }, { kind: "component", type: WfWorkflowCanvasComponent, selector: "wf-workflow-canvas" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1057
- }
1058
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: WfProcessDesignComponent, decorators: [{
1059
- type: Component,
1060
- args: [{ selector: 'wf-process-design', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1061
- AsyncPipe,
1062
- CorePageHeaderComponent,
1063
- WfWorkflowCanvasComponent
1064
- ], template: "<div class=\"wf-process-design-container\">\r\n <core-page-header title=\"UI.COMPONENT_TITLE.WORKFLOW_LIST\" (buttonClick)=\"onCorePageHeaderButtonClicked($event)\"></core-page-header>\r\n @if (!!coreWorkflowService.$currentFlow()) {\r\n <p>{{ coreWorkflowService.$currentFlow()!.name + ' > Process Design' }}</p>\r\n <wf-workflow-canvas></wf-workflow-canvas>\r\n }\r\n</div>" }]
1065
- }], ctorParameters: () => [{ type: CoreWorkflowService }] });
1066
-
1067
- export { WfProcessDesignComponent };
1068
- //# sourceMappingURL=ngx-histaff-alpha-wf-process-design.component-D9Ba7Fkx.mjs.map