ngx-t-forms 2.0.29 → 2.0.31

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 (161) hide show
  1. package/fesm2022/ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs +104 -0
  2. package/fesm2022/ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs.map +1 -0
  3. package/fesm2022/ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs +85 -0
  4. package/fesm2022/ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs.map +1 -0
  5. package/fesm2022/ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs +643 -0
  6. package/fesm2022/ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs.map +1 -0
  7. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs +97 -0
  8. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs.map +1 -0
  9. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs +195 -0
  10. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs.map +1 -0
  11. package/fesm2022/ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs +261 -0
  12. package/fesm2022/ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs.map +1 -0
  13. package/fesm2022/ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs +85 -0
  14. package/fesm2022/ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs.map +1 -0
  15. package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs +156 -0
  16. package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs.map +1 -0
  17. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs +368 -0
  18. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs.map +1 -0
  19. package/fesm2022/ngx-t-forms-document-picker.component-qObjcqhE.mjs +704 -0
  20. package/fesm2022/ngx-t-forms-document-picker.component-qObjcqhE.mjs.map +1 -0
  21. package/fesm2022/ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs +294 -0
  22. package/fesm2022/ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs.map +1 -0
  23. package/fesm2022/ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs +240 -0
  24. package/fesm2022/ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs.map +1 -0
  25. package/fesm2022/ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs +205 -0
  26. package/fesm2022/ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs.map +1 -0
  27. package/fesm2022/ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs +86 -0
  28. package/fesm2022/ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs.map +1 -0
  29. package/fesm2022/ngx-t-forms-form-json-view.component-856Hx1Bg.mjs +22 -0
  30. package/fesm2022/ngx-t-forms-form-json-view.component-856Hx1Bg.mjs.map +1 -0
  31. package/fesm2022/ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs +179 -0
  32. package/fesm2022/ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs.map +1 -0
  33. package/fesm2022/ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs +319 -0
  34. package/fesm2022/ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs.map +1 -0
  35. package/fesm2022/ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs +379 -0
  36. package/fesm2022/ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs.map +1 -0
  37. package/fesm2022/ngx-t-forms-geo-location.component-Bosp1UzR.mjs +124 -0
  38. package/fesm2022/ngx-t-forms-geo-location.component-Bosp1UzR.mjs.map +1 -0
  39. package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs +31 -0
  40. package/fesm2022/ngx-t-forms-getInputIcon-B4ADgevZ.mjs.map +1 -0
  41. package/fesm2022/ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs +180 -0
  42. package/fesm2022/ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs.map +1 -0
  43. package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs +2 -0
  44. package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs.map +1 -0
  45. package/fesm2022/ngx-t-forms-input-custom.component-BkbHFAyR.mjs +105 -0
  46. package/fesm2022/ngx-t-forms-input-custom.component-BkbHFAyR.mjs.map +1 -0
  47. package/fesm2022/ngx-t-forms-input-editor.component-BPUOM9kQ.mjs +181 -0
  48. package/fesm2022/ngx-t-forms-input-editor.component-BPUOM9kQ.mjs.map +1 -0
  49. package/fesm2022/{ngx-t-forms-map-mat-options-keys-CbdW82su.mjs → ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs} +12 -14
  50. package/fesm2022/ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs.map +1 -0
  51. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs +66 -0
  52. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs.map +1 -0
  53. package/fesm2022/ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs +211 -0
  54. package/fesm2022/ngx-t-forms-mat-slider-editor.component-CTSBrM-j.mjs.map +1 -0
  55. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs +165 -0
  56. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-CcYiwx-8.mjs.map +1 -0
  57. package/fesm2022/ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs +38 -0
  58. package/fesm2022/ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs.map +1 -0
  59. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs +38 -0
  60. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs.map +1 -0
  61. package/fesm2022/ngx-t-forms-mscoa-error-display.component-99DpVSy7.mjs +126 -0
  62. package/fesm2022/ngx-t-forms-mscoa-error-display.component-99DpVSy7.mjs.map +1 -0
  63. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs +336 -0
  64. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs.map +1 -0
  65. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs +74 -0
  66. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs.map +1 -0
  67. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs +905 -0
  68. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs.map +1 -0
  69. package/fesm2022/ngx-t-forms-ngx-t-forms-u_kigDid.mjs +19461 -0
  70. package/fesm2022/ngx-t-forms-ngx-t-forms-u_kigDid.mjs.map +1 -0
  71. package/fesm2022/ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs +555 -0
  72. package/fesm2022/ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs.map +1 -0
  73. package/fesm2022/ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs +748 -0
  74. package/fesm2022/ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs.map +1 -0
  75. package/fesm2022/ngx-t-forms-record-list-manager.component-CUMMvMch.mjs +358 -0
  76. package/fesm2022/ngx-t-forms-record-list-manager.component-CUMMvMch.mjs.map +1 -0
  77. package/fesm2022/ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs +272 -0
  78. package/fesm2022/ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs.map +1 -0
  79. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs +398 -0
  80. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs.map +1 -0
  81. package/fesm2022/ngx-t-forms-search-field.component-B2ZO7lqO.mjs +38 -0
  82. package/fesm2022/ngx-t-forms-search-field.component-B2ZO7lqO.mjs.map +1 -0
  83. package/fesm2022/ngx-t-forms-section-report.component-BxOhR6C0.mjs +98 -0
  84. package/fesm2022/ngx-t-forms-section-report.component-BxOhR6C0.mjs.map +1 -0
  85. package/fesm2022/ngx-t-forms-select-input-element.component-DbgZdNoe.mjs +150 -0
  86. package/fesm2022/ngx-t-forms-select-input-element.component-DbgZdNoe.mjs.map +1 -0
  87. package/fesm2022/ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs +169 -0
  88. package/fesm2022/ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs.map +1 -0
  89. package/fesm2022/ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs +204 -0
  90. package/fesm2022/ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs.map +1 -0
  91. package/fesm2022/ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs +95 -0
  92. package/fesm2022/ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs.map +1 -0
  93. package/fesm2022/ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs +82 -0
  94. package/fesm2022/ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs.map +1 -0
  95. package/fesm2022/ngx-t-forms-validators-config.component-oGjQVGE2.mjs +733 -0
  96. package/fesm2022/ngx-t-forms-validators-config.component-oGjQVGE2.mjs.map +1 -0
  97. package/fesm2022/ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs +1303 -0
  98. package/fesm2022/ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs.map +1 -0
  99. package/fesm2022/ngx-t-forms.mjs +2 -1
  100. package/fesm2022/ngx-t-forms.mjs.map +1 -1
  101. package/package.json +20 -18
  102. package/styles/_editor-mixins.scss +62 -0
  103. package/styles/_json-editor-syntax.scss +26 -0
  104. package/styles/_signature-pad.scss +26 -0
  105. package/styles/_tokens.scss +148 -0
  106. package/types/ngx-t-forms.d.ts +1767 -621
  107. package/fesm2022/ngx-t-forms-calculated-field-rules.component-D-SBMdYg.mjs +0 -313
  108. package/fesm2022/ngx-t-forms-calculated-field-rules.component-D-SBMdYg.mjs.map +0 -1
  109. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-1cpszpPN.mjs +0 -191
  110. package/fesm2022/ngx-t-forms-chip-options-creator-editor.component-1cpszpPN.mjs.map +0 -1
  111. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DFdAVWTg.mjs +0 -207
  112. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DFdAVWTg.mjs.map +0 -1
  113. package/fesm2022/ngx-t-forms-data-source-picker.component-DxORinAD.mjs +0 -204
  114. package/fesm2022/ngx-t-forms-data-source-picker.component-DxORinAD.mjs.map +0 -1
  115. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-DcWS1txl.mjs +0 -289
  116. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-DcWS1txl.mjs.map +0 -1
  117. package/fesm2022/ngx-t-forms-form-input-selector.component-B2QEnvkq.mjs +0 -134
  118. package/fesm2022/ngx-t-forms-form-input-selector.component-B2QEnvkq.mjs.map +0 -1
  119. package/fesm2022/ngx-t-forms-form-json-view.component-DePf44w6.mjs +0 -22
  120. package/fesm2022/ngx-t-forms-form-json-view.component-DePf44w6.mjs.map +0 -1
  121. package/fesm2022/ngx-t-forms-form-section-stepper.component-BTkcSjg7.mjs +0 -270
  122. package/fesm2022/ngx-t-forms-form-section-stepper.component-BTkcSjg7.mjs.map +0 -1
  123. package/fesm2022/ngx-t-forms-forms-builder-menu.component-Wamzf_sq.mjs +0 -345
  124. package/fesm2022/ngx-t-forms-forms-builder-menu.component-Wamzf_sq.mjs.map +0 -1
  125. package/fesm2022/ngx-t-forms-input-editor.component-D4xHO76K.mjs +0 -147
  126. package/fesm2022/ngx-t-forms-input-editor.component-D4xHO76K.mjs.map +0 -1
  127. package/fesm2022/ngx-t-forms-map-mat-options-keys-CbdW82su.mjs.map +0 -1
  128. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DmTyO9Wi.mjs +0 -105
  129. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DmTyO9Wi.mjs.map +0 -1
  130. package/fesm2022/ngx-t-forms-mat-slider-editor.component-DZ4TenrI.mjs +0 -109
  131. package/fesm2022/ngx-t-forms-mat-slider-editor.component-DZ4TenrI.mjs.map +0 -1
  132. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DPyBYE4p.mjs +0 -155
  133. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DPyBYE4p.mjs.map +0 -1
  134. package/fesm2022/ngx-t-forms-missing-form-configs.component-BRmnwAK6.mjs +0 -28
  135. package/fesm2022/ngx-t-forms-missing-form-configs.component-BRmnwAK6.mjs.map +0 -1
  136. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D_umeAPL.mjs +0 -43
  137. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D_umeAPL.mjs.map +0 -1
  138. package/fesm2022/ngx-t-forms-mscoa-error-display.component-CSX2NCNU.mjs +0 -116
  139. package/fesm2022/ngx-t-forms-mscoa-error-display.component-CSX2NCNU.mjs.map +0 -1
  140. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-B6IF8kGg.mjs +0 -296
  141. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-B6IF8kGg.mjs.map +0 -1
  142. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-BPkjsRmH.mjs +0 -83
  143. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-BPkjsRmH.mjs.map +0 -1
  144. package/fesm2022/ngx-t-forms-ngx-t-forms-D9qmig6g.mjs +0 -16844
  145. package/fesm2022/ngx-t-forms-ngx-t-forms-D9qmig6g.mjs.map +0 -1
  146. package/fesm2022/ngx-t-forms-pipeline-generator.component-DBJEyCbd.mjs +0 -613
  147. package/fesm2022/ngx-t-forms-pipeline-generator.component-DBJEyCbd.mjs.map +0 -1
  148. package/fesm2022/ngx-t-forms-record-list-manager.component-Dgs9lNSr.mjs +0 -269
  149. package/fesm2022/ngx-t-forms-record-list-manager.component-Dgs9lNSr.mjs.map +0 -1
  150. package/fesm2022/ngx-t-forms-required-inputs.component-CSIJvSHq.mjs +0 -190
  151. package/fesm2022/ngx-t-forms-required-inputs.component-CSIJvSHq.mjs.map +0 -1
  152. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CY-JSkGs.mjs +0 -291
  153. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-CY-JSkGs.mjs.map +0 -1
  154. package/fesm2022/ngx-t-forms-section-report.component-12-KdKT6.mjs +0 -156
  155. package/fesm2022/ngx-t-forms-section-report.component-12-KdKT6.mjs.map +0 -1
  156. package/fesm2022/ngx-t-forms-selection-options-editor.component-Be3QAG_L.mjs +0 -186
  157. package/fesm2022/ngx-t-forms-selection-options-editor.component-Be3QAG_L.mjs.map +0 -1
  158. package/fesm2022/ngx-t-forms-t-workflow-picker.component-a4f1r8gH.mjs +0 -187
  159. package/fesm2022/ngx-t-forms-t-workflow-picker.component-a4f1r8gH.mjs.map +0 -1
  160. package/fesm2022/ngx-t-forms-validators-config.component-B3j9Dmgu.mjs +0 -215
  161. package/fesm2022/ngx-t-forms-validators-config.component-B3j9Dmgu.mjs.map +0 -1
