ngx-histaff-alpha 5.9.1 → 5.9.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 (62) hide show
  1. package/fesm2022/{ngx-histaff-alpha-ai-hint-for-table.component-ClNRMk6B.mjs → ngx-histaff-alpha-ai-hint-for-table.component-BzUUTmoN.mjs} +3 -3
  2. package/fesm2022/{ngx-histaff-alpha-ai-hint-for-table.component-ClNRMk6B.mjs.map → ngx-histaff-alpha-ai-hint-for-table.component-BzUUTmoN.mjs.map} +1 -1
  3. package/fesm2022/ngx-histaff-alpha-core-form-design.component-C_yKnqtf.mjs +3256 -0
  4. package/fesm2022/ngx-histaff-alpha-core-form-design.component-C_yKnqtf.mjs.map +1 -0
  5. package/fesm2022/{ngx-histaff-alpha-core-sticker-collection.component-ZJ29hnW7.mjs → ngx-histaff-alpha-core-sticker-collection.component-Bl-aiwIo.mjs} +3 -3
  6. package/fesm2022/{ngx-histaff-alpha-core-sticker-collection.component-ZJ29hnW7.mjs.map → ngx-histaff-alpha-core-sticker-collection.component-Bl-aiwIo.mjs.map} +1 -1
  7. package/fesm2022/{ngx-histaff-alpha-core-toast-loading.component-D4lPsJ_K.mjs → ngx-histaff-alpha-core-toast-loading.component-B74LCLn2.mjs} +2 -2
  8. package/fesm2022/{ngx-histaff-alpha-core-toast-loading.component-D4lPsJ_K.mjs.map → ngx-histaff-alpha-core-toast-loading.component-B74LCLn2.mjs.map} +1 -1
  9. package/fesm2022/{ngx-histaff-alpha-core-workflow-consume.component-Dxy4PssU.mjs → ngx-histaff-alpha-core-workflow-consume.component-BDBQQUAT.mjs} +2 -2
  10. package/fesm2022/{ngx-histaff-alpha-core-workflow-consume.component-Dxy4PssU.mjs.map → ngx-histaff-alpha-core-workflow-consume.component-BDBQQUAT.mjs.map} +1 -1
  11. package/fesm2022/{ngx-histaff-alpha-db-settings.component-ovw3ShzY.mjs → ngx-histaff-alpha-db-settings.component-BVIb2eWg.mjs} +5 -5
  12. package/fesm2022/{ngx-histaff-alpha-db-settings.component-ovw3ShzY.mjs.map → ngx-histaff-alpha-db-settings.component-BVIb2eWg.mjs.map} +1 -1
  13. package/fesm2022/{ngx-histaff-alpha-design-wrapper.component-Dd5UoJX1.mjs → ngx-histaff-alpha-design-wrapper.component-KuubA0Jn.mjs} +11 -9
  14. package/fesm2022/ngx-histaff-alpha-design-wrapper.component-KuubA0Jn.mjs.map +1 -0
  15. package/fesm2022/{ngx-histaff-alpha-design-wrapper.route-DLdFwwhp.mjs → ngx-histaff-alpha-design-wrapper.route-CSmaOUHg.mjs} +5 -5
  16. package/fesm2022/{ngx-histaff-alpha-design-wrapper.route-DLdFwwhp.mjs.map → ngx-histaff-alpha-design-wrapper.route-CSmaOUHg.mjs.map} +1 -1
  17. package/fesm2022/{ngx-histaff-alpha-form-array-props.component-DkAM9Uk9.mjs → ngx-histaff-alpha-form-array-props.component-DuM5ZMkG.mjs} +5 -8
  18. package/fesm2022/ngx-histaff-alpha-form-array-props.component-DuM5ZMkG.mjs.map +1 -0
  19. package/fesm2022/{ngx-histaff-alpha-live-form.component-BMCAth2_.mjs → ngx-histaff-alpha-live-form.component-D7oAY8-L.mjs} +17 -23
  20. package/fesm2022/ngx-histaff-alpha-live-form.component-D7oAY8-L.mjs.map +1 -0
  21. package/fesm2022/{ngx-histaff-alpha-ngx-histaff-alpha-CkvGEG39.mjs → ngx-histaff-alpha-ngx-histaff-alpha-Dh4tWGKT.mjs} +1180 -391
  22. package/fesm2022/ngx-histaff-alpha-ngx-histaff-alpha-Dh4tWGKT.mjs.map +1 -0
  23. package/fesm2022/{ngx-histaff-alpha-tracker-studio.component-CeB-VuEP.mjs → ngx-histaff-alpha-tracker-studio.component-D77fag1W.mjs} +2 -2
  24. package/fesm2022/{ngx-histaff-alpha-tracker-studio.component-CeB-VuEP.mjs.map → ngx-histaff-alpha-tracker-studio.component-D77fag1W.mjs.map} +1 -1
  25. package/fesm2022/{ngx-histaff-alpha-wf-form-assign.component-CO09ZkTB.mjs → ngx-histaff-alpha-wf-form-assign.component-CixDiq8u.mjs} +2 -2
  26. package/fesm2022/{ngx-histaff-alpha-wf-form-assign.component-CO09ZkTB.mjs.map → ngx-histaff-alpha-wf-form-assign.component-CixDiq8u.mjs.map} +1 -1
  27. package/fesm2022/ngx-histaff-alpha-wf-instance-status.component-oBkeUjfP.mjs +177 -0
  28. package/fesm2022/ngx-histaff-alpha-wf-instance-status.component-oBkeUjfP.mjs.map +1 -0
  29. package/fesm2022/{ngx-histaff-alpha-wf-instance-step-react.component-DRUYdQY3.mjs → ngx-histaff-alpha-wf-instance-step-react.component-D53ZEW27.mjs} +3 -3
  30. package/fesm2022/{ngx-histaff-alpha-wf-instance-step-react.component-DRUYdQY3.mjs.map → ngx-histaff-alpha-wf-instance-step-react.component-D53ZEW27.mjs.map} +1 -1
  31. package/fesm2022/ngx-histaff-alpha.mjs +1 -1
  32. package/lib/app/directives/html-tooltip.directive.d.ts +14 -4
  33. package/lib/app/libraries/core-button-group-vns/core-button-group-vns/EnumCoreButtonVNSCode.d.ts +3 -0
  34. package/lib/app/libraries/core-control/core-control/core-control.component.d.ts +1 -0
  35. package/lib/app/libraries/core-form/core-form/core-form.component.d.ts +1 -0
  36. package/lib/app/libraries/core-form/core-form/enum-interfaces.d.ts +1 -1
  37. package/lib/app/libraries/core-form/core-form-array/core-form-array.component.d.ts +8 -9
  38. package/lib/app/libraries/core-form-design/core-form-array-layout-editor/core-form-array-layout-editor.component.d.ts +14 -13
  39. package/lib/app/libraries/core-form-design/core-form-design-monitor/core-form-design-monitor.component.d.ts +35 -0
  40. package/lib/app/libraries/core-form-design/core-form-design.component.d.ts +5 -23
  41. package/lib/app/libraries/core-form-design/core-form-design.service.d.ts +41 -14
  42. package/lib/app/libraries/core-form-design/core-form-group-editor.component.d.ts +104 -0
  43. package/lib/app/libraries/core-form-design/field-setting/base-props/base-props.component.d.ts +10 -4
  44. package/lib/app/libraries/core-form-design/field-setting/calculated-props/calculated-props.component.d.ts +0 -1
  45. package/lib/app/libraries/core-form-design/field-setting/field-setting.component.d.ts +4 -3
  46. package/lib/app/libraries/core-form-design/interfaces.d.ts +3 -1
  47. package/lib/app/libraries/core-form-design/json-safe.pipe.d.ts +11 -0
  48. package/lib/app/libraries/core-form-design/live-form/live-form.component.d.ts +1 -2
  49. package/lib/app/libraries/core-form-design/props-host/props-host.component.d.ts +2 -1
  50. package/lib/app/libraries/core-workflow-builder/core-workflow.service.d.ts +1 -0
  51. package/lib/app/libraries/core-workflow-builder/wf-instance-status/wf-instance-status.component.d.ts +3 -0
  52. package/lib/app/services/json.service.d.ts +5 -1
  53. package/lib/app/services/organization.service.d.ts +3 -1
  54. package/package.json +1 -1
  55. package/fesm2022/ngx-histaff-alpha-core-form-design.component-KQsI4L2g.mjs +0 -2437
  56. package/fesm2022/ngx-histaff-alpha-core-form-design.component-KQsI4L2g.mjs.map +0 -1
  57. package/fesm2022/ngx-histaff-alpha-design-wrapper.component-Dd5UoJX1.mjs.map +0 -1
  58. package/fesm2022/ngx-histaff-alpha-form-array-props.component-DkAM9Uk9.mjs.map +0 -1
  59. package/fesm2022/ngx-histaff-alpha-live-form.component-BMCAth2_.mjs.map +0 -1
  60. package/fesm2022/ngx-histaff-alpha-ngx-histaff-alpha-CkvGEG39.mjs.map +0 -1
  61. package/fesm2022/ngx-histaff-alpha-wf-instance-status.component-DQfVNySE.mjs +0 -153
  62. package/fesm2022/ngx-histaff-alpha-wf-instance-status.component-DQfVNySE.mjs.map +0 -1
