ngx-t-forms 2.0.24 → 2.0.26

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 (149) hide show
  1. package/README.md +177 -16
  2. package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cs_Lhz_D.mjs +313 -0
  3. package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cs_Lhz_D.mjs.map +1 -0
  4. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-C00n6tFs.mjs → ngx-t-forms-chip-options-creator-editor.component-DkTpG5yQ.mjs} +6 -6
  5. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-C00n6tFs.mjs.map → ngx-t-forms-chip-options-creator-editor.component-DkTpG5yQ.mjs.map} +1 -1
  6. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DtfUKZL-.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DJ9d3Oy9.mjs} +9 -9
  7. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-DtfUKZL-.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DJ9d3Oy9.mjs.map} +1 -1
  8. package/fesm2022/{ngx-t-forms-data-source-picker.component-BBEQuzn2.mjs → ngx-t-forms-data-source-picker.component-CFQ_GVPG.mjs} +11 -11
  9. package/fesm2022/{ngx-t-forms-data-source-picker.component-BBEQuzn2.mjs.map → ngx-t-forms-data-source-picker.component-CFQ_GVPG.mjs.map} +1 -1
  10. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CPF_BLRA.mjs +291 -0
  11. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-CPF_BLRA.mjs.map +1 -0
  12. package/fesm2022/{ngx-t-forms-form-input-selector.component-CniLZN1h.mjs → ngx-t-forms-form-input-selector.component-C38FXT55.mjs} +8 -8
  13. package/fesm2022/{ngx-t-forms-form-input-selector.component-CniLZN1h.mjs.map → ngx-t-forms-form-input-selector.component-C38FXT55.mjs.map} +1 -1
  14. package/fesm2022/{ngx-t-forms-form-json-view.component-bnjkxqgV.mjs → ngx-t-forms-form-json-view.component-C7i6JZ-l.mjs} +6 -6
  15. package/fesm2022/{ngx-t-forms-form-json-view.component-bnjkxqgV.mjs.map → ngx-t-forms-form-json-view.component-C7i6JZ-l.mjs.map} +1 -1
  16. package/fesm2022/ngx-t-forms-form-section-stepper.component-CJz0yr78.mjs +264 -0
  17. package/fesm2022/ngx-t-forms-form-section-stepper.component-CJz0yr78.mjs.map +1 -0
  18. package/fesm2022/ngx-t-forms-forms-builder-menu.component-G3Agd-vE.mjs +349 -0
  19. package/fesm2022/ngx-t-forms-forms-builder-menu.component-G3Agd-vE.mjs.map +1 -0
  20. package/fesm2022/{ngx-t-forms-input-editor.component-BBP90B_e.mjs → ngx-t-forms-input-editor.component-B12zbXE1.mjs} +19 -19
  21. package/fesm2022/{ngx-t-forms-input-editor.component-BBP90B_e.mjs.map → ngx-t-forms-input-editor.component-B12zbXE1.mjs.map} +1 -1
  22. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-dIY3BX1u.mjs +106 -0
  23. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-dIY3BX1u.mjs.map +1 -0
  24. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-CIiYyxkb.mjs → ngx-t-forms-mat-slider-editor.component-yMRCg8fo.mjs} +5 -5
  25. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-CIiYyxkb.mjs.map → ngx-t-forms-mat-slider-editor.component-yMRCg8fo.mjs.map} +1 -1
  26. package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-DDR2JurF.mjs → ngx-t-forms-mat-slider-toggle-editor.component-0aUVP9A6.mjs} +7 -7
  27. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-0aUVP9A6.mjs.map +1 -0
  28. package/fesm2022/{ngx-t-forms-missing-form-configs.component-CYN9mVz9.mjs → ngx-t-forms-missing-form-configs.component-CsPMQZqg.mjs} +9 -9
  29. package/fesm2022/{ngx-t-forms-missing-form-configs.component-CYN9mVz9.mjs.map → ngx-t-forms-missing-form-configs.component-CsPMQZqg.mjs.map} +1 -1
  30. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D8a9-6lt.mjs +43 -0
  31. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-D8a9-6lt.mjs.map +1 -0
  32. package/fesm2022/ngx-t-forms-mscoa-error-display.component-DwbyXd_D.mjs +116 -0
  33. package/fesm2022/ngx-t-forms-mscoa-error-display.component-DwbyXd_D.mjs.map +1 -0
  34. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BXPghOuH.mjs +299 -0
  35. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-BXPghOuH.mjs.map +1 -0
  36. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-CBRfWvfD.mjs +83 -0
  37. package/fesm2022/ngx-t-forms-mscoa-temporary-hint.component-CBRfWvfD.mjs.map +1 -0
  38. package/fesm2022/{ngx-t-forms-ngx-t-forms-DwsbmVlY.mjs → ngx-t-forms-ngx-t-forms-CD9InaXz.mjs} +3364 -931
  39. package/fesm2022/ngx-t-forms-ngx-t-forms-CD9InaXz.mjs.map +1 -0
  40. package/fesm2022/ngx-t-forms-pipeline-generator.component-QE-I58e4.mjs +637 -0
  41. package/fesm2022/ngx-t-forms-pipeline-generator.component-QE-I58e4.mjs.map +1 -0
  42. package/fesm2022/ngx-t-forms-record-list-manager.component-D4wlLtdc.mjs +270 -0
  43. package/fesm2022/ngx-t-forms-record-list-manager.component-D4wlLtdc.mjs.map +1 -0
  44. package/fesm2022/ngx-t-forms-required-inputs.component-BoqmVDp2.mjs +192 -0
  45. package/fesm2022/ngx-t-forms-required-inputs.component-BoqmVDp2.mjs.map +1 -0
  46. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-BcItch1n.mjs → ngx-t-forms-rest-api-call-setup.component-CtfudSGT.mjs} +15 -15
  47. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-BcItch1n.mjs.map → ngx-t-forms-rest-api-call-setup.component-CtfudSGT.mjs.map} +1 -1
  48. package/fesm2022/{ngx-t-forms-section-report.component-Cn_oWXBX.mjs → ngx-t-forms-section-report.component-Dntm1m5b.mjs} +10 -10
  49. package/fesm2022/{ngx-t-forms-section-report.component-Cn_oWXBX.mjs.map → ngx-t-forms-section-report.component-Dntm1m5b.mjs.map} +1 -1
  50. package/fesm2022/{ngx-t-forms-selection-options-editor.component-Cc41XG4s.mjs → ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs} +11 -11
  51. package/fesm2022/{ngx-t-forms-selection-options-editor.component-Cc41XG4s.mjs.map → ngx-t-forms-selection-options-editor.component-Cc_qCtW2.mjs.map} +1 -1
  52. package/fesm2022/ngx-t-forms-t-workflow-picker.component-xvX8t0pu.mjs +187 -0
  53. package/fesm2022/ngx-t-forms-t-workflow-picker.component-xvX8t0pu.mjs.map +1 -0
  54. package/fesm2022/{ngx-t-forms-validators-config.component-4Iy5uJj3.mjs → ngx-t-forms-validators-config.component-D6JG1p81.mjs} +13 -13
  55. package/fesm2022/{ngx-t-forms-validators-config.component-4Iy5uJj3.mjs.map → ngx-t-forms-validators-config.component-D6JG1p81.mjs.map} +1 -1
  56. package/fesm2022/ngx-t-forms.mjs +1 -1
  57. package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +4 -1
  58. package/lib/components/form-builder/elements/form-submissions-config/form-submissions-config.component.d.ts +1 -1
  59. package/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.d.ts +6 -2
  60. package/lib/components/forms/forms.component.d.ts +8 -0
  61. package/lib/components/forms/store/Form-actions-formBuilder.d.ts +1 -0
  62. package/lib/components/forms/store/Form-selectors-FormBuilder.d.ts +3 -1
  63. package/lib/components/forms/store/Forms-Effects.d.ts +7 -1
  64. package/lib/components/forms/store/forms-store.service.d.ts +19 -53
  65. package/lib/components/index.d.ts +2 -1
  66. package/lib/components/t-dynamic-data-edit/elements/api-value-access-rules/api-value-access-rules.component.d.ts +40 -20
  67. package/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/calculated-field-rules.component.d.ts +51 -63
  68. package/lib/components/t-dynamic-data-edit/elements/document-list-label-config-editor/document-list-label-config-editor.component.d.ts +8 -1
  69. package/lib/components/t-dynamic-data-edit/elements/json-editor/json-editor.component.d.ts +37 -9
  70. package/lib/components/t-dynamic-data-edit/elements/mat-chip-list-editor/mat-chip-list-editor.component.d.ts +2 -1
  71. package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +4 -1
  72. package/lib/components/t-dynamic-data-edit/elements/pipeline-generator/pipeline-generator.component.d.ts +2 -0
  73. package/lib/components/t-dynamic-data-edit/elements/record-list-manager/record-list-manager.component.d.ts +75 -0
  74. package/lib/components/t-dynamic-data-edit/elements/required-inputs/required-inputs.component.d.ts +1 -0
  75. package/lib/components/t-dynamic-data-edit/elements/t-workflow-picker/t-workflow-picker.component.d.ts +7 -3
  76. package/lib/components/t-dynamic-data-edit/t-dynamic-data-edit.component.d.ts +1 -0
  77. package/lib/components/t-form-input/elements/Geo-location-form-input/geo-location.component.d.ts +1 -1
  78. package/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.d.ts +1 -1
  79. package/lib/components/t-form-input/elements/basic-input-input-element/basic-input-input-element.component.d.ts +2 -1
  80. package/lib/components/t-form-input/elements/basic-input-input-element/core/input-custom/input-custom.component.d.ts +2 -1
  81. package/lib/components/t-form-input/elements/date-picker-input-element/date-picker-input-element.component.d.ts +1 -1
  82. package/lib/components/t-form-input/elements/date-range-picker-input-element/date-range-picker-input-element.component.d.ts +1 -1
  83. package/lib/components/t-form-input/elements/document-picker/document-picker.component.d.ts +1 -1
  84. package/lib/components/t-form-input/elements/editor-input-element/editor-input-element.component.d.ts +1 -1
  85. package/lib/components/t-form-input/elements/file-upload-input-element/file-upload-input-element.component.d.ts +1 -1
  86. package/lib/components/t-form-input/elements/image-capture-input-element/image-capture-input-element.component.d.ts +1 -1
  87. package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +8 -0
  88. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-chart-input-menu/mscoa-chart-input-menu.component.d.ts +23 -0
  89. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-chart-toolbar/mscoa-chart-toolbar.component.d.ts +22 -0
  90. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-error-display/mscoa-error-display.component.d.ts +34 -0
  91. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/components/mscoa-temporary-hint/mscoa-temporary-hint.component.d.ts +21 -0
  92. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/extractCols.d.ts +22 -0
  93. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +299 -86
  94. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-chart.constants.d.ts +47 -0
  95. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-chart.helpers.d.ts +87 -0
  96. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-chart.types.d.ts +51 -0
  97. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/utils/mscoa-message-formatter.d.ts +87 -0
  98. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-computation/mscoa-computation.component.d.ts +149 -22
  99. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-reactive-form-field/mscoa-reactive-form-field.component.d.ts +11 -0
  100. package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +4 -0
  101. package/lib/components/t-form-input/elements/mscoa-form-input/mscoa-form-input.component.d.ts +1 -1
  102. package/lib/components/t-form-input/elements/mscoa-form-input/store/accountConstants.d.ts +7 -2
  103. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-actions.d.ts +13 -2
  104. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-component-store.service.d.ts +45 -8
  105. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-effects.d.ts +1 -0
  106. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-selectors.d.ts +33 -8
  107. package/lib/components/t-form-input/elements/multiple-input-input-element/multiple-input-input-element.component.d.ts +1 -1
  108. package/lib/components/t-form-input/elements/select-input-element/select-input-element.component.d.ts +1 -1
  109. package/lib/components/t-form-input/elements/signature-input-element/core/signature-pad-input/functions/getSignatureImage.d.ts +3 -0
  110. package/lib/components/t-form-input/elements/signature-input-element/signature-input-element.component.d.ts +1 -1
  111. package/lib/components/t-form-input/elements/textarea-input-element/core/text-area-reactive-input/text-area-reactive-input.component.d.ts +1 -2
  112. package/lib/components/t-form-input/elements/textarea-input-element/textarea-input-element.component.d.ts +1 -1
  113. package/lib/components/t-form-input/elements/toggle-input-element/toggle-input-element.component.d.ts +1 -1
  114. package/lib/components/t-form-input/elements/workflow-adjudication/workflow-adjudication.component.d.ts +1 -1
  115. package/lib/services/core/t-form-builder/functions/deleteSection.d.ts +1 -0
  116. package/lib/services/core/t-form-builder/functions/inputElementEditorConfigs.d.ts +9 -3
  117. package/lib/services/core/t-form-builder/functions/removeItem.d.ts +1 -0
  118. package/lib/services/core/t-form-builder/functions/stepTitleChangeStep.d.ts +1 -0
  119. package/lib/services/core/t-form-controller/function/calculateInputValue.d.ts +1 -1
  120. package/lib/services/core/t-form-controller/function/getInputSourcedValue.d.ts +4 -0
  121. package/lib/services/core/t-form-tower-controller/functions/runMultipleInputPrepopulationFunctions.d.ts +11 -0
  122. package/lib/services/core/t-form-tower-controller/functions/updateFormInputConfig.d.ts +7 -0
  123. package/lib/services/core/t-input-controller/functions/baseCustomInput.d.ts +4 -2
  124. package/lib/services/core/t-input-controller/functions/inputErrorMessage.d.ts +1 -1
  125. package/lib/shared/functions/convertElementEditorTypesToInputType.d.ts +3 -0
  126. package/lib/shared/functions/fuzzyTextSearch.d.ts +4 -0
  127. package/lib/shared/functions/getPipedValueFromDataType.d.ts +2 -0
  128. package/lib/shared/index.d.ts +2 -1
  129. package/package.json +2 -2
  130. package/fesm2022/ngx-t-forms-calculated-field-rules.component-BUKzXsXn.mjs +0 -316
  131. package/fesm2022/ngx-t-forms-calculated-field-rules.component-BUKzXsXn.mjs.map +0 -1
  132. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-D6kwe89h.mjs +0 -238
  133. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-D6kwe89h.mjs.map +0 -1
  134. package/fesm2022/ngx-t-forms-form-section-stepper.component-DFbYNeAi.mjs +0 -261
  135. package/fesm2022/ngx-t-forms-form-section-stepper.component-DFbYNeAi.mjs.map +0 -1
  136. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DBEgmcSi.mjs +0 -348
  137. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DBEgmcSi.mjs.map +0 -1
  138. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CQ76110I.mjs +0 -103
  139. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-CQ76110I.mjs.map +0 -1
  140. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DDR2JurF.mjs.map +0 -1
  141. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C9zKzzzX.mjs +0 -281
  142. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C9zKzzzX.mjs.map +0 -1
  143. package/fesm2022/ngx-t-forms-ngx-t-forms-DwsbmVlY.mjs.map +0 -1
  144. package/fesm2022/ngx-t-forms-pipeline-generator.component-CGKxfvvC.mjs +0 -727
  145. package/fesm2022/ngx-t-forms-pipeline-generator.component-CGKxfvvC.mjs.map +0 -1
  146. package/fesm2022/ngx-t-forms-required-inputs.component-Bktx1QGr.mjs +0 -188
  147. package/fesm2022/ngx-t-forms-required-inputs.component-Bktx1QGr.mjs.map +0 -1
  148. package/fesm2022/ngx-t-forms-t-workflow-picker.component-CezFgp2z.mjs +0 -171
  149. package/fesm2022/ngx-t-forms-t-workflow-picker.component-CezFgp2z.mjs.map +0 -1