@@ -1,313 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { EventEmitter, Input, Output, HostBinding, Optional, Self, Component } from '@angular/core';
3
- import { v4 } from 'uuid';
4
- import { _ as _isEqual, M as MatModulesModule } from './ngx-t-forms-ngx-t-forms-D9qmig6g.mjs';
5
- import * as i2 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
- import * as i1 from '@angular/forms';
8
- import { FormsModule } from '@angular/forms';
9
- import { FormInputSelectorComponent } from './ngx-t-forms-form-input-selector.component-B2QEnvkq.mjs';
10
- import { MatFormFieldControl } from '@angular/material/form-field';
11
- import { Subject } from 'rxjs';
12
- import { CalculationFunctions } from 'ngx-t-forms-types';
13
- import * as i10 from '@angular/cdk/overlay';
14
- import { OverlayModule } from '@angular/cdk/overlay';
15
- import * as i2$1 from '@angular/material/autocomplete';
16
- import * as i2$2 from '@angular/material/button';
17
- import * as i3 from '@angular/material/card';
18
- import * as i4 from '@angular/material/chips';
19
- import * as i4$1 from '@angular/material/divider';
20
- import * as i3$1 from '@angular/material/icon';
21
- import * as i3$2 from '@angular/material/select';
22
- import * as i5 from '@angular/material/toolbar';
23
- import * as i13 from '@angular/material/input';
24
-
25
- // import 'mathlive';
26
- // Define the interface for the Mathfield element to avoid TS errors
27
- // declare global {
28
- // interface HTMLElementTagNameMap {
29
- // 'math-field': MathfieldElement;
30
- // }
31
- // }
32
- // import { MathfieldElement } from 'mathlive';
33
- // import { cleanLatexForMathJS, cleanMathJSForLatex } from '../../../../services/core/t-form-tower-controller/functions/lateToMathjs';
34
- class CalculatedFieldRulesComponent {
35
- static { this.nextId = 0; }
36
- constructor(ngControl, _elementRef) {
37
- this.ngControl = ngControl;
38
- this._elementRef = _elementRef;
39
- // #region MatFormFieldControl Properties
40
- this.id = `app-calculated-field-rules-${CalculatedFieldRulesComponent.nextId++}`;
41
- this.stateChanges = new Subject();
42
- this.focused = false;
43
- this.touched = false;
44
- this.controlType = 'app-calculated-field-rules';
45
- this.placeholder = '';
46
- this.required = false;
47
- this.disabled = false;
48
- // #endregion
49
- // #region Component Inputs/Outputs
50
- this.mapToData = undefined;
51
- this.formInputs = [];
52
- this.errors = [];
53
- this.valueChange2dWithPath = new EventEmitter();
54
- this.valueChanged = new EventEmitter();
55
- // Edit Mode State
56
- this.isEditing = false;
57
- this.tempValue = {}; // Local state for editing
58
- // Cache for performance (calculated in ngOnChanges)
59
- this.cachedNumberInputs = [];
60
- // Variable config state
61
- this.activeVariable = {};
62
- this.showVariableConfig = false;
63
- this.roundingType = [
64
- { value: 'FLOOR', label: 'Round Down (FLOOR)' },
65
- { value: 'CEIL', label: 'Round Up (CEIL)' },
66
- { value: 'ROUND', label: 'Standard Rounding (ROUND)' },
67
- ];
68
- this.onChange = (_) => { };
69
- this.onTouched = () => { };
70
- if (this.ngControl) {
71
- this.ngControl.valueAccessor = this;
72
- }
73
- }
74
- ngOnInit() { }
75
- ngOnChanges(changes) {
76
- if (changes['formInputs']) {
77
- this.cachedNumberInputs = this.formInputs?.filter((input) => input.dataType === 'number' || input.type === 'number') || [];
78
- }
79
- }
80
- ngOnDestroy() {
81
- this.stateChanges.next();
82
- this.stateChanges.complete();
83
- }
84
- // #region Value Accessor & MatFormFieldControl Logic
85
- get value() {
86
- return this._value;
87
- }
88
- set value(val) {
89
- if (_isEqual(this._value, val))
90
- return;
91
- this._value = val ? {
92
- ...val
93
- } : undefined;
94
- this.stateChanges.next();
95
- this.valueChanged.emit(this._value);
96
- this.onChange(this._value);
97
- }
98
- get empty() {
99
- return !this._value;
100
- }
101
- get shouldLabelFloat() {
102
- return this.focused || !this.empty;
103
- }
104
- get errorState() {
105
- const hasCustomError = (this.errors || []).length > 0;
106
- const hasControlError = !!this.ngControl?.control?.errors;
107
- return ((this.touched && (hasControlError || hasCustomError)) ||
108
- (!!this.required && !this.value));
109
- }
110
- writeValue(value) {
111
- this.value = value;
112
- }
113
- registerOnChange(fn) {
114
- this.onChange = fn;
115
- }
116
- registerOnTouched(fn) {
117
- this.onTouched = fn;
118
- }
119
- setDescribedByIds(ids) {
120
- if (this._elementRef?.nativeElement) {
121
- const controlElement = this._elementRef.nativeElement.querySelector('.app-calculated-field-rules');
122
- if (controlElement) {
123
- controlElement.setAttribute('aria-describedby', ids.join(' '));
124
- }
125
- }
126
- }
127
- onContainerClick(event) {
128
- if (!this.focused) {
129
- this.focused = true;
130
- this.stateChanges.next();
131
- }
132
- this.markAsTouched();
133
- }
134
- markAsTouched() {
135
- if (!this.touched) {
136
- this.onTouched();
137
- this.touched = true;
138
- this.stateChanges.next();
139
- }
140
- }
141
- // #endregion
142
- // #region Edit Mode Logic
143
- startEdit() {
144
- // Clone the current value into tempValue to prevent immediate emission
145
- this.tempValue = this.value
146
- ? JSON.parse(JSON.stringify(this.value))
147
- : {};
148
- this.isEditing = true;
149
- this.markAsTouched();
150
- }
151
- saveEdit() {
152
- // Commit tempValue to actual value
153
- this.value = this.tempValue;
154
- this.isEditing = false;
155
- }
156
- cancelEdit() {
157
- // Discard changes
158
- this.isEditing = false;
159
- this.tempValue = {};
160
- }
161
- // #endregion
162
- // #region Getters
163
- get allCalculationFunction() {
164
- return Object.values(CalculationFunctions);
165
- }
166
- get tableMode() {
167
- return !!this.mapToData?.tableConfig;
168
- }
169
- get tableConfig() {
170
- return this.mapToData?.tableConfig;
171
- }
172
- // #endregion
173
- // #region Logic (Refactored to use tempValue)
174
- checkIfInputCanBeLinkedToCalVariable(currentInput, inputToDisable) {
175
- if (!currentInput)
176
- return false;
177
- if (currentInput.formControlName === inputToDisable.formControlName) {
178
- return true;
179
- }
180
- if (!currentInput.multipleInputInEditId) {
181
- return !!inputToDisable.parentInput || !!inputToDisable.multipleInputInEditId;
182
- }
183
- return false;
184
- }
185
- linkFormulaSource(event) {
186
- this.tempValue = {
187
- ...this.tempValue,
188
- formControlWithFormula: event.value,
189
- formula: undefined // Reset formula when source changes
190
- };
191
- }
192
- removeVariable(variableId) {
193
- if (!this.tempValue?.variables)
194
- return;
195
- this.tempValue = {
196
- ...this.tempValue,
197
- variables: this.tempValue.variables.filter(v => v.id !== variableId)
198
- };
199
- }
200
- appendVariableToFormula(variableName) {
201
- const currentFormula = this.tempValue?.formula || '';
202
- this.tempValue = {
203
- ...this.tempValue,
204
- formula: `${currentFormula} ${variableName}`
205
- };
206
- }
207
- // #endregion
208
- // #region Variable Configuration
209
- toggleVariableConfig() {
210
- this.showVariableConfig = !this.showVariableConfig;
211
- if (!this.showVariableConfig) {
212
- this.activeVariable = {};
213
- }
214
- }
215
- bindInput(inputId) {
216
- const input = this.formInputs?.find((i) => i.id === inputId);
217
- if (!input)
218
- return;
219
- if (this.activeVariable.formControlName === input.formControlName) {
220
- return;
221
- }
222
- this.activeVariable = {
223
- ...this.activeVariable,
224
- formControlName: input.formControlName,
225
- label: input.label,
226
- inputId: input.id,
227
- parentInputId: input.multipleInputInEditId
228
- };
229
- }
230
- attachFunction(event, funcValue) {
231
- event.stopPropagation();
232
- if (this.activeVariable.function === funcValue) {
233
- this.activeVariable.function = undefined;
234
- this.activeVariable.applyFunctionToCol = undefined;
235
- this.activeVariable.applyFunctionToLabel = undefined;
236
- }
237
- else {
238
- this.activeVariable.function = funcValue;
239
- this.activeVariable.applyFunctionToCol = this.activeVariable.formControlName;
240
- this.activeVariable.applyFunctionToLabel = this.activeVariable.label;
241
- }
242
- }
243
- cancelVariableConfig() {
244
- this.activeVariable = {};
245
- this.showVariableConfig = false;
246
- }
247
- saveNewVariable() {
248
- const currentVariables = this.tempValue?.variables || [];
249
- const newVar = {
250
- ...this.activeVariable,
251
- id: v4(),
252
- variable: this.activeVariable.variable || '',
253
- };
254
- if (this.inputIsInItemList(newVar)) {
255
- const input = this.formInputs?.find((i) => i.formControlName === newVar.formControlName);
256
- if (input?.multipleInputInEditId) {
257
- newVar['parentInputId'] = input.multipleInputInEditId;
258
- }
259
- }
260
- this.tempValue = {
261
- ...this.tempValue,
262
- variables: [...currentVariables, newVar],
263
- formula: this.tempValue.formula || ''
264
- };
265
- this.activeVariable = {};
266
- this.showVariableConfig = false;
267
- }
268
- inputIsInItemList(v) {
269
- const input = this.formInputs?.find((i) => i.formControlName === v.formControlName);
270
- const hasParent = input ? !!input.multipleInputInEditId : false;
271
- const isInTable = v.tableCell;
272
- return hasParent || isInTable;
273
- }
274
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: CalculatedFieldRulesComponent, deps: [{ token: i1.NgControl, optional: true, self: true }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
275
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: CalculatedFieldRulesComponent, isStandalone: true, selector: "app-calculated-field-rules", inputs: { placeholder: "placeholder", required: "required", disabled: "disabled", mapToData: "mapToData", formInputs: "formInputs", errors: "errors", value: "value" }, outputs: { valueChange2dWithPath: "valueChange2dWithPath", valueChanged: "valueChanged" }, host: { properties: { "id": "this.id" } }, providers: [{ provide: MatFormFieldControl, useExisting: CalculatedFieldRulesComponent }], usesOnChanges: true, ngImport: i0, template: "<br>\r\n\r\n<!-- View Mode (Summary) -->\r\n@if (!isEditing) {\r\n<div class=\"view-mode-container\"\r\n style=\"display: flex; flex-direction: column; gap: 8px;background:var(--mat-sys-surface-variant)\">\r\n\r\n @if (!!value && !mapToData?.['id'] && !tableMode) {\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>Save the input first to enable calculated field configurations</span>\r\n </div>\r\n }\r\n\r\n <div\r\n style=\"display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--mat-sys-outline-variant, #ccc); border-radius: 4px; padding: 12px;\">\r\n <div style=\"display: flex; flex-direction: column; width: 100%;\">\r\n <span style=\"font-size: 0.85em; opacity: 0.7;\">Current Formula</span>\r\n <span style=\"font-weight: 500; font-size: 1.1em; width: 100%;\">\r\n <!-- <math-field style=\"width: 100%;\" #mathfield \r\n [readOnly]=\"true\"\r\n [value]=\"getFormular\">\r\n </math-field> -->\r\n\r\n <code>\r\n <pre>\r\n {{ value?.formula || 'No formula configured' }}\r\n </pre>\r\n </code>\r\n\r\n\r\n </span>\r\n @if(value?.decimalPlaces) {\r\n <span style=\"font-size: 0.8em; margin-top: 4px; opacity: 0.7;\">\r\n Decimals: {{value?.decimalPlaces}} | Rounding: {{value?.roundingMode || 'None'}}\r\n </span>\r\n }\r\n </div>\r\n\r\n </div>\r\n</div>\r\n<button style=\"width: 100%;margin-top: 16px;\" mat-stroked-button color=\"primary\" (click)=\"startEdit()\">\r\n <mat-icon>edit</mat-icon>\r\n Edit Rules\r\n</button>\r\n}\r\n\r\n<!-- Edit Mode (Editor Card) -->\r\n@else {\r\n<mat-card appearance=\"outlined\" class=\"editor-card\" style=\"padding: 16px; border-color: var(--mat-sys-primary);\">\r\n <h3 style=\"margin-top: 0; margin-bottom: 16px; color: var(--mat-sys-primary);\">\r\n <mat-icon style=\"vertical-align: middle; margin-right: 8px;\">functions</mat-icon>\r\n Edit Calculation\r\n </h3>\r\n\r\n <section>\r\n <!-- Main Formula Input -->\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>Equation</mat-label>\r\n <textarea matInput [(ngModel)]=\"tempValue['formula']\" placeholder=\"Enter calculation expression\"\r\n rows=\"3\"></textarea>\r\n <mat-hint>example: ((a+2)/(b-1))*2</mat-hint>\r\n </mat-form-field>\r\n <!-- <math-field style=\"width: 100%;\" #mathfield \r\n [readOnly]=\"false\"\r\n [value]=\"getFormular\" \r\n [smartMode]=\"true\"\r\n (input)=\"onInput(mathfield.value)\">\r\n </math-field> -->\r\n <!-- Optional Source Link -->\r\n @if (!!tempValue?.getFormulaFromAFormInput) {\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\"\r\n style=\"margin-bottom: 8px; margin-top: 12px; width: 100%;\" appearance=\"outline\">\r\n <mat-label>Equation Source</mat-label>\r\n <mat-select matNativeControl [value]=\"tempValue.formControlWithFormula\"\r\n (selectionChange)=\"linkFormulaSource($event)\" placeholder=\"select Input with formula\">\r\n @for (input of formInputs; track input.id) {\r\n <mat-option [disabled]=\"checkIfInputCanBeLinkedToCalVariable(mapToData, input) || input.element !== 'select'\"\r\n [value]=\"input.formControlName\">\r\n {{input.label}}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-hint>Link formula to an input value</mat-hint>\r\n </mat-form-field>\r\n }\r\n\r\n <!-- Variable Chips List -->\r\n <div style=\"margin-top: 12px; margin-bottom: 12px;\">\r\n <label style=\"font-size: 0.9em; opacity: 0.8; display: block; margin-bottom: 8px;\">Variables</label>\r\n <mat-chip-listbox aria-label=\"options\">\r\n @for (variable of (tempValue['variables'] || []); track variable.id) {\r\n <mat-chip (click)=\"appendVariableToFormula(variable.variable)\" (removed)=\"removeVariable(variable.id!)\">\r\n <div [style.color]=\"variable.tableCell ? 'var(--ion-color-purple)' : ''\" style=\"font-size: 0.8125em\">\r\n {{ variable.variable }} - {{ variable.label }}\r\n @if (variable.function) {\r\n <span style=\"opacity: 0.6; padding-left: 5px\">{{ variable.function }}</span>\r\n }\r\n </div>\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n\r\n <!-- Add/Close Variable Button -->\r\n <mat-chip highlighted=\"true\" [color]=\"showVariableConfig ? 'warn' : 'accent'\" (click)=\"toggleVariableConfig()\">\r\n <span>{{ showVariableConfig ? 'Close Variable Edit' : 'Add a new Variable' }}</span>\r\n <mat-icon matChipTrailingIcon>{{ showVariableConfig ? 'close' : 'add' }}</mat-icon>\r\n </mat-chip>\r\n </mat-chip-listbox>\r\n </div>\r\n\r\n <!-- Variable Configuration Panel -->\r\n @if (showVariableConfig) {\r\n @defer (on immediate) {\r\n <ng-container *ngTemplateOutlet=\"variableConfigurationTpl\"></ng-container>\r\n }\r\n }\r\n\r\n <mat-divider style=\"margin: 16px 0;\"></mat-divider>\r\n\r\n <!-- Rounding Settings -->\r\n <div style=\"display: flex; gap: 16px; flex-wrap: wrap;\">\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\"\r\n style=\"flex: 1; min-width: 150px;\">\r\n <mat-label>Decimal Places</mat-label>\r\n <input matInput [(ngModel)]=\"tempValue['decimalPlaces']\" placeholder=\"0\" type=\"number\" min=\"0\">\r\n </mat-form-field>\r\n\r\n @if (tempValue['decimalPlaces']) {\r\n <div style=\"flex: 2;\">\r\n <label style=\"font-size: 0.85em; opacity: 0.8;\">Rounding Mode</label>\r\n <mat-chip-listbox aria-label=\"Rounding types\" style=\"margin-top: 4px;\">\r\n @for (type of roundingType; track type.value) {\r\n <mat-chip-option (click)=\"tempValue['roundingMode'] = type.value\"\r\n [selected]=\"tempValue['roundingMode'] === type.value\">\r\n {{type.label}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n </div>\r\n }\r\n </div>\r\n </section>\r\n\r\n <!-- Card Actions (Save/Cancel) -->\r\n <div style=\"display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px;\">\r\n <button mat-button (click)=\"cancelEdit()\">Cancel</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveEdit()\">Save Changes</button>\r\n </div>\r\n</mat-card>\r\n}\r\n\r\n<!-- Variable Configuration Template -->\r\n<ng-template #variableConfigurationTpl>\r\n <div\r\n style=\"background: var(--mat-sys-surface-variant, #f5f5f5); border-radius: 8px; padding: 12px; margin-top: 8px; border: 1px dashed #ccc;\">\r\n <div class=\"tree-instructions\" style=\"background: azure; margin-bottom: 12px;\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n <strong>Configure variable</strong><br>\r\n Link a form input to a variable to use in the equation\r\n </span>\r\n </div>\r\n\r\n <!-- Input Selector -->\r\n <lib-form-input-selector [disabled]=\"!!activeVariable.formControlName\" [formInputs]=\"cachedNumberInputs\"\r\n [value]=\"activeVariable.inputId\" (click)=\"$event.stopPropagation()\" (change)=\"bindInput($event)\">\r\n </lib-form-input-selector>\r\n\r\n @if (activeVariable.formControlName) {\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\"\r\n style=\"width: 100%; margin-top: 12px;\">\r\n <mat-label>Variable Name</mat-label>\r\n <textarea matInput (click)=\"$event.stopPropagation()\" [(ngModel)]=\"activeVariable.variable\"\r\n placeholder=\"enter variable\" rows=\"1\"></textarea>\r\n <mat-hint>A variable is an alphabet or term that represents a form input in the equation.</mat-hint>\r\n </mat-form-field>\r\n\r\n @if (activeVariable.parentInputId) {\r\n <br>\r\n <mat-label><small>list function ( \u0192 )</small></mat-label>\r\n <mat-chip-listbox class=\"mat-mdc-chip-set-stacked\" aria-label=\"Calculation function\">\r\n @for (func of allCalculationFunction; track func) {\r\n <mat-chip-option (click)=\"attachFunction($event, func)\" [selected]=\"activeVariable.function === func\">\r\n {{func}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n }\r\n }\r\n\r\n <!-- Actions -->\r\n <mat-toolbar style=\"background: transparent; padding: 0; margin-top: 12px;\" lines=\"none\">\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"cancelVariableConfig()\">Cancel</button>\r\n <button mat-flat-button color=\"primary\" [disabled]=\"!activeVariable.formControlName || !activeVariable.variable\"\r\n (click)=\"saveNewVariable()\">\r\n Add Variable\r\n </button>\r\n </mat-toolbar>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Overlay for disabled state -->\r\n<ng-template cdkConnectedOverlay [cdkConnectedOverlayOpen]=\"disabled\">\r\n <div\r\n style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 10;\">\r\n </div>\r\n</ng-template>", styles: [".labelM{font-size:.8125em}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon{min-width:38px;margin:8px auto auto}mat-form-field{width:100%;background:azure}.endIcons{height:100%;display:flex!important;align-items:center!important;justify-content:center}mat-chip{cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: MatModulesModule }, { kind: "component", type: i2$1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i2$2.MatButton, selector: " button[matButton], a[matButton], button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button], a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button] ", inputs: ["matButton"], exportAs: ["matButton", "matAnchor"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i4.MatChip, selector: "mat-basic-chip, [mat-basic-chip], mat-chip, [mat-chip]", inputs: ["role", "id", "aria-label", "aria-description", "value", "color", "removable", "highlighted", "disableRipple", "disabled"], outputs: ["removed", "destroyed"], exportAs: ["matChip"] }, { kind: "component", type: i4.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i4.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i4.MatChipRemove, selector: "[matChipRemove]" }, { kind: "directive", type: i4.MatChipTrailingIcon, selector: "mat-chip-trailing-icon, [matChipTrailingIcon]" }, { kind: "component", type: i4$1.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i3$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i3$2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i3$2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i3$2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i3$2.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i5.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i10.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i13.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "ngmodule", type: CommonModule }, { 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.MinValidator, selector: "input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]", inputs: ["min"] }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: FormInputSelectorComponent, selector: "lib-form-input-selector", inputs: ["errors", "value", "formInputs", "disabled"], outputs: ["change"] }, { kind: "ngmodule", type: OverlayModule }], deferBlockDependencies: [() => [i2.NgTemplateOutlet]] }); }
276
- }
277
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: CalculatedFieldRulesComponent, decorators: [{
278
- type: Component,
279
- args: [{ selector: 'app-calculated-field-rules', standalone: true, imports: [
280
- MatModulesModule,
281
- CommonModule,
282
- FormsModule,
283
- FormInputSelectorComponent,
284
- OverlayModule
285
- ], providers: [{ provide: MatFormFieldControl, useExisting: CalculatedFieldRulesComponent }], template: "<br>\r\n\r\n<!-- View Mode (Summary) -->\r\n@if (!isEditing) {\r\n<div class=\"view-mode-container\"\r\n style=\"display: flex; flex-direction: column; gap: 8px;background:var(--mat-sys-surface-variant)\">\r\n\r\n @if (!!value && !mapToData?.['id'] && !tableMode) {\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>Save the input first to enable calculated field configurations</span>\r\n </div>\r\n }\r\n\r\n <div\r\n style=\"display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--mat-sys-outline-variant, #ccc); border-radius: 4px; padding: 12px;\">\r\n <div style=\"display: flex; flex-direction: column; width: 100%;\">\r\n <span style=\"font-size: 0.85em; opacity: 0.7;\">Current Formula</span>\r\n <span style=\"font-weight: 500; font-size: 1.1em; width: 100%;\">\r\n <!-- <math-field style=\"width: 100%;\" #mathfield \r\n [readOnly]=\"true\"\r\n [value]=\"getFormular\">\r\n </math-field> -->\r\n\r\n <code>\r\n <pre>\r\n {{ value?.formula || 'No formula configured' }}\r\n </pre>\r\n </code>\r\n\r\n\r\n </span>\r\n @if(value?.decimalPlaces) {\r\n <span style=\"font-size: 0.8em; margin-top: 4px; opacity: 0.7;\">\r\n Decimals: {{value?.decimalPlaces}} | Rounding: {{value?.roundingMode || 'None'}}\r\n </span>\r\n }\r\n </div>\r\n\r\n </div>\r\n</div>\r\n<button style=\"width: 100%;margin-top: 16px;\" mat-stroked-button color=\"primary\" (click)=\"startEdit()\">\r\n <mat-icon>edit</mat-icon>\r\n Edit Rules\r\n</button>\r\n}\r\n\r\n<!-- Edit Mode (Editor Card) -->\r\n@else {\r\n<mat-card appearance=\"outlined\" class=\"editor-card\" style=\"padding: 16px; border-color: var(--mat-sys-primary);\">\r\n <h3 style=\"margin-top: 0; margin-bottom: 16px; color: var(--mat-sys-primary);\">\r\n <mat-icon style=\"vertical-align: middle; margin-right: 8px;\">functions</mat-icon>\r\n Edit Calculation\r\n </h3>\r\n\r\n <section>\r\n <!-- Main Formula Input -->\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>Equation</mat-label>\r\n <textarea matInput [(ngModel)]=\"tempValue['formula']\" placeholder=\"Enter calculation expression\"\r\n rows=\"3\"></textarea>\r\n <mat-hint>example: ((a+2)/(b-1))*2</mat-hint>\r\n </mat-form-field>\r\n <!-- <math-field style=\"width: 100%;\" #mathfield \r\n [readOnly]=\"false\"\r\n [value]=\"getFormular\" \r\n [smartMode]=\"true\"\r\n (input)=\"onInput(mathfield.value)\">\r\n </math-field> -->\r\n <!-- Optional Source Link -->\r\n @if (!!tempValue?.getFormulaFromAFormInput) {\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\"\r\n style=\"margin-bottom: 8px; margin-top: 12px; width: 100%;\" appearance=\"outline\">\r\n <mat-label>Equation Source</mat-label>\r\n <mat-select matNativeControl [value]=\"tempValue.formControlWithFormula\"\r\n (selectionChange)=\"linkFormulaSource($event)\" placeholder=\"select Input with formula\">\r\n @for (input of formInputs; track input.id) {\r\n <mat-option [disabled]=\"checkIfInputCanBeLinkedToCalVariable(mapToData, input) || input.element !== 'select'\"\r\n [value]=\"input.formControlName\">\r\n {{input.label}}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-hint>Link formula to an input value</mat-hint>\r\n </mat-form-field>\r\n }\r\n\r\n <!-- Variable Chips List -->\r\n <div style=\"margin-top: 12px; margin-bottom: 12px;\">\r\n <label style=\"font-size: 0.9em; opacity: 0.8; display: block; margin-bottom: 8px;\">Variables</label>\r\n <mat-chip-listbox aria-label=\"options\">\r\n @for (variable of (tempValue['variables'] || []); track variable.id) {\r\n <mat-chip (click)=\"appendVariableToFormula(variable.variable)\" (removed)=\"removeVariable(variable.id!)\">\r\n <div [style.color]=\"variable.tableCell ? 'var(--ion-color-purple)' : ''\" style=\"font-size: 0.8125em\">\r\n {{ variable.variable }} - {{ variable.label }}\r\n @if (variable.function) {\r\n <span style=\"opacity: 0.6; padding-left: 5px\">{{ variable.function }}</span>\r\n }\r\n </div>\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n\r\n <!-- Add/Close Variable Button -->\r\n <mat-chip highlighted=\"true\" [color]=\"showVariableConfig ? 'warn' : 'accent'\" (click)=\"toggleVariableConfig()\">\r\n <span>{{ showVariableConfig ? 'Close Variable Edit' : 'Add a new Variable' }}</span>\r\n <mat-icon matChipTrailingIcon>{{ showVariableConfig ? 'close' : 'add' }}</mat-icon>\r\n </mat-chip>\r\n </mat-chip-listbox>\r\n </div>\r\n\r\n <!-- Variable Configuration Panel -->\r\n @if (showVariableConfig) {\r\n @defer (on immediate) {\r\n <ng-container *ngTemplateOutlet=\"variableConfigurationTpl\"></ng-container>\r\n }\r\n }\r\n\r\n <mat-divider style=\"margin: 16px 0;\"></mat-divider>\r\n\r\n <!-- Rounding Settings -->\r\n <div style=\"display: flex; gap: 16px; flex-wrap: wrap;\">\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\"\r\n style=\"flex: 1; min-width: 150px;\">\r\n <mat-label>Decimal Places</mat-label>\r\n <input matInput [(ngModel)]=\"tempValue['decimalPlaces']\" placeholder=\"0\" type=\"number\" min=\"0\">\r\n </mat-form-field>\r\n\r\n @if (tempValue['decimalPlaces']) {\r\n <div style=\"flex: 2;\">\r\n <label style=\"font-size: 0.85em; opacity: 0.8;\">Rounding Mode</label>\r\n <mat-chip-listbox aria-label=\"Rounding types\" style=\"margin-top: 4px;\">\r\n @for (type of roundingType; track type.value) {\r\n <mat-chip-option (click)=\"tempValue['roundingMode'] = type.value\"\r\n [selected]=\"tempValue['roundingMode'] === type.value\">\r\n {{type.label}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n </div>\r\n }\r\n </div>\r\n </section>\r\n\r\n <!-- Card Actions (Save/Cancel) -->\r\n <div style=\"display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px;\">\r\n <button mat-button (click)=\"cancelEdit()\">Cancel</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveEdit()\">Save Changes</button>\r\n </div>\r\n</mat-card>\r\n}\r\n\r\n<!-- Variable Configuration Template -->\r\n<ng-template #variableConfigurationTpl>\r\n <div\r\n style=\"background: var(--mat-sys-surface-variant, #f5f5f5); border-radius: 8px; padding: 12px; margin-top: 8px; border: 1px dashed #ccc;\">\r\n <div class=\"tree-instructions\" style=\"background: azure; margin-bottom: 12px;\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n <strong>Configure variable</strong><br>\r\n Link a form input to a variable to use in the equation\r\n </span>\r\n </div>\r\n\r\n <!-- Input Selector -->\r\n <lib-form-input-selector [disabled]=\"!!activeVariable.formControlName\" [formInputs]=\"cachedNumberInputs\"\r\n [value]=\"activeVariable.inputId\" (click)=\"$event.stopPropagation()\" (change)=\"bindInput($event)\">\r\n </lib-form-input-selector>\r\n\r\n @if (activeVariable.formControlName) {\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\"\r\n style=\"width: 100%; margin-top: 12px;\">\r\n <mat-label>Variable Name</mat-label>\r\n <textarea matInput (click)=\"$event.stopPropagation()\" [(ngModel)]=\"activeVariable.variable\"\r\n placeholder=\"enter variable\" rows=\"1\"></textarea>\r\n <mat-hint>A variable is an alphabet or term that represents a form input in the equation.</mat-hint>\r\n </mat-form-field>\r\n\r\n @if (activeVariable.parentInputId) {\r\n <br>\r\n <mat-label><small>list function ( \u0192 )</small></mat-label>\r\n <mat-chip-listbox class=\"mat-mdc-chip-set-stacked\" aria-label=\"Calculation function\">\r\n @for (func of allCalculationFunction; track func) {\r\n <mat-chip-option (click)=\"attachFunction($event, func)\" [selected]=\"activeVariable.function === func\">\r\n {{func}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n }\r\n }\r\n\r\n <!-- Actions -->\r\n <mat-toolbar style=\"background: transparent; padding: 0; margin-top: 12px;\" lines=\"none\">\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"cancelVariableConfig()\">Cancel</button>\r\n <button mat-flat-button color=\"primary\" [disabled]=\"!activeVariable.formControlName || !activeVariable.variable\"\r\n (click)=\"saveNewVariable()\">\r\n Add Variable\r\n </button>\r\n </mat-toolbar>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Overlay for disabled state -->\r\n<ng-template cdkConnectedOverlay [cdkConnectedOverlayOpen]=\"disabled\">\r\n <div\r\n style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 10;\">\r\n </div>\r\n</ng-template>", styles: [".labelM{font-size:.8125em}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon{min-width:38px;margin:8px auto auto}mat-form-field{width:100%;background:azure}.endIcons{height:100%;display:flex!important;align-items:center!important;justify-content:center}mat-chip{cursor:pointer}\n"] }]
286
- }], ctorParameters: () => [{ type: i1.NgControl, decorators: [{
287
- type: Optional
288
- }, {
289
- type: Self
290
- }] }, { type: i0.ElementRef }], propDecorators: { id: [{
291
- type: HostBinding
292
- }], placeholder: [{
293
- type: Input
294
- }], required: [{
295
- type: Input
296
- }], disabled: [{
297
- type: Input
298
- }], mapToData: [{
299
- type: Input
300
- }], formInputs: [{
301
- type: Input
302
- }], errors: [{
303
- type: Input
304
- }], valueChange2dWithPath: [{
305
- type: Output
306
- }], valueChanged: [{
307
- type: Output
308
- }], value: [{
309
- type: Input
310
- }] } });
311
-
312
- export { CalculatedFieldRulesComponent };
313
- //# sourceMappingURL=ngx-t-forms-calculated-field-rules.component-D-SBMdYg.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ngx-t-forms-calculated-field-rules.component-D-SBMdYg.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.html"],"sourcesContent":["import {\r\n\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n HostBinding,\r\n Input,\r\n\r\n OnChanges,\r\n\r\n OnDestroy,\r\n OnInit,\r\n Optional,\r\n Output,\r\n Self,\r\n// CUSTOM_ELEMENTS_SCHEMA,\r\n SimpleChanges,\r\n\r\n\r\n} from '@angular/core';\r\n\r\nimport { v4 as uuidv4 } from 'uuid';\r\nimport { MatModulesModule } from '../../../../shared/modules/mat-modules.module';\r\nimport { CommonModule } from '@angular/common';\r\nimport { CalculatedFieldRules, TableConfigurationsInterface } from 'ngx-t-forms-types';\r\n\r\nimport { FormColumnInputs } from 'ngx-t-forms-types';\r\nimport { FormsModule, NgControl } from '@angular/forms';\r\nimport { MatSelectChange } from '@angular/material/select';\r\nimport { FormInputSelectorComponent } from '../form-input-selector/form-input-selector.component';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { Subject } from 'rxjs';\r\nimport { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { CalculationFunctions, calculationVariableInterface } from \"ngx-t-forms-types\"\r\nimport { OverlayModule } from '@angular/cdk/overlay';\r\nimport { _isEqual } from '../../../../shared/functions/isEqual';\r\n// import 'mathlive';\r\n// Define the interface for the Mathfield element to avoid TS errors\r\n// declare global {\r\n// interface HTMLElementTagNameMap {\r\n// 'math-field': MathfieldElement;\r\n// }\r\n// }\r\n\r\n\r\n// import { MathfieldElement } from 'mathlive';\r\n// import { cleanLatexForMathJS, cleanMathJSForLatex } from '../../../../services/core/t-form-tower-controller/functions/lateToMathjs';\r\n@Component({\r\n selector: 'app-calculated-field-rules',\r\n templateUrl: './calculated-field-rules.component.html',\r\n styleUrls: ['./calculated-field-rules.component.scss'],\r\n standalone: true,\r\n imports: [\r\n MatModulesModule,\r\n CommonModule,\r\n FormsModule,\r\n FormInputSelectorComponent,\r\n OverlayModule\r\n ],\r\n // schemas: [CUSTOM_ELEMENTS_SCHEMA],\r\n providers: [{ provide: MatFormFieldControl, useExisting: CalculatedFieldRulesComponent }],\r\n})\r\nexport class CalculatedFieldRulesComponent implements OnInit, OnChanges, OnDestroy,\r\n MatFormFieldControl<CalculatedFieldRules | undefined> {\r\n static nextId = 0;\r\n\r\n // #region MatFormFieldControl Properties\r\n @HostBinding() id = `app-calculated-field-rules-${CalculatedFieldRulesComponent.nextId++}`;\r\n stateChanges = new Subject<void>();\r\n focused = false;\r\n touched = false;\r\n controlType = 'app-calculated-field-rules';\r\n\r\n @Input() placeholder: string = '';\r\n @Input() required: boolean = false;\r\n @Input() disabled: boolean = false;\r\n\r\n // #endregion\r\n\r\n // #region Component Inputs/Outputs\r\n @Input() mapToData: FormColumnInputs | undefined = undefined;\r\n @Input() formInputs: Array<FormColumnInputs> = [];\r\n @Input() errors: IConfigElementError[] | undefined = [];\r\n\r\n @Output() valueChange2dWithPath = new EventEmitter<any>();\r\n @Output() valueChanged = new EventEmitter<CalculatedFieldRules | null>();\r\n // #endregion\r\n\r\n // Internal State\r\n protected _value: CalculatedFieldRules | undefined;\r\n\r\n // Edit Mode State\r\n isEditing = false;\r\n tempValue: CalculatedFieldRules = {} as CalculatedFieldRules; // Local state for editing\r\n\r\n // Cache for performance (calculated in ngOnChanges)\r\n cachedNumberInputs: FormColumnInputs[] = [];\r\n\r\n // Variable config state\r\n activeVariable: Partial<calculationVariableInterface & { inputId?: string, parentInputId?: string }> = {};\r\n showVariableConfig = false;\r\n\r\n roundingType: {\r\n value: any;\r\n label: string;\r\n }[] = [\r\n { value: 'FLOOR', label: 'Round Down (FLOOR)' },\r\n { value: 'CEIL', label: 'Round Up (CEIL)' },\r\n { value: 'ROUND', label: 'Standard Rounding (ROUND)' },\r\n ];\r\n\r\n constructor(\r\n @Optional() @Self() public ngControl: NgControl,\r\n private _elementRef: ElementRef<HTMLElement>\r\n ) {\r\n if (this.ngControl) {\r\n this.ngControl.valueAccessor = this;\r\n }\r\n }\r\n\r\n\r\n ngOnInit() { }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (changes['formInputs']) {\r\n this.cachedNumberInputs = this.formInputs?.filter(\r\n (input) => input.dataType === 'number' || input.type === 'number'\r\n ) || [];\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.stateChanges.next();\r\n this.stateChanges.complete();\r\n }\r\n\r\n // #region Value Accessor & MatFormFieldControl Logic\r\n\r\n @Input()\r\n get value(): CalculatedFieldRules | undefined {\r\n return this._value;\r\n }\r\n\r\n set value(val: CalculatedFieldRules | undefined) {\r\n if (_isEqual(this._value, val)) return;\r\n this._value = val ? { \r\n \r\n ...val \r\n \r\n } : undefined;\r\n this.stateChanges.next();\r\n this.valueChanged.emit(this._value);\r\n this.onChange(this._value);\r\n }\r\n\r\n get empty(): boolean {\r\n return !this._value;\r\n }\r\n\r\n get shouldLabelFloat(): boolean {\r\n return this.focused || !this.empty;\r\n }\r\n\r\n get errorState(): boolean {\r\n const hasCustomError = (this.errors || []).length > 0;\r\n const hasControlError = !!this.ngControl?.control?.errors;\r\n return (\r\n (this.touched && (hasControlError || hasCustomError)) ||\r\n (!!this.required && !this.value)\r\n );\r\n }\r\n\r\n onChange = (_: any) => { };\r\n onTouched = () => { };\r\n\r\n writeValue(value: CalculatedFieldRules): void {\r\n this.value = value;\r\n }\r\n\r\n registerOnChange(fn: any): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: any): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDescribedByIds(ids: string[]): void {\r\n if (this._elementRef?.nativeElement) {\r\n const controlElement = this._elementRef.nativeElement.querySelector(\r\n '.app-calculated-field-rules'\r\n );\r\n if (controlElement) {\r\n controlElement.setAttribute('aria-describedby', ids.join(' '));\r\n }\r\n }\r\n }\r\n\r\n onContainerClick(event: MouseEvent): void {\r\n if (!this.focused) {\r\n this.focused = true;\r\n this.stateChanges.next();\r\n }\r\n this.markAsTouched();\r\n }\r\n\r\n markAsTouched() {\r\n if (!this.touched) {\r\n this.onTouched();\r\n this.touched = true;\r\n this.stateChanges.next();\r\n }\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Edit Mode Logic\r\n\r\n startEdit() {\r\n // Clone the current value into tempValue to prevent immediate emission\r\n this.tempValue = this.value\r\n ? JSON.parse(JSON.stringify(this.value))\r\n : {} as CalculatedFieldRules;\r\n this.isEditing = true;\r\n this.markAsTouched();\r\n }\r\n\r\n saveEdit() {\r\n // Commit tempValue to actual value\r\n this.value = this.tempValue;\r\n this.isEditing = false;\r\n }\r\n\r\n cancelEdit() {\r\n // Discard changes\r\n this.isEditing = false;\r\n this.tempValue = {} as CalculatedFieldRules;\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Getters\r\n\r\n get allCalculationFunction() {\r\n return Object.values(CalculationFunctions);\r\n }\r\n\r\n get tableMode(): boolean {\r\n return !!this.mapToData?.tableConfig;\r\n }\r\n\r\n get tableConfig(): TableConfigurationsInterface | undefined {\r\n return this.mapToData?.tableConfig;\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Logic (Refactored to use tempValue)\r\n\r\n checkIfInputCanBeLinkedToCalVariable(\r\n currentInput: FormColumnInputs | undefined,\r\n inputToDisable: { formControlName: any; parentInput?: any; multipleInputInEditId?: any }\r\n ): boolean {\r\n if (!currentInput) return false;\r\n\r\n if (currentInput.formControlName === inputToDisable.formControlName) {\r\n return true;\r\n }\r\n\r\n if (!currentInput.multipleInputInEditId) {\r\n return !!inputToDisable.parentInput || !!inputToDisable.multipleInputInEditId;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n linkFormulaSource(event: MatSelectChange) {\r\n this.tempValue = {\r\n ...this.tempValue,\r\n formControlWithFormula: event.value,\r\n formula: undefined as any // Reset formula when source changes\r\n };\r\n }\r\n\r\n removeVariable(variableId: string) {\r\n if (!this.tempValue?.variables) return;\r\n\r\n this.tempValue = {\r\n ...this.tempValue,\r\n variables: this.tempValue.variables.filter(v => v.id !== variableId)\r\n };\r\n }\r\n\r\n appendVariableToFormula(variableName: string) {\r\n const currentFormula = this.tempValue?.formula || '';\r\n this.tempValue = {\r\n ...this.tempValue,\r\n formula: `${currentFormula} ${variableName}`\r\n } as CalculatedFieldRules;\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Variable Configuration\r\n\r\n toggleVariableConfig() {\r\n this.showVariableConfig = !this.showVariableConfig;\r\n if (!this.showVariableConfig) {\r\n this.activeVariable = {};\r\n }\r\n }\r\n\r\n bindInput(inputId: string) {\r\n const input = this.formInputs?.find((i) => i.id === inputId);\r\n if (!input) return;\r\n\r\n if (this.activeVariable.formControlName === input.formControlName) {\r\n return;\r\n }\r\n\r\n this.activeVariable = {\r\n ...this.activeVariable,\r\n formControlName: input.formControlName,\r\n label: input.label,\r\n inputId: input.id,\r\n parentInputId: input.multipleInputInEditId\r\n };\r\n }\r\n\r\n attachFunction(event: Event, funcValue: any) {\r\n event.stopPropagation();\r\n\r\n if (this.activeVariable.function === funcValue) {\r\n this.activeVariable.function = undefined;\r\n this.activeVariable.applyFunctionToCol = undefined;\r\n this.activeVariable.applyFunctionToLabel = undefined;\r\n } else {\r\n this.activeVariable.function = funcValue;\r\n this.activeVariable.applyFunctionToCol = this.activeVariable.formControlName;\r\n this.activeVariable.applyFunctionToLabel = this.activeVariable.label;\r\n }\r\n }\r\n\r\n cancelVariableConfig() {\r\n this.activeVariable = {};\r\n this.showVariableConfig = false;\r\n }\r\n\r\n saveNewVariable() {\r\n const currentVariables = this.tempValue?.variables || [];\r\n\r\n const newVar: calculationVariableInterface = {\r\n ...this.activeVariable,\r\n id: uuidv4(),\r\n variable: this.activeVariable.variable || '',\r\n } as calculationVariableInterface;\r\n\r\n if (this.inputIsInItemList(newVar)) {\r\n const input = this.formInputs?.find(\r\n (i) => i.formControlName === newVar.formControlName\r\n );\r\n if (input?.multipleInputInEditId) {\r\n (newVar as any)['parentInputId'] = input.multipleInputInEditId;\r\n }\r\n }\r\n\r\n this.tempValue = {\r\n ...this.tempValue,\r\n variables: [...currentVariables, newVar],\r\n formula: this.tempValue.formula || ''\r\n };\r\n\r\n this.activeVariable = {};\r\n this.showVariableConfig = false;\r\n }\r\n\r\n private inputIsInItemList(v: Partial<calculationVariableInterface>): boolean {\r\n const input = this.formInputs?.find(\r\n (i) => i.formControlName === v.formControlName\r\n );\r\n const hasParent = input ? !!input.multipleInputInEditId : false;\r\n const isInTable = (v as any).tableCell;\r\n return hasParent || isInTable;\r\n }\r\n\r\n // #endregion\r\n\r\n\r\n // #region Mathlive setup\r\n // onInput(event: string) {\r\n // // The event target is the <math-field> element\r\n \r\n \r\n // this.tempValue = {\r\n // ...this.tempValue,\r\n // formula:cleanLatexForMathJS(event)\r\n // }\r\n\r\n // // Update the local state with the new LaTeX value\r\n \r\n // }\r\n // get getFormular(){\r\n // return cleanMathJSForLatex(this.value?.formula||'')\r\n // }\r\n // #endregion\r\n}","<br>\r\n\r\n<!-- View Mode (Summary) -->\r\n@if (!isEditing) {\r\n<div class=\"view-mode-container\"\r\n style=\"display: flex; flex-direction: column; gap: 8px;background:var(--mat-sys-surface-variant)\">\r\n\r\n @if (!!value && !mapToData?.['id'] && !tableMode) {\r\n <div class=\"tree-instructions\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>Save the input first to enable calculated field configurations</span>\r\n </div>\r\n }\r\n\r\n <div\r\n style=\"display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--mat-sys-outline-variant, #ccc); border-radius: 4px; padding: 12px;\">\r\n <div style=\"display: flex; flex-direction: column; width: 100%;\">\r\n <span style=\"font-size: 0.85em; opacity: 0.7;\">Current Formula</span>\r\n <span style=\"font-weight: 500; font-size: 1.1em; width: 100%;\">\r\n <!-- <math-field style=\"width: 100%;\" #mathfield \r\n [readOnly]=\"true\"\r\n [value]=\"getFormular\">\r\n </math-field> -->\r\n\r\n <code>\r\n <pre>\r\n {{ value?.formula || 'No formula configured' }}\r\n </pre>\r\n </code>\r\n\r\n\r\n </span>\r\n @if(value?.decimalPlaces) {\r\n <span style=\"font-size: 0.8em; margin-top: 4px; opacity: 0.7;\">\r\n Decimals: {{value?.decimalPlaces}} | Rounding: {{value?.roundingMode || 'None'}}\r\n </span>\r\n }\r\n </div>\r\n\r\n </div>\r\n</div>\r\n<button style=\"width: 100%;margin-top: 16px;\" mat-stroked-button color=\"primary\" (click)=\"startEdit()\">\r\n <mat-icon>edit</mat-icon>\r\n Edit Rules\r\n</button>\r\n}\r\n\r\n<!-- Edit Mode (Editor Card) -->\r\n@else {\r\n<mat-card appearance=\"outlined\" class=\"editor-card\" style=\"padding: 16px; border-color: var(--mat-sys-primary);\">\r\n <h3 style=\"margin-top: 0; margin-bottom: 16px; color: var(--mat-sys-primary);\">\r\n <mat-icon style=\"vertical-align: middle; margin-right: 8px;\">functions</mat-icon>\r\n Edit Calculation\r\n </h3>\r\n\r\n <section>\r\n <!-- Main Formula Input -->\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\" style=\"width: 100%;\">\r\n <mat-label>Equation</mat-label>\r\n <textarea matInput [(ngModel)]=\"tempValue['formula']\" placeholder=\"Enter calculation expression\"\r\n rows=\"3\"></textarea>\r\n <mat-hint>example: ((a+2)/(b-1))*2</mat-hint>\r\n </mat-form-field>\r\n <!-- <math-field style=\"width: 100%;\" #mathfield \r\n [readOnly]=\"false\"\r\n [value]=\"getFormular\" \r\n [smartMode]=\"true\"\r\n (input)=\"onInput(mathfield.value)\">\r\n </math-field> -->\r\n <!-- Optional Source Link -->\r\n @if (!!tempValue?.getFormulaFromAFormInput) {\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\"\r\n style=\"margin-bottom: 8px; margin-top: 12px; width: 100%;\" appearance=\"outline\">\r\n <mat-label>Equation Source</mat-label>\r\n <mat-select matNativeControl [value]=\"tempValue.formControlWithFormula\"\r\n (selectionChange)=\"linkFormulaSource($event)\" placeholder=\"select Input with formula\">\r\n @for (input of formInputs; track input.id) {\r\n <mat-option [disabled]=\"checkIfInputCanBeLinkedToCalVariable(mapToData, input) || input.element !== 'select'\"\r\n [value]=\"input.formControlName\">\r\n {{input.label}}\r\n </mat-option>\r\n }\r\n </mat-select>\r\n <mat-hint>Link formula to an input value</mat-hint>\r\n </mat-form-field>\r\n }\r\n\r\n <!-- Variable Chips List -->\r\n <div style=\"margin-top: 12px; margin-bottom: 12px;\">\r\n <label style=\"font-size: 0.9em; opacity: 0.8; display: block; margin-bottom: 8px;\">Variables</label>\r\n <mat-chip-listbox aria-label=\"options\">\r\n @for (variable of (tempValue['variables'] || []); track variable.id) {\r\n <mat-chip (click)=\"appendVariableToFormula(variable.variable)\" (removed)=\"removeVariable(variable.id!)\">\r\n <div [style.color]=\"variable.tableCell ? 'var(--ion-color-purple)' : ''\" style=\"font-size: 0.8125em\">\r\n {{ variable.variable }} - {{ variable.label }}\r\n @if (variable.function) {\r\n <span style=\"opacity: 0.6; padding-left: 5px\">{{ variable.function }}</span>\r\n }\r\n </div>\r\n <button matChipRemove>\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip>\r\n }\r\n\r\n <!-- Add/Close Variable Button -->\r\n <mat-chip highlighted=\"true\" [color]=\"showVariableConfig ? 'warn' : 'accent'\" (click)=\"toggleVariableConfig()\">\r\n <span>{{ showVariableConfig ? 'Close Variable Edit' : 'Add a new Variable' }}</span>\r\n <mat-icon matChipTrailingIcon>{{ showVariableConfig ? 'close' : 'add' }}</mat-icon>\r\n </mat-chip>\r\n </mat-chip-listbox>\r\n </div>\r\n\r\n <!-- Variable Configuration Panel -->\r\n @if (showVariableConfig) {\r\n @defer (on immediate) {\r\n <ng-container *ngTemplateOutlet=\"variableConfigurationTpl\"></ng-container>\r\n }\r\n }\r\n\r\n <mat-divider style=\"margin: 16px 0;\"></mat-divider>\r\n\r\n <!-- Rounding Settings -->\r\n <div style=\"display: flex; gap: 16px; flex-wrap: wrap;\">\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\"\r\n style=\"flex: 1; min-width: 150px;\">\r\n <mat-label>Decimal Places</mat-label>\r\n <input matInput [(ngModel)]=\"tempValue['decimalPlaces']\" placeholder=\"0\" type=\"number\" min=\"0\">\r\n </mat-form-field>\r\n\r\n @if (tempValue['decimalPlaces']) {\r\n <div style=\"flex: 2;\">\r\n <label style=\"font-size: 0.85em; opacity: 0.8;\">Rounding Mode</label>\r\n <mat-chip-listbox aria-label=\"Rounding types\" style=\"margin-top: 4px;\">\r\n @for (type of roundingType; track type.value) {\r\n <mat-chip-option (click)=\"tempValue['roundingMode'] = type.value\"\r\n [selected]=\"tempValue['roundingMode'] === type.value\">\r\n {{type.label}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n </div>\r\n }\r\n </div>\r\n </section>\r\n\r\n <!-- Card Actions (Save/Cancel) -->\r\n <div style=\"display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px;\">\r\n <button mat-button (click)=\"cancelEdit()\">Cancel</button>\r\n <button mat-raised-button color=\"primary\" (click)=\"saveEdit()\">Save Changes</button>\r\n </div>\r\n</mat-card>\r\n}\r\n\r\n<!-- Variable Configuration Template -->\r\n<ng-template #variableConfigurationTpl>\r\n <div\r\n style=\"background: var(--mat-sys-surface-variant, #f5f5f5); border-radius: 8px; padding: 12px; margin-top: 8px; border: 1px dashed #ccc;\">\r\n <div class=\"tree-instructions\" style=\"background: azure; margin-bottom: 12px;\">\r\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\r\n <span>\r\n <strong>Configure variable</strong><br>\r\n Link a form input to a variable to use in the equation\r\n </span>\r\n </div>\r\n\r\n <!-- Input Selector -->\r\n <lib-form-input-selector [disabled]=\"!!activeVariable.formControlName\" [formInputs]=\"cachedNumberInputs\"\r\n [value]=\"activeVariable.inputId\" (click)=\"$event.stopPropagation()\" (change)=\"bindInput($event)\">\r\n </lib-form-input-selector>\r\n\r\n @if (activeVariable.formControlName) {\r\n <mat-form-field [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\" appearance=\"outline\"\r\n style=\"width: 100%; margin-top: 12px;\">\r\n <mat-label>Variable Name</mat-label>\r\n <textarea matInput (click)=\"$event.stopPropagation()\" [(ngModel)]=\"activeVariable.variable\"\r\n placeholder=\"enter variable\" rows=\"1\"></textarea>\r\n <mat-hint>A variable is an alphabet or term that represents a form input in the equation.</mat-hint>\r\n </mat-form-field>\r\n\r\n @if (activeVariable.parentInputId) {\r\n <br>\r\n <mat-label><small>list function ( ƒ )</small></mat-label>\r\n <mat-chip-listbox class=\"mat-mdc-chip-set-stacked\" aria-label=\"Calculation function\">\r\n @for (func of allCalculationFunction; track func) {\r\n <mat-chip-option (click)=\"attachFunction($event, func)\" [selected]=\"activeVariable.function === func\">\r\n {{func}}\r\n </mat-chip-option>\r\n }\r\n </mat-chip-listbox>\r\n }\r\n }\r\n\r\n <!-- Actions -->\r\n <mat-toolbar style=\"background: transparent; padding: 0; margin-top: 12px;\" lines=\"none\">\r\n <span class=\"spacer\"></span>\r\n <button mat-button (click)=\"cancelVariableConfig()\">Cancel</button>\r\n <button mat-flat-button color=\"primary\" [disabled]=\"!activeVariable.formControlName || !activeVariable.variable\"\r\n (click)=\"saveNewVariable()\">\r\n Add Variable\r\n </button>\r\n </mat-toolbar>\r\n </div>\r\n</ng-template>\r\n\r\n<!-- Overlay for disabled state -->\r\n<ng-template cdkConnectedOverlay [cdkConnectedOverlayOpen]=\"disabled\">\r\n <div\r\n style=\"position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 10;\">\r\n </div>\r\n</ng-template>"],"names":["uuidv4","i2","i3","i4","i5","i6","i7","i8","i9","i11","i12"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAoCA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA;MAgBa,6BAA6B,CAAA;aAEjC,IAAA,CAAA,MAAM,GAAG,CAAH,CAAK;IA+ClB,WAAA,CAC6B,SAAoB,EACvC,WAAoC,EAAA;QADjB,IAAA,CAAA,SAAS,GAAT,SAAS;QAC5B,IAAA,CAAA,WAAW,GAAX,WAAW;;AA9CN,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,2BAAA,EAA8B,6BAA6B,CAAC,MAAM,EAAE,EAAE;AAC1F,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QAClC,IAAA,CAAA,OAAO,GAAG,KAAK;QACf,IAAA,CAAA,OAAO,GAAG,KAAK;QACf,IAAA,CAAA,WAAW,GAAG,4BAA4B;QAEjC,IAAA,CAAA,WAAW,GAAW,EAAE;QACxB,IAAA,CAAA,QAAQ,GAAY,KAAK;QACzB,IAAA,CAAA,QAAQ,GAAY,KAAK;;;QAKzB,IAAA,CAAA,SAAS,GAAiC,SAAS;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