@@ -1,2437 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { inject, ChangeDetectorRef, Component, signal, effect, HostListener, ChangeDetectionStrategy, Injectable, computed, viewChild, ViewContainerRef, Input, EventEmitter, Output, Renderer2, input, isDevMode } from '@angular/core';
3
- import { trigger, state, transition, style, animate } from '@angular/animations';
4
- import { n as CoreFormDesignService, b as CoreWorkflowService, B as BaseEditComponent, i as AlertService, L as AppConfigService, O as EnumCorePageEditMode, P as EnumCoreButtonVNSCode, R as READONLY_WORKFLOW_FIELDS, Q as noneAutoClosedAlertOptions, p as DialogService, M as MultiLanguageService, C as CorePageHeaderComponent, U as CoreFormComponent, V as CoreButtonGroupVnsComponent, T as TranslatePipe, E as EnumFormBaseContolType, e as BaseComponent, W as EnumCoreTablePipeType, J as CoreCheckboxComponent, r as CoreDropdownComponent, g as TooltipDirective, G as GptService, l as alertOptions, y as CoreRadioGroupComponent, X as HtmlTooltipDirective, c as EnumCoreFormControlSeekerSourceType, Y as CoreControlNoFormArrayComponent, Z as EnumFormDesignMode, q as DomService, K as JsonService, z as ApplicationHelpService, H as HotKeysDirective, _ as CoreControlComponent, j as TableCellPipe, s as CoreChecklistComponent, u as CoreFormControlSeekerComponent, $ as CoreAttachmentComponent, t as CoreDatePickerComponent, a0 as CoreMonthSelectorComponent, v as CoreCurrencyInputComponent } from './ngx-histaff-alpha-ngx-histaff-alpha-CkvGEG39.mjs';
5
- import * as i1 from '@angular/forms';
6
- import { FormsModule, FormGroup, FormControl, FormArray, Validators, ReactiveFormsModule } from '@angular/forms';
7
- import { NgStyle, JsonPipe, UpperCasePipe, AsyncPipe, NgTemplateOutlet } from '@angular/common';
8
- import { BehaviorSubject, catchError, of, filter, distinctUntilChanged, tap, switchMap } from 'rxjs';
9
- import { Router, ActivatedRoute } from '@angular/router';
10
- import { CoreStickerCollectionComponent } from './ngx-histaff-alpha-core-sticker-collection.component-ZJ29hnW7.mjs';
11
- import { D as DbService, C as CoreToastLoadingComponent } from './ngx-histaff-alpha-core-toast-loading.component-D4lPsJ_K.mjs';
12
- import { EnumTranslateKey } from 'alpha-global-constants';
13
- import { L as LiveFormComponent } from './ngx-histaff-alpha-live-form.component-BMCAth2_.mjs';
14
-
15
- const slideFromTopFadeIn = trigger('slideFromTopFadeIn', [
16
- state('in', style({ opacity: 1, transform: 'translateY(0)' })),
17
- state('out', style({ opacity: 0, transform: 'translateY(-50vh)' })),
18
- transition('out => in', [
19
- animate('200ms ease-out')
20
- ]),
21
- transition('in => out', [
22
- animate('150ms ease-in')
23
- ])
24
- ]);
25
-
26
- class SaveLiveJsonComponent {
27
- constructor() {
28
- this.fds = inject(CoreFormDesignService);
29
- this.cdr = inject(ChangeDetectorRef);
30
- this.wfs = inject(CoreWorkflowService);
31
- }
32
- copyToClipboard() {
33
- navigator.clipboard.writeText(this.fds.$saveLiveJson());
34
- }
35
- download() {
36
- const blob = new Blob([this.fds.$saveLiveJson()], { type: 'application/json' });
37
- const url = URL.createObjectURL(blob);
38
- const link = document.createElement('a');
39
- link.href = url;
40
- link.download = `${this.fds.$afInstance().name || 'form'}.json`;
41
- link.click();
42
- }
43
- ngAfterViewInit() {
44
- setTimeout(() => this.cdr.markForCheck());
45
- }
46
- ngOnDestroy() {
47
- this.wfs.$initialFormDesignJson.set('{}');
48
- }
49
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SaveLiveJsonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
50
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: SaveLiveJsonComponent, isStandalone: true, selector: "save-live-json", ngImport: i0, template: "<pre class=\"json-preview\">{{ fds.$saveLiveJson() }}</pre>", styles: [".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;width:390px;height:calc(100vh - 125px);margin:0}\n"] }); }
51
- }
52
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SaveLiveJsonComponent, decorators: [{
53
- type: Component,
54
- args: [{ selector: 'save-live-json', imports: [], template: "<pre class=\"json-preview\">{{ fds.$saveLiveJson() }}</pre>", styles: [".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;width:390px;height:calc(100vh - 125px);margin:0}\n"] }]
55
- }] });
56
-
57
- class FormMetadataComponent extends BaseEditComponent {
58
- onEscape() {
59
- this.coreFormDesignService.$showFormMetadata.set(false);
60
- }
61
- onWindowClick(_) {
62
- /*
63
- Trigger What Happens
64
- 🖱️ First Click: Opens checklist overlay, but Angular hasn’t re-checked the DOM yet → markForCheck() is called, but view not updated yet
65
- 🖱️ Second Click: Now DOM is updated, click is registered inside the actual rendered checklist, interaction works
66
- */
67
- //This lets Angular finish updating the DOM before running change detection.
68
- setTimeout(() => this.cdr.markForCheck());
69
- }
70
- constructor(dialogService, mls) {
71
- super(dialogService);
72
- this.dialogService = dialogService;
73
- this.mls = mls;
74
- this.coreFormDesignService = inject(CoreFormDesignService);
75
- this.wfs = inject(CoreWorkflowService);
76
- this.cdr = inject(ChangeDetectorRef);
77
- this.alertService = inject(AlertService);
78
- this.router = inject(Router);
79
- this.appConfigService = inject(AppConfigService);
80
- this.form = this.coreFormDesignService.formMetadata;
81
- this.$loading = signal(false);
82
- this.mode$ = new BehaviorSubject(EnumCorePageEditMode.UPDATE);
83
- this.customButtonChecklistOptions$ = this.coreFormDesignService.formMetadataCustomButtonChecklistOptions$;
84
- this.$sections = this.coreFormDesignService.$formMetadataSections;
85
- this.$isInWorkflowDesign = this.coreFormDesignService.$isInWorkflowDesign;
86
- this.customButtons = [
87
- EnumCoreButtonVNSCode.NONE_HEADER_SAVE,
88
- ];
89
- effect(() => {
90
- if (this.coreFormDesignService.$shouldPatchMetadataForm()) {
91
- this.patchFormFromInstance();
92
- this.coreFormDesignService.$shouldPatchMetadataForm.set(false); // ✅ reset
93
- }
94
- });
95
- effect(() => {
96
- const isInWorkflowDesign = this.$isInWorkflowDesign();
97
- if (isInWorkflowDesign) {
98
- READONLY_WORKFLOW_FIELDS.forEach(x => {
99
- const control = this.form.get(x);
100
- control?.disable();
101
- });
102
- }
103
- else {
104
- }
105
- });
106
- }
107
- patchFormFromInstance() {
108
- const instance = this.coreFormDesignService.$afInstance();
109
- this.form.patchValue({
110
- name: instance.name,
111
- captionCode: instance.captionCode,
112
- entityTable: instance.entityTable ?? '',
113
- submitApi: instance.submitApi,
114
- postSubmitRoute: instance.postSubmitRoute ?? '',
115
- postCancelRoute: instance.postCancelRoute ?? '',
116
- normalMode: instance.normalMode ?? false,
117
- autoGetByIdOff: instance.autoGetByIdOff ?? false,
118
- hasIdOfStringType: instance.hasIdOfStringType ?? false,
119
- customFormButtonItems: instance.customFormButtonItems ?? [],
120
- crudCreate: instance.crud?.c ?? '',
121
- crudRead: instance.crud?.r ?? '',
122
- crudUpdate: instance.crud?.u ?? '',
123
- crudDelete: instance.crud?.d ?? '',
124
- crudReadChildren: instance.crud?.rChildren ?? '',
125
- entityUniqueIndexesJson: JSON.stringify(instance.entityUniqueIndexes ?? [])
126
- });
127
- }
128
- onButtonClick(e) {
129
- if (e.code === EnumCoreButtonVNSCode.NONE_HEADER_SAVE) {
130
- if (this.form.valid) {
131
- this.$loading.set(true);
132
- const apiObject = this.coreFormDesignService.editMode$.value === EnumCorePageEditMode.CREATE ?
133
- this.coreFormDesignService.createFormInstance(this.coreFormDesignService.$afInstance()) :
134
- this.coreFormDesignService.updateFormInstance(this.coreFormDesignService.$afInstance());
135
- const apiObservable = apiObject.pipe(catchError(err => {
136
- this.$loading.set(false);
137
- const msg = err?.error?.message || // API-defined message
138
- err?.message || // Native JS or HttpErrorResponse
139
- err?.statusText || // Fallback
140
- 'An unknown error occurred.';
141
- this.alertService.error(msg, noneAutoClosedAlertOptions);
142
- return of(msg);
143
- }));
144
- apiObservable.subscribe(x => {
145
- this.$loading.set(false);
146
- if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
147
- this.coreFormDesignService.$showFormMetadata.set(false);
148
- }
149
- });
150
- }
151
- else {
152
- this.coreFormDesignService.formMetadataCheckError$.next(true);
153
- setTimeout(() => this.cdr.markForCheck());
154
- setTimeout(() => this.coreFormDesignService.formMetadataCheckError$.next(false), 5000);
155
- }
156
- }
157
- }
158
- onClose() {
159
- this.coreFormDesignService.$showFormMetadata.set(false);
160
- }
161
- onSave(e) {
162
- }
163
- onFormCreated(event) {
164
- const form = event.formGroup;
165
- form.get('normalMode')?.valueChanges.subscribe(x => {
166
- this.coreFormDesignService.$liveFormNormalMode.set(!!x);
167
- });
168
- form.get('customFormButtonItems')?.valueChanges.subscribe(x => {
169
- if (Array.isArray(x)) {
170
- this.coreFormDesignService.$customFormButtonItems.set(x);
171
- }
172
- else {
173
- this.coreFormDesignService.$customFormButtonItems.set(undefined);
174
- }
175
- });
176
- const widthField = form.get('width');
177
- if (!!widthField) {
178
- widthField.valueChanges.subscribe(width => {
179
- console.warn(`WAR [width$] changed explicitly:`, width);
180
- });
181
- }
182
- else {
183
- console.warn(`WAR [widthField] not found`);
184
- }
185
- form.valueChanges.subscribe(value => {
186
- console.warn('[width] from form.valueChanges', value?.width);
187
- const current = this.coreFormDesignService.$afInstance();
188
- const { crudCreate, crudRead, crudUpdate, crudDelete, crudReadChildren,
189
- // ES6 destructuring: Pull id out of the object and throw it away under the name _ignored — don’t include it in rest
190
- id: _ignored, ...rest } = value;
191
- const updatedCrud = {
192
- ...current.crud,
193
- ...(crudCreate !== undefined ? { c: crudCreate } : {}),
194
- ...(crudRead !== undefined ? { r: crudRead } : {}),
195
- ...(crudUpdate !== undefined ? { u: crudUpdate } : {}),
196
- ...(crudDelete !== undefined ? { d: crudDelete } : {}),
197
- ...(crudReadChildren !== undefined ? { rChildren: crudReadChildren } : {})
198
- };
199
- const next = {
200
- ...current,
201
- ...rest,
202
- width: rest.width ?? current.width, // That way, rogue undefined values can’t silently override valid ones.
203
- crud: updatedCrud
204
- };
205
- console.warn('[SET $afInstance width] from FormMetadataComponent', next.width);
206
- this.coreFormDesignService.$afInstance.set(next);
207
- });
208
- form.statusChanges.subscribe(status => {
209
- // Optional: Save status if you want to show error summary, disable save button, etc.
210
- this.formStatus = status; // string: 'VALID' | 'INVALID' | 'PENDING' | 'DISABLED'
211
- });
212
- this.form = form;
213
- }
214
- ngAfterViewInit() {
215
- // Defer to next tick to avoid ExpressionChangedAfterItHasBeenCheckedError
216
- this.$isInWorkflowDesign.set(this.router.url.includes('/workflow/design'));
217
- setTimeout(() => {
218
- const allButtons = Object.values(EnumCoreButtonVNSCode);
219
- const noneHeaderOptions = allButtons
220
- .filter(value => value.startsWith('NONE_HEADER_') && value !== 'NONE_HEADER_IMPORT_OPTION')
221
- .map(value => ({
222
- value,
223
- text: this.mls.trans(value),
224
- checked: false
225
- }));
226
- this.customButtonChecklistOptions$.next(noneHeaderOptions);
227
- const sections = this.coreFormDesignService.$placeholderSections();
228
- // 🔥 DO NOT READ this.$afInstance()
229
- this.coreFormDesignService.$afInstance.update(instance => ({
230
- ...instance,
231
- formDesignSections: sections
232
- }));
233
- // Inform Angular to re-check since values arrived late
234
- this.cdr.markForCheck();
235
- });
236
- }
237
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FormMetadataComponent, deps: [{ token: DialogService }, { token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
238
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: FormMetadataComponent, isStandalone: true, selector: "form-metadata", host: { listeners: { "document:keydown.escape": "onEscape($event)", "window:click": "onWindowClick($event)" } }, usesInheritance: true, ngImport: i0, template: "<div class=\"form-metadata-container\">\r\n\r\n <div class=\"metadata-body\">\r\n\r\n <div class=\"header-n-form\">\r\n\r\n @if (!$isInWorkflowDesign()) {\r\n\r\n <div class=\"h15\"></div>\r\n\r\n <div class=\"d-flex d-flex-start w-100 pr1rem\">\r\n <core-button-group-vns [showCaption]=\"true\" [forHeader]=\"false\" (buttonClick)=\"onButtonClick($event)\"\r\n [shownItems]=\"customButtons\" class=\"buttonGroupCustom\"></core-button-group-vns>\r\n </div>\r\n <div class=\"h15\"></div>\r\n\r\n <div class=\"header-wrapper\">\r\n <core-page-header [title]=\"'FORM OVERVIEW'\" [hideButtonGroup]=\"true\"></core-page-header>\r\n <div class=\"close-wrapper\" (click)=\"onClose()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </div>\r\n\r\n } \r\n\r\n\r\n\r\n <div class=\"af-instance\">\r\n\r\n <div class=\"af-instance-left\">\r\n <core-form \r\n [inputSections]=\"$sections()\" \r\n [width]=\"800\" \r\n [mode$]=\"mode$\" \r\n [checkError$]=\"coreFormDesignService.formMetadataCheckError$\"\r\n [hideButtons]=\"true\" \r\n [forceCreateNewForm]=\"true\"\r\n [hideDevSector]=\"!!$isInWorkflowDesign()\"\r\n (onFormCreated)=\"onFormCreated($event)\" />\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n @if (!$isInWorkflowDesign()) {\r\n <div class=\"af-instance-right\">\r\n <save-live-json></save-live-json>\r\n </div>\r\n }\r\n\r\n\r\n </div>\r\n\r\n</div>", styles: [".form-metadata-container .header-wrapper{padding:0 15px}.form-metadata-container .header-wrapper .close-wrapper{display:flex;position:absolute;right:7px;top:8px;width:24px;height:24px;color:#848484;cursor:pointer}.form-metadata-container .header-wrapper .close-wrapper i{font-size:24px}.form-metadata-container .af-instance{display:flex}.form-metadata-container .h15{height:15px!important}.form-metadata-container .pr1rem{padding-right:1rem}.form-metadata-container .metadata-body{display:flex;align-items:flex-start;justify-content:space-between}.form-metadata-container .af-instance-right{margin-top:45px;margin-right:15px}\n"], dependencies: [{ kind: "component", type: CorePageHeaderComponent, selector: "core-page-header", inputs: ["instanceNumber", "shownItems", "title", "hideButtonGroup", "htmlTooltipRef"], outputs: ["buttonClick"] }, { kind: "component", type: CoreFormComponent, selector: "core-form", inputs: ["formName", "width", "submitText", "leftInputSections", "leftInputSectionsFlexSize", "inputSections", "mode$", "bottomTemplateRef", "customFormButtonItems", "showCaptionButton", "disableSaveButton", "disableCancelButton", "checkError$", "hideButtons", "forceCreateNewForm", "secondBottomTemplateRef", "hideDevSector", "hideCalculatedSection", "buttonGroupTemplateRef"], outputs: ["onFormCreated", "onFormRefCreated", "onSubmit", "onSave", "onCancal", "buttonClick"] }, { kind: "component", type: SaveLiveJsonComponent, selector: "save-live-json" }, { kind: "component", type: CoreButtonGroupVnsComponent, selector: "core-button-group-vns", inputs: ["height", "instanceNumber", "forHeader", "fixedShow", "shownItems", "showCaption", "lastChildEffectOff"], outputs: ["buttonClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
239
- }
240
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FormMetadataComponent, decorators: [{
241
- type: Component,
242
- args: [{ selector: 'form-metadata', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
243
- TranslatePipe,
244
- CorePageHeaderComponent,
245
- CoreFormComponent,
246
- SaveLiveJsonComponent,
247
- CoreButtonGroupVnsComponent
248
- ], template: "<div class=\"form-metadata-container\">\r\n\r\n <div class=\"metadata-body\">\r\n\r\n <div class=\"header-n-form\">\r\n\r\n @if (!$isInWorkflowDesign()) {\r\n\r\n <div class=\"h15\"></div>\r\n\r\n <div class=\"d-flex d-flex-start w-100 pr1rem\">\r\n <core-button-group-vns [showCaption]=\"true\" [forHeader]=\"false\" (buttonClick)=\"onButtonClick($event)\"\r\n [shownItems]=\"customButtons\" class=\"buttonGroupCustom\"></core-button-group-vns>\r\n </div>\r\n <div class=\"h15\"></div>\r\n\r\n <div class=\"header-wrapper\">\r\n <core-page-header [title]=\"'FORM OVERVIEW'\" [hideButtonGroup]=\"true\"></core-page-header>\r\n <div class=\"close-wrapper\" (click)=\"onClose()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </div>\r\n\r\n } \r\n\r\n\r\n\r\n <div class=\"af-instance\">\r\n\r\n <div class=\"af-instance-left\">\r\n <core-form \r\n [inputSections]=\"$sections()\" \r\n [width]=\"800\" \r\n [mode$]=\"mode$\" \r\n [checkError$]=\"coreFormDesignService.formMetadataCheckError$\"\r\n [hideButtons]=\"true\" \r\n [forceCreateNewForm]=\"true\"\r\n [hideDevSector]=\"!!$isInWorkflowDesign()\"\r\n (onFormCreated)=\"onFormCreated($event)\" />\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n @if (!$isInWorkflowDesign()) {\r\n <div class=\"af-instance-right\">\r\n <save-live-json></save-live-json>\r\n </div>\r\n }\r\n\r\n\r\n </div>\r\n\r\n</div>", styles: [".form-metadata-container .header-wrapper{padding:0 15px}.form-metadata-container .header-wrapper .close-wrapper{display:flex;position:absolute;right:7px;top:8px;width:24px;height:24px;color:#848484;cursor:pointer}.form-metadata-container .header-wrapper .close-wrapper i{font-size:24px}.form-metadata-container .af-instance{display:flex}.form-metadata-container .h15{height:15px!important}.form-metadata-container .pr1rem{padding-right:1rem}.form-metadata-container .metadata-body{display:flex;align-items:flex-start;justify-content:space-between}.form-metadata-container .af-instance-right{margin-top:45px;margin-right:15px}\n"] }]
249
- }], ctorParameters: () => [{ type: DialogService }, { type: MultiLanguageService }], propDecorators: { onEscape: [{
250
- type: HostListener,
251
- args: ['document:keydown.escape', ['$event']]
252
- }], onWindowClick: [{
253
- type: HostListener,
254
- args: ['window:click', ['$event']]
255
- }] } });
256
-
257
- class AttachmentFieldHelperService {
258
- static isAttachment(control) {
259
- return control.controlType === 'ATTACHMENT';
260
- }
261
- static autoGenerateAttachmentNames(baseName) {
262
- return {
263
- field: baseName + 'Buffer',
264
- assignTo: baseName
265
- };
266
- }
267
- static buildHiddenAssignToField(baseFieldName) {
268
- return {
269
- field: baseFieldName,
270
- controlType: EnumFormBaseContolType.TEXTBOX,
271
- type: 'string',
272
- label: '',
273
- value: '',
274
- hidden: true,
275
- flexSize: 0
276
- };
277
- }
278
- static injectAssignToFieldIntoRow(row, assignToField) {
279
- row.cells.push({ flexSize: assignToField.flexSize ?? 12, control: assignToField });
280
- }
281
- /**
282
- * Called when user edits the "field" of an ATTACHMENT control
283
- */
284
- static handleFieldNameChangeForAttachment(control, form, typedFieldName) {
285
- const { field, assignTo } = this.autoGenerateAttachmentNames(typedFieldName);
286
- control.field = field;
287
- control.assignTo = assignTo;
288
- }
289
- /**
290
- * Called in drop handler when user drops a new ATTACHMENT
291
- */
292
- static setupAttachmentOnDrop(newControl, form) {
293
- if (this.isAttachment(newControl)) {
294
- const baseName = newControl.field.replace(/Buffer$/, '');
295
- const { field, assignTo } = this.autoGenerateAttachmentNames(baseName);
296
- newControl.field = field;
297
- newControl.assignTo = assignTo;
298
- }
299
- }
300
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AttachmentFieldHelperService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
301
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AttachmentFieldHelperService, providedIn: 'root' }); }
302
- }
303
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AttachmentFieldHelperService, decorators: [{
304
- type: Injectable,
305
- args: [{
306
- providedIn: 'root'
307
- }]
308
- }] });
309
-
310
- class BasePropsComponent extends BaseComponent {
311
- constructor() {
312
- super(...arguments);
313
- this.coreFormDesignService = inject(CoreFormDesignService);
314
- this.$selectedCell = this.coreFormDesignService.$selectedCell;
315
- this.$formContext = this.coreFormDesignService.$formContext;
316
- this.form = this.coreFormDesignService.formDesign;
317
- this.patchControl = this.coreFormDesignService.patchControl.bind(this.coreFormDesignService);
318
- this.normalize = this.coreFormDesignService.normalize.bind(this.coreFormDesignService);
319
- this.cdr = inject(ChangeDetectorRef);
320
- this.setControlProp = this.coreFormDesignService.setControlProp.bind(this.coreFormDesignService);
321
- this.$control = computed(() => {
322
- const cell = this.$selectedCell();
323
- if (!cell?.control)
324
- throw new Error('No control selected!');
325
- return this.normalize(cell.control);
326
- });
327
- }
328
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BasePropsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
329
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: BasePropsComponent, isStandalone: true, selector: "base-props", usesInheritance: true, ngImport: i0, template: './base-props.component.html', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
330
- }
331
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: BasePropsComponent, decorators: [{
332
- type: Component,
333
- args: [{
334
- selector: 'base-props',
335
- changeDetection: ChangeDetectionStrategy.OnPush,
336
- template: './base-props.component.html'
337
- }]
338
- }] });
339
-
340
- class MandatoryPropsComponent extends BasePropsComponent {
341
- constructor() {
342
- super(...arguments);
343
- this.$fieldInputRef = viewChild('fieldInput');
344
- this.afs = inject(CoreFormDesignService);
345
- this.$isNormalField = computed(() => this.afs.$currentControl()?.type !== 'calculated');
346
- this.$typedField = computed(() => {
347
- const control = this.$control();
348
- const field = AttachmentFieldHelperService.isAttachment(control)
349
- ? control.assignTo || ''
350
- : control.field;
351
- return field;
352
- });
353
- }
354
- onFieldChange(val) {
355
- this.setControlProp('field', val);
356
- const expected = this.$typedField();
357
- const actual = this.$fieldInputRef()?.nativeElement.value;
358
- if (!!actual && actual !== expected) {
359
- console.warn('Manual fix: input mismatch detected. Forcing value reset.');
360
- this.$fieldInputRef().nativeElement.value = expected;
361
- }
362
- }
363
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MandatoryPropsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
364
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: MandatoryPropsComponent, isStandalone: true, selector: "mandatory-props", viewQueries: [{ propertyName: "$fieldInputRef", first: true, predicate: ["fieldInput"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"setting-group mandatory-group\" [ngStyle]=\"{ padding: '15px', maxWidth: '352px' }\">\r\n\r\n <div class=\"setting-row\">\r\n <label>Field</label>\r\n <!-- <input class=\"form-control\" type=\"text\" \r\n [ngModel]=\"$typedField()\" \r\n (focus)=\"capturePreviousField()\"\r\n (ngModelChange)=\"setControlProp('field', $event, previousFieldName)\" /> -->\r\n <input #fieldInput class=\"form-control\" type=\"text\" \r\n [ngModel]=\"$typedField()\" \r\n (ngModelChange)=\"onFieldChange($event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Label</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control()?.label\" (ngModelChange)=\"setControlProp('label', $event)\" />\r\n </div>\r\n\r\n @if ($isNormalField()) {\r\n\r\n <div class=\"setting-row\">\r\n <label>Flex Size</label>\r\n <input class=\"form-control\" type=\"number\" [ngModel]=\"$control()?.flexSize\" (ngModelChange)=\"setControlProp('flexSize', $event)\" />\r\n </div>\r\n\r\n @if ($control()?.controlType !== 'FORM_ARRAY') {\r\n <div class=\"setting-row\">\r\n <label>Default</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control()?.value\" (ngModelChange)=\"setControlProp('value', $event)\" />\r\n </div>\r\n }\r\n }\r\n\r\n</div>", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
365
- }
366
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MandatoryPropsComponent, decorators: [{
367
- type: Component,
368
- args: [{ selector: 'mandatory-props', changeDetection: ChangeDetectionStrategy.OnPush, imports: [NgStyle, FormsModule], template: "<div class=\"setting-group mandatory-group\" [ngStyle]=\"{ padding: '15px', maxWidth: '352px' }\">\r\n\r\n <div class=\"setting-row\">\r\n <label>Field</label>\r\n <!-- <input class=\"form-control\" type=\"text\" \r\n [ngModel]=\"$typedField()\" \r\n (focus)=\"capturePreviousField()\"\r\n (ngModelChange)=\"setControlProp('field', $event, previousFieldName)\" /> -->\r\n <input #fieldInput class=\"form-control\" type=\"text\" \r\n [ngModel]=\"$typedField()\" \r\n (ngModelChange)=\"onFieldChange($event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Label</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control()?.label\" (ngModelChange)=\"setControlProp('label', $event)\" />\r\n </div>\r\n\r\n @if ($isNormalField()) {\r\n\r\n <div class=\"setting-row\">\r\n <label>Flex Size</label>\r\n <input class=\"form-control\" type=\"number\" [ngModel]=\"$control()?.flexSize\" (ngModelChange)=\"setControlProp('flexSize', $event)\" />\r\n </div>\r\n\r\n @if ($control()?.controlType !== 'FORM_ARRAY') {\r\n <div class=\"setting-row\">\r\n <label>Default</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control()?.value\" (ngModelChange)=\"setControlProp('value', $event)\" />\r\n </div>\r\n }\r\n }\r\n\r\n</div>", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"] }]
369
- }] });
370
-
371
- class OptionalPropsComponent extends BasePropsComponent {
372
- constructor() {
373
- super(...arguments);
374
- this.pipeOptions = Object.values(EnumCoreTablePipeType);
375
- this.pipeOptions$ = new BehaviorSubject(Object.values(EnumCoreTablePipeType).map(x => ({ value: x, text: x })));
376
- }
377
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionalPropsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
378
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: OptionalPropsComponent, isStandalone: true, selector: "optional-props", usesInheritance: true, ngImport: i0, template: "<div class=\"setting-group optional-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Readonly</label>\r\n <core-checkbox ngModel ngDefaultControl [ngModel]=\"$control().readonly\" (ngModelChange)=\"setControlProp('readonly', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Hidden</label>\r\n <core-checkbox [ngModel]=\"$control().hidden\" (ngModelChange)=\"setControlProp('hidden', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Disabled</label>\r\n <core-checkbox [ngModel]=\"$control().disabled\" (ngModelChange)=\"setControlProp('disabled', $event)\" /> \r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Hint</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().hint\" (ngModelChange)=\"setControlProp('hint', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Pipe</label>\r\n <div class=\"control-wrapper\">\r\n <core-dropdown [ngModel]=\"$control().pipe\" (ngModelChange)=\"setControlProp('pipe', $event)\"\r\n [paramMode]=\"true\"\r\n [options$]=\"pipeOptions$\"\r\n >\r\n </core-dropdown>\r\n </div>\r\n </div>\r\n\r\n</div>", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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: "component", type: CoreCheckboxComponent, selector: "core-checkbox", inputs: ["text", "tooltipPosition", "tooltip", "inputValue", "disabled"], outputs: ["onClick"] }, { kind: "component", type: CoreDropdownComponent, selector: "core-dropdown", inputs: ["getByIdObject$", "paramMode", "shownFrom", "options$", "height", "placeholder", "loading", "warningDisable", "clearDisable", "fitHeightWithItemCount", "itemHeight", "optionApiDriven", "optionApi", "optionHttpVerb", "optionHttpPayload", "optionValueFrom", "optionTextFrom"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
379
- }
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: OptionalPropsComponent, decorators: [{
381
- type: Component,
382
- args: [{ selector: 'optional-props', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
383
- NgStyle,
384
- FormsModule,
385
- CoreCheckboxComponent,
386
- CoreDropdownComponent
387
- ], template: "<div class=\"setting-group optional-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Readonly</label>\r\n <core-checkbox ngModel ngDefaultControl [ngModel]=\"$control().readonly\" (ngModelChange)=\"setControlProp('readonly', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Hidden</label>\r\n <core-checkbox [ngModel]=\"$control().hidden\" (ngModelChange)=\"setControlProp('hidden', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Disabled</label>\r\n <core-checkbox [ngModel]=\"$control().disabled\" (ngModelChange)=\"setControlProp('disabled', $event)\" /> \r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Hint</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().hint\" (ngModelChange)=\"setControlProp('hint', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Pipe</label>\r\n <div class=\"control-wrapper\">\r\n <core-dropdown [ngModel]=\"$control().pipe\" (ngModelChange)=\"setControlProp('pipe', $event)\"\r\n [paramMode]=\"true\"\r\n [options$]=\"pipeOptions$\"\r\n >\r\n </core-dropdown>\r\n </div>\r\n </div>\r\n\r\n</div>", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"] }]
388
- }] });
389
-
390
- class PropsHostComponent {
391
- constructor() {
392
- this.vcRef = inject(ViewContainerRef);
393
- }
394
- set props(value) {
395
- this._props = value;
396
- this.assignInputs();
397
- }
398
- async ngOnInit() {
399
- if (this.loadComponent) {
400
- const componentType = await this.loadComponent();
401
- this.componentRef = this.vcRef.createComponent(componentType);
402
- this.assignInputs();
403
- }
404
- }
405
- assignInputs() {
406
- if (this.componentRef && this._props) {
407
- Object.assign(this.componentRef.instance, this._props);
408
- this.componentRef.changeDetectorRef.markForCheck();
409
- }
410
- }
411
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: PropsHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
412
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: PropsHostComponent, isStandalone: true, selector: "props-host", inputs: { loadComponent: "loadComponent", props: "props" }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
413
- }
414
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: PropsHostComponent, decorators: [{
415
- type: Component,
416
- args: [{
417
- selector: 'props-host',
418
- standalone: true,
419
- template: '',
420
- changeDetection: ChangeDetectionStrategy.OnPush
421
- }]
422
- }], propDecorators: { loadComponent: [{
423
- type: Input
424
- }], props: [{
425
- type: Input
426
- }] } });
427
-
428
- class AttachmentPropsComponent extends BasePropsComponent {
429
- constructor() {
430
- super(...arguments);
431
- this.$typedField = computed(() => {
432
- const control = this.$control();
433
- return AttachmentFieldHelperService.isAttachment(control)
434
- ? control.assignTo || ''
435
- : control.field;
436
- });
437
- }
438
- setTypedField(val) {
439
- const control = this.$control();
440
- const context = this.$formContext();
441
- if (AttachmentFieldHelperService.isAttachment(control)) {
442
- AttachmentFieldHelperService.handleFieldNameChangeForAttachment(control, context, val);
443
- }
444
- else {
445
- control.field = val;
446
- }
447
- this.patchControl(control);
448
- }
449
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AttachmentPropsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
450
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: AttachmentPropsComponent, isStandalone: true, selector: "attachment-props", usesInheritance: true, ngImport: i0, template: "<p>attachment-props works!</p>\r\n", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"] }); }
451
- }
452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: AttachmentPropsComponent, decorators: [{
453
- type: Component,
454
- args: [{ selector: 'attachment-props', imports: [], template: "<p>attachment-props works!</p>\r\n", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"] }]
455
- }] });
456
-
457
- class ChecklistPropsComponent {
458
- constructor() {
459
- this.controlChange = new EventEmitter();
460
- }
461
- update() {
462
- this.controlChange.emit(this.control);
463
- }
464
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ChecklistPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
465
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: ChecklistPropsComponent, isStandalone: true, selector: "checklist-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>checklist-props works!</p>\r\n", styles: [""] }); }
466
- }
467
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ChecklistPropsComponent, decorators: [{
468
- type: Component,
469
- args: [{ selector: 'checklist-props', imports: [], template: "<p>checklist-props works!</p>\r\n" }]
470
- }], propDecorators: { control: [{
471
- type: Input
472
- }], controlChange: [{
473
- type: Output
474
- }] } });
475
-
476
- class DatepickerPropsComponent {
477
- constructor() {
478
- this.controlChange = new EventEmitter();
479
- }
480
- update() {
481
- this.controlChange.emit(this.control);
482
- }
483
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DatepickerPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
484
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: DatepickerPropsComponent, isStandalone: true, selector: "datepicker-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>datepicker-props works!</p>\r\n", styles: [""] }); }
485
- }
486
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DatepickerPropsComponent, decorators: [{
487
- type: Component,
488
- args: [{ selector: 'datepicker-props', imports: [], template: "<p>datepicker-props works!</p>\r\n" }]
489
- }], propDecorators: { control: [{
490
- type: Input
491
- }], controlChange: [{
492
- type: Output
493
- }] } });
494
-
495
- class DropdownPropsComponent extends BasePropsComponent {
496
- constructor() {
497
- super(...arguments);
498
- this.jsonPayload = '';
499
- this.httpVerbOptions$ = new BehaviorSubject([
500
- {
501
- value: 'HttpGet',
502
- text: 'GET'
503
- },
504
- {
505
- value: 'HttpPost',
506
- text: 'POST'
507
- }
508
- ]);
509
- }
510
- onPayloadJsonBlur() {
511
- try {
512
- const optionHttpPayload = JSON.parse(this.jsonPayload);
513
- this.setControlProp('optionHttpPayload', optionHttpPayload);
514
- }
515
- catch (e) {
516
- console.warn('⚠️ Invalid JSON payload');
517
- }
518
- }
519
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DropdownPropsComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
520
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: DropdownPropsComponent, isStandalone: true, selector: "dropdown-props", usesInheritance: true, ngImport: i0, template: "<div class=\"setting-group dropdown-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Use API</label>\r\n <core-checkbox [ngModel]=\"$control().optionApiDriven\" (ngModelChange)=\"setControlProp('optionApiDriven', $event)\" />\r\n </div>\r\n\r\n @if (!!$control().optionApiDriven) {\r\n <div class=\"setting-row\">\r\n <label>API Endpoint</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().optionApi\" (ngModelChange)=\"setControlProp('optionApi', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>HTTP Verb</label>\r\n <div class=\"control-wrapper\">\r\n <core-dropdown [ngModel]=\"$control().optionHttpVerb\" (ngModelChange)=\"setControlProp('optionHttpVerb', $event)\" [paramMode]=\"true\"\r\n [options$]=\"httpVerbOptions$\">\r\n </core-dropdown>\r\n </div>\r\n </div>\r\n\r\n @if ($control().optionHttpVerb === 'HttpPost') {\r\n <div class=\"setting-row\">\r\n <label>Payload (JSON)</label>\r\n <div class=\"control-wrapper\">\r\n <textarea class=\"form-control\" rows=\"3\" [(ngModel)]=\"jsonPayload\" (ngModelChange)=\"onPayloadJsonBlur()\"></textarea>\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"setting-row\">\r\n <label>Value Field</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().optionValueFrom\" (ngModelChange)=\"setControlProp('optionValueFrom', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Text Field</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().optionTextFrom\" (ngModelChange)=\"setControlProp('optionTextFrom', $event)\" />\r\n </div>\r\n }\r\n</div>", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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: "component", type: CoreCheckboxComponent, selector: "core-checkbox", inputs: ["text", "tooltipPosition", "tooltip", "inputValue", "disabled"], outputs: ["onClick"] }, { kind: "component", type: CoreDropdownComponent, selector: "core-dropdown", inputs: ["getByIdObject$", "paramMode", "shownFrom", "options$", "height", "placeholder", "loading", "warningDisable", "clearDisable", "fitHeightWithItemCount", "itemHeight", "optionApiDriven", "optionApi", "optionHttpVerb", "optionHttpPayload", "optionValueFrom", "optionTextFrom"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
521
- }
522
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: DropdownPropsComponent, decorators: [{
523
- type: Component,
524
- args: [{ selector: 'dropdown-props', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
525
- NgStyle,
526
- FormsModule,
527
- CoreCheckboxComponent,
528
- CoreDropdownComponent,
529
- ], template: "<div class=\"setting-group dropdown-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n <div class=\"setting-row optional-bool\">\r\n <label>Use API</label>\r\n <core-checkbox [ngModel]=\"$control().optionApiDriven\" (ngModelChange)=\"setControlProp('optionApiDriven', $event)\" />\r\n </div>\r\n\r\n @if (!!$control().optionApiDriven) {\r\n <div class=\"setting-row\">\r\n <label>API Endpoint</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().optionApi\" (ngModelChange)=\"setControlProp('optionApi', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>HTTP Verb</label>\r\n <div class=\"control-wrapper\">\r\n <core-dropdown [ngModel]=\"$control().optionHttpVerb\" (ngModelChange)=\"setControlProp('optionHttpVerb', $event)\" [paramMode]=\"true\"\r\n [options$]=\"httpVerbOptions$\">\r\n </core-dropdown>\r\n </div>\r\n </div>\r\n\r\n @if ($control().optionHttpVerb === 'HttpPost') {\r\n <div class=\"setting-row\">\r\n <label>Payload (JSON)</label>\r\n <div class=\"control-wrapper\">\r\n <textarea class=\"form-control\" rows=\"3\" [(ngModel)]=\"jsonPayload\" (ngModelChange)=\"onPayloadJsonBlur()\"></textarea>\r\n </div>\r\n </div>\r\n }\r\n\r\n <div class=\"setting-row\">\r\n <label>Value Field</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().optionValueFrom\" (ngModelChange)=\"setControlProp('optionValueFrom', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row\">\r\n <label>Text Field</label>\r\n <input class=\"form-control\" type=\"text\" [ngModel]=\"$control().optionTextFrom\" (ngModelChange)=\"setControlProp('optionTextFrom', $event)\" />\r\n </div>\r\n }\r\n</div>", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"] }]
530
- }] });
531
-
532
- var dropdownProps_component = /*#__PURE__*/Object.freeze({
533
- __proto__: null,
534
- DropdownPropsComponent: DropdownPropsComponent
535
- });
536
-
537
- class GridBufferPropsComponent {
538
- constructor() {
539
- this.controlChange = new EventEmitter();
540
- }
541
- update() {
542
- this.controlChange.emit(this.control);
543
- }
544
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: GridBufferPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
545
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: GridBufferPropsComponent, isStandalone: true, selector: "grid-buffer-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>grid-buffer-props works!</p>\r\n", styles: [""] }); }
546
- }
547
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: GridBufferPropsComponent, decorators: [{
548
- type: Component,
549
- args: [{ selector: 'grid-buffer-props', imports: [], template: "<p>grid-buffer-props works!</p>\r\n" }]
550
- }], propDecorators: { control: [{
551
- type: Input
552
- }], controlChange: [{
553
- type: Output
554
- }] } });
555
-
556
- class ListPropsComponent {
557
- constructor() {
558
- this.controlChange = new EventEmitter();
559
- }
560
- update() {
561
- this.controlChange.emit(this.control);
562
- }
563
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ListPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
564
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: ListPropsComponent, isStandalone: true, selector: "list-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>list-props works!</p>\r\n", styles: [""] }); }
565
- }
566
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ListPropsComponent, decorators: [{
567
- type: Component,
568
- args: [{ selector: 'list-props', imports: [], template: "<p>list-props works!</p>\r\n" }]
569
- }], propDecorators: { control: [{
570
- type: Input
571
- }], controlChange: [{
572
- type: Output
573
- }] } });
574
-
575
- class MccPropsComponent {
576
- constructor() {
577
- this.controlChange = new EventEmitter();
578
- }
579
- update() {
580
- this.controlChange.emit(this.control);
581
- }
582
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MccPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
583
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: MccPropsComponent, isStandalone: true, selector: "mcc-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>mcc-props works!</p>\r\n", styles: [""] }); }
584
- }
585
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: MccPropsComponent, decorators: [{
586
- type: Component,
587
- args: [{ selector: 'mcc-props', imports: [], template: "<p>mcc-props works!</p>\r\n" }]
588
- }], propDecorators: { control: [{
589
- type: Input
590
- }], controlChange: [{
591
- type: Output
592
- }] } });
593
-
594
- class NumberPropsComponent {
595
- constructor() {
596
- this.controlChange = new EventEmitter();
597
- }
598
- update() {
599
- this.controlChange.emit(this.control);
600
- }
601
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: NumberPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
602
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: NumberPropsComponent, isStandalone: true, selector: "number-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<div class=\"number-props-container\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n</div>", styles: [""], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] }); }
603
- }
604
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: NumberPropsComponent, decorators: [{
605
- type: Component,
606
- args: [{ selector: 'number-props', imports: [NgStyle], template: "<div class=\"number-props-container\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n</div>" }]
607
- }], propDecorators: { control: [{
608
- type: Input
609
- }], controlChange: [{
610
- type: Output
611
- }] } });
612
-
613
- var numberProps_component = /*#__PURE__*/Object.freeze({
614
- __proto__: null,
615
- NumberPropsComponent: NumberPropsComponent
616
- });
617
-
618
- class RadioGroupPropsComponent {
619
- constructor() {
620
- this.controlChange = new EventEmitter();
621
- }
622
- update() {
623
- this.controlChange.emit(this.control);
624
- }
625
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: RadioGroupPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
626
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: RadioGroupPropsComponent, isStandalone: true, selector: "radio-group-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>radio-group-props works!</p>\r\n", styles: [""] }); }
627
- }
628
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: RadioGroupPropsComponent, decorators: [{
629
- type: Component,
630
- args: [{ selector: 'radio-group-props', imports: [], template: "<p>radio-group-props works!</p>\r\n" }]
631
- }], propDecorators: { control: [{
632
- type: Input
633
- }], controlChange: [{
634
- type: Output
635
- }] } });
636
-
637
- class SeekerPropsComponent {
638
- constructor() {
639
- this.controlChange = new EventEmitter();
640
- }
641
- update() {
642
- this.controlChange.emit(this.control);
643
- }
644
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SeekerPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
645
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: SeekerPropsComponent, isStandalone: true, selector: "seeker-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>seeker-props works!</p>\r\n", styles: [""] }); }
646
- }
647
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: SeekerPropsComponent, decorators: [{
648
- type: Component,
649
- args: [{ selector: 'seeker-props', imports: [], template: "<p>seeker-props works!</p>\r\n" }]
650
- }], propDecorators: { control: [{
651
- type: Input
652
- }], controlChange: [{
653
- type: Output
654
- }] } });
655
-
656
- class TextareaPropsComponent {
657
- constructor() {
658
- this.controlChange = new EventEmitter();
659
- }
660
- update() {
661
- this.controlChange.emit(this.control);
662
- }
663
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: TextareaPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
664
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: TextareaPropsComponent, isStandalone: true, selector: "textarea-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>textarea-props works!</p>\r\n", styles: [""] }); }
665
- }
666
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: TextareaPropsComponent, decorators: [{
667
- type: Component,
668
- args: [{ selector: 'textarea-props', imports: [], template: "<p>textarea-props works!</p>\r\n" }]
669
- }], propDecorators: { control: [{
670
- type: Input
671
- }], controlChange: [{
672
- type: Output
673
- }] } });
674
-
675
- class UploaderPropsComponent {
676
- constructor() {
677
- this.controlChange = new EventEmitter();
678
- }
679
- update() {
680
- this.controlChange.emit(this.control);
681
- }
682
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: UploaderPropsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
683
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.5", type: UploaderPropsComponent, isStandalone: true, selector: "uploader-props", inputs: { control: "control" }, outputs: { controlChange: "controlChange" }, ngImport: i0, template: "<p>uploader-props works!</p>\r\n", styles: [""] }); }
684
- }
685
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: UploaderPropsComponent, decorators: [{
686
- type: Component,
687
- args: [{ selector: 'uploader-props', imports: [], template: "<p>uploader-props works!</p>\r\n" }]
688
- }], propDecorators: { control: [{
689
- type: Input
690
- }], controlChange: [{
691
- type: Output
692
- }] } });
693
-
694
- class ValidatorEditorComponent extends BasePropsComponent {
695
- constructor(mls) {
696
- super(mls);
697
- this.mls = mls;
698
- // 🔹 Computed list based on controlType
699
- this.$availableValidators = computed(() => this.coreFormDesignService.getSupportedValidators(this.$control()));
700
- // 🔹 Signal for selected validators with their values
701
- this.$selectedValidators = signal({});
702
- effect(() => {
703
- const c = this.$control(); // will re-run when selection changes
704
- this.syncFromControl();
705
- });
706
- }
707
- // ✅ Check if a validator is enabled
708
- isChecked(v) {
709
- return this.$selectedValidators()[v] !== undefined;
710
- }
711
- syncFromControl() {
712
- const control = this.$control();
713
- const validators = control.validators ?? [];
714
- const validatorMap = {};
715
- for (const v of validators) {
716
- validatorMap[v.name] = v;
717
- }
718
- this.$selectedValidators.set(validatorMap);
719
- }
720
- toggleValidator(v) {
721
- const current = { ...this.$selectedValidators() };
722
- const requiresValue = ['minLength', 'maxLength', 'min', 'max', 'pattern'];
723
- const isAlreadyChecked = !!current[v];
724
- if (isAlreadyChecked) {
725
- delete current[v]; // ❌ Remove validator
726
- }
727
- else {
728
- const validator = {
729
- name: v,
730
- errorMessage: this.coreFormDesignService.getErrorMessageFor(v),
731
- validator: this.coreFormDesignService.getValidatorFn(v, null), // stub until value is filled
732
- value: requiresValue.includes(v) ? '' : true
733
- };
734
- current[v] = validator;
735
- }
736
- this.$selectedValidators.set(current);
737
- // ✅ Skip update if validator requires value but it's still empty
738
- const shouldSkip = !isAlreadyChecked &&
739
- requiresValue.includes(v) &&
740
- current[v]?.value === '';
741
- if (shouldSkip)
742
- return;
743
- const validatorArray = this.coreFormDesignService.toIValidatorArray(current);
744
- this.setControlProp('validators', validatorArray);
745
- }
746
- updateValidatorValue(v, raw) {
747
- const value = raw?.toString().trim();
748
- const updated = { ...this.$selectedValidators() };
749
- if (value === '') {
750
- // 👇 Remove the validator if it was cleared
751
- delete updated[v];
752
- }
753
- else {
754
- if (updated[v]) {
755
- updated[v].value = value;
756
- }
757
- }
758
- this.$selectedValidators.set(updated);
759
- // ✅ Only update the control if it's valid or fully removed
760
- const validatorArray = this.coreFormDesignService.toIValidatorArray(updated);
761
- this.setControlProp('validators', validatorArray);
762
- }
763
- isReadOnlyValidator(v) {
764
- return this.$selectedValidators()[v]?.readOnly === true;
765
- }
766
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ValidatorEditorComponent, deps: [{ token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
767
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: ValidatorEditorComponent, isStandalone: true, selector: "validator-editor", usesInheritance: true, ngImport: i0, template: "<div class=\"setting-group validator-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n @for (v of $availableValidators(); track v) {\r\n <div class=\"setting-row\">\r\n\r\n <label>\r\n {{ v }}\r\n @if (isReadOnlyValidator(v)) {\r\n <i class=\"feather-lock tiny-lock\" title=\"Read-only system validator\"></i>\r\n }\r\n </label>\r\n\r\n <div class=\"control-wrapper\">\r\n <core-checkbox ngModel ngDefaultControl [ngModel]=\"isChecked(v)\" [disabled]=\"isReadOnlyValidator(v)\"\r\n [appTooltip]=\"isReadOnlyValidator(v) ? 'System validator' : ''\" (ngModelChange)=\"toggleValidator(v)\" />\r\n\r\n @if (isChecked(v) && ['minLength', 'maxLength', 'min', 'max'].includes(v)) {\r\n <input class=\"form-control validator-value\" [type]=\"'number'\"\r\n [value]=\"$selectedValidators()[v]?.value || ''\"\r\n (input)=\"updateValidatorValue(v, $any($event.target).value)\"\r\n [placeholder]=\"'Enter value' | translate: lang\" [disabled]=\"isReadOnlyValidator(v)\"\r\n [appTooltip]=\"isReadOnlyValidator(v) ? 'Default validator \u2014 cannot be modified' : ''\" />\r\n }\r\n\r\n @else if (isChecked(v) && v === 'pattern') {\r\n <input class=\"form-control validator-value\" type=\"text\" [value]=\"$selectedValidators()[v]?.value || ''\"\r\n (input)=\"updateValidatorValue(v, $any($event.target).value)\" [placeholder]=\"'Enter regex'\"\r\n [disabled]=\"isReadOnlyValidator(v)\"\r\n [appTooltip]=\"isReadOnlyValidator(v) ? 'Default validator \u2014 cannot be modified' : ''\" />\r\n }\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "component", type: CoreCheckboxComponent, selector: "core-checkbox", inputs: ["text", "tooltipPosition", "tooltip", "inputValue", "disabled"], outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
768
- }
769
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ValidatorEditorComponent, decorators: [{
770
- type: Component,
771
- args: [{ selector: 'validator-editor', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
772
- NgStyle,
773
- FormsModule,
774
- TranslatePipe,
775
- TooltipDirective,
776
- CoreCheckboxComponent
777
- ], template: "<div class=\"setting-group validator-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n @for (v of $availableValidators(); track v) {\r\n <div class=\"setting-row\">\r\n\r\n <label>\r\n {{ v }}\r\n @if (isReadOnlyValidator(v)) {\r\n <i class=\"feather-lock tiny-lock\" title=\"Read-only system validator\"></i>\r\n }\r\n </label>\r\n\r\n <div class=\"control-wrapper\">\r\n <core-checkbox ngModel ngDefaultControl [ngModel]=\"isChecked(v)\" [disabled]=\"isReadOnlyValidator(v)\"\r\n [appTooltip]=\"isReadOnlyValidator(v) ? 'System validator' : ''\" (ngModelChange)=\"toggleValidator(v)\" />\r\n\r\n @if (isChecked(v) && ['minLength', 'maxLength', 'min', 'max'].includes(v)) {\r\n <input class=\"form-control validator-value\" [type]=\"'number'\"\r\n [value]=\"$selectedValidators()[v]?.value || ''\"\r\n (input)=\"updateValidatorValue(v, $any($event.target).value)\"\r\n [placeholder]=\"'Enter value' | translate: lang\" [disabled]=\"isReadOnlyValidator(v)\"\r\n [appTooltip]=\"isReadOnlyValidator(v) ? 'Default validator \u2014 cannot be modified' : ''\" />\r\n }\r\n\r\n @else if (isChecked(v) && v === 'pattern') {\r\n <input class=\"form-control validator-value\" type=\"text\" [value]=\"$selectedValidators()[v]?.value || ''\"\r\n (input)=\"updateValidatorValue(v, $any($event.target).value)\" [placeholder]=\"'Enter regex'\"\r\n [disabled]=\"isReadOnlyValidator(v)\"\r\n [appTooltip]=\"isReadOnlyValidator(v) ? 'Default validator \u2014 cannot be modified' : ''\" />\r\n }\r\n </div>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".setting-group{display:flex;flex-direction:column}.setting-row{display:flex;justify-content:flex-start;align-items:center;height:50px}.setting-row label{width:30%}.setting-row .control-wrapper,.setting-row input,.setting-row .readonly-field{width:65%}.setting-row .readonly-field{font-style:italic;color:#666}.setting-row input.validator-value{text-align:right}.setting-row input.validator-value.pattern{text-align:left}.setting-row .control-wrapper{display:flex;align-items:center;justify-content:flex-start}.validator-group .setting-row{justify-content:flex-start}.validator-group .setting-row input{margin-left:15px;width:100%}.tiny-lock{margin-left:6px;font-size:12px;color:#888}\n"] }]
778
- }], ctorParameters: () => [{ type: MultiLanguageService }] });
779
-
780
- class CalculatedPropsComponent extends BasePropsComponent {
781
- constructor(mls) {
782
- super(mls);
783
- this.mls = mls;
784
- this.$shortHtmlHintForCSharpSyntax = viewChild('shortHtmlHintForCSharpSyntax');
785
- this.$shortHtmlHintForSqlSyntax = viewChild('shortHtmlHintForSqlSyntax');
786
- this.$loading = signal(false);
787
- this.$beingValidated = signal(false);
788
- this.wfs = inject(CoreWorkflowService);
789
- this.fds = inject(CoreFormDesignService);
790
- this.dbs = inject(DbService);
791
- this.gpt = inject(GptService);
792
- this.alertService = inject(AlertService);
793
- this.$currentControl = this.fds.$currentControl;
794
- this.$sqlScriptError = signal(null);
795
- this.$aiGeneratorOn = signal(false);
796
- this.$selectedTables = signal([]);
797
- this.$generatedScript = signal('');
798
- this.$sqlPrompt = signal('');
799
- this.$selectedTablesForAi = computed(() => {
800
- const selectedTables = this.$selectedTables();
801
- if (!selectedTables.length)
802
- return 'No tables selected.';
803
- let result = 'Consider the following database tables and columns:\n\n';
804
- for (const table of selectedTables) {
805
- result += `Table: ${table.table}\n`;
806
- const activeColumns = table.columns.filter(c => c.isActive);
807
- for (const col of activeColumns) {
808
- const hint = col.hintForAi?.trim();
809
- result += ` - ${col.column}` + (hint ? ` (${hint})` : '') + `\n`;
810
- }
811
- result += '\n';
812
- }
813
- return result.trim();
814
- });
815
- this.radioOptions$ = new BehaviorSubject([
816
- {
817
- value: 'in-memory',
818
- text: 'In Memory',
819
- htmlTooltip: this.$shortHtmlHintForCSharpSyntax()
820
- },
821
- {
822
- value: 'sql-query',
823
- text: 'SQL Query',
824
- htmlTooltip: this.$shortHtmlHintForSqlSyntax()
825
- },
826
- ]);
827
- this.$fields = computed(() => {
828
- const currentField = this.fds.$currentControl()?.field;
829
- return this.wfs.$availableCols().filter(c => c.field !== currentField).map(c => ({ field: c.field }));
830
- });
831
- this.$placeholderForScriptInput = computed(() => {
832
- switch (this.$currentControl()?.evaluationMode) {
833
- case 'in-memory':
834
- return 'Enter expression formula';
835
- case 'sql-query':
836
- return 'Enter SQL script';
837
- default:
838
- return 'Please select Evaluation Mode';
839
- }
840
- });
841
- effect(() => {
842
- const shortHtmlHintForCSharpSyntax = this.$shortHtmlHintForCSharpSyntax();
843
- const shortHtmlHintForSqlSyntax = this.$shortHtmlHintForSqlSyntax();
844
- if (!!shortHtmlHintForCSharpSyntax && !!shortHtmlHintForSqlSyntax) {
845
- this.radioOptions$.next([
846
- {
847
- value: 'in-memory',
848
- text: 'In Memory',
849
- htmlTooltip: shortHtmlHintForCSharpSyntax
850
- },
851
- {
852
- value: 'sql-query',
853
- text: 'SQL Query',
854
- htmlTooltip: shortHtmlHintForSqlSyntax
855
- },
856
- ]);
857
- }
858
- });
859
- }
860
- loadDbSchema() {
861
- const fullRequest = {};
862
- this.subscriptions.push(this.dbs.syncAndGetWorkflowSchemaMetadata(fullRequest).pipe(catchError(() => of({ ok: false, status: 500 })))
863
- .subscribe(x => {
864
- if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
865
- this.wfs.$workflowDbSchema.set(x.body.innerBody.items);
866
- }
867
- }));
868
- }
869
- toTables(names) {
870
- const allTables = this.wfs.$workflowDbSchema(); // All available tables
871
- return allTables.filter(table => names.includes(table.table));
872
- }
873
- validateScript(e) {
874
- e.stopPropagation();
875
- const control = this.$currentControl();
876
- if (!control) {
877
- this.alertService.info(`No current control detected`);
878
- return;
879
- }
880
- if (!control.script) {
881
- this.alertService.info(`There is no script to validate for ${control.field}`);
882
- return;
883
- }
884
- if (!control.returnType) {
885
- this.alertService.info(`You should set return type for ${control.field}`);
886
- return;
887
- }
888
- const evalMode = this.$currentControl()?.evaluationMode;
889
- if (!evalMode) {
890
- this.alertService.error('Please select avaluation mode', alertOptions);
891
- return;
892
- }
893
- const request = {
894
- input: control.script,
895
- context: this.getValidationContextByMode(evalMode),
896
- purpose: 'validate-calculated-field',
897
- isSystemPrompt: true
898
- };
899
- this.$beingValidated.set(true);
900
- this.subscriptions.push(this.gpt.askGpt(request).pipe(catchError(err => {
901
- this.$beingValidated.set(false);
902
- this.alertService.error('Validation failed.');
903
- return of({ ok: false, status: 500 });
904
- })).subscribe(x => {
905
- this.$beingValidated.set(false);
906
- if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
907
- const reply = x.body.innerBody?.trim();
908
- this.alertService.success(`GPT: ${reply}`);
909
- }
910
- else {
911
- this.alertService.error('Could not validate script.');
912
- }
913
- }));
914
- }
915
- generateScript() {
916
- this.$aiGeneratorOn.update(current => !current);
917
- }
918
- applyGeneratedSql() {
919
- const generated = this.$generatedScript();
920
- if (!generated)
921
- return;
922
- this.setControlProp('script', generated);
923
- this.alertService.success('Script applied from AI.');
924
- this.$aiGeneratorOn.set(false);
925
- }
926
- submitScriptPrompt() {
927
- const control = this.$currentControl();
928
- const evalMode = control?.evaluationMode;
929
- const prompt = this.$sqlPrompt().trim();
930
- const dependsOn = control?.dependsOn ?? [];
931
- const selectedTables = this.$selectedTables();
932
- if (!evalMode) {
933
- this.alertService.warn('Please select an evaluation mode.');
934
- return;
935
- }
936
- if (!prompt) {
937
- this.alertService.warn('Please enter a description for the AI to generate your script.');
938
- return;
939
- }
940
- if (dependsOn.length === 0) {
941
- this.alertService.warn('Please select at least one field that the script depends on.');
942
- return;
943
- }
944
- if (evalMode === 'sql-query') {
945
- if (!selectedTables.length) {
946
- this.alertService.warn('Please select at least one table.');
947
- return;
948
- }
949
- const tablesWithNoHint = selectedTables
950
- .filter(t => !t.hintForAi?.trim())
951
- .map(t => t.table);
952
- if (tablesWithNoHint.length > 0) {
953
- this.alertService.warn(`Please provide a hint for the following table(s): ${tablesWithNoHint.join(', ')}`);
954
- return;
955
- }
956
- }
957
- // 🧠 Construct prompt
958
- const dependsOnLine = `The script should depend on: ${dependsOn.join(', ')}.`;
959
- const contextIntro = this.getContextByMode(evalMode);
960
- const tableContext = this.$selectedTablesForAi(); // nicely formatted
961
- const fullPrompt = `${prompt}\n\n${dependsOnLine}\n\n${tableContext}`;
962
- const request = {
963
- input: fullPrompt,
964
- context: contextIntro,
965
- purpose: 'generate-calculated-field',
966
- isSystemPrompt: true
967
- };
968
- this.$loading.set(true);
969
- this.subscriptions.push(this.gpt.askGpt(request).pipe(catchError(err => {
970
- this.$loading.set(false);
971
- this.alertService.error('AI generation failed.');
972
- return of({ ok: false, status: 500 });
973
- })).subscribe(res => {
974
- this.$loading.set(false);
975
- if (res.ok && res.status === 200 && res.body?.statusCode === 200) {
976
- const reply = res.body.innerBody?.trim();
977
- if (reply) {
978
- this.$generatedScript.set(reply);
979
- }
980
- else {
981
- this.alertService.warn('AI returned an empty result.');
982
- }
983
- }
984
- else {
985
- this.alertService.error('AI could not generate a valid script.');
986
- }
987
- }));
988
- }
989
- tableCheckedChange(selected) {
990
- this.$selectedTables.set(this.toTables(selected));
991
- }
992
- getContextByMode(mode) {
993
- if (mode === 'sql-query') {
994
- return [
995
- `You use ${this.mls.lang$.value.toUpperCase() === 'VI' ? 'Vietnamese' : 'English'} for answer`,
996
- "You are a SQL validator for a workflow engine.",
997
- "User input must be a full SQL SELECT statement compatible with Dapper.",
998
- "User input must not modify database schema",
999
- "It must contain a FROM clause with a real table name.",
1000
- "It must contain a UPDATE, DELETE or DROP clause.",
1001
- "It must contain a WHERE clause.",
1002
- "It must return exactly one value",
1003
- "Examples of valid patterns include:",
1004
- " SELECT CASE WHEN EXISTS (SELECT 1 FROM Users WHERE IsActive = 1) THEN 1 ELSE 0 END",
1005
- " SELECT CASE WHEN @Amount > 1000 THEN @Amount ELSE 0 END -- when Amount is a parameter",
1006
- "The query must be syntactically complete, no partial expressions or clauses.",
1007
- `The query must return a type of ${this.$currentControl()?.returnType} JavaScript equivalent.`,
1008
- "Do not wrap your output in triple backticks or markdown.",
1009
- "Respond with only the raw SQL script.",
1010
- ];
1011
- }
1012
- return [
1013
- `You use ${this.mls.lang$.value.toUpperCase() === 'VI' ? 'Vietnamese' : 'English'} for answer`,
1014
- 'You are a C# expression validator.',
1015
- `Validate whether the expression returns a type of ${this.$currentControl()?.returnType} JavaScript equivalent result using C# syntax.`,
1016
- 'The result will be used inside an if-statement or condition tree.'
1017
- ];
1018
- }
1019
- getValidationContextByMode(mode) {
1020
- if (mode === 'sql-query') {
1021
- return [
1022
- `You use ${this.mls.lang$.value.toUpperCase() === 'VI' ? 'Vietnamese' : 'English'} for answer`,
1023
- "You're a SQL validator for a business rule engine.",
1024
- "The input is a full SQL SELECT statement written by a human.",
1025
- "Analyze if it meets these criteria:",
1026
- "- Compatible with SQL Server and Dapper parameter style.",
1027
- "- Has FROM clause with table name.",
1028
- "- Has WHERE clause.",
1029
- "- Uses @param style inputs.",
1030
- "Return only a short answer like 'Valid ✅' or explain what's wrong in plain terms.",
1031
- ];
1032
- }
1033
- return [
1034
- `You use ${this.mls.lang$.value.toUpperCase() === 'VI' ? 'Vietnamese' : 'English'} for answer`,
1035
- "You're a validator for C# expressions and the result should be compatible with DynamicExpresso",
1036
- `Analyze whether this expression is valid syntax and returns a type = ${this.$control().returnType}`,
1037
- "If valid, say 'Valid ✅'. If not, explain the syntax issue.",
1038
- ];
1039
- }
1040
- validateSqlScript(input) {
1041
- const trimmed = input.trim();
1042
- if (!/^SELECT\b/i.test(trimmed)) {
1043
- return 'Only SELECT queries are allowed.';
1044
- }
1045
- const destructivePattern = /^\s*(DELETE|DROP|UPDATE|INSERT|ALTER|TRUNCATE|EXEC|MERGE)\b/gi;
1046
- if (destructivePattern.test(trimmed)) {
1047
- return 'Dangerous SQL operations (DELETE, DROP, etc.) are not allowed.';
1048
- }
1049
- return null;
1050
- }
1051
- onScriptChange(script) {
1052
- if (this.$control().evaluationMode === 'sql-query') {
1053
- const error = this.validateSqlScript(script);
1054
- this.setControlProp('isUnsafe', !!error);
1055
- this.$sqlScriptError.set(error);
1056
- this.setControlProp('script', script);
1057
- }
1058
- else {
1059
- this.setControlProp('script', script);
1060
- this.setControlProp('isUnsafe', false);
1061
- }
1062
- }
1063
- ngAfterViewInit() {
1064
- setTimeout(() => this.loadDbSchema());
1065
- }
1066
- openHintEditor(table, e) {
1067
- }
1068
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CalculatedPropsComponent, deps: [{ token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
1069
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: CalculatedPropsComponent, isStandalone: true, selector: "calculated-props", viewQueries: [{ propertyName: "$shortHtmlHintForCSharpSyntax", first: true, predicate: ["shortHtmlHintForCSharpSyntax"], descendants: true, isSignal: true }, { propertyName: "$shortHtmlHintForSqlSyntax", first: true, predicate: ["shortHtmlHintForSqlSyntax"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"setting-group calculated-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n <div class=\"setting-row evaluation-mode-row\">\r\n <label class=\"setting-label\">Evaluation Mode</label>\r\n <core-radio-group [options$]=\"radioOptions$\" [vertical]=\"true\" [gapY]=\"8\"\r\n [ngModel]=\"$currentControl()?.evaluationMode\" (ngModelChange)=\"setControlProp('evaluationMode', $event)\">\r\n </core-radio-group>\r\n </div>\r\n\r\n <div class=\"setting-row depends-on-row\">\r\n <label class=\"setting-label\">Depends On</label>\r\n <core-sticker-collection [$items]=\"$fields()\" [$shownFrom]=\"'field'\"\r\n [$initialChecked]=\"$currentControl()?.dependsOn || []\" ($checkedChange)=\"setControlProp('dependsOn', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row return-type-row\">\r\n <label class=\"setting-label\">Return Type</label>\r\n <select class=\"form-control setting-input\" [ngModel]=\"$currentControl()?.returnType || 'number'\"\r\n (ngModelChange)=\"setControlProp('returnType', $event)\">\r\n <option value=\"boolean\">Boolean</option>\r\n <option value=\"number\">Number</option>\r\n <option value=\"string\">String</option>\r\n <option value=\"number[]\">Number[]</option>\r\n <option value=\"string[]\">String[]</option>\r\n <!-- Omitting 'Date' and 'object' -->\r\n </select>\r\n </div>\r\n\r\n @if (!!$currentControl()?.dependsOn && !!$currentControl()?.dependsOn!.length) {\r\n\r\n\r\n <div class=\"setting-row script-row\">\r\n <label class=\"setting-label\">Script {{ $beingValidated() ? 'is being validated...' : '' }}</label>\r\n <textarea [ngStyle]=\"{ minHeight: '150px', borderRadius: '8px' }\" [readonly]=\"!$currentControl()?.evaluationMode\"\r\n [disabled]=\"!$currentControl()?.evaluationMode\" class=\"form-control\"\r\n [class.form-control-disabled]=\"!$currentControl()?.evaluationMode\" rows=\"20\" [ngModel]=\"$currentControl()?.script\"\r\n (ngModelChange)=\"onScriptChange($event)\" [placeholder]=\"$placeholderForScriptInput()\">\r\n </textarea>\r\n @if (!!$sqlScriptError()) {\r\n <small class=\"text-danger\">{{ $sqlScriptError() }}</small>\r\n }\r\n\r\n\r\n @if (!!$currentControl()?.evaluationMode) {\r\n <div class=\"button-group\">\r\n <button class=\"btn btn-secondary validate-btn\" (click)=\"validateScript($event)\">Validate with AI</button>\r\n <button class=\"btn btn-primary validate-btn\" (click)=\"generateScript()\">\r\n {{ $aiGeneratorOn() ? 'Hide AI Prompt Editor' : 'Show AI Prompt Editor' }}\r\n </button>\r\n </div>\r\n }\r\n\r\n @if ($aiGeneratorOn()) {\r\n <div class=\"sql-generator-panel\">\r\n <div class=\"alert alert-info\" style=\"margin-top: 1rem;\">\r\n <strong>SQL Generator:</strong> Describe what you want the script to do, and AI will generate SQL for you.\r\n </div>\r\n\r\n @if ($currentControl()?.evaluationMode==='sql-query') {\r\n <div class=\"sql-generator-panel mt-4\">\r\n <label class=\"fw-bold mb-2\">Select Related Tables</label>\r\n\r\n <core-sticker-collection [$enableFilter]=\"true\" [$items]=\"wfs.$workflowDbSchema()\" [$shownFrom]=\"'table'\"\r\n [$tooltipFrom]=\"'hintForAi'\" [$initialChecked]=\"[]\" ($checkedChange)=\"tableCheckedChange($event)\">\r\n </core-sticker-collection>\r\n\r\n </div>\r\n }\r\n\r\n @if (!!$currentControl()?.evaluationMode) {\r\n <textarea class=\"form-control\" style=\"min-height: 100px; margin-top: 0.5rem; border-radius: 8px;\"\r\n [(ngModel)]=\"$sqlPrompt\" placeholder=\"e.g., Calculate leave days between FROM_DATE and TO_DATE\">\r\n </textarea>\r\n\r\n <div class=\"mt-2 d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-success\" (click)=\"submitScriptPrompt()\">\r\n Generate Script\r\n </button>\r\n </div>\r\n }\r\n\r\n @if ($generatedScript()) {\r\n <div class=\"generated-sql-box mt-3\">\r\n <label class=\"fw-bold\">Generated by AI:</label>\r\n <pre class=\"bg-light p-3 rounded\" style=\"white-space: pre-wrap;\">{{$generatedScript()}}</pre>\r\n <button class=\"btn btn-sm btn-primary mt-2\" (click)=\"applyGeneratedSql()\">Apply to Script</button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n\r\n\r\n }\r\n\r\n<ng-template #shortHtmlHintForCSharpSyntax>\r\n <div class=\"syntax-hint\">\r\n <strong>Example (C# Expression):</strong>\r\n <pre><code>FullName.ToUpper() + \" #\" + EmployeeCode</code></pre>\r\n <div class=\"note\">\r\n This expression will be evaluated dynamically using <code>DynamicExpresso</code>.<br>\r\n You can return any value from context.\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #shortHtmlHintForSqlSyntax>\r\n <div class=\"syntax-hint\">\r\n <strong>Example (SQL Query):</strong>\r\n <pre><code>SELECT EMPLOYEE_CODE FROM HU_EMPLOYEE WHERE ORG_ID = 123</code></pre>\r\n <div class=\"note\">\r\n Your SQL can return either a single value <em>or</em> a list.<br>\r\n The system will extract data from the <strong>first column of all rows</strong>.<br>\r\n Use standard SQL compatible with your database.\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n\r\n\r\n</div>", styles: [".setting-row{margin:30px 0}.button-group{margin-top:15px}.button-group button{height:35px;font-size:13px;border-radius:17.5px;margin-right:8px}.setting-divider{margin:1.5rem 0 .75rem;color:#555;border-top:1px dashed #ccc;padding-top:.5rem}.evaluation-mode-row{background-color:#ffecb3;border-radius:8px;width:180px;height:110px;padding:15px}.evaluation-mode-row label{margin-bottom:8px}.script-row{margin:30px 0}.syntax-hint{color:#666;background:#fff;border:1px solid #ccc;border-radius:6px;padding:12px;font-size:13px;max-width:320px;box-shadow:0 2px 6px #0000000d}.syntax-hint pre{margin:8px 0;background-color:#f8f8f8;padding:8px;border-radius:4px;font-family:monospace;white-space:pre-wrap;word-break:break-word}.syntax-hint .note{margin-top:6px;font-size:12px}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { 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.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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: CoreStickerCollectionComponent, selector: "core-sticker-collection", inputs: ["$items", "$shownFrom", "$tooltipFrom", "$initialChecked", "$showMore", "$showMoreTooltip", "$hideShowMoreIfNotSelected", "$enableFilter"], outputs: ["$checkedChange", "$onShowMore"] }, { kind: "component", type: CoreRadioGroupComponent, selector: "core-radio-group", inputs: ["options$", "vertical", "columnCount", "gapY", "defaultValue"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1070
- }
1071
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CalculatedPropsComponent, decorators: [{
1072
- type: Component,
1073
- args: [{ selector: 'calculated-props', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1074
- NgStyle,
1075
- FormsModule,
1076
- CoreStickerCollectionComponent,
1077
- CoreRadioGroupComponent,
1078
- ], template: "<div class=\"setting-group calculated-group\" [ngStyle]=\"{ padding: '15px' }\">\r\n\r\n <div class=\"setting-row evaluation-mode-row\">\r\n <label class=\"setting-label\">Evaluation Mode</label>\r\n <core-radio-group [options$]=\"radioOptions$\" [vertical]=\"true\" [gapY]=\"8\"\r\n [ngModel]=\"$currentControl()?.evaluationMode\" (ngModelChange)=\"setControlProp('evaluationMode', $event)\">\r\n </core-radio-group>\r\n </div>\r\n\r\n <div class=\"setting-row depends-on-row\">\r\n <label class=\"setting-label\">Depends On</label>\r\n <core-sticker-collection [$items]=\"$fields()\" [$shownFrom]=\"'field'\"\r\n [$initialChecked]=\"$currentControl()?.dependsOn || []\" ($checkedChange)=\"setControlProp('dependsOn', $event)\" />\r\n </div>\r\n\r\n <div class=\"setting-row return-type-row\">\r\n <label class=\"setting-label\">Return Type</label>\r\n <select class=\"form-control setting-input\" [ngModel]=\"$currentControl()?.returnType || 'number'\"\r\n (ngModelChange)=\"setControlProp('returnType', $event)\">\r\n <option value=\"boolean\">Boolean</option>\r\n <option value=\"number\">Number</option>\r\n <option value=\"string\">String</option>\r\n <option value=\"number[]\">Number[]</option>\r\n <option value=\"string[]\">String[]</option>\r\n <!-- Omitting 'Date' and 'object' -->\r\n </select>\r\n </div>\r\n\r\n @if (!!$currentControl()?.dependsOn && !!$currentControl()?.dependsOn!.length) {\r\n\r\n\r\n <div class=\"setting-row script-row\">\r\n <label class=\"setting-label\">Script {{ $beingValidated() ? 'is being validated...' : '' }}</label>\r\n <textarea [ngStyle]=\"{ minHeight: '150px', borderRadius: '8px' }\" [readonly]=\"!$currentControl()?.evaluationMode\"\r\n [disabled]=\"!$currentControl()?.evaluationMode\" class=\"form-control\"\r\n [class.form-control-disabled]=\"!$currentControl()?.evaluationMode\" rows=\"20\" [ngModel]=\"$currentControl()?.script\"\r\n (ngModelChange)=\"onScriptChange($event)\" [placeholder]=\"$placeholderForScriptInput()\">\r\n </textarea>\r\n @if (!!$sqlScriptError()) {\r\n <small class=\"text-danger\">{{ $sqlScriptError() }}</small>\r\n }\r\n\r\n\r\n @if (!!$currentControl()?.evaluationMode) {\r\n <div class=\"button-group\">\r\n <button class=\"btn btn-secondary validate-btn\" (click)=\"validateScript($event)\">Validate with AI</button>\r\n <button class=\"btn btn-primary validate-btn\" (click)=\"generateScript()\">\r\n {{ $aiGeneratorOn() ? 'Hide AI Prompt Editor' : 'Show AI Prompt Editor' }}\r\n </button>\r\n </div>\r\n }\r\n\r\n @if ($aiGeneratorOn()) {\r\n <div class=\"sql-generator-panel\">\r\n <div class=\"alert alert-info\" style=\"margin-top: 1rem;\">\r\n <strong>SQL Generator:</strong> Describe what you want the script to do, and AI will generate SQL for you.\r\n </div>\r\n\r\n @if ($currentControl()?.evaluationMode==='sql-query') {\r\n <div class=\"sql-generator-panel mt-4\">\r\n <label class=\"fw-bold mb-2\">Select Related Tables</label>\r\n\r\n <core-sticker-collection [$enableFilter]=\"true\" [$items]=\"wfs.$workflowDbSchema()\" [$shownFrom]=\"'table'\"\r\n [$tooltipFrom]=\"'hintForAi'\" [$initialChecked]=\"[]\" ($checkedChange)=\"tableCheckedChange($event)\">\r\n </core-sticker-collection>\r\n\r\n </div>\r\n }\r\n\r\n @if (!!$currentControl()?.evaluationMode) {\r\n <textarea class=\"form-control\" style=\"min-height: 100px; margin-top: 0.5rem; border-radius: 8px;\"\r\n [(ngModel)]=\"$sqlPrompt\" placeholder=\"e.g., Calculate leave days between FROM_DATE and TO_DATE\">\r\n </textarea>\r\n\r\n <div class=\"mt-2 d-flex gap-2 justify-content-end\">\r\n <button class=\"btn btn-success\" (click)=\"submitScriptPrompt()\">\r\n Generate Script\r\n </button>\r\n </div>\r\n }\r\n\r\n @if ($generatedScript()) {\r\n <div class=\"generated-sql-box mt-3\">\r\n <label class=\"fw-bold\">Generated by AI:</label>\r\n <pre class=\"bg-light p-3 rounded\" style=\"white-space: pre-wrap;\">{{$generatedScript()}}</pre>\r\n <button class=\"btn btn-sm btn-primary mt-2\" (click)=\"applyGeneratedSql()\">Apply to Script</button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n </div>\r\n\r\n\r\n\r\n }\r\n\r\n<ng-template #shortHtmlHintForCSharpSyntax>\r\n <div class=\"syntax-hint\">\r\n <strong>Example (C# Expression):</strong>\r\n <pre><code>FullName.ToUpper() + \" #\" + EmployeeCode</code></pre>\r\n <div class=\"note\">\r\n This expression will be evaluated dynamically using <code>DynamicExpresso</code>.<br>\r\n You can return any value from context.\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n<ng-template #shortHtmlHintForSqlSyntax>\r\n <div class=\"syntax-hint\">\r\n <strong>Example (SQL Query):</strong>\r\n <pre><code>SELECT EMPLOYEE_CODE FROM HU_EMPLOYEE WHERE ORG_ID = 123</code></pre>\r\n <div class=\"note\">\r\n Your SQL can return either a single value <em>or</em> a list.<br>\r\n The system will extract data from the <strong>first column of all rows</strong>.<br>\r\n Use standard SQL compatible with your database.\r\n </div>\r\n </div>\r\n</ng-template>\r\n\r\n\r\n\r\n\r\n\r\n</div>", styles: [".setting-row{margin:30px 0}.button-group{margin-top:15px}.button-group button{height:35px;font-size:13px;border-radius:17.5px;margin-right:8px}.setting-divider{margin:1.5rem 0 .75rem;color:#555;border-top:1px dashed #ccc;padding-top:.5rem}.evaluation-mode-row{background-color:#ffecb3;border-radius:8px;width:180px;height:110px;padding:15px}.evaluation-mode-row label{margin-bottom:8px}.script-row{margin:30px 0}.syntax-hint{color:#666;background:#fff;border:1px solid #ccc;border-radius:6px;padding:12px;font-size:13px;max-width:320px;box-shadow:0 2px 6px #0000000d}.syntax-hint pre{margin:8px 0;background-color:#f8f8f8;padding:8px;border-radius:4px;font-family:monospace;white-space:pre-wrap;word-break:break-word}.syntax-hint .note{margin-top:6px;font-size:12px}\n"] }]
1079
- }], ctorParameters: () => [{ type: MultiLanguageService }] });
1080
-
1081
- class FieldSettingComponent extends BaseComponent {
1082
- constructor() {
1083
- super(...arguments);
1084
- this.coreFormDesignService = inject(CoreFormDesignService);
1085
- this.enumControlType = EnumFormBaseContolType;
1086
- this.renderer = inject(Renderer2);
1087
- this.cdr = inject(ChangeDetectorRef);
1088
- // 🔹 Reactive normalized control (always derived from selected cell)
1089
- this.$control = computed(() => {
1090
- const cell = this.coreFormDesignService.$selectedCell();
1091
- if (!cell?.control)
1092
- throw new Error('No control selected!');
1093
- return this.coreFormDesignService.normalize(cell.control);
1094
- });
1095
- // 🔹 Context (flat control list)
1096
- this.$formContext = computed(() => this.coreFormDesignService.$formContext());
1097
- this.componentLoaderMap = {
1098
- 'number-props': () => Promise.resolve().then(function () { return numberProps_component; }).then(m => m.NumberPropsComponent),
1099
- 'email-props': () => import('./ngx-histaff-alpha-email-props.component-Cf35Pexq.mjs').then(m => m.EmailPropsComponent),
1100
- 'dropdown-props': () => Promise.resolve().then(function () { return dropdownProps_component; }).then(m => m.DropdownPropsComponent),
1101
- 'form-array-props': () => import('./ngx-histaff-alpha-form-array-props.component-DkAM9Uk9.mjs').then(m => m.FormArrayPropsComponent),
1102
- // etc...
1103
- };
1104
- }
1105
- // 🔹 Optional trigger for downstream side-effects (no longer emits)
1106
- onControlParamsChange() {
1107
- const updated = this.$control();
1108
- this.coreFormDesignService.patchControl(updated);
1109
- }
1110
- closeFieldSettingPanel() {
1111
- this.coreFormDesignService.$fieldSettingPanelOpen.set(false);
1112
- }
1113
- getFriendlyControlLabel(control) {
1114
- if (!control)
1115
- return 'Control';
1116
- // 🧠 Detailed mapping: "controlType:type" → Friendly Name
1117
- const fullTypeMap = {
1118
- 'TEXTBOX:string': 'String Box',
1119
- 'TEXTBOX:number': 'Number Box',
1120
- 'TEXTBOX:email': 'Email Field',
1121
- 'DROPDOWN': 'Dropdown',
1122
- 'CHECKLIST': 'Checklist',
1123
- 'SEEKER': 'Seeker',
1124
- 'DATEPICKER': 'Date Picker',
1125
- 'TEXTAREA': 'Text Area',
1126
- 'CHECKBOX': 'Checkbox'
1127
- // Add more mappings as needed
1128
- };
1129
- const controlType = control.controlType?.toUpperCase() ?? '';
1130
- const inputType = control.type?.toLowerCase();
1131
- const fullKey = inputType ? `${controlType}:${inputType}` : controlType;
1132
- return fullTypeMap[fullKey] ?? this.camelToTitle(control.controlType ?? 'Control');
1133
- }
1134
- camelToTitle(input) {
1135
- return input
1136
- .replace(/([a-z])([A-Z])/g, '$1 $2')
1137
- .replace(/^./, str => str.toUpperCase());
1138
- }
1139
- ngAfterViewInit() {
1140
- this.listenerFn = this.renderer.listen('window', 'click', (e) => {
1141
- this.cdr.markForCheck();
1142
- });
1143
- }
1144
- ngOnDestroy() {
1145
- this.subscriptions.forEach(x => x?.unsubscribe());
1146
- if (this.listenerFn)
1147
- this.listenerFn();
1148
- }
1149
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FieldSettingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1150
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: FieldSettingComponent, isStandalone: true, selector: "field-setting", usesInheritance: true, ngImport: i0, template: "<div class=\"field-setting-container\">\r\n\r\n @if (!!$control()) {\r\n <div class=\"panel-caption-header\">\r\n <div class=\"panel-caption\">\r\n Editing: {{ $control().type !== 'calculated' ? $control()?.controlType + ' - ' : '' }}{{ $control()?.field ||\r\n 'Unnamed' }}\r\n </div>\r\n <div class=\"close-wrapper pointer\" (click)=\"closeFieldSettingPanel()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"field-setting-content\">\r\n\r\n\r\n @if ($control().type === 'calculated') {\r\n\r\n <div class=\"group-title mandatory\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-lock\"></i>\r\n </div>\r\n <div class=\"group-name\">Mandatory</div>\r\n </div>\r\n <mandatory-props></mandatory-props>\r\n\r\n <div class=\"group-title calculated\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-lock\"></i>\r\n </div>\r\n <div class=\"group-name\">Calculated Rule<i class=\"feather-help-circle\" [htmlTooltip]=\"aboutCalculatedField\"\r\n [maxWidthUnset]=\"true\"></i></div>\r\n </div>\r\n <calculated-props></calculated-props>\r\n\r\n\r\n } @else {\r\n\r\n <div class=\"group-title mandatory\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-lock\"></i>\r\n </div>\r\n <div class=\"group-name\">Mandatory</div>\r\n </div>\r\n <mandatory-props></mandatory-props>\r\n\r\n <!-- <div class=\"setting-divider\"></div> -->\r\n\r\n @if ($control().controlType !== 'FORM_ARRAY') {\r\n <div class=\"group-title optional\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-sliders\"></i>\r\n </div>\r\n <div class=\"group-name\">Optional</div>\r\n </div>\r\n <optional-props></optional-props>\r\n\r\n <!-- <div class=\"setting-divider\"></div> -->\r\n\r\n <div class=\"group-title validators\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-check-square\"></i>\r\n </div>\r\n <div class=\"group-name\">Validators</div>\r\n </div>\r\n <validator-editor></validator-editor>\r\n }\r\n\r\n @if (!($control().controlType === 'TEXTBOX' && ['string', 'text', 'email'].includes(($control().type ||\r\n '').toLowerCase()))) {\r\n\r\n <div class=\"group-title\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-check-square\"></i>\r\n </div>\r\n <div class=\"group-name\">{{ getFriendlyControlLabel($control()) }} Settings</div>\r\n </div>\r\n\r\n <props-host [loadComponent]=\"componentLoaderMap[coreFormDesignService.$currentPropsComponent()]\"\r\n [props]=\"{ control: $control(), controlChange: onControlParamsChange.bind(this) }\">\r\n </props-host>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n\r\n\r\n</div>\r\n\r\n<ng-template #aboutCalculatedField>\r\n\r\n <div class=\"calculated-field-rule\" style=\"padding: 1rem; border-radius: 8px; background: #000; width: 800px;\">\r\n <h4 style=\"margin-top: 0; color: #fff;\">Calculated Field Rule</h4>\r\n <p><strong>Calculated fields</strong> are invisible boolean fields evaluated based on form inputs and logic. They\r\n help drive dynamic workflow behavior, such as conditional routing or validation triggers.</p>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Key Properties</h5>\r\n <ul style=\"margin-top: 0;\">\r\n <li><strong>script:</strong> Expression to evaluate (e.g.,\r\n <code>leaveDays &gt; 3 &amp;&amp; status == 'Approved'</code>)</li>\r\n <li><strong>evaluationMode:</strong> <code>\"in-memory\"</code> or <code>\"sql-query\"</code></li>\r\n <li><strong>dependsOn[]:</strong> List of field names the script depends on</li>\r\n <li><strong>filterMode:</strong> <code>\"HardBlock\"</code> or <code>\"SoftWarn\"</code></li>\r\n </ul>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Evaluation Modes</h5>\r\n <ul style=\"margin-top: 0;\">\r\n <li>\r\n <strong>in-memory:</strong> Uses <code>DynamicExpresso</code> to evaluate C#-like logic at runtime<br />\r\n <small>Example: <code>leaveType == \"ANNUAL\" &amp;&amp; leaveDays &lt; 5</code></small>\r\n </li>\r\n <li>\r\n <strong>sql-query:</strong> Runs backend SQL to evaluate conditions via\r\n <code>SELECT CASE WHEN ... THEN 1 ELSE 0 END</code><br />\r\n <small>Example:\r\n <code>SELECT CASE WHEN QUOTA &gt; 0 THEN 1 ELSE 0 END FROM LEAVE_QUOTA WHERE EMPLOYEE_ID = {{ '@' }}employeeId</code></small>\r\n </li>\r\n </ul>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Use Cases</h5>\r\n <ul style=\"margin-top: 0;\">\r\n <li>Validate complex logic without showing the field</li>\r\n <li>Route to a different workflow branch based on hidden logic</li>\r\n <li>Trigger warning or block submission based on business rules</li>\r\n </ul>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Example</h5>\r\n <pre style=\"color: #eee; padding: 0.5rem 1rem; border-radius: 4px; overflow-x: auto;\">\r\n {{ '{' }}\r\n \"script\": \"leaveDays > 3 && status == 'APPROVED'\",\r\n \"evaluationMode\": \"in-memory\",\r\n \"dependsOn\": [\"leaveDays\", \"status\"],\r\n \"filterMode\": \"HardBlock\"\r\n {{ '}' }}\r\n </pre>\r\n </div>\r\n\r\n\r\n</ng-template>", styles: [".field-setting-container{max-height:100%;overflow-x:hidden;overflow-y:auto}.field-setting-container .field-setting-content{padding:15px}.field-setting-container .panel-caption-header{display:flex;align-items:center;justify-content:space-between;padding:15px;height:60px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;color:#1f2937}.field-setting-container .panel-caption-header .panel-caption{flex-grow:1}.field-setting-container .panel-caption-header .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}.field-setting-container .panel-caption-header .close-wrapper:hover{background-color:#e2e8f0}.field-setting-container .setting-divider{margin:1.5rem 0 .75rem;color:#555;border-top:1px dashed #ccc;padding-top:.5rem}.field-setting-container .group-title{display:flex;height:35px;align-items:center;gap:8px;background-color:#87ceeb;padding:6px 12px;font-weight:600;color:#1f2937;font-size:13px;margin:12px 0 4px;box-shadow:0 1px 2px #0000000d}.field-setting-container .group-title .icon-wrapper{display:flex;align-items:center;justify-content:center;width:18px;height:18px;color:#1f2937}.field-setting-container .group-title .icon-wrapper i{width:16px;height:16px;stroke-width:2}.field-setting-container .group-title.mandatory{background-color:#ffecb3}.field-setting-container .group-title.optional{background-color:#d0f0fd}.field-setting-container .group-title.validators{background-color:#e8f5e9}.field-setting-container .group-title .group-name{flex:1}.field-setting-container .group-title .group-name .feather-help-circle{display:inline-block;margin-left:8px}.field-setting-container .calculated-field-rule{font-family:system-ui,sans-serif;border:1px solid #ccc;padding:1rem;border-radius:8px}.field-setting-container .calculated-field-rule h2{margin-top:0;color:#2b3e50}.field-setting-container .calculated-field-rule pre{background:#eee;padding:.5rem 1rem;border-radius:4px;overflow-x:auto}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: MandatoryPropsComponent, selector: "mandatory-props" }, { kind: "component", type: OptionalPropsComponent, selector: "optional-props" }, { kind: "component", type: ValidatorEditorComponent, selector: "validator-editor" }, { kind: "component", type: PropsHostComponent, selector: "props-host", inputs: ["loadComponent", "props"] }, { kind: "component", type: CalculatedPropsComponent, selector: "calculated-props" }, { kind: "directive", type: HtmlTooltipDirective, selector: "[htmlTooltip]", inputs: ["htmlTooltip", "tooltipContext", "maxWidthUnset", "backgroundColor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1151
- }
1152
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FieldSettingComponent, decorators: [{
1153
- type: Component,
1154
- args: [{ selector: 'field-setting', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1155
- FormsModule,
1156
- NgStyle,
1157
- MandatoryPropsComponent,
1158
- OptionalPropsComponent,
1159
- ValidatorEditorComponent,
1160
- PropsHostComponent,
1161
- AttachmentPropsComponent,
1162
- ChecklistPropsComponent,
1163
- DatepickerPropsComponent,
1164
- DropdownPropsComponent,
1165
- GridBufferPropsComponent,
1166
- ListPropsComponent,
1167
- MccPropsComponent,
1168
- NumberPropsComponent,
1169
- RadioGroupPropsComponent,
1170
- SeekerPropsComponent,
1171
- TextareaPropsComponent,
1172
- UploaderPropsComponent,
1173
- CalculatedPropsComponent,
1174
- HtmlTooltipDirective
1175
- ], template: "<div class=\"field-setting-container\">\r\n\r\n @if (!!$control()) {\r\n <div class=\"panel-caption-header\">\r\n <div class=\"panel-caption\">\r\n Editing: {{ $control().type !== 'calculated' ? $control()?.controlType + ' - ' : '' }}{{ $control()?.field ||\r\n 'Unnamed' }}\r\n </div>\r\n <div class=\"close-wrapper pointer\" (click)=\"closeFieldSettingPanel()\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"field-setting-content\">\r\n\r\n\r\n @if ($control().type === 'calculated') {\r\n\r\n <div class=\"group-title mandatory\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-lock\"></i>\r\n </div>\r\n <div class=\"group-name\">Mandatory</div>\r\n </div>\r\n <mandatory-props></mandatory-props>\r\n\r\n <div class=\"group-title calculated\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-lock\"></i>\r\n </div>\r\n <div class=\"group-name\">Calculated Rule<i class=\"feather-help-circle\" [htmlTooltip]=\"aboutCalculatedField\"\r\n [maxWidthUnset]=\"true\"></i></div>\r\n </div>\r\n <calculated-props></calculated-props>\r\n\r\n\r\n } @else {\r\n\r\n <div class=\"group-title mandatory\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-lock\"></i>\r\n </div>\r\n <div class=\"group-name\">Mandatory</div>\r\n </div>\r\n <mandatory-props></mandatory-props>\r\n\r\n <!-- <div class=\"setting-divider\"></div> -->\r\n\r\n @if ($control().controlType !== 'FORM_ARRAY') {\r\n <div class=\"group-title optional\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-sliders\"></i>\r\n </div>\r\n <div class=\"group-name\">Optional</div>\r\n </div>\r\n <optional-props></optional-props>\r\n\r\n <!-- <div class=\"setting-divider\"></div> -->\r\n\r\n <div class=\"group-title validators\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-check-square\"></i>\r\n </div>\r\n <div class=\"group-name\">Validators</div>\r\n </div>\r\n <validator-editor></validator-editor>\r\n }\r\n\r\n @if (!($control().controlType === 'TEXTBOX' && ['string', 'text', 'email'].includes(($control().type ||\r\n '').toLowerCase()))) {\r\n\r\n <div class=\"group-title\">\r\n <div class=\"icon-wrapper\">\r\n <i class=\"feather-check-square\"></i>\r\n </div>\r\n <div class=\"group-name\">{{ getFriendlyControlLabel($control()) }} Settings</div>\r\n </div>\r\n\r\n <props-host [loadComponent]=\"componentLoaderMap[coreFormDesignService.$currentPropsComponent()]\"\r\n [props]=\"{ control: $control(), controlChange: onControlParamsChange.bind(this) }\">\r\n </props-host>\r\n }\r\n }\r\n </div>\r\n }\r\n\r\n\r\n\r\n</div>\r\n\r\n<ng-template #aboutCalculatedField>\r\n\r\n <div class=\"calculated-field-rule\" style=\"padding: 1rem; border-radius: 8px; background: #000; width: 800px;\">\r\n <h4 style=\"margin-top: 0; color: #fff;\">Calculated Field Rule</h4>\r\n <p><strong>Calculated fields</strong> are invisible boolean fields evaluated based on form inputs and logic. They\r\n help drive dynamic workflow behavior, such as conditional routing or validation triggers.</p>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Key Properties</h5>\r\n <ul style=\"margin-top: 0;\">\r\n <li><strong>script:</strong> Expression to evaluate (e.g.,\r\n <code>leaveDays &gt; 3 &amp;&amp; status == 'Approved'</code>)</li>\r\n <li><strong>evaluationMode:</strong> <code>\"in-memory\"</code> or <code>\"sql-query\"</code></li>\r\n <li><strong>dependsOn[]:</strong> List of field names the script depends on</li>\r\n <li><strong>filterMode:</strong> <code>\"HardBlock\"</code> or <code>\"SoftWarn\"</code></li>\r\n </ul>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Evaluation Modes</h5>\r\n <ul style=\"margin-top: 0;\">\r\n <li>\r\n <strong>in-memory:</strong> Uses <code>DynamicExpresso</code> to evaluate C#-like logic at runtime<br />\r\n <small>Example: <code>leaveType == \"ANNUAL\" &amp;&amp; leaveDays &lt; 5</code></small>\r\n </li>\r\n <li>\r\n <strong>sql-query:</strong> Runs backend SQL to evaluate conditions via\r\n <code>SELECT CASE WHEN ... THEN 1 ELSE 0 END</code><br />\r\n <small>Example:\r\n <code>SELECT CASE WHEN QUOTA &gt; 0 THEN 1 ELSE 0 END FROM LEAVE_QUOTA WHERE EMPLOYEE_ID = {{ '@' }}employeeId</code></small>\r\n </li>\r\n </ul>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Use Cases</h5>\r\n <ul style=\"margin-top: 0;\">\r\n <li>Validate complex logic without showing the field</li>\r\n <li>Route to a different workflow branch based on hidden logic</li>\r\n <li>Trigger warning or block submission based on business rules</li>\r\n </ul>\r\n\r\n <h5 style=\"margin-bottom: 0.5rem; color: #fff;\">Example</h5>\r\n <pre style=\"color: #eee; padding: 0.5rem 1rem; border-radius: 4px; overflow-x: auto;\">\r\n {{ '{' }}\r\n \"script\": \"leaveDays > 3 && status == 'APPROVED'\",\r\n \"evaluationMode\": \"in-memory\",\r\n \"dependsOn\": [\"leaveDays\", \"status\"],\r\n \"filterMode\": \"HardBlock\"\r\n {{ '}' }}\r\n </pre>\r\n </div>\r\n\r\n\r\n</ng-template>", styles: [".field-setting-container{max-height:100%;overflow-x:hidden;overflow-y:auto}.field-setting-container .field-setting-content{padding:15px}.field-setting-container .panel-caption-header{display:flex;align-items:center;justify-content:space-between;padding:15px;height:60px;background-color:#f8fafc;border-bottom:1px solid #e2e8f0;color:#1f2937}.field-setting-container .panel-caption-header .panel-caption{flex-grow:1}.field-setting-container .panel-caption-header .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}.field-setting-container .panel-caption-header .close-wrapper:hover{background-color:#e2e8f0}.field-setting-container .setting-divider{margin:1.5rem 0 .75rem;color:#555;border-top:1px dashed #ccc;padding-top:.5rem}.field-setting-container .group-title{display:flex;height:35px;align-items:center;gap:8px;background-color:#87ceeb;padding:6px 12px;font-weight:600;color:#1f2937;font-size:13px;margin:12px 0 4px;box-shadow:0 1px 2px #0000000d}.field-setting-container .group-title .icon-wrapper{display:flex;align-items:center;justify-content:center;width:18px;height:18px;color:#1f2937}.field-setting-container .group-title .icon-wrapper i{width:16px;height:16px;stroke-width:2}.field-setting-container .group-title.mandatory{background-color:#ffecb3}.field-setting-container .group-title.optional{background-color:#d0f0fd}.field-setting-container .group-title.validators{background-color:#e8f5e9}.field-setting-container .group-title .group-name{flex:1}.field-setting-container .group-title .group-name .feather-help-circle{display:inline-block;margin-left:8px}.field-setting-container .calculated-field-rule{font-family:system-ui,sans-serif;border:1px solid #ccc;padding:1rem;border-radius:8px}.field-setting-container .calculated-field-rule h2{margin-top:0;color:#2b3e50}.field-setting-container .calculated-field-rule pre{background:#eee;padding:.5rem 1rem;border-radius:4px;overflow-x:auto}\n"] }]
1176
- }] });
1177
-
1178
- var EnumLeftPanelMode;
1179
- (function (EnumLeftPanelMode) {
1180
- EnumLeftPanelMode["FieldCollection"] = "FieldCollection";
1181
- EnumLeftPanelMode["Json"] = "Json";
1182
- })(EnumLeftPanelMode || (EnumLeftPanelMode = {}));
1183
-
1184
- class CoreFormArrayControlPaletteComponent {
1185
- constructor() {
1186
- this.coreFormDesignService = inject(CoreFormDesignService);
1187
- this.controlOptions = [
1188
- {
1189
- flexSize: 12,
1190
- controlType: EnumFormBaseContolType.TEXTBOX,
1191
- type: 'string',
1192
- field: 'stringBox',
1193
- label: '',
1194
- value: '',
1195
- readonly: true,
1196
- placeholder: 'String box',
1197
- headless: true,
1198
- },
1199
- {
1200
- flexSize: 12,
1201
- controlType: EnumFormBaseContolType.TEXTBOX,
1202
- type: 'email',
1203
- field: 'email',
1204
- label: '',
1205
- value: '',
1206
- readonly: true,
1207
- placeholder: 'Email',
1208
- headless: true,
1209
- },
1210
- {
1211
- flexSize: 12,
1212
- controlType: EnumFormBaseContolType.TEXTAREA,
1213
- type: 'string',
1214
- field: 'textarea',
1215
- label: '',
1216
- value: '',
1217
- readonly: true,
1218
- textareaRows: 2,
1219
- placeholder: 'Text area',
1220
- headless: true,
1221
- },
1222
- {
1223
- flexSize: 12,
1224
- controlType: EnumFormBaseContolType.TEXTBOX,
1225
- type: 'number',
1226
- field: 'number',
1227
- label: '',
1228
- value: 100,
1229
- readonly: true,
1230
- placeholder: 'Number',
1231
- headless: true,
1232
- },
1233
- {
1234
- flexSize: 12,
1235
- controlType: EnumFormBaseContolType.CURRENCY,
1236
- type: 'number',
1237
- field: 'currency',
1238
- label: '',
1239
- value: '',
1240
- readonly: true,
1241
- placeholder: 'Currency',
1242
- headless: true,
1243
- },
1244
- {
1245
- flexSize: 12,
1246
- controlType: EnumFormBaseContolType.DROPDOWN,
1247
- type: 'any',
1248
- field: 'dropdown',
1249
- label: '',
1250
- value: '',
1251
- readonly: true,
1252
- dropdownOptions$: new BehaviorSubject([]),
1253
- shownFrom: 'name',
1254
- getByIdObject$: new BehaviorSubject({}),
1255
- placeholder: 'Dropdown',
1256
- headless: true,
1257
- },
1258
- {
1259
- flexSize: 12,
1260
- controlType: EnumFormBaseContolType.SEEKER,
1261
- seekerSourceType: EnumCoreFormControlSeekerSourceType.EMPLOYEE_SEEK,
1262
- type: 'any[]',
1263
- field: 'employeeSeeker',
1264
- label: '',
1265
- value: ['Nguyễn A'],
1266
- readonly: true,
1267
- boundFrom: 'id',
1268
- shownFrom: 'fullname',
1269
- getByIdObject$: new BehaviorSubject({}),
1270
- placeholder: 'Employee seeker',
1271
- headless: true,
1272
- },
1273
- {
1274
- flexSize: 12,
1275
- controlType: EnumFormBaseContolType.CHECKLIST,
1276
- type: 'any[]',
1277
- field: 'checklist',
1278
- label: '',
1279
- value: [],
1280
- readonly: true,
1281
- checklistOptions$: new BehaviorSubject([]),
1282
- shownFrom: 'name',
1283
- getByIdObject$: new BehaviorSubject({}),
1284
- placeholder: 'Check list',
1285
- headless: true,
1286
- },
1287
- {
1288
- flexSize: 12,
1289
- controlType: EnumFormBaseContolType.SEEKER,
1290
- seekerSourceType: EnumCoreFormControlSeekerSourceType.EMPLOYEE_SEEK,
1291
- multiMode: true,
1292
- type: 'any[]',
1293
- field: 'employeeSeekerMultiple',
1294
- label: '',
1295
- value: [],
1296
- readonly: true,
1297
- objectList$: new BehaviorSubject([]),
1298
- boundFrom: 'id',
1299
- shownFrom: 'fullname',
1300
- getByIdObject$: new BehaviorSubject({}),
1301
- multiModeTableHeight: 100,
1302
- placeholder: 'Employee seeker (multi mode)',
1303
- headless: true,
1304
- },
1305
- {
1306
- flexSize: 12,
1307
- controlType: EnumFormBaseContolType.DATEPICKER,
1308
- type: 'date',
1309
- field: 'datePicker',
1310
- label: '',
1311
- value: '',
1312
- readonly: true,
1313
- placeholder: 'Date picker',
1314
- showPlaceholder: true,
1315
- headless: true,
1316
- },
1317
- {
1318
- flexSize: 12,
1319
- controlType: EnumFormBaseContolType.TEXTBOX,
1320
- type: 'time',
1321
- field: 'timeBox',
1322
- label: '',
1323
- value: null,
1324
- readonly: true,
1325
- placeholder: 'Time box',
1326
- headless: true,
1327
- },
1328
- {
1329
- flexSize: 12,
1330
- controlType: EnumFormBaseContolType.MONTHSELECTOR,
1331
- type: 'string',
1332
- field: 'monthSelector',
1333
- label: '',
1334
- value: '',
1335
- readonly: true,
1336
- placeholder: 'Month selector',
1337
- headless: true,
1338
- },
1339
- {
1340
- flexSize: 12,
1341
- controlType: EnumFormBaseContolType.ATTACHMENT,
1342
- type: 'string',
1343
- field: 'attachment',
1344
- label: '',
1345
- value: '',
1346
- readonly: true,
1347
- assignTo: 'unknown',
1348
- placeholder: 'Attachment',
1349
- headless: true,
1350
- },
1351
- {
1352
- flexSize: 12,
1353
- controlType: EnumFormBaseContolType.CHECKBOX,
1354
- type: 'boolean',
1355
- field: 'checkbox',
1356
- label: '',
1357
- value: '',
1358
- readonly: true,
1359
- placeholder: 'Checkbox',
1360
- headless: true,
1361
- }
1362
- ];
1363
- this.form = new FormGroup({
1364
- stringBox: new FormControl(),
1365
- timeBox: new FormControl(),
1366
- email: new FormControl(),
1367
- textarea: new FormControl(),
1368
- number: new FormControl(),
1369
- currency: new FormControl(),
1370
- dropdown: new FormControl(),
1371
- employeeSeeker: new FormControl(),
1372
- checklist: new FormControl(),
1373
- employeeSeekerMultiple: new FormControl(),
1374
- datePicker: new FormControl(),
1375
- monthSelector: new FormControl(),
1376
- attachment: new FormControl(),
1377
- attachmentBuffer: new FormControl(),
1378
- checkbox: new FormControl(),
1379
- });
1380
- this.checkError$ = new BehaviorSubject(false);
1381
- }
1382
- onDragStart(event, control) {
1383
- event.dataTransfer?.setData('application/json', JSON.stringify(control));
1384
- }
1385
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreFormArrayControlPaletteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1386
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: CoreFormArrayControlPaletteComponent, isStandalone: true, selector: "core-form-array-control-palette", ngImport: i0, template: "<ul>\r\n <!-- <div class=\"palette-debug\">\r\n <div>controlOptions length: {{ controlOptions.length }}</div>\r\n <pre>{{ controlOptions | json }}</pre>\r\n </div> -->\r\n @for (control of controlOptions; track $index) {\r\n <li class=\"palette-item\" draggable=\"true\" (dragstart)=\"onDragStart($event, control)\">\r\n <core-control-no-form-array [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\" />\r\n </li>\r\n }\r\n</ul>", styles: [".palette-debug{font-size:12px;background:#f9f9f9;border:1px solid #ddd;padding:8px;border-radius:4px;color:#333;margin-bottom:8px;white-space:pre-wrap}ul{padding:0}ul li{margin:8px}\n"], dependencies: [{ kind: "component", type: CoreControlNoFormArrayComponent, selector: "core-control-no-form-array", inputs: ["control", "form", "checkError$", "rangeLimit"] }] }); }
1387
- }
1388
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreFormArrayControlPaletteComponent, decorators: [{
1389
- type: Component,
1390
- args: [{ selector: 'core-form-array-control-palette', imports: [
1391
- JsonPipe,
1392
- CoreControlNoFormArrayComponent
1393
- ], template: "<ul>\r\n <!-- <div class=\"palette-debug\">\r\n <div>controlOptions length: {{ controlOptions.length }}</div>\r\n <pre>{{ controlOptions | json }}</pre>\r\n </div> -->\r\n @for (control of controlOptions; track $index) {\r\n <li class=\"palette-item\" draggable=\"true\" (dragstart)=\"onDragStart($event, control)\">\r\n <core-control-no-form-array [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\" />\r\n </li>\r\n }\r\n</ul>", styles: [".palette-debug{font-size:12px;background:#f9f9f9;border:1px solid #ddd;padding:8px;border-radius:4px;color:#333;margin-bottom:8px;white-space:pre-wrap}ul{padding:0}ul li{margin:8px}\n"] }]
1394
- }] });
1395
-
1396
- const PLACEHOLDER_CONTROL = {
1397
- controlType: EnumFormBaseContolType.PLACEHOLDER,
1398
- field: '',
1399
- label: '',
1400
- flexSize: 12,
1401
- value: ''
1402
- };
1403
- class CoreFormArrayLayoutEditorComponent {
1404
- constructor() {
1405
- this.checkError$ = new BehaviorSubject(false);
1406
- this.coreFormDesignService = inject(CoreFormDesignService);
1407
- this.$sections = this.coreFormDesignService.$nestedDesignSections;
1408
- this.form = this.coreFormDesignService.formDesign;
1409
- this.showDebug = false;
1410
- this.dropIndex = 0;
1411
- }
1412
- onClose() {
1413
- this.coreFormDesignService.$showFormArrayDesign.set(false);
1414
- }
1415
- onMiniDrop(event, sectionIndex, rowIndex, colIndex) {
1416
- const rawData = event?.dataTransfer?.getData('application/json');
1417
- if (!rawData)
1418
- return;
1419
- const control = JSON.parse(rawData);
1420
- const newControl = structuredClone(control);
1421
- newControl.field = `control_${++this.dropIndex}`;
1422
- const current = this.$sections();
1423
- if (!current)
1424
- return;
1425
- current[sectionIndex].rows[rowIndex][colIndex] = newControl;
1426
- this.$sections.set([...current]);
1427
- }
1428
- addSection() {
1429
- const current = this.$sections() || [];
1430
- current.push({ caption: '', rows: [[PLACEHOLDER_CONTROL]] });
1431
- this.$sections.set([...current]);
1432
- }
1433
- addRow(sectionIndex) {
1434
- const current = this.$sections();
1435
- if (!current?.[sectionIndex])
1436
- return;
1437
- current[sectionIndex].rows.push([PLACEHOLDER_CONTROL]);
1438
- this.$sections.set([...current]);
1439
- }
1440
- removeControl(sectionIndex, rowIndex, colIndex) {
1441
- const current = this.$sections();
1442
- // Guard: Make sure the section and row exist
1443
- if (!current?.[sectionIndex]?.rows[rowIndex])
1444
- return;
1445
- // Replace the control at given slot with a type-safe placeholder
1446
- current[sectionIndex].rows[rowIndex][colIndex] = PLACEHOLDER_CONTROL;
1447
- // Update the signal to trigger re-render
1448
- this.$sections.set([...current]);
1449
- }
1450
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreFormArrayLayoutEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1451
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: CoreFormArrayLayoutEditorComponent, isStandalone: true, selector: "core-form-array-layout-editor", ngImport: i0, template: "<div class=\"core-form-array-layout-editor-container\">\r\n <div class=\"modal-container\">\r\n <div class=\"modal-content-root\">\r\n\r\n <div class=\"layout-header\">\r\n {{ 'Design Form Array Layout' | uppercase }}\r\n <button class=\"close-button\" (click)=\"onClose()\">\u00D7</button>\r\n </div>\r\n\r\n <div class=\"layout-main-content\">\r\n <!-- Left: Palette -->\r\n <div class=\"layout-left\">\r\n <core-form-array-control-palette />\r\n </div>\r\n\r\n <!-- Right: Grid Layout -->\r\n <div class=\"layout-right\">\r\n <div class=\"layout-toolbar\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"addSection()\">+ Section</button>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"addRow(0)\">+ Row to First Section</button>\r\n <button class=\"btn btn-sm btn-outline-dark\" (click)=\"showDebug = !showDebug\">\r\n {{ showDebug ? 'Hide' : 'Show' }} Debug\r\n </button>\r\n </div>\r\n\r\n @if (showDebug) {\r\n <pre>{{ $sections() | json }}</pre>\r\n }\r\n\r\n <div class=\"layout-body\">\r\n @for (section of $sections(); track $index; let sectionIndex = $index) {\r\n <div class=\"section-card\">\r\n <div class=\"section-caption\">\r\n {{ section.caption || 'Untitled Section' }}\r\n </div>\r\n\r\n @for (row of section.rows; track $index; let rowIndex = $index) {\r\n <div class=\"row\">\r\n @for (control of row; track $index; let colIndex = $index) {\r\n <div class=\"form-cell mini-drop-target\" miniDropTarget\r\n (miniDropped)=\"onMiniDrop($event, sectionIndex, rowIndex, colIndex)\">\r\n @if (control) {\r\n <div class=\"form-cell-inner\">\r\n <core-control-no-form-array [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\" />\r\n <button class=\"btn btn-sm btn-link text-danger remove-btn\"\r\n (click)=\"removeControl(sectionIndex, rowIndex, colIndex)\">\r\n \u00D7\r\n </button>\r\n </div>\r\n } @else {\r\n <div class=\"placeholder-slot\">Drop Here</div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".layout-header{position:relative;padding:15px;font-size:20px;border-bottom:1px solid #e0e0e0;display:flex;align-items:center;transform:translate(-15px,-15px);width:calc(100% + 30px)}.close-button{position:absolute;top:12px;right:12px;background:none;border:none;font-size:22px;cursor:pointer;color:#666;line-height:1;padding:0;z-index:1}.close-button:hover{color:#000}.layout-main-content{display:flex;gap:24px}.layout-left{width:200px;flex:0 0 240px;border-right:1px solid #eee;padding-right:16px;overflow:auto}.layout-right{flex:1;padding-left:16px;overflow-x:auto}.layout-toolbar{display:flex;gap:12px;margin-bottom:12px}.layout-body{display:flex;flex-direction:column;gap:24px}.section-card{background-color:#fdfdfd;border:1px solid #ddd;border-radius:8px;padding:12px}.section-caption{font-weight:600;margin-bottom:12px}.row{display:flex;gap:12px;margin-bottom:12px}.form-cell{flex:1;min-width:120px;padding:6px;border:1px dashed #ccc;border-radius:4px;background-color:#fff;position:relative}.form-cell-inner{position:relative}.remove-btn{position:absolute;top:0;right:0;font-size:14px;padding:0 4px;border:none}.placeholder-slot{text-align:center;color:#aaa;padding:16px;background:#fafafa;border:1px dashed #bbb;border-radius:4px}\n"], dependencies: [{ kind: "pipe", type: JsonPipe, name: "json" }, { kind: "pipe", type: UpperCasePipe, name: "uppercase" }, { kind: "component", type: CoreControlNoFormArrayComponent, selector: "core-control-no-form-array", inputs: ["control", "form", "checkError$", "rangeLimit"] }, { kind: "component", type: CoreFormArrayControlPaletteComponent, selector: "core-form-array-control-palette" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1452
- }
1453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreFormArrayLayoutEditorComponent, decorators: [{
1454
- type: Component,
1455
- args: [{ selector: 'core-form-array-layout-editor', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
1456
- JsonPipe,
1457
- UpperCasePipe,
1458
- CoreControlNoFormArrayComponent,
1459
- CoreFormArrayControlPaletteComponent
1460
- ], template: "<div class=\"core-form-array-layout-editor-container\">\r\n <div class=\"modal-container\">\r\n <div class=\"modal-content-root\">\r\n\r\n <div class=\"layout-header\">\r\n {{ 'Design Form Array Layout' | uppercase }}\r\n <button class=\"close-button\" (click)=\"onClose()\">\u00D7</button>\r\n </div>\r\n\r\n <div class=\"layout-main-content\">\r\n <!-- Left: Palette -->\r\n <div class=\"layout-left\">\r\n <core-form-array-control-palette />\r\n </div>\r\n\r\n <!-- Right: Grid Layout -->\r\n <div class=\"layout-right\">\r\n <div class=\"layout-toolbar\">\r\n <button class=\"btn btn-sm btn-primary\" (click)=\"addSection()\">+ Section</button>\r\n <button class=\"btn btn-sm btn-secondary\" (click)=\"addRow(0)\">+ Row to First Section</button>\r\n <button class=\"btn btn-sm btn-outline-dark\" (click)=\"showDebug = !showDebug\">\r\n {{ showDebug ? 'Hide' : 'Show' }} Debug\r\n </button>\r\n </div>\r\n\r\n @if (showDebug) {\r\n <pre>{{ $sections() | json }}</pre>\r\n }\r\n\r\n <div class=\"layout-body\">\r\n @for (section of $sections(); track $index; let sectionIndex = $index) {\r\n <div class=\"section-card\">\r\n <div class=\"section-caption\">\r\n {{ section.caption || 'Untitled Section' }}\r\n </div>\r\n\r\n @for (row of section.rows; track $index; let rowIndex = $index) {\r\n <div class=\"row\">\r\n @for (control of row; track $index; let colIndex = $index) {\r\n <div class=\"form-cell mini-drop-target\" miniDropTarget\r\n (miniDropped)=\"onMiniDrop($event, sectionIndex, rowIndex, colIndex)\">\r\n @if (control) {\r\n <div class=\"form-cell-inner\">\r\n <core-control-no-form-array [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\" />\r\n <button class=\"btn btn-sm btn-link text-danger remove-btn\"\r\n (click)=\"removeControl(sectionIndex, rowIndex, colIndex)\">\r\n \u00D7\r\n </button>\r\n </div>\r\n } @else {\r\n <div class=\"placeholder-slot\">Drop Here</div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>", styles: [".layout-header{position:relative;padding:15px;font-size:20px;border-bottom:1px solid #e0e0e0;display:flex;align-items:center;transform:translate(-15px,-15px);width:calc(100% + 30px)}.close-button{position:absolute;top:12px;right:12px;background:none;border:none;font-size:22px;cursor:pointer;color:#666;line-height:1;padding:0;z-index:1}.close-button:hover{color:#000}.layout-main-content{display:flex;gap:24px}.layout-left{width:200px;flex:0 0 240px;border-right:1px solid #eee;padding-right:16px;overflow:auto}.layout-right{flex:1;padding-left:16px;overflow-x:auto}.layout-toolbar{display:flex;gap:12px;margin-bottom:12px}.layout-body{display:flex;flex-direction:column;gap:24px}.section-card{background-color:#fdfdfd;border:1px solid #ddd;border-radius:8px;padding:12px}.section-caption{font-weight:600;margin-bottom:12px}.row{display:flex;gap:12px;margin-bottom:12px}.form-cell{flex:1;min-width:120px;padding:6px;border:1px dashed #ccc;border-radius:4px;background-color:#fff;position:relative}.form-cell-inner{position:relative}.remove-btn{position:absolute;top:0;right:0;font-size:14px;padding:0 4px;border:none}.placeholder-slot{text-align:center;color:#aaa;padding:16px;background:#fafafa;border:1px dashed #bbb;border-radius:4px}\n"] }]
1461
- }] });
1462
-
1463
- class CoreFormDesignComponent extends BaseComponent {
1464
- constructor(mls) {
1465
- super(mls);
1466
- this.mls = mls;
1467
- this.$idAsInput = input();
1468
- this.$id = input();
1469
- this.$settingPanel = viewChild('settingPanel');
1470
- this.$jsonMode = signal('selectedField');
1471
- this.injectedFields$ = new BehaviorSubject([]);
1472
- this.enumType = EnumFormDesignMode;
1473
- this.enumLeftPanelMode = EnumLeftPanelMode;
1474
- this.$leftPanelMode = computed(() => {
1475
- if (this.coreFormDesignService.$fieldSettingPanelOpen()) {
1476
- return this.enumLeftPanelMode.Json;
1477
- }
1478
- else {
1479
- return this.enumLeftPanelMode.FieldCollection;
1480
- }
1481
- });
1482
- this.ds = inject(DomService);
1483
- this.js = inject(JsonService);
1484
- this.$zIndex = computed(() => {
1485
- if (this.coreFormDesignService.$fieldSettingPanelOpen()) {
1486
- return this.ds.getMaxZIndex() + 1;
1487
- }
1488
- else {
1489
- return 0;
1490
- }
1491
- });
1492
- this.previewMode$ = new BehaviorSubject(EnumCorePageEditMode.CREATE);
1493
- this.$loading = signal(false);
1494
- this.coreFormDesignService = inject(CoreFormDesignService);
1495
- this.renderer = inject(Renderer2);
1496
- this.cdr = inject(ChangeDetectorRef);
1497
- this.router = inject(Router);
1498
- this.route = inject(ActivatedRoute);
1499
- this.alertService = inject(AlertService);
1500
- this.applicationHelpService = inject(ApplicationHelpService);
1501
- this.wfs = inject(CoreWorkflowService);
1502
- this.dbs = inject(DbService);
1503
- this.appConfigService = inject(AppConfigService);
1504
- this.$hasCalculatedSection = computed(() => {
1505
- return this.coreFormDesignService.$placeholderSections().some(s => !!s.forCalculatedFields);
1506
- });
1507
- this.formDesign = this.coreFormDesignService.formDesign;
1508
- this.setControlProp = this.coreFormDesignService.setControlProp.bind(this.coreFormDesignService);
1509
- this.isDragOverMap = {};
1510
- this.idStream$ = new BehaviorSubject(undefined);
1511
- this.getByIdStream$ = this.idStream$.pipe(filter(id => !!id && id !== '0'), distinctUntilChanged(), tap(() => {
1512
- this.$loading.set(true);
1513
- this.coreFormDesignService.editMode$.next(EnumCorePageEditMode.UPDATE);
1514
- this.coreFormDesignService.$submitText.set(EnumTranslateKey.UI_EDIT_FORM_BUTTON_SAVE);
1515
- }), switchMap(id => {
1516
- return this.coreFormDesignService.getById(id)
1517
- .pipe(catchError(err => {
1518
- this.$loading.set(false);
1519
- return of(err);
1520
- }));
1521
- }));
1522
- this.form = new FormGroup({
1523
- stringBox: new FormControl(),
1524
- timeBox: new FormControl(),
1525
- email: new FormControl(),
1526
- textarea: new FormControl(),
1527
- number: new FormControl(),
1528
- currency: new FormControl(),
1529
- dropdown: new FormControl(),
1530
- employeeSeeker: new FormControl(),
1531
- checklist: new FormControl(),
1532
- employeeSeekerMultiple: new FormControl(),
1533
- datePicker: new FormControl(),
1534
- monthSelector: new FormControl(),
1535
- attachment: new FormControl(),
1536
- attachmentBuffer: new FormControl(),
1537
- checkbox: new FormControl(),
1538
- calculated: new FormControl(),
1539
- formArray: new FormArray([
1540
- new FormControl('')
1541
- ])
1542
- });
1543
- this.$sections = computed(() => {
1544
- const hydrated = this.coreFormDesignService.rehydrateSections(this.coreFormDesignService.$placeholderSections());
1545
- let sections = this.coreFormDesignService.toCoreFormSections(hydrated);
1546
- // ✅ Inject hidden "id" field into the first cell row of the first section
1547
- sections = this.coreFormDesignService.injectSystemControls(sections, this.coreFormDesignService.$afInstance().hasIdOfStringType ?? false);
1548
- return sections;
1549
- });
1550
- this.checkError$ = new BehaviorSubject(false);
1551
- this.controlCategories = [
1552
- {
1553
- name: 'Calculated fields',
1554
- controls: [
1555
- {
1556
- flexSize: 12,
1557
- controlType: EnumFormBaseContolType.CALCULATED,
1558
- type: 'calculated',
1559
- field: 'calculated',
1560
- label: '',
1561
- value: '',
1562
- placeholder: 'Calculated',
1563
- headless: true,
1564
- }
1565
- ]
1566
- },
1567
- {
1568
- name: 'Text',
1569
- controls: [
1570
- {
1571
- flexSize: 12,
1572
- controlType: EnumFormBaseContolType.TEXTBOX,
1573
- type: 'string',
1574
- field: 'stringBox',
1575
- label: '',
1576
- value: '',
1577
- placeholder: 'String box',
1578
- headless: true,
1579
- },
1580
- {
1581
- flexSize: 12,
1582
- controlType: EnumFormBaseContolType.TEXTBOX,
1583
- type: 'email',
1584
- field: 'email',
1585
- label: '',
1586
- value: '',
1587
- placeholder: 'Email',
1588
- headless: true,
1589
- },
1590
- {
1591
- flexSize: 12,
1592
- controlType: EnumFormBaseContolType.TEXTAREA,
1593
- type: 'string',
1594
- field: 'textarea',
1595
- label: '',
1596
- value: '',
1597
- textareaRows: 2,
1598
- placeholder: 'Text area',
1599
- headless: true,
1600
- }
1601
- ]
1602
- },
1603
- {
1604
- name: 'Numerical',
1605
- controls: [
1606
- {
1607
- flexSize: 12,
1608
- controlType: EnumFormBaseContolType.TEXTBOX,
1609
- type: 'number',
1610
- field: 'number',
1611
- label: '',
1612
- value: 100,
1613
- placeholder: 'Number',
1614
- headless: true,
1615
- },
1616
- {
1617
- flexSize: 12,
1618
- controlType: EnumFormBaseContolType.CURRENCY,
1619
- type: 'number',
1620
- field: 'currency',
1621
- label: '',
1622
- value: '',
1623
- placeholder: 'Currency',
1624
- headless: true,
1625
- },
1626
- ]
1627
- },
1628
- {
1629
- name: 'Single selection',
1630
- controls: [
1631
- {
1632
- flexSize: 12,
1633
- controlType: EnumFormBaseContolType.DROPDOWN,
1634
- type: 'any',
1635
- field: 'dropdown',
1636
- label: '',
1637
- value: '',
1638
- dropdownOptions$: new BehaviorSubject([]),
1639
- shownFrom: 'name',
1640
- getByIdObject$: new BehaviorSubject({}),
1641
- placeholder: 'Dropdown',
1642
- headless: true,
1643
- },
1644
- {
1645
- flexSize: 12,
1646
- controlType: EnumFormBaseContolType.SEEKER,
1647
- seekerSourceType: EnumCoreFormControlSeekerSourceType.EMPLOYEE_SEEK,
1648
- type: 'any[]',
1649
- field: 'employeeSeeker',
1650
- label: '',
1651
- value: ['Nguyễn A'],
1652
- boundFrom: 'id',
1653
- shownFrom: 'fullname',
1654
- getByIdObject$: new BehaviorSubject({}),
1655
- placeholder: 'Employee seeker',
1656
- headless: true,
1657
- }
1658
- ]
1659
- },
1660
- {
1661
- name: 'Multiple Selection',
1662
- controls: [
1663
- // {
1664
- // flexSize: 12,
1665
- // controlType: EnumFormBaseContolType.GRIDBUFFER,
1666
- // type: 'children',
1667
- // field: 'gridbuffer',
1668
- // label: '',
1669
- // value: [],
1670
- // placeholder: 'Grid buffer',
1671
- // gridBufferFormSections: [
1672
- // {
1673
- // rows: [
1674
- // [
1675
- // {
1676
- // flexSize: 6,
1677
- // field: 'field1',
1678
- // type: 'date',
1679
- // value: '',
1680
- // controlType: EnumFormBaseContolType.DATEPICKER,
1681
- // label: 'field 1'
1682
- // },
1683
- // {
1684
- // flexSize: 6,
1685
- // field: 'field2',
1686
- // type: 'number',
1687
- // value: null,
1688
- // controlType: EnumFormBaseContolType.TEXTBOX,
1689
- // label: 'field 2'
1690
- // },
1691
- // ]
1692
- // ]
1693
- // }
1694
- // ],
1695
- // gridBufferTableColumns: [
1696
- // {
1697
- // caption: 'id',
1698
- // field: 'id',
1699
- // hidden: true,
1700
- // type: 'string',
1701
- // align: 'left',
1702
- // width: 0,
1703
- // },
1704
- // {
1705
- // field: 'field1',
1706
- // width: 200,
1707
- // caption: 'field 1',
1708
- // type: 'date',
1709
- // pipe: EnumCoreTablePipeType.DATE,
1710
- // align: 'center'
1711
- // },
1712
- // {
1713
- // field: 'field2',
1714
- // width: 100,
1715
- // caption: 'field 2',
1716
- // type: 'number',
1717
- // align: 'right'
1718
- // },
1719
- // ],
1720
- // headless: true,
1721
- // tableHeight: 100,
1722
- // liteMode: true,
1723
- // },
1724
- {
1725
- flexSize: 12,
1726
- controlType: EnumFormBaseContolType.CHECKLIST,
1727
- type: 'any[]',
1728
- field: 'checklist',
1729
- label: '',
1730
- value: [],
1731
- checklistOptions$: new BehaviorSubject([]),
1732
- shownFrom: 'name',
1733
- getByIdObject$: new BehaviorSubject({}),
1734
- placeholder: 'Check list',
1735
- headless: true,
1736
- },
1737
- {
1738
- flexSize: 12,
1739
- controlType: EnumFormBaseContolType.SEEKER,
1740
- seekerSourceType: EnumCoreFormControlSeekerSourceType.EMPLOYEE_SEEK,
1741
- multiMode: true,
1742
- type: 'any[]',
1743
- field: 'employeeSeekerMultiple',
1744
- label: '',
1745
- value: [],
1746
- objectList$: new BehaviorSubject([]),
1747
- boundFrom: 'id',
1748
- shownFrom: 'fullname',
1749
- getByIdObject$: new BehaviorSubject({}),
1750
- multiModeTableHeight: 100,
1751
- placeholder: 'Employee seeker (multi mode)',
1752
- headless: true,
1753
- }
1754
- ]
1755
- },
1756
- {
1757
- name: 'Date',
1758
- controls: [
1759
- {
1760
- flexSize: 12,
1761
- controlType: EnumFormBaseContolType.DATEPICKER,
1762
- type: 'date',
1763
- field: 'datePicker',
1764
- label: '',
1765
- value: '',
1766
- placeholder: 'Date picker',
1767
- showPlaceholder: true,
1768
- headless: true,
1769
- },
1770
- {
1771
- flexSize: 12,
1772
- controlType: EnumFormBaseContolType.TEXTBOX,
1773
- type: 'time',
1774
- field: 'timeBox',
1775
- label: '',
1776
- value: null,
1777
- placeholder: 'Time box',
1778
- headless: true,
1779
- },
1780
- {
1781
- flexSize: 12,
1782
- controlType: EnumFormBaseContolType.MONTHSELECTOR,
1783
- type: 'string',
1784
- field: 'monthSelector',
1785
- label: '',
1786
- value: '',
1787
- placeholder: 'Month selector',
1788
- headless: true,
1789
- },
1790
- ]
1791
- },
1792
- {
1793
- name: 'Other',
1794
- controls: [
1795
- {
1796
- flexSize: 12,
1797
- controlType: EnumFormBaseContolType.ATTACHMENT,
1798
- type: 'string',
1799
- field: 'attachment',
1800
- label: '',
1801
- value: '',
1802
- assignTo: 'unknown',
1803
- placeholder: 'Attachment',
1804
- headless: true,
1805
- },
1806
- {
1807
- flexSize: 12,
1808
- controlType: EnumFormBaseContolType.CHECKBOX,
1809
- type: 'boolean',
1810
- field: 'checkbox',
1811
- label: '',
1812
- value: '',
1813
- placeholder: 'Checkbox',
1814
- headless: true,
1815
- },
1816
- ]
1817
- },
1818
- {
1819
- name: 'Form Array',
1820
- controls: [
1821
- {
1822
- flexSize: 12,
1823
- controlType: EnumFormBaseContolType.FORM_ARRAY,
1824
- type: 'children',
1825
- field: 'formArray',
1826
- label: '',
1827
- value: '',
1828
- placeholder: 'FormArray',
1829
- headless: true,
1830
- childrenSections: [
1831
- {
1832
- rows: [
1833
- [
1834
- {
1835
- field: 'textBox',
1836
- flexSize: 12,
1837
- controlType: EnumFormBaseContolType.TEXTBOX,
1838
- type: 'text',
1839
- value: '',
1840
- label: ''
1841
- }
1842
- ]
1843
- ]
1844
- }
1845
- ]
1846
- },
1847
- ]
1848
- },
1849
- ];
1850
- this.generateFieldNameFor = this.coreFormDesignService.generateFieldNameFor.bind(this.coreFormDesignService);
1851
- this.generateLabelNameFor = this.coreFormDesignService.generateLabelNameFor.bind(this.coreFormDesignService);
1852
- this.getAllControlsFromSections = this.coreFormDesignService.getAllControlsFromSections.bind(this.coreFormDesignService);
1853
- this.getControl = this.coreFormDesignService.getControl.bind(this.coreFormDesignService);
1854
- this.coreFormDesignService.resetFormDesignState();
1855
- effect(() => {
1856
- const _ = this.coreFormDesignService.$placeholderSections();
1857
- this.syncFormDesignWithSections();
1858
- });
1859
- effect(() => {
1860
- this.idStream$.next(this.$id());
1861
- });
1862
- this.applicationHelpService.activeKey$.pipe(distinctUntilChanged()).subscribe(x => {
1863
- switch (x) {
1864
- case 'F3':
1865
- this.coreFormDesignService.$fieldSettingPanelOpen.set(true);
1866
- break;
1867
- case 'F6':
1868
- this.coreFormDesignService.$mode.set(EnumFormDesignMode.Preview);
1869
- break;
1870
- case 'Escape':
1871
- this.coreFormDesignService.$fieldSettingPanelOpen.set(false);
1872
- this.coreFormDesignService.$mode.set(EnumFormDesignMode.Default);
1873
- break;
1874
- }
1875
- });
1876
- }
1877
- ngOnInit() {
1878
- this.subscriptions.push(this.mls.lang$.subscribe(x => this.lang = x));
1879
- if (this.appConfigService.WORKFLOW_ENABLE_DEBUG_MODE) {
1880
- this.injectedFields$.next([
1881
- {
1882
- field: '___submitterEmployeeId',
1883
- flexSize: 12,
1884
- type: 'number',
1885
- controlType: EnumFormBaseContolType.SEEKER,
1886
- seekerSourceType: EnumCoreFormControlSeekerSourceType.EMPLOYEE_SEEK,
1887
- getByIdApi: '',
1888
- getByIdObject$: new BehaviorSubject({}),
1889
- label: 'Simulated Requester',
1890
- boundFrom: 'id',
1891
- shownFrom: 'fullname',
1892
- value: null,
1893
- },
1894
- {
1895
- field: "___reason",
1896
- type: "text",
1897
- value: '',
1898
- label: "UI_FORM_CONTROL_LABEL.REASON",
1899
- flexSize: 12,
1900
- controlType: EnumFormBaseContolType.TEXTAREA,
1901
- textareaRows: 5,
1902
- validators: [
1903
- {
1904
- name: 'required',
1905
- validator: Validators.required,
1906
- errorMessage: EnumTranslateKey.UI_FORM_CONTROL_ERROR_REQUIRED
1907
- }
1908
- ],
1909
- }
1910
- ]);
1911
- }
1912
- else {
1913
- this.injectedFields$.next([
1914
- {
1915
- field: "___reason",
1916
- type: "text",
1917
- value: '',
1918
- label: "UI_FORM_CONTROL_LABEL.REASON",
1919
- flexSize: 12,
1920
- controlType: EnumFormBaseContolType.TEXTAREA,
1921
- textareaRows: 5,
1922
- validators: [
1923
- {
1924
- name: 'required',
1925
- validator: Validators.required,
1926
- errorMessage: EnumTranslateKey.UI_FORM_CONTROL_ERROR_REQUIRED
1927
- }
1928
- ],
1929
- }
1930
- ]);
1931
- }
1932
- }
1933
- switchJson() {
1934
- if (this.$jsonMode() === 'full') {
1935
- this.$jsonMode.set('selectedField');
1936
- }
1937
- else {
1938
- this.$jsonMode.set('full');
1939
- }
1940
- }
1941
- onDragStart(event, control) {
1942
- this.coreFormDesignService.beginDragTemplate(control);
1943
- }
1944
- onDragOver(event, section, control) {
1945
- event.preventDefault(); // necessary to allow drop
1946
- if ((!!section.forCalculatedFields && this.coreFormDesignService.$draggingControl()?.type === 'calculated') ||
1947
- (!section.forCalculatedFields && this.coreFormDesignService.$draggingControl()?.type !== 'calculated')) {
1948
- event.dataTransfer.dropEffect = 'copy';
1949
- }
1950
- else {
1951
- event.dataTransfer.dropEffect = 'none';
1952
- }
1953
- }
1954
- onDragEnter(placeholderId) {
1955
- this.isDragOverMap[placeholderId] = true;
1956
- }
1957
- onDragLeave(placeholderId) {
1958
- this.isDragOverMap[placeholderId] = false;
1959
- }
1960
- onDropIntoCell(event, sectionIndex, rowIndex, colIndex) {
1961
- event.preventDefault();
1962
- const template = this.coreFormDesignService.$currentControlTemplate();
1963
- if (!template)
1964
- return;
1965
- const section = this.coreFormDesignService.$placeholderSections()[sectionIndex];
1966
- if (!section.forCalculatedFields && template.type === 'calculated')
1967
- return;
1968
- if (!!section.forCalculatedFields && template.type !== 'calculated')
1969
- return;
1970
- const normalized = this.coreFormDesignService.normalize({
1971
- ...template,
1972
- field: this.generateFieldNameFor(template),
1973
- label: this.generateLabelNameFor(template),
1974
- value: null
1975
- });
1976
- if (normalized.controlType === EnumFormBaseContolType.CALCULATED) {
1977
- normalized.returnType = 'number';
1978
- }
1979
- this.coreFormDesignService.$placeholderSections.update(sections => {
1980
- const section = sections[sectionIndex];
1981
- const row = section?.rows[rowIndex];
1982
- if (!row || row.cells.length <= colIndex)
1983
- return sections;
1984
- const usedFlex = row.cells.reduce((sum, cell) => sum + (cell?.control?.flexSize ?? 0), 0);
1985
- const remainingFlex = 12 - usedFlex;
1986
- const flexSize = Math.max(1, remainingFlex);
1987
- normalized.flexSize = flexSize;
1988
- const previous = row.cells[colIndex]?.control;
1989
- if (previous && previous.flexSize !== undefined) {
1990
- /*
1991
- AttachmentFieldHelperService.handleAttachmentOverwrite(
1992
- previous as IFormBaseControl,
1993
- this.coreFormDesignService.getAllControlsFromSections()
1994
- );
1995
- */
1996
- }
1997
- const previousField = row.cells[colIndex]?.control?.field ?? null;
1998
- this.coreFormDesignService.replaceControl(previousField, normalized);
1999
- // 🔹 INSERT FIRST
2000
- row.cells[colIndex] = { ...row.cells[colIndex], control: normalized };
2001
- this.coreFormDesignService.$selectedCell.set(row.cells[colIndex]);
2002
- // 🔹 THEN CALL setup
2003
- if (AttachmentFieldHelperService.isAttachment(normalized)) {
2004
- const assignToField = AttachmentFieldHelperService.buildHiddenAssignToField(normalized.field);
2005
- normalized.field = `${normalized.field}Buffer`;
2006
- normalized.assignTo = assignToField.field;
2007
- AttachmentFieldHelperService.injectAssignToFieldIntoRow(row, assignToField);
2008
- }
2009
- setTimeout(() => {
2010
- this.coreFormDesignService.setControlPropDirectly('validators', normalized.validators ?? [], normalized);
2011
- });
2012
- return sections;
2013
- });
2014
- this.triggerUpdateSections();
2015
- this.isDragOverMap[sectionIndex + '_' + rowIndex + '_' + colIndex] = false;
2016
- this.coreFormDesignService.endDrag();
2017
- this.openSettingsForCell(this.coreFormDesignService.$selectedCell(), sectionIndex, rowIndex, colIndex);
2018
- }
2019
- addCalculatedSection() {
2020
- this.coreFormDesignService.$placeholderSections.update(sections => [
2021
- {
2022
- caption: `Calculated Section`,
2023
- forCalculatedFields: true,
2024
- hidden: true,
2025
- rows: [{ cells: [{ flexSize: 12 }] }]
2026
- },
2027
- ...sections,
2028
- ]);
2029
- }
2030
- addSection() {
2031
- this.coreFormDesignService.$placeholderSections.update(sections => [
2032
- ...sections,
2033
- {
2034
- caption: `Section ${sections.length + 1}`,
2035
- rows: [{ cells: [{ flexSize: 12 }] }]
2036
- }
2037
- ]);
2038
- }
2039
- deleteSection(sectionIndex) {
2040
- const sections = this.coreFormDesignService.$placeholderSections();
2041
- const section = sections[sectionIndex];
2042
- const hasControls = section?.rows?.some(row => row?.cells?.some(cell => !!cell?.control));
2043
- if (hasControls) {
2044
- const confirmed = confirm('This section contains controls. Are you sure you want to delete it?');
2045
- if (!confirmed)
2046
- return;
2047
- }
2048
- this.coreFormDesignService.$placeholderSections.update(prev => prev.filter((_, idx) => idx !== sectionIndex));
2049
- }
2050
- deleteRow(sectionIndex, rowIndex) {
2051
- const sections = this.coreFormDesignService.$placeholderSections();
2052
- const section = sections[sectionIndex];
2053
- const row = section?.rows?.[rowIndex];
2054
- if (!row)
2055
- return; // safety check
2056
- const hasControls = row.cells?.some(cell => !!cell?.control);
2057
- if (hasControls) {
2058
- const confirmed = confirm('This row contains controls. Are you sure you want to delete it?');
2059
- if (!confirmed)
2060
- return; // user canceled
2061
- }
2062
- this.coreFormDesignService.$placeholderSections.update(sections => {
2063
- return sections.map((section, sIdx) => {
2064
- if (sIdx !== sectionIndex)
2065
- return section;
2066
- return {
2067
- ...section,
2068
- rows: (section.rows ?? []).filter((_, rIdx) => rIdx !== rowIndex)
2069
- };
2070
- });
2071
- });
2072
- }
2073
- addRow(sectionIndex) {
2074
- this.coreFormDesignService.$placeholderSections.update(sections => {
2075
- const section = sections[sectionIndex];
2076
- if (section) {
2077
- section.rows.push({ cells: [{ flexSize: 12 }] });
2078
- }
2079
- return sections;
2080
- });
2081
- }
2082
- addColumn(row) {
2083
- if (!row || row.cells.length >= 4)
2084
- return;
2085
- const usedFlex = row.cells.reduce((sum, c) => sum + (c.flexSize ?? 0), 0);
2086
- // ✅ Case 1: Normal case – still space available
2087
- if (usedFlex < 12) {
2088
- const remaining = 12 - usedFlex;
2089
- row.cells.push({ flexSize: Math.min(3, remaining) });
2090
- return;
2091
- }
2092
- // 💥 Case 2: Full row — try to rebalance
2093
- if (usedFlex === 12) {
2094
- const count = row.cells.length;
2095
- if (count === 1) {
2096
- // 12 → 6 + 6
2097
- row.cells[0].flexSize = 6;
2098
- row.cells.push({ flexSize: 6 });
2099
- return;
2100
- }
2101
- if (count === 2) {
2102
- // 6 + 6 → 4 + 4 + 4
2103
- row.cells.forEach(c => (c.flexSize = 4));
2104
- row.cells.push({ flexSize: 4 });
2105
- return;
2106
- }
2107
- if (count === 3) {
2108
- // 4 + 4 + 4 → 3 + 3 + 3 + 3
2109
- row.cells.forEach(c => (c.flexSize = 3));
2110
- row.cells.push({ flexSize: 3 });
2111
- return;
2112
- }
2113
- // ❌ Already 4 cells, each 3 — can’t split further
2114
- return;
2115
- }
2116
- // 🔧 Optional fallback logic for unknown edge cases
2117
- const maxIndex = row.cells.reduce((maxI, c, i, arr) => (c.flexSize ?? 0) > (arr[maxI]?.flexSize ?? 0) ? i : maxI, 0);
2118
- const maxCell = row.cells[maxIndex];
2119
- if ((maxCell?.flexSize ?? 0) <= 3)
2120
- return; // nothing to shrink
2121
- maxCell.flexSize -= 3;
2122
- row.cells.push({ flexSize: 3 });
2123
- }
2124
- onCorePageHeaderButtonClicked(e) {
2125
- if (e.code === EnumCoreButtonVNSCode.HEADER_SWITCH_VIEW) {
2126
- if (this.coreFormDesignService.$mode() === EnumFormDesignMode.Default) {
2127
- const sections = this.coreFormDesignService.toCoreFormSections(this.coreFormDesignService.$placeholderSections());
2128
- this.coreFormDesignService.$liveFormSections.set(sections);
2129
- }
2130
- setTimeout(() => this.coreFormDesignService.$mode.set(this.coreFormDesignService.$mode() === EnumFormDesignMode.Preview ? EnumFormDesignMode.Default : EnumFormDesignMode.Preview));
2131
- }
2132
- else if (e.code === EnumCoreButtonVNSCode.HEADER_SAVE) {
2133
- }
2134
- }
2135
- closePreview() {
2136
- this.coreFormDesignService.$mode.set(EnumFormDesignMode.Default);
2137
- }
2138
- onPreviewSubmit(e) {
2139
- alert(JSON.stringify(e, null, 2));
2140
- }
2141
- onCellClicked(sectionIndex, rowIndex, colIndex) {
2142
- const row = this.coreFormDesignService.$placeholderSections()[sectionIndex].rows[rowIndex];
2143
- if (!!row) {
2144
- // Toggle selection
2145
- if (!!row.cells && row.cells.length > colIndex) {
2146
- row.cells[colIndex].selected = !row.cells[colIndex].selected;
2147
- }
2148
- // Only allow max 2 selections
2149
- const selected = row.cells.filter(c => c?.selected);
2150
- if (selected.length > 2) {
2151
- row.cells.forEach(c => c && (c.selected = false));
2152
- row[colIndex].selected = true;
2153
- }
2154
- }
2155
- }
2156
- canMergeCells(sectionIndex, rowIndex) {
2157
- const row = this.coreFormDesignService.$placeholderSections()[sectionIndex].rows[rowIndex];
2158
- const selected = row?.cells.map((c, i) => ({ c, i })).filter(x => x.c?.selected);
2159
- if (selected?.length !== 2)
2160
- return false;
2161
- const [a, b] = selected;
2162
- if (a.c.control || b.c.control)
2163
- return false;
2164
- return Math.abs(a.i - b.i) === 1; // Must be neighbors
2165
- }
2166
- mergeCells(sectionIndex, rowIndex) {
2167
- const row = this.coreFormDesignService.$placeholderSections()[sectionIndex].rows[rowIndex];
2168
- if (!row)
2169
- return;
2170
- this.coreFormDesignService.$placeholderSections.update(sections => {
2171
- const selected = row.cells
2172
- .map((c, i) => ({ c, i }))
2173
- .filter(x => x.c?.selected);
2174
- if (selected.length !== 2)
2175
- return sections;
2176
- const [a, b] = selected.sort((a, b) => a.i - b.i);
2177
- const mergedFlex = (typeof a.c.flexSize === 'number' ? a.c.flexSize : 3) +
2178
- (typeof b.c.flexSize === 'number' ? b.c.flexSize : 3);
2179
- const mergedCell = {
2180
- //control: { ...a.c.control, flexSize: mergedFlex }, // keep control data
2181
- flexSize: mergedFlex,
2182
- selected: false
2183
- };
2184
- row.cells.splice(a.i, 2, mergedCell); // replace both cells with one
2185
- return sections;
2186
- });
2187
- }
2188
- openSettingsForCell(cell, sectionIndex, rowIndex, colIndex) {
2189
- this.coreFormDesignService.$sectionIndex.set(sectionIndex);
2190
- this.coreFormDesignService.$rowIndex.set(rowIndex);
2191
- this.coreFormDesignService.$colIndex.set(colIndex);
2192
- this.coreFormDesignService.$selectedCell.set({ ...cell });
2193
- this.coreFormDesignService.$fieldSettingPanelOpen.set(true);
2194
- }
2195
- /*
2196
- deleteField(row: IFormDesignRow | undefined, colIndex: number): void {
2197
- if (!row || !row.cells[colIndex]) return;
2198
- const cellToDelete = row.cells[colIndex];
2199
- if (!cellToDelete.control) return;
2200
-
2201
- if (confirm('Are you sure to remove the field?')) {
2202
-
2203
- // 🧠 Check if it's selected
2204
- const selectedCell = this.coreFormDesignService.$selectedCell();
2205
- const shouldClearSelection = selectedCell === cellToDelete;
2206
- let deletedControl: IFormBaseControl | null = null;
2207
-
2208
- // ✅ Update the reactive state
2209
- this.coreFormDesignService.$placeholderSections.update(sections => {
2210
- for (const section of sections) {
2211
- for (const r of section.rows) {
2212
- if (r === row) {
2213
- const control = r.cells[colIndex].control;
2214
- if (control && control.field && control.flexSize !== undefined) {
2215
- deletedControl = control as IFormBaseControl; // ✅ Save before removing
2216
- }
2217
- r.cells[colIndex].control = { flexSize: r.cells[colIndex].control?.flexSize }; // ❌ Clear after
2218
- break;
2219
- }
2220
- }
2221
- }
2222
- return sections;
2223
- });
2224
-
2225
- if (deletedControl) {
2226
- this.coreFormDesignService.$placeholderSections.update(sections => {
2227
- for (const section of sections) {
2228
- for (const row of section.rows) {
2229
- if (!!row) {
2230
- row.cells = row.cells.filter(cell => cell.control?.field !== deletedControl?.assignTo);
2231
- }
2232
- }
2233
- }
2234
- return sections;
2235
- });
2236
- }
2237
-
2238
- // ❌ Clear selection if needed
2239
- if (shouldClearSelection) {
2240
- this.coreFormDesignService.$selectedCell.set(null);
2241
- }
2242
-
2243
- console.log("this.coreFormDesignService.$placeholderSections before triggerUpdateSections", this.coreFormDesignService.$placeholderSections())
2244
- this.triggerUpdateSections();
2245
- }
2246
- }
2247
- */
2248
- // Anti AI version
2249
- deleteField(row, sectionIndex, rowIndex, colIndex) {
2250
- if (!row)
2251
- return;
2252
- const dCell = row.cells[colIndex];
2253
- const currentControl = dCell.control;
2254
- if (!currentControl)
2255
- return;
2256
- const currentPlaceholderSections = this.coreFormDesignService.$placeholderSections();
2257
- if (!currentPlaceholderSections[sectionIndex].rows[rowIndex])
2258
- return;
2259
- currentPlaceholderSections[sectionIndex].rows[rowIndex].cells[colIndex].control = undefined;
2260
- this.coreFormDesignService.$selectedCell.set(null);
2261
- this.coreFormDesignService.$placeholderSections.set([...currentPlaceholderSections]);
2262
- }
2263
- onCaptionEditEnd(index, event) {
2264
- const newCaption = event.target.innerText.trim();
2265
- this.coreFormDesignService.$placeholderSections.update(sections => {
2266
- sections[index].caption = newCaption;
2267
- return sections;
2268
- });
2269
- }
2270
- onFieldCaptionEditEnd(cell, event) {
2271
- const element = event.target;
2272
- const newLabel = element.innerText.trim();
2273
- // Fallback if empty
2274
- cell.control.label = newLabel || 'Unnamed Field';
2275
- this.triggerUpdateSections();
2276
- }
2277
- insertSection() {
2278
- }
2279
- insertRow(sectionIndex, rowIndex) {
2280
- const sections = this.coreFormDesignService.$placeholderSections();
2281
- const section = sections[sectionIndex];
2282
- if (!section)
2283
- return;
2284
- const newRow = {
2285
- cells: [
2286
- { flexSize: 12 },
2287
- ]
2288
- };
2289
- section.rows.splice(rowIndex + 1, 0, newRow);
2290
- this.coreFormDesignService.$placeholderSections.set([...sections]);
2291
- }
2292
- closeFieldSettingPanel() {
2293
- this.coreFormDesignService.$fieldSettingPanelOpen.set(false);
2294
- this.coreFormDesignService.$selectedCell.set(null);
2295
- this.coreFormDesignService.$currentControlTemplate.set(null);
2296
- this.coreFormDesignService.$currentControl.set(null);
2297
- }
2298
- ngAfterViewInit() {
2299
- setTimeout(() => {
2300
- this.subscriptions.push(this.getByIdStream$.subscribe(x => {
2301
- this.$loading.set(false);
2302
- if (x.ok && x.status === 200 && x.body?.statusCode === 200) {
2303
- this.coreFormDesignService.$afInstance.set(this.coreFormDesignService.mapFromAfInstanceDTO(x.body.innerBody));
2304
- this.coreFormDesignService.syncPlaceholderSectionsFromInstance();
2305
- this.coreFormDesignService.$shouldPatchMetadataForm.set(true);
2306
- const saveLiveJson = this.coreFormDesignService.$saveLiveJson();
2307
- setTimeout(() => this.wfs.$initialFormDesignJson.set(saveLiveJson));
2308
- }
2309
- }));
2310
- if (!this.$idAsInput()) {
2311
- this.subscriptions.push(this.route.params.subscribe(x => {
2312
- let id = '0';
2313
- try {
2314
- id = atob(x['id']);
2315
- this.coreFormDesignService.$afInstance.update(instance => ({
2316
- ...instance,
2317
- id
2318
- }));
2319
- }
2320
- catch (err) {
2321
- if (isDevMode()) {
2322
- this.alertService.error(err.toString(), noneAutoClosedAlertOptions);
2323
- }
2324
- return;
2325
- }
2326
- this.idStream$.next(id);
2327
- }));
2328
- }
2329
- console.warn('InitialFormDesignJson on load', this.wfs.$initialFormDesignJson());
2330
- });
2331
- }
2332
- onControlParamsChange(updated) {
2333
- this.coreFormDesignService.$placeholderSections.update(sections => {
2334
- const cell = this.coreFormDesignService.$selectedCell();
2335
- if (!cell)
2336
- return sections;
2337
- // Patch the selected cell
2338
- Object.assign(cell.control, updated);
2339
- return sections;
2340
- });
2341
- }
2342
- get normalizedSelectedControl() {
2343
- const cell = this.coreFormDesignService.$selectedCell();
2344
- if (!cell?.control) {
2345
- throw new Error('No control is currently selected.');
2346
- }
2347
- return this.coreFormDesignService.normalize(cell.control);
2348
- }
2349
- triggerUpdateSections() {
2350
- const newValue = this.coreFormDesignService.$placeholderSections();
2351
- this.coreFormDesignService.$placeholderSections.set([...newValue]);
2352
- }
2353
- syncFormDesignWithSections() {
2354
- const existingControls = Object.keys(this.formDesign.controls);
2355
- const expectedControls = [];
2356
- for (const section of this.coreFormDesignService.$placeholderSections()) {
2357
- for (const row of section.rows) {
2358
- for (const cell of row?.cells || []) {
2359
- const control = cell?.control;
2360
- if (control?.field) {
2361
- expectedControls.push(control.field);
2362
- if (!this.formDesign.contains(control.field)) {
2363
- this.formDesign.addControl(control.field, new FormControl(control.value ?? null));
2364
- }
2365
- }
2366
- }
2367
- }
2368
- }
2369
- // 🧹 Remove controls that no longer exist
2370
- for (const field of existingControls) {
2371
- if (!expectedControls.includes(field)) {
2372
- this.formDesign.removeControl(field);
2373
- }
2374
- }
2375
- }
2376
- isRequired(control) {
2377
- if (!control || !control.validators)
2378
- return false;
2379
- return control.validators.some((v) => v.name === 'required' || v.name === 'requiredTrue');
2380
- }
2381
- filteredCells(row) {
2382
- if (!row)
2383
- return [];
2384
- return row.cells.filter(cell => (cell?.flexSize ?? 0) > 0);
2385
- }
2386
- onFormDesignCreated(e) {
2387
- console.log("onFormDesignCreated", e);
2388
- }
2389
- onLiveFormCreated(e) {
2390
- console.log("onLiveFormCreated", e);
2391
- }
2392
- showMetadata() {
2393
- this.coreFormDesignService.$showFormMetadata.set(true);
2394
- }
2395
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreFormDesignComponent, deps: [{ token: MultiLanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
2396
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.5", type: CoreFormDesignComponent, isStandalone: true, selector: "core-form-design", inputs: { $idAsInput: { classPropertyName: "$idAsInput", publicName: "$idAsInput", isSignal: true, isRequired: false, transformFunction: null }, $id: { classPropertyName: "$id", publicName: "$id", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "$settingPanel", first: true, predicate: ["settingPanel"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"core-form-design-container fs-13\" [hotKeys]=\"['F3', 'F6', 'Escape']\">\r\n\r\n <core-page-header title=\"UI.COMPONENT_TITLE.WORKFLOW_FORM_DESIGN\" (buttonClick)=\"onCorePageHeaderButtonClicked($event)\"></core-page-header>\r\n\r\n <ng-template #formMetadata>\r\n <form-metadata></form-metadata>\r\n </ng-template>\r\n\r\n @if (coreFormDesignService.$showFormArrayDesign()) {\r\n <core-form-array-layout-editor />\r\n }\r\n\r\n @if (!coreFormDesignService.$isInWorkflowDesign()) {\r\n <aside class=\"af-metadata-overlay\" [@slideFromTopFadeIn]=\"coreFormDesignService.$showFormMetadata() ? 'in' : 'out'\"\r\n [class.shown]=\"coreFormDesignService.$showFormMetadata()\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"formMetadata\"></ng-container>\r\n </aside>\r\n }\r\n\r\n <div \r\n class=\"field-setting-panel\" \r\n [class.open]=\"coreFormDesignService.$fieldSettingPanelOpen()\" \r\n [class.calculated-type]=\"coreFormDesignService.$selectedCell()?.control?.type==='calculated'\"\r\n [ngStyle]=\"{ zIndex: $zIndex() }\"\r\n #settingPanel\r\n >\r\n @if (!!(this.coreFormDesignService.$selectedCell())) {\r\n <field-setting></field-setting>\r\n }\r\n </div>\r\n\r\n <div class=\"form-design-left\">\r\n\r\n @switch ($leftPanelMode()) {\r\n @case (enumLeftPanelMode.FieldCollection) {\r\n @for (category of controlCategories; track $index) {\r\n <div class=\"category-name\">\r\n {{ category.name }}\r\n </div>\r\n <ul>\r\n @for (control of category.controls; track $index) {\r\n <li draggable=\"true\" (dragstart)=\"onDragStart($event, control)\" [class.full-width]=\"control.controlType === 'SEEKER' || control.controlType === 'ATTACHMENT' || control.controlType === 'GRIDBUFFER'\">\r\n @if (control.controlType === 'GRIDBUFFER') {\r\n <div class=\"grid-buffer-wrapper\">\r\n <core-control [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n } @else {\r\n <core-control [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n }\r\n </li>\r\n <div class=\"space\"></div>\r\n }\r\n </ul>\r\n }\r\n }\r\n @case (enumLeftPanelMode.Json) {\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"switchJson()\">{{ $jsonMode() }}</button>\r\n @if ($jsonMode()==='selectedField') {\r\n <pre class=\"json-preview\">{{ coreFormDesignService.$currentControlJson() }}</pre>\r\n } @else {\r\n <pre class=\"json-preview\">{{ coreFormDesignService.$saveLiveJson() }}</pre>\r\n }\r\n \r\n }\r\n }\r\n\r\n </div>\r\n\r\n <div class=\"form-design-right\">\r\n <!-- <pre>{{ $injectedFieldsJson() }}</pre> -->\r\n\r\n @if (coreFormDesignService.$mode() === enumType.Default) {\r\n <div class=\"form-wrapper\">\r\n\r\n @if (!!coreFormDesignService.$isInWorkflowDesign()) {\r\n <form-metadata></form-metadata>\r\n }\r\n\r\n <form [formGroup]=\"formDesign\" autocomplete=\"off\">\r\n <div class=\"form-cells\">\r\n\r\n <div class=\"form-tool-bar\">\r\n @if (!$hasCalculatedSection()) {\r\n <button class=\"core-button-vns-container\" (click)=\"addCalculatedSection()\">+ Calculated fields</button>\r\n }\r\n <button class=\"core-button-vns-container\" (click)=\"addSection()\">+ Add Section</button>\r\n </div>\r\n \r\n @for (section of coreFormDesignService.$placeholderSections(); track $index; let sectionIndex = $index) {\r\n <div class=\"form-section-placeholder\">\r\n\r\n <div class=\"section-header\">\r\n\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\" [class.calculated]=\"section.forCalculatedFields\"></div>\r\n </div>\r\n\r\n <label [attr.contenteditable]=\"!section.forCalculatedFields\"\r\n [htmlTooltip]=\"!!section.forCalculatedFields ? calculatedFieldsTooltip : null\"\r\n (blur)=\"onCaptionEditEnd(sectionIndex, $event)\"\r\n (keydown.enter)=\"onCaptionEditEnd(sectionIndex, $event); $event.preventDefault()\"\r\n >{{ section.caption }}</label>\r\n\r\n <div class=\"section-tool pointer\" (click)=\"deleteSection(sectionIndex)\" [appTooltip]=\"'Delete section'\" [showAnyway]=\"true\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n \r\n </div>\r\n \r\n @for (row of section.rows; track $index; let rowIndex = $index) {\r\n\r\n <div class=\"form-row-wrapper\">\r\n <div class=\"form-row\">\r\n @for (cell of filteredCells(row); track $index; let colIndex = $index) {\r\n <div class=\"form-cell drop-target\" \r\n [ngStyle]=\"{ flex: (cell.flexSize ?? 0) + ' 1 0%' }\"\r\n [attr.data-flex]=\"cell.flexSize ?? 0\"\r\n (drop)=\"onDropIntoCell($event, sectionIndex, rowIndex, colIndex)\"\r\n (dragover)=\"onDragOver($event, section, cell.control!)\"\r\n (dragenter)=\"onDragEnter(sectionIndex + '_' + rowIndex + '_' + colIndex)\"\r\n (dragleave)=\"onDragLeave(sectionIndex + '_' + rowIndex + '_' + colIndex)\"\r\n [class.selected]=\"cell?.selected\"\r\n [class.dragging-over]=\"isDragOverMap[sectionIndex + '_' + rowIndex + '_' + colIndex]\"\r\n [class.has-control]=\"!!cell && !!cell.control && !!getControl(cell)\"\r\n (click)=\"onCellClicked(sectionIndex, rowIndex, colIndex)\"\r\n >\r\n\r\n\r\n @if (!isDragOverMap[sectionIndex + '_' + rowIndex + '_' + colIndex]) {\r\n\r\n @if (!!cell && !!cell.control && !!getControl(cell)) {\r\n <label contenteditable=\"true\"\r\n (blur)=\"onFieldCaptionEditEnd(cell, $event)\"\r\n (keydown.enter)=\"onFieldCaptionEditEnd(cell, $event); $event.preventDefault()\"\r\n [class.d-none]=\"!!getControl(cell)?.hidden\"\r\n [class.required]=\"!!cell && !!cell.control && !!getControl(cell) && isRequired(getControl(cell))\"\r\n >{{ cell.control.label || 'label' }}</label>\r\n\r\n @if (cell.control.controlType==='CALCULATED') {\r\n <div class=\"control-wrapper\" (click)=\"openSettingsForCell(cell, sectionIndex, rowIndex, colIndex)\">\r\n <core-control \r\n [control]=\"getControl(cell)!\" \r\n [form]=\"formDesign\"\r\n [checkError$]=\"checkError$\" />\r\n </div>\r\n } @else {\r\n <core-control \r\n [control]=\"getControl(cell)!\" \r\n [form]=\"formDesign\"\r\n [checkError$]=\"checkError$\" />\r\n }\r\n \r\n <div class=\"field-toolbar\">\r\n <ul>\r\n <li>\r\n <div class=\"field-tool pointer\" (click)=\"openSettingsForCell(cell, sectionIndex, rowIndex, colIndex)\" [appTooltip]=\"'Show settings'\">\r\n <i class=\"feather-settings\"></i>\r\n </div>\r\n </li>\r\n <li>\r\n <div class=\"field-tool pointer\" (click)=\"deleteField(row, sectionIndex, rowIndex, colIndex)\" [appTooltip]=\"'Remove field from cell'\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n \r\n } @else {\r\n <div class=\"placeholder\" [class.calculated]=\"!!section.forCalculatedFields\">\r\n {{ !!section.forCalculatedFields ? 'Drop calculated field here' : 'Drop here'}}\r\n </div>\r\n }\r\n\r\n @if (cell?.selected && canMergeCells(sectionIndex, rowIndex)) {\r\n <div class=\"merge-toolbar\">\r\n <button (click)=\"mergeCells(sectionIndex, rowIndex)\">\uD83D\uDD17 Merge</button>\r\n </div>\r\n }\r\n \r\n }\r\n\r\n </div>\r\n }\r\n </div>\r\n <div class=\"row-tool-bar\">\r\n <div class=\"icon-wrapper\" (click)=\"deleteRow(sectionIndex, rowIndex)\" [appTooltip]=\"'Delete row'\" [showAnyway]=\"true\"><i class=\"feather-x\"></i></div>\r\n <div class=\"icon-wrapper\" (click)=\"addRow(sectionIndex)\" [appTooltip]=\"'Add row'\" [showAnyway]=\"true\"><i class=\"feather-arrow-down\"></i></div>\r\n <div class=\"icon-wrapper\" (click)=\"insertRow(sectionIndex, rowIndex)\" [appTooltip]=\"'Insert row'\" [showAnyway]=\"true\"><i class=\"feather-corner-right-down\"></i></div>\r\n <div class=\"icon-wrapper\" (click)=\"addColumn(row)\" [appTooltip]=\"'Add column'\" [showAnyway]=\"true\"><i class=\"feather-arrow-right\"></i></div>\r\n </div>\r\n </div>\r\n\r\n }\r\n </div>\r\n }\r\n \r\n \r\n </div>\r\n </form>\r\n </div>\r\n } @else if (!!$sections()) {\r\n\r\n @if(!!(injectedFields$ | async) && !!(injectedFields$ | async)!.length) {\r\n\r\n @if (!!coreFormDesignService.$afInstance().normalMode) {\r\n <live-form [$designMode]=\"true\" [$forKickOff]=\"true\" />\r\n } @else {\r\n <live-form [$designMode]=\"true\" [$forKickOff]=\"true\" ($onClose)=\"closePreview()\" />\r\n }\r\n\r\n } @else {\r\n <h2>COULD NOT UPDATE injectedFields$</h2>\r\n }\r\n\r\n } @else {\r\n <h2>$sections() empty / null / undefined</h2>\r\n }\r\n\r\n\r\n \r\n </div>\r\n @if ($loading()) {\r\n <core-toast-loading></core-toast-loading>\r\n }\r\n\r\n <ng-template #calculatedFieldsTooltip>\r\n <div style=\"max-width: 280px;\">\r\n <strong>Calculated Fields</strong><br />\r\n <p></p>\r\n These fields are hidden from the form and cannot be edited directly.<br /><br />\r\n - They are computed automatically during workflow execution.<br />\r\n - Each field depends on one or more standard input fields.<br />\r\n - The calculation is evaluated using either an SQL query engine (like <strong>Dapper</strong>) or an in-memory expression engine (like <strong>Dynamic Expresso</strong>).<br /><br />\r\n In both cases, the result is a <code>0</code> or <code>1</code>, representing <strong>false</strong> or <strong>true</strong>.<br /><br />\r\n These results can be used to influence workflow logic, rule trees, or approval paths.\r\n </div>\r\n </ng-template>\r\n \r\n</div>", styles: ["@charset \"UTF-8\";.core-form-design-container{position:relative;height:calc(100vh - var(--size-header-height) - var(--size-layout-block-cell-spacing));width:100%;overflow:hidden;background-color:#eff0f1;font-size:13px}.core-form-design-container .core-button-vns-container{margin-right:8px!important}.core-form-design-container .core-button-vns-container:last-child{background-color:#000;color:#fff;margin-right:0}.core-form-design-container .af-metadata-overlay{position:fixed;top:60px;left:66px;background:#fff;box-shadow:.4rem 0 2rem #0000002e;z-index:1000;width:1214px;height:calc(100vh - 75px);overflow-y:auto;pointer-events:none}.core-form-design-container .af-metadata-overlay.shown{pointer-events:auto}.core-form-design-container *{border-radius:0}.core-form-design-container ul,.core-form-design-container li{padding:0}.core-form-design-container li{max-width:200px}.core-form-design-container ul div.space{display:block;height:15px}.core-form-design-container li.full-width{max-width:100%}.core-form-design-container .field-setting-panel{display:block;position:fixed;width:360px;height:100vh;top:0;right:-360px;background-color:#fff;box-shadow:.4rem 0 2rem #0000002e;transition:right .5s ease-out}.core-form-design-container .field-setting-panel .close-wrapper{width:32px;height:32px;position:absolute;top:15px;right:15px;display:flex;background-color:#848484;border-radius:50%}.core-form-design-container .field-setting-panel .close-wrapper i{width:16px;height:16px;font-size:18px;color:#848484}.core-form-design-container .field-setting-panel .panel-caption{margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid #ddd;width:100%;overflow:hidden;text-wrap:nowrap;text-overflow:ellipsis}.core-form-design-container .field-setting-panel.calculated-type{width:500px;right:-500px}.core-form-design-container .field-setting-panel.calculated-type textarea{border-radius:8px;height:150px}.core-form-design-container .field-setting-panel.open{right:0}.core-form-design-container .form-design-left{position:absolute;top:var(--size-core-page-header-height);bottom:0;left:0;z-index:1;width:360px;height:calc(100vh - var(--size-header-height) - var(--size-layout-block-cell-spacing));padding:15px;padding-right:calc(15px + var(--size-scrollbar-width));background-color:#87ceeb;overflow-y:hidden}.core-form-design-container .form-design-left .category-name{color:#fff}.core-form-design-container .form-design-left .grid-buffer-wrapper{background-color:#fff;padding:15px}.core-form-design-container .form-design-left ul:last-child{padding-bottom:400px}.core-form-design-container .form-design-left .category-name{margin-bottom:15px}.core-form-design-container .form-design-left .json-preview{background-color:#fff;color:#333;padding:1rem 1.5rem;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;width:330px;height:calc(100vh - 205px)}.core-form-design-container .form-design-left button{height:35px;border-radius:0;margin-bottom:15px;color:#fff;border:none;font-size:13px;background-color:transparent}.core-form-design-container .form-design-left:hover{overflow-y:auto;padding-right:15px}.core-form-design-container .form-design-right{width:100%;height:calc(100vh - var(--size-header-height) - var(--size-layout-block-cell-spacing));padding:15px 15px 15px 375px;overflow-y:auto}.core-form-design-container .form-design-right .form-wrapper{width:100%;overflow-y:visible;background-color:#fff}.core-form-design-container .form-design-right .form-wrapper button{margin-left:12px;padding:4px 10px;border:1px solid #ccc;cursor:pointer;transition:all .2s;width:110px}.core-form-design-container .form-design-right .form-wrapper button:hover{background-color:#e4f0ff;border-color:#007bff;color:#007bff}.core-form-design-container .form-design-right .form-wrapper .form-tool-bar{display:flex;align-items:center;justify-content:flex-end}.core-form-design-container .form-design-right .form-wrapper .form-tool-bar>button{width:150px;margin:0}.core-form-design-container .form-design-right .form-wrapper .form-cells{display:flex;flex-direction:column;gap:32px;padding:20px 15px 15px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder{padding:12px 15px;border:1px dashed #ccc;background-color:#fff;box-shadow:0 2px 6px #0000000a}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header{display:flex;position:relative;align-items:center;justify-content:flex-start;font-weight:600;margin-bottom:12px;color:#333}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-img{width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center;margin-right:8px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-img.calculated{background-image:url(/assets/images/sql-icon.svg);background-color:transparent;border-radius:0}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-tool{position:absolute;right:5px;top:6px;display:none;z-index:2;color:gray}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-tool i{font-size:24px;color:#848484}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header:hover .section-tool{display:block}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .row-tool-bar{display:flex;align-items:center;justify-content:flex-end;margin-bottom:8px;height:24px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-row{display:flex;gap:15px;margin-bottom:15px;min-height:50px;background-color:#d3d3d3;padding:8px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell{flex:1;min-height:90px;background-color:#fcfcfc;border:1px dashed #ccc;position:relative;padding:20px 10px 10px;transition:border .2s ease-in-out}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell:before{content:attr(data-flex);position:absolute;top:2px;left:4px;font-size:10px;color:#999}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell label.required:after{content:\" *\";color:#ff040b}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar{position:absolute;right:7px;top:6px;display:none;z-index:2;color:gray}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar ul{display:flex}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar ul li div{display:flex;width:24px;height:24px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar ul li div i{font-size:18px;width:18px;height:18px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell.has-control:hover .field-toolbar{display:flex}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell.active-drop{border-color:#007bff;background-color:#eef6ff;transition:.2s}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .placeholder{display:flex;align-items:center;justify-content:center;background-color:#fff;color:#007bff;padding:15px 0;width:100%;cursor:default}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .placeholder.calculated{color:#ff4500}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .icon-wrapper{width:24px;height:24px;border-radius:50%;padding:0;cursor:pointer;display:none;color:gray;border:1px solid gray;margin-left:8px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .icon-wrapper i{font-size:18px;width:18px;height:18px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper:hover .icon-wrapper{display:flex}.core-form-design-container .form-design-right .form-wrapper .form-cell.selected{background-color:#dff6dd}.core-form-design-container .form-design-right .form-wrapper .merge-toolbar{text-align:center;margin-top:4px}.core-form-design-container .form-design-right .form-wrapper.live-form{padding-bottom:15px}.core-form-design-container .form-design-right .form-wrapper.live-form .live-form-header{padding:0 15px}.core-form-design-container .form-design-right .form-wrapper.live-form .live-form-header .preview-close-icon{position:absolute;right:7px;top:6px;z-index:2;color:gray;cursor:pointer}.core-form-design-container .form-design-right .form-wrapper.live-form .live-form-header .preview-close-icon i{font-size:18px}.core-form-design-container .drop-target{min-height:50px;min-width:50px;border:2px dashed transparent;transition:border .2s ease}.core-form-design-container .drop-target.active-drop{border-color:#007bff;background-color:#eaf4ff}.core-form-design-container .no-padding{padding:0!important}.core-form-design-container .modal-content-root{overflow:visible}\n", ".core-form-container{overflow-x:visible}.core-form-container>form .section{margin-top:var(--size-layout-block-cell-spacing)}.core-form-container>form .section:not(:first-child){margin-top:calc(var(--size-layout-block-cell-spacing) * 2)}.core-form-container>form .section .section-header-label{display:block;height:34px;line-height:34px;margin-bottom:15px;margin-left:12px}.core-form-container>form .section .section-header-label .section-img-wrapper{position:relative}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img{position:absolute;width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img.calculated{background-image:url(/assets/images/sql-icon.svg);border-radius:0;background-color:transparent}.core-form-container>form .section .section-header-label .section-calc-wrapper{width:34px;height:34px;display:flex;align-items:center;justify-content:center;background-color:#d3d3d3;border-radius:50%}.core-form-container>form .section .section-header-label .section-calc-wrapper i{width:24px;height:24px;font-size:24px;color:#1b4332}.core-form-container>form .section .section-header-label .section-caption{padding-left:40px;font-weight:700;color:#696969}.core-form-container .row{margin-left:var(--size-layout-block-cell-spacing) 0px;margin-right:var(--size-layout-block-cell-spacing) 0px}.core-form-container .row .grid-buffer{border:dotted 2px darkgray}.core-form-container .row .button-control{display:flex;align-items:flex-end}.core-form-container .form-row{margin:var(--size-layout-block-cell-spacing) 0px;display:flex;align-items:center;justify-content:center}.core-form-container .form-row>button{cursor:pointer;border-radius:0}.core-form-container .form-row>button:not(:first-child){margin-left:var(--size-layout-block-cell-spacing)}.core-form-container .dev-button{cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:13px;padding:8px;width:120px;border-radius:18px;box-shadow:.4rem 0 2rem #0000002e}.core-form-container .dev-button:not(:last-child){margin-right:15px}.core-form-container .dev-button:first-child{background-color:#dff6dd;border:1px #9fdc9d solid}.core-form-container .dev-button:last-child{background-color:#fff4ce;border:1px #ffda6a solid}.core-form-container .payload-preview{display:block;width:calc(100% - 48px);height:200px;white-space:pre-wrap;overflow-x:hidden;overflow-y:auto;background-color:#dff6dd;padding:24px;margin:24px;text-indent:-58px;color:#333!important;font-family:Fira Code,monospace;font-size:.85rem;word-break:keep-all;line-height:1.5}.core-form-container .payload-preview.validator-preview{background-color:#fff4ce}.core-form-container .bottom-template-wrapper{padding-left:12px;padding-right:12px}.core-form-container .w-100{width:100%}.core-form-container .pr18{padding-right:18px}\n", ".core-button-vns-container{height:30px;display:flex;align-items:center;justify-content:center;min-width:30px}.core-button-vns-container .action-wrapper{height:30px!important;width:30px!important;display:flex;align-items:center;justify-content:center}.core-button-vns-container .action-wrapper:has(i:hover){background-color:#e7e7e7;border-radius:50%}.core-button-vns-container .btn-for-form{border:none;border-radius:0;background-color:transparent;color:#000;min-width:120px}.core-button-vns-container button.last-child{background-color:#000;color:#fff}.core-button-vns-container .action-wrapper.last-child{background-color:var(--color-basic-orange);color:#fff;border-radius:50%}.core-button-vns-container .action-wrapper.last-child:hover{background-color:var(--color-basic-orange);box-shadow:0 1rem 3rem #0000002e}.core-button-vns-container .temporary-unavailable{user-select:none;-moz-user-select:none;-webkit-user-select:none;cursor:not-allowed!important;opacity:.5}.core-button-vns-container .temporary-unavailable:hover{background-color:transparent!important}\n"], dependencies: [{ kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CoreFormArrayLayoutEditorComponent, selector: "core-form-array-layout-editor" }, { kind: "component", type: CoreToastLoadingComponent, selector: "core-toast-loading" }, { kind: "component", type: CorePageHeaderComponent, selector: "core-page-header", inputs: ["instanceNumber", "shownItems", "title", "hideButtonGroup", "htmlTooltipRef"], outputs: ["buttonClick"] }, { kind: "component", type: FormMetadataComponent, selector: "form-metadata" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { 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: TooltipDirective, selector: "[appTooltip]", inputs: ["color", "backgroundColor", "appTooltip", "showAnyway", "position"] }, { kind: "directive", type: HotKeysDirective, selector: "[hotKeys]", inputs: ["hotKeys"] }, { kind: "component", type: CoreControlComponent, selector: "core-control", inputs: ["control", "form", "checkError$", "rangeLimit"] }, { kind: "component", type: FieldSettingComponent, selector: "field-setting" }, { kind: "component", type: LiveFormComponent, selector: "live-form", inputs: ["$designMode", "$forKickOff", "$workflowReactContext"], outputs: ["$onClose"] }, { kind: "directive", type: HtmlTooltipDirective, selector: "[htmlTooltip]", inputs: ["htmlTooltip", "tooltipContext", "maxWidthUnset", "backgroundColor"] }], animations: [slideFromTopFadeIn], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
2397
- }
2398
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CoreFormDesignComponent, decorators: [{
2399
- type: Component,
2400
- args: [{ selector: 'core-form-design', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
2401
- NgStyle,
2402
- AsyncPipe,
2403
- NgTemplateOutlet,
2404
- CoreFormArrayLayoutEditorComponent,
2405
- CoreToastLoadingComponent,
2406
- CorePageHeaderComponent,
2407
- FormMetadataComponent,
2408
- ReactiveFormsModule,
2409
- TranslatePipe,
2410
- TableCellPipe,
2411
- TooltipDirective,
2412
- HotKeysDirective,
2413
- CoreFormComponent,
2414
- CoreControlComponent,
2415
- CoreDropdownComponent,
2416
- CoreChecklistComponent,
2417
- CoreFormControlSeekerComponent,
2418
- CoreCheckboxComponent,
2419
- CoreAttachmentComponent,
2420
- CoreDatePickerComponent,
2421
- CoreRadioGroupComponent,
2422
- CoreMonthSelectorComponent,
2423
- TooltipDirective,
2424
- CoreCurrencyInputComponent,
2425
- FieldSettingComponent,
2426
- LiveFormComponent,
2427
- HtmlTooltipDirective,
2428
- ], animations: [slideFromTopFadeIn], template: "<div class=\"core-form-design-container fs-13\" [hotKeys]=\"['F3', 'F6', 'Escape']\">\r\n\r\n <core-page-header title=\"UI.COMPONENT_TITLE.WORKFLOW_FORM_DESIGN\" (buttonClick)=\"onCorePageHeaderButtonClicked($event)\"></core-page-header>\r\n\r\n <ng-template #formMetadata>\r\n <form-metadata></form-metadata>\r\n </ng-template>\r\n\r\n @if (coreFormDesignService.$showFormArrayDesign()) {\r\n <core-form-array-layout-editor />\r\n }\r\n\r\n @if (!coreFormDesignService.$isInWorkflowDesign()) {\r\n <aside class=\"af-metadata-overlay\" [@slideFromTopFadeIn]=\"coreFormDesignService.$showFormMetadata() ? 'in' : 'out'\"\r\n [class.shown]=\"coreFormDesignService.$showFormMetadata()\"\r\n >\r\n <ng-container *ngTemplateOutlet=\"formMetadata\"></ng-container>\r\n </aside>\r\n }\r\n\r\n <div \r\n class=\"field-setting-panel\" \r\n [class.open]=\"coreFormDesignService.$fieldSettingPanelOpen()\" \r\n [class.calculated-type]=\"coreFormDesignService.$selectedCell()?.control?.type==='calculated'\"\r\n [ngStyle]=\"{ zIndex: $zIndex() }\"\r\n #settingPanel\r\n >\r\n @if (!!(this.coreFormDesignService.$selectedCell())) {\r\n <field-setting></field-setting>\r\n }\r\n </div>\r\n\r\n <div class=\"form-design-left\">\r\n\r\n @switch ($leftPanelMode()) {\r\n @case (enumLeftPanelMode.FieldCollection) {\r\n @for (category of controlCategories; track $index) {\r\n <div class=\"category-name\">\r\n {{ category.name }}\r\n </div>\r\n <ul>\r\n @for (control of category.controls; track $index) {\r\n <li draggable=\"true\" (dragstart)=\"onDragStart($event, control)\" [class.full-width]=\"control.controlType === 'SEEKER' || control.controlType === 'ATTACHMENT' || control.controlType === 'GRIDBUFFER'\">\r\n @if (control.controlType === 'GRIDBUFFER') {\r\n <div class=\"grid-buffer-wrapper\">\r\n <core-control [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n </div>\r\n } @else {\r\n <core-control [control]=\"control\" [form]=\"form\" [checkError$]=\"checkError$\"></core-control>\r\n }\r\n </li>\r\n <div class=\"space\"></div>\r\n }\r\n </ul>\r\n }\r\n }\r\n @case (enumLeftPanelMode.Json) {\r\n <button type=\"button\" class=\"btn btn-secondary\" (click)=\"switchJson()\">{{ $jsonMode() }}</button>\r\n @if ($jsonMode()==='selectedField') {\r\n <pre class=\"json-preview\">{{ coreFormDesignService.$currentControlJson() }}</pre>\r\n } @else {\r\n <pre class=\"json-preview\">{{ coreFormDesignService.$saveLiveJson() }}</pre>\r\n }\r\n \r\n }\r\n }\r\n\r\n </div>\r\n\r\n <div class=\"form-design-right\">\r\n <!-- <pre>{{ $injectedFieldsJson() }}</pre> -->\r\n\r\n @if (coreFormDesignService.$mode() === enumType.Default) {\r\n <div class=\"form-wrapper\">\r\n\r\n @if (!!coreFormDesignService.$isInWorkflowDesign()) {\r\n <form-metadata></form-metadata>\r\n }\r\n\r\n <form [formGroup]=\"formDesign\" autocomplete=\"off\">\r\n <div class=\"form-cells\">\r\n\r\n <div class=\"form-tool-bar\">\r\n @if (!$hasCalculatedSection()) {\r\n <button class=\"core-button-vns-container\" (click)=\"addCalculatedSection()\">+ Calculated fields</button>\r\n }\r\n <button class=\"core-button-vns-container\" (click)=\"addSection()\">+ Add Section</button>\r\n </div>\r\n \r\n @for (section of coreFormDesignService.$placeholderSections(); track $index; let sectionIndex = $index) {\r\n <div class=\"form-section-placeholder\">\r\n\r\n <div class=\"section-header\">\r\n\r\n <div class=\"section-img-wrapper\">\r\n <div class=\"section-img\" [class.calculated]=\"section.forCalculatedFields\"></div>\r\n </div>\r\n\r\n <label [attr.contenteditable]=\"!section.forCalculatedFields\"\r\n [htmlTooltip]=\"!!section.forCalculatedFields ? calculatedFieldsTooltip : null\"\r\n (blur)=\"onCaptionEditEnd(sectionIndex, $event)\"\r\n (keydown.enter)=\"onCaptionEditEnd(sectionIndex, $event); $event.preventDefault()\"\r\n >{{ section.caption }}</label>\r\n\r\n <div class=\"section-tool pointer\" (click)=\"deleteSection(sectionIndex)\" [appTooltip]=\"'Delete section'\" [showAnyway]=\"true\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n \r\n </div>\r\n \r\n @for (row of section.rows; track $index; let rowIndex = $index) {\r\n\r\n <div class=\"form-row-wrapper\">\r\n <div class=\"form-row\">\r\n @for (cell of filteredCells(row); track $index; let colIndex = $index) {\r\n <div class=\"form-cell drop-target\" \r\n [ngStyle]=\"{ flex: (cell.flexSize ?? 0) + ' 1 0%' }\"\r\n [attr.data-flex]=\"cell.flexSize ?? 0\"\r\n (drop)=\"onDropIntoCell($event, sectionIndex, rowIndex, colIndex)\"\r\n (dragover)=\"onDragOver($event, section, cell.control!)\"\r\n (dragenter)=\"onDragEnter(sectionIndex + '_' + rowIndex + '_' + colIndex)\"\r\n (dragleave)=\"onDragLeave(sectionIndex + '_' + rowIndex + '_' + colIndex)\"\r\n [class.selected]=\"cell?.selected\"\r\n [class.dragging-over]=\"isDragOverMap[sectionIndex + '_' + rowIndex + '_' + colIndex]\"\r\n [class.has-control]=\"!!cell && !!cell.control && !!getControl(cell)\"\r\n (click)=\"onCellClicked(sectionIndex, rowIndex, colIndex)\"\r\n >\r\n\r\n\r\n @if (!isDragOverMap[sectionIndex + '_' + rowIndex + '_' + colIndex]) {\r\n\r\n @if (!!cell && !!cell.control && !!getControl(cell)) {\r\n <label contenteditable=\"true\"\r\n (blur)=\"onFieldCaptionEditEnd(cell, $event)\"\r\n (keydown.enter)=\"onFieldCaptionEditEnd(cell, $event); $event.preventDefault()\"\r\n [class.d-none]=\"!!getControl(cell)?.hidden\"\r\n [class.required]=\"!!cell && !!cell.control && !!getControl(cell) && isRequired(getControl(cell))\"\r\n >{{ cell.control.label || 'label' }}</label>\r\n\r\n @if (cell.control.controlType==='CALCULATED') {\r\n <div class=\"control-wrapper\" (click)=\"openSettingsForCell(cell, sectionIndex, rowIndex, colIndex)\">\r\n <core-control \r\n [control]=\"getControl(cell)!\" \r\n [form]=\"formDesign\"\r\n [checkError$]=\"checkError$\" />\r\n </div>\r\n } @else {\r\n <core-control \r\n [control]=\"getControl(cell)!\" \r\n [form]=\"formDesign\"\r\n [checkError$]=\"checkError$\" />\r\n }\r\n \r\n <div class=\"field-toolbar\">\r\n <ul>\r\n <li>\r\n <div class=\"field-tool pointer\" (click)=\"openSettingsForCell(cell, sectionIndex, rowIndex, colIndex)\" [appTooltip]=\"'Show settings'\">\r\n <i class=\"feather-settings\"></i>\r\n </div>\r\n </li>\r\n <li>\r\n <div class=\"field-tool pointer\" (click)=\"deleteField(row, sectionIndex, rowIndex, colIndex)\" [appTooltip]=\"'Remove field from cell'\">\r\n <i class=\"feather-x\"></i>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n \r\n } @else {\r\n <div class=\"placeholder\" [class.calculated]=\"!!section.forCalculatedFields\">\r\n {{ !!section.forCalculatedFields ? 'Drop calculated field here' : 'Drop here'}}\r\n </div>\r\n }\r\n\r\n @if (cell?.selected && canMergeCells(sectionIndex, rowIndex)) {\r\n <div class=\"merge-toolbar\">\r\n <button (click)=\"mergeCells(sectionIndex, rowIndex)\">\uD83D\uDD17 Merge</button>\r\n </div>\r\n }\r\n \r\n }\r\n\r\n </div>\r\n }\r\n </div>\r\n <div class=\"row-tool-bar\">\r\n <div class=\"icon-wrapper\" (click)=\"deleteRow(sectionIndex, rowIndex)\" [appTooltip]=\"'Delete row'\" [showAnyway]=\"true\"><i class=\"feather-x\"></i></div>\r\n <div class=\"icon-wrapper\" (click)=\"addRow(sectionIndex)\" [appTooltip]=\"'Add row'\" [showAnyway]=\"true\"><i class=\"feather-arrow-down\"></i></div>\r\n <div class=\"icon-wrapper\" (click)=\"insertRow(sectionIndex, rowIndex)\" [appTooltip]=\"'Insert row'\" [showAnyway]=\"true\"><i class=\"feather-corner-right-down\"></i></div>\r\n <div class=\"icon-wrapper\" (click)=\"addColumn(row)\" [appTooltip]=\"'Add column'\" [showAnyway]=\"true\"><i class=\"feather-arrow-right\"></i></div>\r\n </div>\r\n </div>\r\n\r\n }\r\n </div>\r\n }\r\n \r\n \r\n </div>\r\n </form>\r\n </div>\r\n } @else if (!!$sections()) {\r\n\r\n @if(!!(injectedFields$ | async) && !!(injectedFields$ | async)!.length) {\r\n\r\n @if (!!coreFormDesignService.$afInstance().normalMode) {\r\n <live-form [$designMode]=\"true\" [$forKickOff]=\"true\" />\r\n } @else {\r\n <live-form [$designMode]=\"true\" [$forKickOff]=\"true\" ($onClose)=\"closePreview()\" />\r\n }\r\n\r\n } @else {\r\n <h2>COULD NOT UPDATE injectedFields$</h2>\r\n }\r\n\r\n } @else {\r\n <h2>$sections() empty / null / undefined</h2>\r\n }\r\n\r\n\r\n \r\n </div>\r\n @if ($loading()) {\r\n <core-toast-loading></core-toast-loading>\r\n }\r\n\r\n <ng-template #calculatedFieldsTooltip>\r\n <div style=\"max-width: 280px;\">\r\n <strong>Calculated Fields</strong><br />\r\n <p></p>\r\n These fields are hidden from the form and cannot be edited directly.<br /><br />\r\n - They are computed automatically during workflow execution.<br />\r\n - Each field depends on one or more standard input fields.<br />\r\n - The calculation is evaluated using either an SQL query engine (like <strong>Dapper</strong>) or an in-memory expression engine (like <strong>Dynamic Expresso</strong>).<br /><br />\r\n In both cases, the result is a <code>0</code> or <code>1</code>, representing <strong>false</strong> or <strong>true</strong>.<br /><br />\r\n These results can be used to influence workflow logic, rule trees, or approval paths.\r\n </div>\r\n </ng-template>\r\n \r\n</div>", styles: ["@charset \"UTF-8\";.core-form-design-container{position:relative;height:calc(100vh - var(--size-header-height) - var(--size-layout-block-cell-spacing));width:100%;overflow:hidden;background-color:#eff0f1;font-size:13px}.core-form-design-container .core-button-vns-container{margin-right:8px!important}.core-form-design-container .core-button-vns-container:last-child{background-color:#000;color:#fff;margin-right:0}.core-form-design-container .af-metadata-overlay{position:fixed;top:60px;left:66px;background:#fff;box-shadow:.4rem 0 2rem #0000002e;z-index:1000;width:1214px;height:calc(100vh - 75px);overflow-y:auto;pointer-events:none}.core-form-design-container .af-metadata-overlay.shown{pointer-events:auto}.core-form-design-container *{border-radius:0}.core-form-design-container ul,.core-form-design-container li{padding:0}.core-form-design-container li{max-width:200px}.core-form-design-container ul div.space{display:block;height:15px}.core-form-design-container li.full-width{max-width:100%}.core-form-design-container .field-setting-panel{display:block;position:fixed;width:360px;height:100vh;top:0;right:-360px;background-color:#fff;box-shadow:.4rem 0 2rem #0000002e;transition:right .5s ease-out}.core-form-design-container .field-setting-panel .close-wrapper{width:32px;height:32px;position:absolute;top:15px;right:15px;display:flex;background-color:#848484;border-radius:50%}.core-form-design-container .field-setting-panel .close-wrapper i{width:16px;height:16px;font-size:18px;color:#848484}.core-form-design-container .field-setting-panel .panel-caption{margin-bottom:1rem;padding-bottom:.5rem;border-bottom:1px solid #ddd;width:100%;overflow:hidden;text-wrap:nowrap;text-overflow:ellipsis}.core-form-design-container .field-setting-panel.calculated-type{width:500px;right:-500px}.core-form-design-container .field-setting-panel.calculated-type textarea{border-radius:8px;height:150px}.core-form-design-container .field-setting-panel.open{right:0}.core-form-design-container .form-design-left{position:absolute;top:var(--size-core-page-header-height);bottom:0;left:0;z-index:1;width:360px;height:calc(100vh - var(--size-header-height) - var(--size-layout-block-cell-spacing));padding:15px;padding-right:calc(15px + var(--size-scrollbar-width));background-color:#87ceeb;overflow-y:hidden}.core-form-design-container .form-design-left .category-name{color:#fff}.core-form-design-container .form-design-left .grid-buffer-wrapper{background-color:#fff;padding:15px}.core-form-design-container .form-design-left ul:last-child{padding-bottom:400px}.core-form-design-container .form-design-left .category-name{margin-bottom:15px}.core-form-design-container .form-design-left .json-preview{background-color:#fff;color:#333;padding:1rem 1.5rem;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;width:330px;height:calc(100vh - 205px)}.core-form-design-container .form-design-left button{height:35px;border-radius:0;margin-bottom:15px;color:#fff;border:none;font-size:13px;background-color:transparent}.core-form-design-container .form-design-left:hover{overflow-y:auto;padding-right:15px}.core-form-design-container .form-design-right{width:100%;height:calc(100vh - var(--size-header-height) - var(--size-layout-block-cell-spacing));padding:15px 15px 15px 375px;overflow-y:auto}.core-form-design-container .form-design-right .form-wrapper{width:100%;overflow-y:visible;background-color:#fff}.core-form-design-container .form-design-right .form-wrapper button{margin-left:12px;padding:4px 10px;border:1px solid #ccc;cursor:pointer;transition:all .2s;width:110px}.core-form-design-container .form-design-right .form-wrapper button:hover{background-color:#e4f0ff;border-color:#007bff;color:#007bff}.core-form-design-container .form-design-right .form-wrapper .form-tool-bar{display:flex;align-items:center;justify-content:flex-end}.core-form-design-container .form-design-right .form-wrapper .form-tool-bar>button{width:150px;margin:0}.core-form-design-container .form-design-right .form-wrapper .form-cells{display:flex;flex-direction:column;gap:32px;padding:20px 15px 15px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder{padding:12px 15px;border:1px dashed #ccc;background-color:#fff;box-shadow:0 2px 6px #0000000a}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header{display:flex;position:relative;align-items:center;justify-content:flex-start;font-weight:600;margin-bottom:12px;color:#333}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-img{width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center;margin-right:8px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-img.calculated{background-image:url(/assets/images/sql-icon.svg);background-color:transparent;border-radius:0}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-tool{position:absolute;right:5px;top:6px;display:none;z-index:2;color:gray}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header .section-tool i{font-size:24px;color:#848484}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-section-placeholder .section-header:hover .section-tool{display:block}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .row-tool-bar{display:flex;align-items:center;justify-content:flex-end;margin-bottom:8px;height:24px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-row{display:flex;gap:15px;margin-bottom:15px;min-height:50px;background-color:#d3d3d3;padding:8px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell{flex:1;min-height:90px;background-color:#fcfcfc;border:1px dashed #ccc;position:relative;padding:20px 10px 10px;transition:border .2s ease-in-out}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell:before{content:attr(data-flex);position:absolute;top:2px;left:4px;font-size:10px;color:#999}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell label.required:after{content:\" *\";color:#ff040b}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar{position:absolute;right:7px;top:6px;display:none;z-index:2;color:gray}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar ul{display:flex}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar ul li div{display:flex;width:24px;height:24px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell .field-toolbar ul li div i{font-size:18px;width:18px;height:18px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell.has-control:hover .field-toolbar{display:flex}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .form-cell.active-drop{border-color:#007bff;background-color:#eef6ff;transition:.2s}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .placeholder{display:flex;align-items:center;justify-content:center;background-color:#fff;color:#007bff;padding:15px 0;width:100%;cursor:default}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .placeholder.calculated{color:#ff4500}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .icon-wrapper{width:24px;height:24px;border-radius:50%;padding:0;cursor:pointer;display:none;color:gray;border:1px solid gray;margin-left:8px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper .icon-wrapper i{font-size:18px;width:18px;height:18px}.core-form-design-container .form-design-right .form-wrapper .form-cells .form-row-wrapper:hover .icon-wrapper{display:flex}.core-form-design-container .form-design-right .form-wrapper .form-cell.selected{background-color:#dff6dd}.core-form-design-container .form-design-right .form-wrapper .merge-toolbar{text-align:center;margin-top:4px}.core-form-design-container .form-design-right .form-wrapper.live-form{padding-bottom:15px}.core-form-design-container .form-design-right .form-wrapper.live-form .live-form-header{padding:0 15px}.core-form-design-container .form-design-right .form-wrapper.live-form .live-form-header .preview-close-icon{position:absolute;right:7px;top:6px;z-index:2;color:gray;cursor:pointer}.core-form-design-container .form-design-right .form-wrapper.live-form .live-form-header .preview-close-icon i{font-size:18px}.core-form-design-container .drop-target{min-height:50px;min-width:50px;border:2px dashed transparent;transition:border .2s ease}.core-form-design-container .drop-target.active-drop{border-color:#007bff;background-color:#eaf4ff}.core-form-design-container .no-padding{padding:0!important}.core-form-design-container .modal-content-root{overflow:visible}\n", ".core-form-container{overflow-x:visible}.core-form-container>form .section{margin-top:var(--size-layout-block-cell-spacing)}.core-form-container>form .section:not(:first-child){margin-top:calc(var(--size-layout-block-cell-spacing) * 2)}.core-form-container>form .section .section-header-label{display:block;height:34px;line-height:34px;margin-bottom:15px;margin-left:12px}.core-form-container>form .section .section-header-label .section-img-wrapper{position:relative}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img{position:absolute;width:34px;height:34px;border-radius:50%;background-color:#d3d3d3;float:left;background-image:url(/assets/images/info.svg);background-repeat:no-repeat;background-position:center}.core-form-container>form .section .section-header-label .section-img-wrapper .section-img.calculated{background-image:url(/assets/images/sql-icon.svg);border-radius:0;background-color:transparent}.core-form-container>form .section .section-header-label .section-calc-wrapper{width:34px;height:34px;display:flex;align-items:center;justify-content:center;background-color:#d3d3d3;border-radius:50%}.core-form-container>form .section .section-header-label .section-calc-wrapper i{width:24px;height:24px;font-size:24px;color:#1b4332}.core-form-container>form .section .section-header-label .section-caption{padding-left:40px;font-weight:700;color:#696969}.core-form-container .row{margin-left:var(--size-layout-block-cell-spacing) 0px;margin-right:var(--size-layout-block-cell-spacing) 0px}.core-form-container .row .grid-buffer{border:dotted 2px darkgray}.core-form-container .row .button-control{display:flex;align-items:flex-end}.core-form-container .form-row{margin:var(--size-layout-block-cell-spacing) 0px;display:flex;align-items:center;justify-content:center}.core-form-container .form-row>button{cursor:pointer;border-radius:0}.core-form-container .form-row>button:not(:first-child){margin-left:var(--size-layout-block-cell-spacing)}.core-form-container .dev-button{cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:13px;padding:8px;width:120px;border-radius:18px;box-shadow:.4rem 0 2rem #0000002e}.core-form-container .dev-button:not(:last-child){margin-right:15px}.core-form-container .dev-button:first-child{background-color:#dff6dd;border:1px #9fdc9d solid}.core-form-container .dev-button:last-child{background-color:#fff4ce;border:1px #ffda6a solid}.core-form-container .payload-preview{display:block;width:calc(100% - 48px);height:200px;white-space:pre-wrap;overflow-x:hidden;overflow-y:auto;background-color:#dff6dd;padding:24px;margin:24px;text-indent:-58px;color:#333!important;font-family:Fira Code,monospace;font-size:.85rem;word-break:keep-all;line-height:1.5}.core-form-container .payload-preview.validator-preview{background-color:#fff4ce}.core-form-container .bottom-template-wrapper{padding-left:12px;padding-right:12px}.core-form-container .w-100{width:100%}.core-form-container .pr18{padding-right:18px}\n", ".core-button-vns-container{height:30px;display:flex;align-items:center;justify-content:center;min-width:30px}.core-button-vns-container .action-wrapper{height:30px!important;width:30px!important;display:flex;align-items:center;justify-content:center}.core-button-vns-container .action-wrapper:has(i:hover){background-color:#e7e7e7;border-radius:50%}.core-button-vns-container .btn-for-form{border:none;border-radius:0;background-color:transparent;color:#000;min-width:120px}.core-button-vns-container button.last-child{background-color:#000;color:#fff}.core-button-vns-container .action-wrapper.last-child{background-color:var(--color-basic-orange);color:#fff;border-radius:50%}.core-button-vns-container .action-wrapper.last-child:hover{background-color:var(--color-basic-orange);box-shadow:0 1rem 3rem #0000002e}.core-button-vns-container .temporary-unavailable{user-select:none;-moz-user-select:none;-webkit-user-select:none;cursor:not-allowed!important;opacity:.5}.core-button-vns-container .temporary-unavailable:hover{background-color:transparent!important}\n"] }]
2429
- }], ctorParameters: () => [{ type: MultiLanguageService }] });
2430
-
2431
- var coreFormDesign_component = /*#__PURE__*/Object.freeze({
2432
- __proto__: null,
2433
- CoreFormDesignComponent: CoreFormDesignComponent
2434
- });
2435
-
2436
- export { BasePropsComponent as B, CoreFormDesignComponent as C, coreFormDesign_component as c };
2437
- //# sourceMappingURL=ngx-histaff-alpha-core-form-design.component-KQsI4L2g.mjs.map