package/README.md CHANGED
@@ -1,27 +1,188 @@
1
- # NgxTForms
2
- atar
3
- This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.2.0.
1
+ # ngx-t-forms
4
2
 
5
- ## Code scaffolding
3
+ Enterprise-ready Angular form builder and runtime. Build dynamic, multi-step forms from JSON schemas with calculated fields, API-driven options, file uploads, signatures, and rich text editing.
6
4
 
7
- ng generate s tets --project ngx-t-forms
5
+ ## Why ngx-t-forms
8
6
 
9
- Run `ng generate component component-name --project ngx-t-forms` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-t-forms`.
10
- > Note: Don't forget to add `--project ngx-t-forms` or else it will be added to the default project in your `angular.json` file.
7
+ - JSON-driven form schema with sections, columns, and rich inputs
8
+ - Standalone Angular components for fast integration
9
+ - Built-in form builder UI and form listing UI
10
+ - Calculated fields, dependent logic, and custom validation rules
11
+ - API and Mongo pipeline-driven options/value fetching
12
+ - Specialized inputs: signature pad, QR code, geo-location, file upload, rich text editor
11
13
 
12
- ## Build
14
+ ## Requirements
13
15
 
14
- Run `ng build ngx-t-forms` to build the project. The build artifacts will be stored in the `dist/` directory.
15
- `ng build ngx-t-forms --configuration production`
16
+ - Angular `^19.2.6`
17
+ - RxJS `~7.8`
18
+ - Angular CDK + Material (theme required)
19
+ - `ngx-t-forms-types` (type definitions for schemas)
16
20
 
17
- ## Publishing
21
+ Many specialized inputs are enabled by peer dependencies (EditorJS tools, `signature_pad`, `html5-qrcode`, `qrcode`, `mathjs`, `joi`). Install them if you use those inputs.
18
22
 
19
- After building your library with `ng build ngx-t-forms`, go to the dist folder `cd dist/ngx-t-forms` and run `npm publish`.
23
+ ## Installation
20
24
 
21
- ## Running unit tests
25
+ ```bash
26
+ npm i ngx-t-forms ngx-t-forms-types
27
+ ```
22
28
 
23
- Run `ng test ngx-t-forms` to execute the unit tests via [Karma](https://karma-runner.github.io).
29
+ Install peer dependencies used by your inputs:
24
30
 
25
- ## Further help
31
+ ```bash
32
+ npm i @angular/material @angular/cdk @angular/animations
33
+ npm i @editorjs/editorjs @editorjs/header @editorjs/list @editorjs/paragraph @editorjs/table @editorjs/quote @editorjs/marker @editorjs/image @editorjs/embed @editorjs/code @editorjs/raw @editorjs/delimiter @editorjs/text-variant-tune
34
+ npm i signature_pad html5-qrcode qrcode mathjs joi ngx-ui-tour-md-menu db-aggregation-pipeline-builder uuid
35
+ ```
26
36
 
27
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
37
+ Add an Angular Material theme (required for all UI components):
38
+
39
+ ```json
40
+ // styles (angular.json)
41
+ "styles": [
42
+ "node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
43
+ "src/styles.scss"
44
+ ]
45
+ ```
46
+
47
+ ## Quick start
48
+
49
+ ### 1) Provide library configuration
50
+
51
+ `ngx-t-forms` uses a single environment config to wire UI actions and data access.
52
+
53
+ ```ts
54
+ // app.config.ts
55
+ import { ApplicationConfig } from '@angular/core';
56
+ import { provideHttpClient } from '@angular/common/http';
57
+ import { provideNgxTForms } from 'ngx-t-forms';
58
+ import { NgxTFormsConfig } from 'ngx-t-forms-types';
59
+ import { of } from 'rxjs';
60
+
61
+ const ngxTFormsConfig: NgxTFormsConfig = {
62
+ formBuilder: {
63
+ addNewForm: () => {},
64
+ editForm: (formId: string) => {},
65
+ getForm: (formId: string) => of(null),
66
+ saveFormData: (formId: string | undefined, data: Record<string, any>) => {},
67
+ formSubmittedSuccessfully: (formId?: string) => {},
68
+ toastSuccess: (message: string) => {},
69
+ toastError: (message: string) => {},
70
+ httpGetDataFunction: (url: string, options?: any) => of(null),
71
+ httpPostDataFunction: (url: string, data: any, options?: any) => of(null),
72
+ runMongoDbPipeLine: (payload: any) => of([]),
73
+ fileUpload: (file: string, fileName: string, fileType: string) => of({ url: '' }),
74
+ getUserSignature: () => of(null),
75
+ saveUserSignature: (data: any) => of(null),
76
+ getScoaTree: () => of(null),
77
+ getSCOAAccount: (account: string) => of(null),
78
+ getWorkflowCols: (workflowId: string) => of([]),
79
+ getSelectedDocument: (docId: string) => of(null)
80
+ }
81
+ };
82
+
83
+ export const appConfig: ApplicationConfig = {
84
+ providers: [
85
+ provideHttpClient(),
86
+ provideNgxTForms(ngxTFormsConfig)
87
+ ]
88
+ };
89
+ ```
90
+
91
+ ### 2) Render a complete form
92
+
93
+ `UserFormStepperComponent` renders a full, multi-step form from a stored schema.
94
+
95
+ ```ts
96
+ import { Component } from '@angular/core';
97
+ import { UserFormStepperComponent } from 'ngx-t-forms';
98
+
99
+ @Component({
100
+ selector: 'app-form-runner',
101
+ standalone: true,
102
+ imports: [UserFormStepperComponent],
103
+ template: `
104
+ <lib-user-form-stepper
105
+ [formId]="formId"
106
+ [initialValues]="initialValues"
107
+ [passParamsOnSubmit]="submitContext">
108
+ </lib-user-form-stepper>
109
+ `
110
+ })
111
+ export class FormRunnerComponent {
112
+ formId = 'your-form-id';
113
+ initialValues = {};
114
+ submitContext = { submittedBy: 'user-id' };
115
+ }
116
+ ```
117
+
118
+ ## Core components
119
+
120
+ - `FormBuilderComponent`: UI to build and edit forms
121
+ - `FormsComponent`: list and manage saved forms
122
+ - `UserFormStepperComponent`: runtime stepper UI to complete a form
123
+ - `TFormInputComponent`: render a single input definition
124
+ - `TDynamicDataEditComponent` / `TDynamicDataViewComponent`: schema editors and read-only views
125
+
126
+ All components are standalone; import them directly in your `imports` array.
127
+
128
+ ## Form schema (overview)
129
+
130
+ Form schemas are typed in `ngx-t-forms-types`. The core pattern is:
131
+
132
+ ```ts
133
+ import { ElementTypes, InputDataTypes, InputTypes } from 'ngx-t-forms-types';
134
+
135
+ const form = {
136
+ slides: [
137
+ {
138
+ sectionId: 'section-1',
139
+ label: 'Customer Details',
140
+ columns: [
141
+ {
142
+ element: ElementTypes.Input,
143
+ dataType: InputDataTypes.String,
144
+ type: InputTypes.Text,
145
+ label: 'Full name',
146
+ formControlName: 'fullName',
147
+ id: 'fullName',
148
+ colSize: 6,
149
+ required: true
150
+ }
151
+ ]
152
+ }
153
+ ]
154
+ };
155
+ ```
156
+
157
+ ### Calculated fields
158
+
159
+ Use `calculatedFieldRules` to compute values based on other inputs:
160
+
161
+ ```ts
162
+ {
163
+ element: ElementTypes.Input,
164
+ isCalculatedField: true,
165
+ formControlName: 'total',
166
+ calculatedFieldRules: {
167
+ variables: [
168
+ { variable: 'a', inputId: 'price', formControlName: 'price' },
169
+ { variable: 'b', inputId: 'qty', formControlName: 'qty' }
170
+ ],
171
+ formula: 'a * b'
172
+ }
173
+ }
174
+ ```
175
+
176
+ ## Scripts (library development)
177
+
178
+ - Build: `ng build ngx-t-forms --configuration production`
179
+ - Test: `ng test ngx-t-forms`
180
+ - Publish: `ng build ngx-t-forms` then `npm publish` from `dist/ngx-t-forms`
181
+
182
+ ## Repository
183
+
184
+ - Repo: `https://github.com/petoriT/01ANGULAR-WORKSPACE`
185
+
186
+ ## License
187
+
188
+ Private — all rights reserved. Permission to use, copy, or redistribute must be obtained from the founder and creator, Mashego Terrence.
@@ -0,0 +1,313 @@
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-CD9InaXz.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-C38FXT55.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$1 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 i5 from '@angular/material/chips';
19
+ import * as i4 from '@angular/material/divider';
20
+ import * as i2$3 from '@angular/material/icon';
21
+ import * as i2$4 from '@angular/material/select';
22
+ import * as i10 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: "19.2.17", 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: "19.2.17", 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[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i5.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: i5.MatChipListbox, selector: "mat-chip-listbox", inputs: ["multiple", "aria-orientation", "selectable", "compareWith", "required", "hideSingleSelectionIndicator", "value"], outputs: ["change"] }, { kind: "component", type: i5.MatChipOption, selector: "mat-basic-chip-option, [mat-basic-chip-option], mat-chip-option, [mat-chip-option]", inputs: ["selectable", "selected"], outputs: ["selectionChange"] }, { kind: "directive", type: i5.MatChipRemove, selector: "[matChipRemove]" }, { kind: "directive", type: i5.MatChipTrailingIcon, selector: "mat-chip-trailing-icon, [matChipTrailingIcon]" }, { kind: "component", type: i4.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "component", type: i2$3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i2$4.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2$4.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2$4.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "component", type: i2$4.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: i10.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i10$1.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"], 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: "19.2.17", 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-Cs_Lhz_D.mjs.map