ngx-t-forms 3.1.7 → 3.1.9

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 (145) hide show
  1. package/fesm2022/{ngx-t-forms-api-endpoint-config.component-CCwUtGOH.mjs → ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs} +10 -10
  2. package/fesm2022/ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs.map +1 -0
  3. package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-BUCFidjW.mjs → ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs} +9 -9
  4. package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-BUCFidjW.mjs.map → ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs.map} +1 -1
  5. package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs +189 -0
  6. package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs.map +1 -0
  7. package/fesm2022/{ngx-t-forms-basic-input-input-element.component-C92Y7CW_.mjs → ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs} +16 -8
  8. package/fesm2022/ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs.map +1 -0
  9. package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs +603 -0
  10. package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs.map +1 -0
  11. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CWJMjBoK.mjs → ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs} +2 -2
  12. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CWJMjBoK.mjs.map → ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs.map} +1 -1
  13. package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs +99 -0
  14. package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs.map +1 -0
  15. package/fesm2022/{ngx-t-forms-conditional-display-config.component-zauBVptA.mjs → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs} +2 -2
  16. package/fesm2022/{ngx-t-forms-conditional-display-config.component-zauBVptA.mjs.map → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs.map} +1 -1
  17. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-C096Ib2V.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DKb3E9gA.mjs} +4 -4
  18. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-C096Ib2V.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-DKb3E9gA.mjs.map} +1 -1
  19. package/fesm2022/{ngx-t-forms-data-source-picker.component-WkSQqjd-.mjs → ngx-t-forms-data-source-picker.component-BG_sr5VH.mjs} +8 -8
  20. package/fesm2022/{ngx-t-forms-data-source-picker.component-WkSQqjd-.mjs.map → ngx-t-forms-data-source-picker.component-BG_sr5VH.mjs.map} +1 -1
  21. package/fesm2022/{ngx-t-forms-date-picker-input-element.component-Dtzq25sw.mjs → ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs} +10 -10
  22. package/fesm2022/ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs.map +1 -0
  23. package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-W8KV-zoC.mjs → ngx-t-forms-date-range-picker-input-element.component-YVE_s-7Y.mjs} +7 -7
  24. package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-YVE_s-7Y.mjs.map +1 -0
  25. package/fesm2022/{ngx-t-forms-date-time-picker-input-element.component-CQXZDwAo.mjs → ngx-t-forms-date-time-picker-input-element.component-BlOS8NdF.mjs} +11 -10
  26. package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-BlOS8NdF.mjs.map +1 -0
  27. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs +623 -0
  28. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs.map +1 -0
  29. package/fesm2022/{ngx-t-forms-document-picker.component-CvATcveO.mjs → ngx-t-forms-document-picker.component-DOYyRgh4.mjs} +44 -262
  30. package/fesm2022/ngx-t-forms-document-picker.component-DOYyRgh4.mjs.map +1 -0
  31. package/fesm2022/{ngx-t-forms-editor-input-element.component-BqofP5-4.mjs → ngx-t-forms-editor-input-element.component-BvZPNjQX.mjs} +6 -6
  32. package/fesm2022/{ngx-t-forms-editor-input-element.component-BqofP5-4.mjs.map → ngx-t-forms-editor-input-element.component-BvZPNjQX.mjs.map} +1 -1
  33. package/fesm2022/{ngx-t-forms-file-upload-input-element.component-BAQx2BLX.mjs → ngx-t-forms-file-upload-input-element.component-CONELqoi.mjs} +10 -10
  34. package/fesm2022/{ngx-t-forms-file-upload-input-element.component-BAQx2BLX.mjs.map → ngx-t-forms-file-upload-input-element.component-CONELqoi.mjs.map} +1 -1
  35. package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs +248 -0
  36. package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs.map +1 -0
  37. package/fesm2022/{ngx-t-forms-form-input-selector.component-M6O7-j2Q.mjs → ngx-t-forms-form-input-selector.component-Bdkuzw0R.mjs} +2 -2
  38. package/fesm2022/{ngx-t-forms-form-input-selector.component-M6O7-j2Q.mjs.map → ngx-t-forms-form-input-selector.component-Bdkuzw0R.mjs.map} +1 -1
  39. package/fesm2022/{ngx-t-forms-form-json-view.component-Dd-EMosV.mjs → ngx-t-forms-form-json-view.component-CDcbgWgN.mjs} +2 -2
  40. package/fesm2022/{ngx-t-forms-form-json-view.component-Dd-EMosV.mjs.map → ngx-t-forms-form-json-view.component-CDcbgWgN.mjs.map} +1 -1
  41. package/fesm2022/{ngx-t-forms-form-section-stepper.component-B1dYMlCC.mjs → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs} +7 -7
  42. package/fesm2022/{ngx-t-forms-form-section-stepper.component-B1dYMlCC.mjs.map → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs.map} +1 -1
  43. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-S2qfSAT-.mjs → ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs} +185 -15
  44. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs.map +1 -0
  45. package/fesm2022/ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs +187 -0
  46. package/fesm2022/ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs.map +1 -0
  47. package/fesm2022/{ngx-t-forms-geo-location.component-whY7YIMk.mjs → ngx-t-forms-geo-location.component-DA3ATrvw.mjs} +8 -8
  48. package/fesm2022/{ngx-t-forms-geo-location.component-whY7YIMk.mjs.map → ngx-t-forms-geo-location.component-DA3ATrvw.mjs.map} +1 -1
  49. package/fesm2022/{ngx-t-forms-header-template-editor.component-BLn_-jPM.mjs → ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs} +13 -5
  50. package/fesm2022/ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs.map +1 -0
  51. package/fesm2022/{ngx-t-forms-image-capture-input-element.component-D05NKiWm.mjs → ngx-t-forms-image-capture-input-element.component-C9oz_ZjA.mjs} +8 -8
  52. package/fesm2022/{ngx-t-forms-image-capture-input-element.component-D05NKiWm.mjs.map → ngx-t-forms-image-capture-input-element.component-C9oz_ZjA.mjs.map} +1 -1
  53. package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs +2 -0
  54. package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs.map +1 -0
  55. package/fesm2022/{ngx-t-forms-input-custom.component-CGz6j56m.mjs → ngx-t-forms-input-custom.component-CqIr5wpy.mjs} +148 -27
  56. package/fesm2022/ngx-t-forms-input-custom.component-CqIr5wpy.mjs.map +1 -0
  57. package/fesm2022/{ngx-t-forms-input-editor.component-DxrkUbed.mjs → ngx-t-forms-input-editor.component-DU2sgo4i.mjs} +9 -9
  58. package/fesm2022/{ngx-t-forms-input-editor.component-DxrkUbed.mjs.map → ngx-t-forms-input-editor.component-DU2sgo4i.mjs.map} +1 -1
  59. package/fesm2022/{ngx-t-forms-map-mat-options-keys-Cu_L5CRA.mjs → ngx-t-forms-map-mat-options-keys-WfFq_0tS.mjs} +2 -2
  60. package/fesm2022/{ngx-t-forms-map-mat-options-keys-Cu_L5CRA.mjs.map → ngx-t-forms-map-mat-options-keys-WfFq_0tS.mjs.map} +1 -1
  61. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-B98Hv4M1.mjs → ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs} +2 -2
  62. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-B98Hv4M1.mjs.map → ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs.map} +1 -1
  63. package/fesm2022/{ngx-t-forms-missing-form-configs.component-CSnHK6ZR.mjs → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs} +4 -4
  64. package/fesm2022/{ngx-t-forms-missing-form-configs.component-CSnHK6ZR.mjs.map → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs.map} +1 -1
  65. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs +37 -0
  66. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs.map +1 -0
  67. package/fesm2022/{ngx-t-forms-mscoa-config.component-CBqzX9H7.mjs → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs} +10 -10
  68. package/fesm2022/{ngx-t-forms-mscoa-config.component-CBqzX9H7.mjs.map → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs.map} +1 -1
  69. package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs} +4 -4
  70. package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs.map → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs.map} +1 -1
  71. package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-Cr1HXTjG.mjs → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs} +9 -9
  72. package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-Cr1HXTjG.mjs.map → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs.map} +1 -1
  73. package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs → ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs} +3 -3
  74. package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs.map → ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs.map} +1 -1
  75. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs +3592 -0
  76. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs.map +1 -0
  77. package/fesm2022/{ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs → ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs} +17432 -6875
  78. package/fesm2022/ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs.map +1 -0
  79. package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs +596 -0
  80. package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs.map +1 -0
  81. package/fesm2022/{ngx-t-forms-payload-template-editor.component-Dx0pI0A1.mjs → ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs} +13 -5
  82. package/fesm2022/ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs.map +1 -0
  83. package/fesm2022/{ngx-t-forms-pipeline-generator.component-VySkMHQI.mjs → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs} +15 -15
  84. package/fesm2022/{ngx-t-forms-pipeline-generator.component-VySkMHQI.mjs.map → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs.map} +1 -1
  85. package/fesm2022/{ngx-t-forms-quill-input.component-BLaPFcJE.mjs → ngx-t-forms-quill-input.component-x9CHGOJy.mjs} +2 -2
  86. package/fesm2022/{ngx-t-forms-quill-input.component-BLaPFcJE.mjs.map → ngx-t-forms-quill-input.component-x9CHGOJy.mjs.map} +1 -1
  87. package/fesm2022/{ngx-t-forms-record-list-manager.component-qlizX9F4.mjs → ngx-t-forms-record-list-manager.component-BGg86NER.mjs} +7 -7
  88. package/fesm2022/{ngx-t-forms-record-list-manager.component-qlizX9F4.mjs.map → ngx-t-forms-record-list-manager.component-BGg86NER.mjs.map} +1 -1
  89. package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs +281 -0
  90. package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs.map +1 -0
  91. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CLYe2Lf_.mjs → ngx-t-forms-rest-api-call-setup.component-B4LzPwxg.mjs} +5 -5
  92. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CLYe2Lf_.mjs.map → ngx-t-forms-rest-api-call-setup.component-B4LzPwxg.mjs.map} +1 -1
  93. package/fesm2022/{ngx-t-forms-section-report.component-foLHlD-I.mjs → ngx-t-forms-section-report.component-BS2CV_xl.mjs} +4 -4
  94. package/fesm2022/{ngx-t-forms-section-report.component-foLHlD-I.mjs.map → ngx-t-forms-section-report.component-BS2CV_xl.mjs.map} +1 -1
  95. package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs +281 -0
  96. package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs.map +1 -0
  97. package/fesm2022/{ngx-t-forms-selection-options-editor.component-D4luMX5c.mjs → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs} +6 -6
  98. package/fesm2022/{ngx-t-forms-selection-options-editor.component-D4luMX5c.mjs.map → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs.map} +1 -1
  99. package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs} +3 -3
  100. package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs.map → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs.map} +1 -1
  101. package/fesm2022/ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs +161 -0
  102. package/fesm2022/ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs.map +1 -0
  103. package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs +124 -0
  104. package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs.map +1 -0
  105. package/fesm2022/{ngx-t-forms-token-text-input.component-BAjGepTM.mjs → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs} +4 -4
  106. package/fesm2022/{ngx-t-forms-token-text-input.component-BAjGepTM.mjs.map → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs.map} +1 -1
  107. package/fesm2022/{ngx-t-forms-validators-config.component-DVB88bgW.mjs → ngx-t-forms-validators-config.component-DEm9M5s9.mjs} +5 -5
  108. package/fesm2022/{ngx-t-forms-validators-config.component-DVB88bgW.mjs.map → ngx-t-forms-validators-config.component-DEm9M5s9.mjs.map} +1 -1
  109. package/fesm2022/{ngx-t-forms-workflow-adjudication.component-LoF_fpHu.mjs → ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs} +96 -35
  110. package/fesm2022/ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs.map +1 -0
  111. package/fesm2022/ngx-t-forms.mjs +1 -1
  112. package/package.json +2 -2
  113. package/types/ngx-t-forms.d.ts +2864 -168
  114. package/fesm2022/ngx-t-forms-api-endpoint-config.component-CCwUtGOH.mjs.map +0 -1
  115. package/fesm2022/ngx-t-forms-basic-input-input-element.component-C92Y7CW_.mjs.map +0 -1
  116. package/fesm2022/ngx-t-forms-calculated-field-rules.component-33ZARq4R.mjs +0 -603
  117. package/fesm2022/ngx-t-forms-calculated-field-rules.component-33ZARq4R.mjs.map +0 -1
  118. package/fesm2022/ngx-t-forms-date-picker-input-element.component-Dtzq25sw.mjs.map +0 -1
  119. package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-W8KV-zoC.mjs.map +0 -1
  120. package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-CQXZDwAo.mjs.map +0 -1
  121. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-3LcpNBQI.mjs +0 -373
  122. package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-3LcpNBQI.mjs.map +0 -1
  123. package/fesm2022/ngx-t-forms-document-picker.component-CvATcveO.mjs.map +0 -1
  124. package/fesm2022/ngx-t-forms-forms-builder-menu.component-S2qfSAT-.mjs.map +0 -1
  125. package/fesm2022/ngx-t-forms-header-template-editor.component-BLn_-jPM.mjs.map +0 -1
  126. package/fesm2022/ngx-t-forms-index-BnK4nGDh.mjs +0 -2
  127. package/fesm2022/ngx-t-forms-index-BnK4nGDh.mjs.map +0 -1
  128. package/fesm2022/ngx-t-forms-input-custom.component-CGz6j56m.mjs.map +0 -1
  129. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-BUj7wGyx.mjs +0 -38
  130. package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-BUj7wGyx.mjs.map +0 -1
  131. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CfZLcuuu.mjs +0 -2336
  132. package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CfZLcuuu.mjs.map +0 -1
  133. package/fesm2022/ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs.map +0 -1
  134. package/fesm2022/ngx-t-forms-paginated-selection-table-lMTD1N6B.mjs +0 -555
  135. package/fesm2022/ngx-t-forms-paginated-selection-table-lMTD1N6B.mjs.map +0 -1
  136. package/fesm2022/ngx-t-forms-payload-template-editor.component-Dx0pI0A1.mjs.map +0 -1
  137. package/fesm2022/ngx-t-forms-required-inputs.component-DY37Qrnj.mjs +0 -271
  138. package/fesm2022/ngx-t-forms-required-inputs.component-DY37Qrnj.mjs.map +0 -1
  139. package/fesm2022/ngx-t-forms-select-input-element.component-CvrNfvXa.mjs +0 -160
  140. package/fesm2022/ngx-t-forms-select-input-element.component-CvrNfvXa.mjs.map +0 -1
  141. package/fesm2022/ngx-t-forms-textarea-input-element.component-BWyxWDvp.mjs +0 -95
  142. package/fesm2022/ngx-t-forms-textarea-input-element.component-BWyxWDvp.mjs.map +0 -1
  143. package/fesm2022/ngx-t-forms-toggle-input-element.component-CpYC2ivQ.mjs +0 -93
  144. package/fesm2022/ngx-t-forms-toggle-input-element.component-CpYC2ivQ.mjs.map +0 -1
  145. package/fesm2022/ngx-t-forms-workflow-adjudication.component-LoF_fpHu.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/calculated-field-rules/math-preview.component.ts","../../../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 ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n PLATFORM_ID,\r\n ViewEncapsulation,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\nimport katex from 'katex';\r\n\r\nimport { parseInfixFormula } from '../../../../shared/functions/formula/parse-infix-formula';\r\n\r\n/**\r\n * Read-only \"natural maths\" preview of a strictly-infix expression.\r\n *\r\n * It parses the expression with mathjs and renders the result as MathML via\r\n * KaTeX (no stylesheet required — the browser draws the glyphs natively). The\r\n * expression itself is never modified, so what is previewed is exactly what\r\n * `math.evaluate` will later consume.\r\n *\r\n * Internal to `t-dynamic-data-edit` — not part of the library's public surface.\r\n */\r\n@Component({\r\n selector: 'lib-math-preview',\r\n template: '',\r\n styleUrl: './math-preview.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n 'class': 'lib-math-preview',\r\n '[attr.data-state]': 'state()',\r\n },\r\n})\r\nexport class MathPreviewComponent {\r\n /** Strictly-infix expression to render (mathjs syntax, e.g. `((a+2)/(b-1))*2`). */\r\n readonly expression = input<string>('');\r\n\r\n /** Text shown when there is nothing to preview. */\r\n readonly placeholder = input<string>('Nothing to preview yet');\r\n\r\n /** `'empty'` when no expression is set, otherwise `'rendered'`. */\r\n protected readonly state = computed<'empty' | 'rendered'>(() =>\r\n this.expression().trim() ? 'rendered' : 'empty',\r\n );\r\n\r\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\r\n readonly #isBrowser = isPlatformBrowser(inject(PLATFORM_ID));\r\n\r\n constructor() {\r\n effect(() => {\r\n const expression = this.expression().trim();\r\n const placeholder = this.placeholder();\r\n const element = this.#host.nativeElement;\r\n\r\n // On the server KaTeX has no DOM to render into — fall back to plain text.\r\n if (!this.#isBrowser) {\r\n element.textContent = expression || placeholder;\r\n return;\r\n }\r\n if (!expression) {\r\n element.textContent = placeholder;\r\n return;\r\n }\r\n\r\n const { tex } = parseInfixFormula(expression);\r\n if (tex == null) {\r\n // Mid-edit / not yet valid: show the raw infix until it parses cleanly.\r\n element.textContent = expression;\r\n return;\r\n }\r\n katex.render(tex, element, {\r\n output: 'mathml',\r\n throwOnError: false,\r\n displayMode: true,\r\n });\r\n });\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n Input,\r\n OnDestroy,\r\n ViewEncapsulation,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule, NgControl } from '@angular/forms';\r\nimport { MatSelectChange, MatSelectModule } from '@angular/material/select';\r\nimport { MatFormFieldControl, MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatCardModule } from '@angular/material/card';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatChipsModule } from '@angular/material/chips';\r\nimport { OverlayModule } from '@angular/cdk/overlay';\r\nimport { Subject } from 'rxjs';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nimport {\r\n CalculatedFieldRules,\r\n CalculationFunctions,\r\n FormColumnInputs,\r\n ROUNDING_MODES,\r\n ROUNDING_MODE_LABELS,\r\n RoundingMode,\r\n TableConfigurationsInterface,\r\n calculationVariableInterface,\r\n} from 'ngx-t-forms-types';\r\n\r\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { _isEqual } from '../../../../shared/functions/isEqual';\r\nimport { MathPreviewComponent } from './math-preview.component';\r\nimport { parseInfixFormula } from '../../../../shared/functions/formula/parse-infix-formula';\r\n\r\n/** Escapes a string for safe inclusion as a literal inside a `RegExp`. */\r\nfunction escapeRegExp(value: string): string {\r\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}\r\n\r\n/** One selectable rounding strategy shown as a chip option. */\r\ninterface RoundingOption {\r\n readonly value: RoundingMode;\r\n readonly label: string;\r\n}\r\n\r\n/** One operator-palette button: the glyph shown, the infix token it inserts. */\r\ninterface OperatorKey {\r\n /** Glyph rendered on the button. */\r\n readonly label: string;\r\n /** Strictly-infix token inserted into the equation (mathjs syntax). */\r\n readonly token: string;\r\n /** Characters to step the caret back after insertion (e.g. land inside `()`). */\r\n readonly caretBack: number;\r\n /** Accessible name for the button. */\r\n readonly aria: string;\r\n}\r\n\r\n/** Live syntactic state of the equation, surfaced to the user as plain guidance. */\r\ninterface FormulaStatus {\r\n readonly kind: 'empty' | 'valid' | 'invalid';\r\n readonly message: string;\r\n}\r\n\r\n// ControlValueAccessor write callback. Angular types the registered change\r\n// handler as `(value: any) => void`; the alias keeps that `any` contained to one\r\n// place rather than repeating an eslint-disable on every reference.\r\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Angular CVA mandates an untyped change callback.\r\ntype CvaChange = (value: any) => void;\r\n\r\n/**\r\n * Internal calculated-field-rules editor implementing\r\n * `MatFormFieldControl<CalculatedFieldRules | undefined>` and\r\n * `ControlValueAccessor`.\r\n *\r\n * Rendered by `t-dynamic-data-edit`, which supplies the surrounding field label,\r\n * hint, and validation errors — so this component owns only its two modes: a\r\n * read-only formula summary (view) and a sectioned editor (edit) for the\r\n * formula, its variables, the optional formula source link, and the rounding\r\n * settings.\r\n *\r\n * NOTE: `MatFormFieldControl<T>` and `ControlValueAccessor` mandate plain\r\n * mutable `value` / `placeholder` / `required` / `disabled` / `id` members,\r\n * `@Input()` decorators on them, the `focused` / `touched` / `stateChanges` /\r\n * `onChange` / `onTouched` members, and the `useExisting` provider. These are\r\n * framework wiring, not defects — the CLAUDE.md bans on `@Input()` /\r\n * `useExisting` do not apply to MatFormFieldControl integration. Genuinely\r\n * internal state is signal-based.\r\n */\r\n@Component({\r\n selector: 'lib-calculated-field-rules',\r\n templateUrl: './calculated-field-rules.component.html',\r\n styleUrls: ['./calculated-field-rules.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n imports: [\r\n CommonModule,\r\n FormsModule,\r\n MathPreviewComponent,\r\n OverlayModule,\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatSelectModule,\r\n MatIconModule,\r\n MatCardModule,\r\n MatButtonModule,\r\n MatChipsModule,\r\n ],\r\n providers: [{ provide: MatFormFieldControl, useExisting: CalculatedFieldRulesComponent }],\r\n host: {\r\n 'class': 'lib-calculated-field-rules',\r\n '[attr.aria-describedby]': 'describedBy',\r\n },\r\n})\r\nexport class CalculatedFieldRulesComponent\r\n implements OnDestroy, MatFormFieldControl<CalculatedFieldRules | undefined>\r\n{\r\n static nextId = 0;\r\n\r\n // #region MatFormFieldControl framework members (plain mutable — not signals)\r\n @Input() placeholder = '';\r\n @Input() required = false;\r\n @Input() disabled = false;\r\n\r\n readonly stateChanges = new Subject<void>();\r\n readonly controlType = 'app-calculated-field-rules';\r\n readonly id = `app-calculated-field-rules-${CalculatedFieldRulesComponent.nextId++}`;\r\n\r\n focused = false;\r\n touched = false;\r\n describedBy = '';\r\n // #endregion\r\n\r\n // #region Non-MFC inputs / outputs (contract preserved exactly)\r\n /** Owning input definition; supplies table mode and the formula-source map. */\r\n readonly mapToData = input<FormColumnInputs | undefined>(undefined);\r\n /** All form inputs available to bind as calculation variables. */\r\n readonly formInputs = input<Array<FormColumnInputs>>([]);\r\n /** Validation errors surfaced by the parent for error-state derivation. */\r\n readonly errors = input<IConfigElementError[] | undefined>([]);\r\n\r\n /** Retained on the contract; reserved for path-scoped value emission. */\r\n readonly valueChange2dWithPath = output<unknown>();\r\n /** Emits the persisted rules whenever the editor commits a new value. */\r\n readonly valueChanged = output<CalculatedFieldRules | null>();\r\n // #endregion\r\n\r\n // #region Internal signal state\r\n /** Whether the editor card is open (edit mode) versus the summary (view). */\r\n protected readonly isEditing = signal(false);\r\n /** Working copy edited in the card; committed to `value` on save. */\r\n protected readonly tempValue = signal<CalculatedFieldRules>({} as CalculatedFieldRules);\r\n\r\n /** Whether the inline `$` field-picker is open. */\r\n protected readonly pickerOpen = signal(false);\r\n /** Text typed after `$`, used to filter the field-picker. */\r\n protected readonly pickerQuery = signal('');\r\n /** Keyboard-highlighted result in the field-picker. */\r\n protected readonly pickerActiveIndex = signal(0);\r\n\r\n /** Index of the `$` that opened the picker, and the caret at that moment. */\r\n #dollarIndex = -1;\r\n #cursorPosition = 0;\r\n // #endregion\r\n\r\n /** The library's rounding strategies, labelled as the number-format editor labels them. */\r\n protected readonly roundingType: readonly RoundingOption[] = ROUNDING_MODES.map((value) => ({\r\n value,\r\n label: ROUNDING_MODE_LABELS[value],\r\n }));\r\n\r\n /** Operator palette inserted into the equation; glyphs are friendly, tokens are infix. */\r\n protected readonly operatorKeys: readonly OperatorKey[] = [\r\n { label: '+', token: ' + ', caretBack: 0, aria: 'Add' },\r\n { label: '−', token: ' - ', caretBack: 0, aria: 'Subtract' },\r\n { label: '×', token: ' * ', caretBack: 0, aria: 'Multiply' },\r\n { label: '÷', token: ' / ', caretBack: 0, aria: 'Divide' },\r\n { label: '( )', token: '()', caretBack: 1, aria: 'Brackets' },\r\n { label: 'xⁿ', token: '^', caretBack: 0, aria: 'Power' },\r\n ];\r\n\r\n /** The equation textarea, used for caret-aware token insertion. */\r\n protected readonly formulaInputRef =\r\n viewChild<ElementRef<HTMLTextAreaElement>>('formulaInput');\r\n\r\n /** Live, non-technical validity of the working equation (drives the preview banner). */\r\n protected readonly formulaStatus = computed<FormulaStatus>(() => {\r\n const formula = (this.tempValue().formula ?? '').trim();\r\n if (!formula) {\r\n return { kind: 'empty', message: 'Start building your equation below.' };\r\n }\r\n const { error } = parseInfixFormula(formula);\r\n return error\r\n ? { kind: 'invalid', message: error }\r\n : { kind: 'valid', message: 'This equation is valid.' };\r\n });\r\n\r\n /** Number-typed inputs that may back a calculation variable. */\r\n protected readonly cachedNumberInputs = computed<FormColumnInputs[]>(() =>\r\n this.formInputs().filter(\r\n (input) => input.dataType === 'number' || input.type === 'number',\r\n ),\r\n );\r\n\r\n /** Field-picker results: number inputs filtered by the text typed after `$`. */\r\n protected readonly pickerResults = computed<FormColumnInputs[]>(() => {\r\n const query = this.pickerQuery().trim().toLowerCase();\r\n const inputs = this.cachedNumberInputs();\r\n if (!query) {\r\n return inputs;\r\n }\r\n return inputs.filter(\r\n (input) =>\r\n input.label?.toLowerCase().includes(query) ||\r\n input.formControlName?.toLowerCase().includes(query),\r\n );\r\n });\r\n\r\n /** Every calculation function offered as a list-aggregation chip. */\r\n protected readonly allCalculationFunction = computed<CalculationFunctions[]>(() =>\r\n Object.values(CalculationFunctions),\r\n );\r\n\r\n /** True when this editor targets a table column rather than a scalar input. */\r\n protected readonly tableMode = computed<boolean>(() => !!this.mapToData()?.tableConfig);\r\n\r\n /** Table configuration when in table mode. */\r\n protected readonly tableConfig = computed<TableConfigurationsInterface | undefined>(\r\n () => this.mapToData()?.tableConfig,\r\n );\r\n\r\n readonly ngControl = inject(NgControl, { self: true, optional: true });\r\n readonly #elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n constructor() {\r\n if (this.ngControl != null) {\r\n this.ngControl.valueAccessor = this;\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 #value: CalculatedFieldRules | undefined;\r\n\r\n @Input()\r\n get value(): CalculatedFieldRules | undefined {\r\n return this.#value;\r\n }\r\n set value(val: CalculatedFieldRules | undefined) {\r\n if (_isEqual(this.#value, val)) {\r\n return;\r\n }\r\n this.#value = val ? { ...val } : undefined;\r\n this.stateChanges.next();\r\n this.valueChanged.emit(this.#value ?? null);\r\n this.onChange(this.#value);\r\n }\r\n\r\n // MatFormFieldControl reads these as plain getters during its own change\r\n // detection, so they stay getters rather than `computed()` signals.\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 != null;\r\n return (\r\n (this.touched && (hasControlError || hasCustomError)) ||\r\n (this.required && !this.#value)\r\n );\r\n }\r\n\r\n // ControlValueAccessor — Angular registers an untyped change callback.\r\n onChange: CvaChange = () => {};\r\n onTouched: () => void = () => {};\r\n\r\n writeValue(value: CalculatedFieldRules): void {\r\n this.value = value;\r\n }\r\n\r\n registerOnChange(fn: CvaChange): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n this.stateChanges.next();\r\n }\r\n\r\n setDescribedByIds(ids: string[]): void {\r\n const controlElement = this.#elementRef.nativeElement.querySelector(\r\n '.app-calculated-field-rules',\r\n );\r\n controlElement?.setAttribute('aria-describedby', ids.join(' '));\r\n this.describedBy = ids.join(' ');\r\n this.stateChanges.next();\r\n }\r\n\r\n onContainerClick(): 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(): void {\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 lifecycle\r\n\r\n protected startEdit(): void {\r\n this.tempValue.set(\r\n this.#value ? structuredClone(this.#value) : ({} as CalculatedFieldRules),\r\n );\r\n this.isEditing.set(true);\r\n this.markAsTouched();\r\n }\r\n\r\n protected saveEdit(): void {\r\n this.value = this.tempValue();\r\n this.isEditing.set(false);\r\n }\r\n\r\n protected cancelEdit(): void {\r\n this.isEditing.set(false);\r\n this.tempValue.set({} as CalculatedFieldRules);\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Formula / variable editing (operates on tempValue)\r\n\r\n protected checkIfInputCanBeLinkedToCalVariable(\r\n currentInput: FormColumnInputs | undefined,\r\n inputToDisable: {\r\n formControlName: unknown;\r\n parentInput?: unknown;\r\n multipleInputInEditId?: unknown;\r\n },\r\n ): boolean {\r\n if (!currentInput) {\r\n return false;\r\n }\r\n if (currentInput.formControlName === inputToDisable.formControlName) {\r\n return true;\r\n }\r\n if (!currentInput.multipleInputInEditId) {\r\n return !!inputToDisable.parentInput || !!inputToDisable.multipleInputInEditId;\r\n }\r\n return false;\r\n }\r\n\r\n protected linkFormulaSource(event: MatSelectChange): void {\r\n // Resetting formula to undefined intentionally during edit; persisted value\r\n // re-validates on save.\r\n this.tempValue.update((current) => ({\r\n ...current,\r\n formControlWithFormula: event.value,\r\n formula: '',\r\n }));\r\n }\r\n\r\n protected removeVariable(variableId: string): void {\r\n const current = this.tempValue();\r\n const variables = current.variables ?? [];\r\n const target = variables.find((v) => v.id === variableId);\r\n let formula = current.formula ?? '';\r\n if (target?.variable) {\r\n formula = formula\r\n .replace(new RegExp(`\\\\b${escapeRegExp(target.variable)}\\\\b`, 'g'), '')\r\n .replace(/\\s{2,}/g, ' ')\r\n .trim();\r\n }\r\n this.tempValue.set({\r\n ...current,\r\n variables: variables.filter((v) => v.id !== variableId),\r\n formula,\r\n });\r\n }\r\n\r\n protected appendVariableToFormula(variableName: string): void {\r\n // A variable carries no spacing of its own, so pad it only where it would\r\n // otherwise fuse with an adjacent token (e.g. `ab` instead of `a b`).\r\n const { before, after } = this.#caretSlices();\r\n const lead = before.length > 0 && !/[\\s(]$/.test(before) ? ' ' : '';\r\n const trail = after.length > 0 && !/^[\\s)]/.test(after) ? ' ' : '';\r\n this.insertToken(`${lead}${variableName}${trail}`, trail ? 1 : 0);\r\n }\r\n\r\n protected setFormula(formula: string): void {\r\n this.tempValue.update((current) => ({ ...current, formula }));\r\n }\r\n\r\n /**\r\n * Inserts an infix token at the caret (or appends it when the textarea is not\r\n * focused), then restores the caret just after the insertion. Used by both the\r\n * operator palette and the variable chips so the equation reads naturally while\r\n * staying strictly infix.\r\n */\r\n protected insertToken(token: string, caretBack = 0): void {\r\n const element = this.formulaInputRef()?.nativeElement;\r\n const { before, after } = this.#caretSlices();\r\n const next = before + token + after;\r\n\r\n this.setFormula(next);\r\n\r\n if (!element) {\r\n return;\r\n }\r\n const caret = before.length + token.length - caretBack;\r\n // Restore focus + caret after Angular has written the new value back to the DOM.\r\n setTimeout(() => {\r\n element.focus();\r\n element.setSelectionRange(caret, caret);\r\n });\r\n }\r\n\r\n /** The formula split around the current caret/selection (end-of-string when unfocused). */\r\n #caretSlices(): { before: string; after: string } {\r\n const current = this.tempValue().formula ?? '';\r\n const element = this.formulaInputRef()?.nativeElement;\r\n const start = element?.selectionStart ?? current.length;\r\n const end = element?.selectionEnd ?? current.length;\r\n return { before: current.slice(0, start), after: current.slice(end) };\r\n }\r\n\r\n protected setDecimalPlaces(value: number | string | null): void {\r\n const parsed =\r\n value === null || value === '' ? undefined : Number(value);\r\n this.tempValue.update((current) => ({\r\n ...current,\r\n decimalPlaces: parsed !== undefined && Number.isFinite(parsed) ? parsed : undefined,\r\n }));\r\n }\r\n\r\n protected setRoundingMode(mode: RoundingMode): void {\r\n this.tempValue.update((current) => ({ ...current, roundingMode: mode }));\r\n }\r\n\r\n /** Friendly label for a stored rounding mode, used in the read-only summary. */\r\n protected roundingLabel(mode: RoundingMode | undefined): string {\r\n return this.roundingType.find((option) => option.value === mode)?.label ?? 'nearest';\r\n }\r\n\r\n // #endregion\r\n\r\n // #region Inline `$` field-picker & variable binding\r\n\r\n /** Formula text changed: persist it and re-evaluate whether the `$` picker should show. */\r\n protected onFormulaChange(value: string): void {\r\n this.setFormula(value);\r\n this.#syncPicker();\r\n }\r\n\r\n /** Caret moved (click / arrow keys / focus): re-evaluate the `$` picker against the new caret. */\r\n protected onFormulaCaret(): void {\r\n this.#syncPicker();\r\n }\r\n\r\n /** Closes the picker shortly after blur, leaving time for a result click to register. */\r\n protected onFormulaBlur(): void {\r\n setTimeout(() => this.closePicker(), 150);\r\n }\r\n\r\n /** Keyboard control for the open picker: navigate, select, dismiss. */\r\n protected onFormulaKeydown(event: KeyboardEvent): void {\r\n if (!this.pickerOpen()) {\r\n return;\r\n }\r\n const results = this.pickerResults();\r\n switch (event.key) {\r\n case 'ArrowDown':\r\n event.preventDefault();\r\n this.pickerActiveIndex.update((i) => Math.min(i + 1, results.length - 1));\r\n break;\r\n case 'ArrowUp':\r\n event.preventDefault();\r\n this.pickerActiveIndex.update((i) => Math.max(i - 1, 0));\r\n break;\r\n case 'Enter': {\r\n const item = results[this.pickerActiveIndex()];\r\n if (item) {\r\n event.preventDefault();\r\n this.selectField(item);\r\n }\r\n break;\r\n }\r\n case 'Escape':\r\n event.preventDefault();\r\n this.closePicker();\r\n break;\r\n }\r\n }\r\n\r\n protected closePicker(): void {\r\n this.pickerOpen.set(false);\r\n this.pickerActiveIndex.set(0);\r\n this.#dollarIndex = -1;\r\n }\r\n\r\n /**\r\n * Binds a form field to a calculation variable and drops its short token into\r\n * the equation. Reuses an existing scalar binding for the same field; otherwise\r\n * mints the next free short name (a, b, c, …). When opened from `$`, the typed\r\n * `$query` is replaced in place; otherwise the token is appended.\r\n */\r\n protected selectField(input: FormColumnInputs): void {\r\n const current = this.tempValue();\r\n const variables = current.variables ?? [];\r\n const existing = variables.find(\r\n (v) => v.formControlName === input.formControlName && !v.function && !v.parentInputId,\r\n );\r\n const token = existing ? existing.variable : this.#nextShortName();\r\n const nextVars = existing ? variables : [...variables, this.#makeVariable(input, token)];\r\n\r\n const formula = current.formula ?? '';\r\n let nextFormula: string;\r\n let caret: number;\r\n if (this.pickerOpen() && this.#dollarIndex >= 0) {\r\n const before = formula.slice(0, this.#dollarIndex);\r\n const after = formula.slice(this.#cursorPosition);\r\n const lead = before.length > 0 && !/[\\s(]$/.test(before) ? ' ' : '';\r\n const insert = `${lead}${token} `;\r\n nextFormula = before + insert + after;\r\n caret = (before + insert).length;\r\n } else {\r\n const lead = formula.length > 0 && !/[\\s(]$/.test(formula) ? ' ' : '';\r\n nextFormula = `${formula}${lead}${token} `;\r\n caret = nextFormula.length;\r\n }\r\n\r\n this.tempValue.set({ ...current, formula: nextFormula, variables: nextVars });\r\n this.closePicker();\r\n\r\n const element = this.formulaInputRef()?.nativeElement;\r\n if (element) {\r\n setTimeout(() => {\r\n element.focus();\r\n element.setSelectionRange(caret, caret);\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Renames a variable's short token, updating every whole-word occurrence in the\r\n * formula. An empty name is ignored so the token never desyncs from the formula\r\n * (the field repopulates with the current name on the next render).\r\n */\r\n protected setVariableShortName(id: string, rawName: string): void {\r\n const name = rawName.trim();\r\n const current = this.tempValue();\r\n const variables = current.variables ?? [];\r\n const target = variables.find((v) => v.id === id);\r\n if (!target || !name || name === target.variable) {\r\n return;\r\n }\r\n const formula = target.variable\r\n ? (current.formula ?? '').replace(\r\n new RegExp(`\\\\b${escapeRegExp(target.variable)}\\\\b`, 'g'),\r\n name,\r\n )\r\n : (current.formula ?? '');\r\n this.tempValue.set({\r\n ...current,\r\n formula,\r\n variables: variables.map((v) => (v.id === id ? { ...v, variable: name } : v)),\r\n });\r\n }\r\n\r\n /** Toggles a list-aggregation function (sum/avg/…) on a sub-item variable. */\r\n protected setVariableFunction(id: string, func: CalculationFunctions): void {\r\n this.tempValue.update((current) => ({\r\n ...current,\r\n variables: (current.variables ?? []).map((v) => {\r\n if (v.id !== id) {\r\n return v;\r\n }\r\n if (v.function === func) {\r\n return {\r\n ...v,\r\n function: undefined,\r\n applyFunctionToCol: undefined,\r\n applyFunctionToLabel: undefined,\r\n };\r\n }\r\n return {\r\n ...v,\r\n function: func,\r\n applyFunctionToCol: v.formControlName,\r\n applyFunctionToLabel: v.label,\r\n };\r\n }),\r\n }));\r\n }\r\n\r\n /** Recomputes the picker visibility/query from the current formula and caret. */\r\n #syncPicker(): void {\r\n const element = this.formulaInputRef()?.nativeElement;\r\n if (!element) {\r\n this.closePicker();\r\n return;\r\n }\r\n const position = element.selectionStart ?? 0;\r\n this.#cursorPosition = position;\r\n const formula = this.tempValue().formula ?? '';\r\n const lastDollar = formula.slice(0, position).lastIndexOf('$');\r\n if (lastDollar === -1) {\r\n this.closePicker();\r\n return;\r\n }\r\n const query = formula.slice(lastDollar + 1, position);\r\n // Only a run of letters/digits/spaces keeps the picker open; anything else\r\n // (an operator, a newline) means the `$` was not a field trigger.\r\n if (!/^[a-zA-Z0-9 ]*$/.test(query)) {\r\n this.closePicker();\r\n return;\r\n }\r\n this.#dollarIndex = lastDollar;\r\n this.pickerQuery.set(query);\r\n this.pickerActiveIndex.set(0);\r\n this.pickerOpen.set(true);\r\n }\r\n\r\n /** Builds a calculation variable bound to a form field, carrying the list parent when present. */\r\n #makeVariable(input: FormColumnInputs, token: string): calculationVariableInterface {\r\n return {\r\n id: uuidv4(),\r\n variable: token,\r\n formControlName: input.formControlName,\r\n inputId: input.id,\r\n label: input.label,\r\n ...(input.multipleInputInEditId ? { parentInputId: input.multipleInputInEditId } : {}),\r\n } as calculationVariableInterface;\r\n }\r\n\r\n /** Next free single-letter token (a, b, c, …), skipping mathjs constants and falling back to v1, v2…. */\r\n #nextShortName(): string {\r\n const used = new Set((this.tempValue().variables ?? []).map((v) => v.variable));\r\n const reserved = new Set(['e', 'i']); // mathjs constants\r\n for (let code = 97; code <= 122; code++) {\r\n const char = String.fromCharCode(code);\r\n if (!used.has(char) && !reserved.has(char)) {\r\n return char;\r\n }\r\n }\r\n let n = 1;\r\n while (used.has(`v${n}`)) {\r\n n++;\r\n }\r\n return `v${n}`;\r\n }\r\n\r\n // #endregion\r\n}\r\n","<!-- View mode: read-only calculation summary -->\r\n@if (!isEditing()) {\r\n<div class=\"cfr-summary\">\r\n @if (!!value && !mapToData()?.id && !tableMode()) {\r\n <div class=\"cfr-hint\">\r\n <mat-icon class=\"cfr-hint__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 class=\"cfr-formula-card\">\r\n <span class=\"cfr-section__label\">Calculation</span>\r\n <lib-math-preview class=\"cfr-formula-card__preview\" [expression]=\"value?.formula || ''\"\r\n placeholder=\"No calculation set up yet\" />\r\n @if (value?.decimalPlaces) {\r\n <div class=\"cfr-formula-card__meta\">\r\n <mat-icon class=\"cfr-formula-card__meta-icon\">tune</mat-icon>\r\n <span>Rounded to {{ value?.decimalPlaces }} decimal place(s) · {{ value?.roundingMode ? roundingLabel(value?.roundingMode) : 'nearest' }}</span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <button class=\"cfr-edit-trigger\" mat-stroked-button color=\"primary\" [disabled]=\"disabled\"\r\n (click)=\"startEdit()\">\r\n <mat-icon>edit</mat-icon>\r\n {{ !!value?.formula ? 'Edit calculation' : 'Set up calculation' }}\r\n </button>\r\n</div>\r\n}\r\n\r\n<!-- Edit mode: guided calculation builder -->\r\n@else {\r\n<mat-card appearance=\"outlined\" class=\"cfr-editor\">\r\n <header class=\"cfr-editor__head\">\r\n <h3 class=\"cfr-editor__title\">\r\n <mat-icon>functions</mat-icon>\r\n Build the calculation\r\n </h3>\r\n <p class=\"cfr-editor__subtitle\">\r\n Combine your form fields with operators to work out this value automatically.\r\n </p>\r\n </header>\r\n\r\n <!-- Live preview + validity -->\r\n <div class=\"cfr-preview\" [attr.data-state]=\"formulaStatus().kind\">\r\n <span class=\"cfr-section__label\">Live preview</span>\r\n <lib-math-preview class=\"cfr-preview__render\" [expression]=\"tempValue().formula || ''\"\r\n placeholder=\"Your equation will appear here\" />\r\n <p class=\"cfr-preview__status\">\r\n <mat-icon class=\"cfr-preview__status-icon\">\r\n {{ formulaStatus().kind === 'valid' ? 'check_circle' : formulaStatus().kind === 'invalid' ? 'error' : 'lightbulb' }}\r\n </mat-icon>\r\n <span>{{ formulaStatus().message }}</span>\r\n </p>\r\n </div>\r\n\r\n <section class=\"cfr-section\">\r\n <!-- Equation input + inline field-picker + operator keypad -->\r\n <div class=\"cfr-equation\">\r\n <div class=\"cfr-equation__field\">\r\n <mat-form-field class=\"cfr-field\" [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\"\r\n appearance=\"outline\">\r\n <mat-label>Equation</mat-label>\r\n <textarea #formulaInput matInput [ngModel]=\"tempValue().formula\"\r\n (ngModelChange)=\"onFormulaChange($event)\" (keyup)=\"onFormulaCaret()\"\r\n (click)=\"onFormulaCaret()\" (focus)=\"onFormulaCaret()\"\r\n (keydown)=\"onFormulaKeydown($event)\" (blur)=\"onFormulaBlur()\"\r\n placeholder=\"e.g. (a + 2) / b\" rows=\"2\" spellcheck=\"false\" autocapitalize=\"off\"\r\n autocomplete=\"off\"></textarea>\r\n <mat-hint>Type <strong>$</strong> to add a form field, then join fields with the operator keys.</mat-hint>\r\n </mat-form-field>\r\n\r\n @if (pickerOpen()) {\r\n <div class=\"cfr-picker\" role=\"listbox\" aria-label=\"Form fields\">\r\n <div class=\"cfr-picker__head\">Insert a field</div>\r\n @if (pickerResults().length === 0) {\r\n <div class=\"cfr-picker__empty\">No matching number fields</div>\r\n } @else {\r\n @for (item of pickerResults(); track item.id; let idx = $index) {\r\n <button type=\"button\" role=\"option\" class=\"cfr-picker__item\"\r\n [class.cfr-picker__item--active]=\"idx === pickerActiveIndex()\"\r\n [attr.aria-selected]=\"idx === pickerActiveIndex()\"\r\n (mousedown)=\"$event.preventDefault()\" (click)=\"selectField(item)\">\r\n <mat-icon class=\"cfr-picker__icon\">{{ item.multipleInputInEditId ? 'format_list_numbered' : 'tag' }}</mat-icon>\r\n <span class=\"cfr-picker__label\">{{ item.label }}</span>\r\n <span class=\"cfr-picker__meta\">{{ item.formControlName }}</span>\r\n </button>\r\n }\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <div class=\"cfr-keypad\" role=\"group\" aria-label=\"Operators\">\r\n @for (key of operatorKeys; track key.token) {\r\n <button type=\"button\" class=\"cfr-key\" [attr.aria-label]=\"key.aria\"\r\n (click)=\"insertToken(key.token, key.caretBack)\">\r\n {{ key.label }}\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n\r\n <!-- Optional equation source link -->\r\n @if (!!tempValue().getFormulaFromAFormInput) {\r\n <mat-form-field class=\"cfr-field\" [subscriptSizing]=\"'dynamic'\" [floatLabel]=\"'always'\"\r\n appearance=\"outline\">\r\n <mat-label>Equation source</mat-label>\r\n <mat-select [value]=\"tempValue().formControlWithFormula\"\r\n (selectionChange)=\"linkFormulaSource($event)\" placeholder=\"Select an input that holds a formula\">\r\n @for (input of formInputs(); track input.id) {\r\n <mat-option\r\n [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>Pull the equation from another input's value</mat-hint>\r\n </mat-form-field>\r\n }\r\n\r\n <!-- Bound fields legend -->\r\n <div class=\"cfr-variables\">\r\n <div class=\"cfr-block-head\">\r\n <span class=\"cfr-section__label\">Fields in this calculation</span>\r\n <span class=\"cfr-block-head__hint\">Rename a letter, or type $ above to add another</span>\r\n </div>\r\n\r\n @if ((tempValue().variables || []).length === 0) {\r\n <p class=\"cfr-variables__empty\">\r\n Type <strong>$</strong> in the equation above to add a form field — each becomes a short\r\n letter you can use in the equation.\r\n </p>\r\n } @else {\r\n <ul class=\"cfr-legend\">\r\n @for (variable of (tempValue().variables || []); track variable.id) {\r\n <li class=\"cfr-legend__row\">\r\n <div class=\"cfr-legend__main\">\r\n <input class=\"cfr-legend__token\" [ngModel]=\"variable.variable\"\r\n (ngModelChange)=\"setVariableShortName(variable.id, $event)\" aria-label=\"Short name\"\r\n maxlength=\"12\" spellcheck=\"false\" autocomplete=\"off\" autocapitalize=\"off\">\r\n <mat-icon class=\"cfr-legend__arrow\">arrow_right_alt</mat-icon>\r\n <button type=\"button\" class=\"cfr-legend__field\"\r\n [attr.aria-label]=\"'Insert ' + variable.label + ' into the equation'\"\r\n (click)=\"appendVariableToFormula(variable.variable)\">\r\n {{ variable.label }}\r\n </button>\r\n <button type=\"button\" class=\"cfr-legend__remove\"\r\n [attr.aria-label]=\"'Remove ' + variable.variable\"\r\n (click)=\"removeVariable(variable.id)\">\r\n <mat-icon>close</mat-icon>\r\n </button>\r\n </div>\r\n\r\n @if (variable.parentInputId) {\r\n <div class=\"cfr-legend__fns\" role=\"group\" aria-label=\"Combine list values with\">\r\n <span class=\"cfr-legend__fns-label\" aria-hidden=\"true\">ƒ</span>\r\n @for (func of allCalculationFunction(); track func) {\r\n <button type=\"button\" class=\"cfr-legend__fn\"\r\n [class.cfr-legend__fn--active]=\"variable.function === func\"\r\n (click)=\"setVariableFunction(variable.id, func)\">\r\n {{ func }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n\r\n <!-- Result formatting -->\r\n <div class=\"cfr-rounding\">\r\n <div class=\"cfr-block-head\">\r\n <span class=\"cfr-section__label\">Result formatting</span>\r\n <span class=\"cfr-block-head__hint\">Optional — how the answer is rounded</span>\r\n </div>\r\n\r\n <div class=\"cfr-rounding__row\">\r\n <mat-form-field class=\"cfr-field cfr-rounding__decimals\" [subscriptSizing]=\"'dynamic'\"\r\n [floatLabel]=\"'always'\" appearance=\"outline\">\r\n <mat-label>Decimal places</mat-label>\r\n <input matInput [ngModel]=\"tempValue().decimalPlaces\"\r\n (ngModelChange)=\"setDecimalPlaces($event)\" placeholder=\"0\" type=\"number\" min=\"0\">\r\n </mat-form-field>\r\n\r\n @if (tempValue().decimalPlaces) {\r\n <div class=\"cfr-rounding__mode\">\r\n <label class=\"cfr-section__label\">Rounding</label>\r\n <mat-chip-listbox aria-label=\"Rounding method\">\r\n @for (type of roundingType; track type.value) {\r\n <mat-chip-option (click)=\"setRoundingMode(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 </div>\r\n </section>\r\n\r\n <div class=\"cfr-editor__actions\">\r\n <button mat-button (click)=\"cancelEdit()\">Cancel</button>\r\n <button mat-flat-button color=\"primary\" [disabled]=\"formulaStatus().kind === 'invalid'\"\r\n (click)=\"saveEdit()\">\r\n Save calculation\r\n </button>\r\n </div>\r\n</mat-card>\r\n}\r\n\r\n<!-- Disabled overlay -->\r\n<ng-template cdkConnectedOverlay [cdkConnectedOverlayOpen]=\"disabled\">\r\n <div class=\"cfr-disabled-overlay\"></div>\r\n</ng-template>\r\n"],"names":["uuidv4","i6","i7","i9"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBA;;;;;;;;;AASG;MAYU,oBAAoB,CAAA;AAYtB,IAAA,KAAK;AACL,IAAA,UAAU;AAEnB,IAAA,WAAA,GAAA;;AAbS,QAAA,IAAA,CAAA,UAAU,GAA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a;wBACb,eAAe;wBACf,cAAc;qBACf,EAAA,SAAA,EACU,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAA,6BAA+B,EAAE,CAAC,EAAA,IAAA,EACnF;AACJ,wBAAA,OAAO,EAAE,4BAA4B;AACrC,wBAAA,yBAAyB,EAAE,aAAa;AACzC,qBAAA,EAAA,QAAA,EAAA,82TAAA,EAAA,MAAA,EAAA,CAAA,o5RAAA,CAAA,EAAA;;sBAQA;;sBACA;;sBACA;6eA6D4C,cAAc,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA;sBAkE1D;;;;;"}
@@ -6,7 +6,7 @@ import * as i4 from '@angular/material/chips';
6
6
  import { MatChipsModule } from '@angular/material/chips';
7
7
  import * as i3 from '@angular/material/icon';
8
8
  import { MatIconModule } from '@angular/material/icon';
9
- import { E as EmptyStateComponent } from './ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs';
9
+ import { E as EmptyStateComponent } from './ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs';
10
10
 
11
11
  /**
12
12
  * Internal chip-options creator editor: the user types free-text tokens that
@@ -94,4 +94,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
94
94
  }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }] } });
95
95
 
96
96
  export { ChipOptionsCreatorEditorComponent };
97
- //# sourceMappingURL=ngx-t-forms-chip-options-creator-editor.component-CWJMjBoK.mjs.map
97
+ //# sourceMappingURL=ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-t-forms-chip-options-creator-editor.component-CWJMjBoK.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/chip-options-creator-editor/chip-options-creator-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/chip-options-creator-editor/chip-options-creator-editor.component.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { LiveAnnouncer } from '@angular/cdk/a11y';\r\nimport { COMMA, ENTER } from '@angular/cdk/keycodes';\r\nimport { MatChipEditedEvent, MatChipInputEvent, MatChipsModule } from '@angular/material/chips';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { EmptyStateComponent } from '../_shared/empty-state/empty-state.component';\r\n\r\n/**\r\n * Internal chip-options creator editor: the user types free-text tokens that\r\n * become removable, editable chips; the resulting `string[]` is emitted.\r\n *\r\n * Rendered by `t-dynamic-data-edit`'s non-control branch (it is NOT a\r\n * MatFormFieldControl), which already supplies the field label, hint, and\r\n * validation errors — so this component owns only the chip grid and its empty\r\n * state.\r\n */\r\n@Component({\r\n selector: 'lib-chip-options-creator-editor',\r\n imports: [MatChipsModule, MatIconModule, EmptyStateComponent],\r\n templateUrl: './chip-options-creator-editor.component.html',\r\n styleUrl: './chip-options-creator-editor.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n 'class': 'lib-chip-options-creator-editor',\r\n '[attr.id]': 'id()',\r\n },\r\n})\r\nexport class ChipOptionsCreatorEditorComponent {\r\n /** Optional id attribute supplied by the parent editor. */\r\n readonly id = input<string | undefined>(undefined);\r\n /** Disables chip entry/edit/remove. */\r\n readonly disabled = input<boolean>(false);\r\n /** Whether a non-empty value is required (kept on the contract). */\r\n readonly required = input<boolean>(false);\r\n /** External validation errors (surfaced by the parent). */\r\n readonly errors = input<IConfigElementError[] | undefined>([]);\r\n /** The chip values to render. */\r\n readonly value = input<string[] | undefined>(undefined);\r\n /** Placeholder for the new-chip input. */\r\n readonly placeholder = input<string>('');\r\n\r\n /** Emits the full chip list whenever it changes. */\r\n readonly valueChange = output<string[] | undefined>();\r\n\r\n protected readonly separatorKeysCodes = [ENTER, COMMA] as const;\r\n\r\n /** Local working copy of the chip list; mirrors the `value` input. */\r\n readonly #internalValue = signal<readonly string[]>([]);\r\n /** Read-only accessor used by the template. */\r\n protected readonly currentValue = this.#internalValue.asReadonly();\r\n protected readonly isEmpty = computed(() => this.#internalValue().length === 0);\r\n\r\n readonly #announcer = inject(LiveAnnouncer);\r\n\r\n constructor() {\r\n // The parent drives the value declaratively via [value].\r\n effect(() => {\r\n this.#internalValue.set(this.value() ?? []);\r\n });\r\n }\r\n\r\n protected add(event: MatChipInputEvent): void {\r\n const value = (event.value || '').trim();\r\n event.chipInput?.clear();\r\n if (!value) {\r\n return;\r\n }\r\n const current = this.#internalValue();\r\n if (current.includes(value)) {\r\n this.#announcer.announce(`value ${value} already exists`);\r\n return;\r\n }\r\n this.#commit([...current, value]);\r\n }\r\n\r\n protected edit(segment: string, event: MatChipEditedEvent): void {\r\n const newValue = event.value.trim();\r\n if (!newValue) {\r\n this.remove(segment);\r\n return;\r\n }\r\n this.#commit(this.#internalValue().map((s) => (s === segment ? newValue : s)));\r\n }\r\n\r\n protected remove(segment: string): void {\r\n const current = this.#internalValue();\r\n if (!current.includes(segment)) {\r\n return;\r\n }\r\n this.#announcer.announce(`Removed ${segment}`);\r\n this.#commit(current.filter((s) => s !== segment));\r\n }\r\n\r\n #commit(next: readonly string[]): void {\r\n const snapshot = [...next];\r\n this.#internalValue.set(snapshot);\r\n this.valueChange.emit(snapshot);\r\n }\r\n}\r\n","@if (isEmpty()) {\r\n<lib-empty-state icon=\"label_off\" message=\"No options yet — type below to add one\" />\r\n}\r\n\r\n<mat-chip-grid\r\n #chipGrid\r\n class=\"lib-chip-options-creator-editor__grid\"\r\n [disabled]=\"disabled()\"\r\n aria-label=\"Chip options\">\r\n @for (segment of currentValue(); track $index) {\r\n <mat-chip-row\r\n class=\"lib-chip-options-creator-editor__chip\"\r\n [editable]=\"true\"\r\n [aria-description]=\"'press enter to edit ' + segment\"\r\n (edited)=\"edit(segment, $event)\"\r\n (removed)=\"remove(segment)\">\r\n {{ segment }}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + segment\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n <input\r\n class=\"lib-chip-options-creator-editor__input\"\r\n [placeholder]=\"placeholder() || 'New selection...'\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n [matChipInputAddOnBlur]=\"true\"\r\n (matChipInputTokenEnd)=\"add($event)\" />\r\n</mat-chip-grid>\r\n"],"names":["i1"],"mappings":";;;;;;;;;;AAkBA;;;;;;;;AAQG;MAaU,iCAAiC,CAAA;;AAoBnC,IAAA,cAAc;AAKd,IAAA,UAAU;AAEnB,IAAA,WAAA,GAAA;;AAzBS,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAqB,SAAS,yEAAC;;AAEzC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAEhC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAEhC,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAoC,EAAE,6EAAC;;AAErD,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAuB,SAAS,4EAAC;;AAE9C,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK,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,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,OAAO,EAAE,iCAAiC;AAC1C,wBAAA,WAAW,EAAE,MAAM;AACpB,qBAAA,EAAA,QAAA,EAAA,okCAAA,EAAA,MAAA,EAAA,CAAA,4pDAAA,CAAA,EAAA;;;;;"}
1
+ {"version":3,"file":"ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/chip-options-creator-editor/chip-options-creator-editor.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/chip-options-creator-editor/chip-options-creator-editor.component.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewEncapsulation,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { LiveAnnouncer } from '@angular/cdk/a11y';\r\nimport { COMMA, ENTER } from '@angular/cdk/keycodes';\r\nimport { MatChipEditedEvent, MatChipInputEvent, MatChipsModule } from '@angular/material/chips';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\r\nimport { EmptyStateComponent } from '../_shared/empty-state/empty-state.component';\r\n\r\n/**\r\n * Internal chip-options creator editor: the user types free-text tokens that\r\n * become removable, editable chips; the resulting `string[]` is emitted.\r\n *\r\n * Rendered by `t-dynamic-data-edit`'s non-control branch (it is NOT a\r\n * MatFormFieldControl), which already supplies the field label, hint, and\r\n * validation errors — so this component owns only the chip grid and its empty\r\n * state.\r\n */\r\n@Component({\r\n selector: 'lib-chip-options-creator-editor',\r\n imports: [MatChipsModule, MatIconModule, EmptyStateComponent],\r\n templateUrl: './chip-options-creator-editor.component.html',\r\n styleUrl: './chip-options-creator-editor.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n host: {\r\n 'class': 'lib-chip-options-creator-editor',\r\n '[attr.id]': 'id()',\r\n },\r\n})\r\nexport class ChipOptionsCreatorEditorComponent {\r\n /** Optional id attribute supplied by the parent editor. */\r\n readonly id = input<string | undefined>(undefined);\r\n /** Disables chip entry/edit/remove. */\r\n readonly disabled = input<boolean>(false);\r\n /** Whether a non-empty value is required (kept on the contract). */\r\n readonly required = input<boolean>(false);\r\n /** External validation errors (surfaced by the parent). */\r\n readonly errors = input<IConfigElementError[] | undefined>([]);\r\n /** The chip values to render. */\r\n readonly value = input<string[] | undefined>(undefined);\r\n /** Placeholder for the new-chip input. */\r\n readonly placeholder = input<string>('');\r\n\r\n /** Emits the full chip list whenever it changes. */\r\n readonly valueChange = output<string[] | undefined>();\r\n\r\n protected readonly separatorKeysCodes = [ENTER, COMMA] as const;\r\n\r\n /** Local working copy of the chip list; mirrors the `value` input. */\r\n readonly #internalValue = signal<readonly string[]>([]);\r\n /** Read-only accessor used by the template. */\r\n protected readonly currentValue = this.#internalValue.asReadonly();\r\n protected readonly isEmpty = computed(() => this.#internalValue().length === 0);\r\n\r\n readonly #announcer = inject(LiveAnnouncer);\r\n\r\n constructor() {\r\n // The parent drives the value declaratively via [value].\r\n effect(() => {\r\n this.#internalValue.set(this.value() ?? []);\r\n });\r\n }\r\n\r\n protected add(event: MatChipInputEvent): void {\r\n const value = (event.value || '').trim();\r\n event.chipInput?.clear();\r\n if (!value) {\r\n return;\r\n }\r\n const current = this.#internalValue();\r\n if (current.includes(value)) {\r\n this.#announcer.announce(`value ${value} already exists`);\r\n return;\r\n }\r\n this.#commit([...current, value]);\r\n }\r\n\r\n protected edit(segment: string, event: MatChipEditedEvent): void {\r\n const newValue = event.value.trim();\r\n if (!newValue) {\r\n this.remove(segment);\r\n return;\r\n }\r\n this.#commit(this.#internalValue().map((s) => (s === segment ? newValue : s)));\r\n }\r\n\r\n protected remove(segment: string): void {\r\n const current = this.#internalValue();\r\n if (!current.includes(segment)) {\r\n return;\r\n }\r\n this.#announcer.announce(`Removed ${segment}`);\r\n this.#commit(current.filter((s) => s !== segment));\r\n }\r\n\r\n #commit(next: readonly string[]): void {\r\n const snapshot = [...next];\r\n this.#internalValue.set(snapshot);\r\n this.valueChange.emit(snapshot);\r\n }\r\n}\r\n","@if (isEmpty()) {\r\n<lib-empty-state icon=\"label_off\" message=\"No options yet — type below to add one\" />\r\n}\r\n\r\n<mat-chip-grid\r\n #chipGrid\r\n class=\"lib-chip-options-creator-editor__grid\"\r\n [disabled]=\"disabled()\"\r\n aria-label=\"Chip options\">\r\n @for (segment of currentValue(); track $index) {\r\n <mat-chip-row\r\n class=\"lib-chip-options-creator-editor__chip\"\r\n [editable]=\"true\"\r\n [aria-description]=\"'press enter to edit ' + segment\"\r\n (edited)=\"edit(segment, $event)\"\r\n (removed)=\"remove(segment)\">\r\n {{ segment }}\r\n <button matChipRemove [attr.aria-label]=\"'remove ' + segment\">\r\n <mat-icon>cancel</mat-icon>\r\n </button>\r\n </mat-chip-row>\r\n }\r\n <input\r\n class=\"lib-chip-options-creator-editor__input\"\r\n [placeholder]=\"placeholder() || 'New selection...'\"\r\n [matChipInputFor]=\"chipGrid\"\r\n [matChipInputSeparatorKeyCodes]=\"separatorKeysCodes\"\r\n [matChipInputAddOnBlur]=\"true\"\r\n (matChipInputTokenEnd)=\"add($event)\" />\r\n</mat-chip-grid>\r\n"],"names":["i1"],"mappings":";;;;;;;;;;AAkBA;;;;;;;;AAQG;MAaU,iCAAiC,CAAA;;AAoBnC,IAAA,cAAc;AAKd,IAAA,UAAU;AAEnB,IAAA,WAAA,GAAA;;AAzBS,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAqB,SAAS,yEAAC;;AAEzC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAEhC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,+EAAC;;AAEhC,QAAA,IAAA,CAAA,MAAM,GAAG,KAAK,CAAoC,EAAE,6EAAC;;AAErD,QAAA,IAAA,CAAA,KAAK,GA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AC,EAAA,eAAA,EAG5C,uBAAuB,CAAC,MAAM,EAAA,aAAA,EAChC,iBAAiB,CAAC,QAAQ,EAAA,IAAA,EACnC;AACJ,wBAAA,OAAO,EAAE,iCAAiC;AAC1C,wBAAA,WAAW,EAAE,MAAM;AACpB,qBAAA,EAAA,QAAA,EAAA,okCAAA,EAAA,MAAA,EAAA,CAAA,4pDAAA,CAAA,EAAA;;;;;"}
@@ -0,0 +1,99 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, ElementRef, DestroyRef, signal, afterNextRender, Directive } from '@angular/core';
3
+
4
+ const sharedByWindow = new WeakMap();
5
+ function sharedObserversFor(view) {
6
+ const existing = sharedByWindow.get(view);
7
+ if (existing)
8
+ return existing;
9
+ const measures = new WeakMap();
10
+ const resize = new view.ResizeObserver((entries) => {
11
+ for (const entry of entries)
12
+ measures.get(entry.target)?.();
13
+ });
14
+ const mutation = new view.MutationObserver((records) => {
15
+ const touched = new Set();
16
+ for (const record of records) {
17
+ // A text-node change reports the text node; walk up to the probed host.
18
+ let node = record.target;
19
+ while (node) {
20
+ const measure = node instanceof view.Element ? measures.get(node) : undefined;
21
+ if (measure) {
22
+ touched.add(measure);
23
+ break;
24
+ }
25
+ node = node.parentNode;
26
+ }
27
+ }
28
+ touched.forEach((measure) => measure());
29
+ });
30
+ const shared = { resize, mutation, measures };
31
+ sharedByWindow.set(view, shared);
32
+ return shared;
33
+ }
34
+ /**
35
+ * Reports whether its host's text is visually clamped (a `line-clamp` cell cut
36
+ * off with an ellipsis), measured as `scrollHeight > clientHeight` rather than
37
+ * guessed from a character count. The read-only table uses it to give exactly
38
+ * the clamped cells — and no others — a tooltip and a keyboard focus stop.
39
+ *
40
+ * Re-measures when the box resizes (column width, viewport, font load) and
41
+ * when the text inside it changes. Measures nothing on the server or where
42
+ * `ResizeObserver` is missing, in which case `clamped()` stays `false` and the
43
+ * cell simply shows its two lines.
44
+ *
45
+ * @example
46
+ * <span class="clamped-2" libClampProbe #probe="libClampProbe">{{ text }}</span>
47
+ * @if (probe.clamped()) { … }
48
+ *
49
+ * @internal
50
+ */
51
+ class ClampProbeDirective {
52
+ #host;
53
+ #destroyRef;
54
+ #clamped;
55
+ constructor() {
56
+ this.#host = inject(ElementRef);
57
+ this.#destroyRef = inject(DestroyRef);
58
+ this.#clamped = signal(false, ...(ngDevMode ? [{ debugName: "#clamped" }] : /* istanbul ignore next */ []));
59
+ /** True while the host's content overflows its clamped box, i.e. part of the text is hidden. */
60
+ this.clamped = this.#clamped.asReadonly();
61
+ afterNextRender(() => this.#observe());
62
+ }
63
+ /** Starts measuring through the window's shared observers; the host is released on destroy. */
64
+ #observe() {
65
+ const element = this.#host.nativeElement;
66
+ const view = element.ownerDocument.defaultView;
67
+ if (!view || typeof view.ResizeObserver === 'undefined' || typeof view.MutationObserver === 'undefined') {
68
+ return;
69
+ }
70
+ const measure = () => {
71
+ // A one-pixel tolerance absorbs sub-pixel rounding of the line box.
72
+ this.#clamped.set(element.scrollHeight - element.clientHeight > 1);
73
+ };
74
+ const shared = sharedObserversFor(view);
75
+ shared.measures.set(element, measure);
76
+ shared.resize.observe(element);
77
+ // The text can change without the clamped box changing size (two lines stay two lines).
78
+ shared.mutation.observe(element, { childList: true, characterData: true, subtree: true });
79
+ measure();
80
+ this.#destroyRef.onDestroy(() => {
81
+ shared.resize.unobserve(element);
82
+ shared.measures.delete(element);
83
+ // MutationObserver has no per-target unobserve; a detached host stops producing
84
+ // records, and the WeakMap entry is gone, so a late record is a no-op.
85
+ });
86
+ }
87
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ClampProbeDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
88
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.12", type: ClampProbeDirective, isStandalone: true, selector: "[libClampProbe]", exportAs: ["libClampProbe"], ngImport: i0 }); }
89
+ }
90
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: ClampProbeDirective, decorators: [{
91
+ type: Directive,
92
+ args: [{
93
+ selector: '[libClampProbe]',
94
+ exportAs: 'libClampProbe',
95
+ }]
96
+ }], ctorParameters: () => [] });
97
+
98
+ export { ClampProbeDirective };
99
+ //# sourceMappingURL=ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-view/clamp-probe.directive.ts"],"sourcesContent":["import { DestroyRef, Directive, ElementRef, afterNextRender, inject, signal } from '@angular/core';\n\n/** Re-measures one probed element. */\ntype Measure = () => void;\n\n/**\n * One ResizeObserver and one MutationObserver per window, shared by every probe:\n * a line-item table can hold hundreds of read-only cells, and an observer pair\n * per cell is wasteful. Each probed host is keyed to its own measure callback.\n */\ninterface SharedObservers {\n readonly resize: ResizeObserver;\n readonly mutation: MutationObserver;\n readonly measures: WeakMap<Element, Measure>;\n}\n\nconst sharedByWindow = new WeakMap<Window, SharedObservers>();\n\nfunction sharedObserversFor(view: Window & typeof globalThis): SharedObservers {\n const existing = sharedByWindow.get(view);\n if (existing) return existing;\n const measures = new WeakMap<Element, Measure>();\n const resize = new view.ResizeObserver((entries) => {\n for (const entry of entries) measures.get(entry.target)?.();\n });\n const mutation = new view.MutationObserver((records) => {\n const touched = new Set<Measure>();\n for (const record of records) {\n // A text-node change reports the text node; walk up to the probed host.\n let node: Node | null = record.target;\n while (node) {\n const measure = node instanceof view.Element ? measures.get(node) : undefined;\n if (measure) {\n touched.add(measure);\n break;\n }\n node = node.parentNode;\n }\n }\n touched.forEach((measure) => measure());\n });\n const shared: SharedObservers = { resize, mutation, measures };\n sharedByWindow.set(view, shared);\n return shared;\n}\n\n/**\n * Reports whether its host's text is visually clamped (a `line-clamp` cell cut\n * off with an ellipsis), measured as `scrollHeight > clientHeight` rather than\n * guessed from a character count. The read-only table uses it to give exactly\n * the clamped cells — and no others — a tooltip and a keyboard focus stop.\n *\n * Re-measures when the box resizes (column width, viewport, font load) and\n * when the text inside it changes. Measures nothing on the server or where\n * `ResizeObserver` is missing, in which case `clamped()` stays `false` and the\n * cell simply shows its two lines.\n *\n * @example\n * <span class=\"clamped-2\" libClampProbe #probe=\"libClampProbe\">{{ text }}</span>\n * @if (probe.clamped()) { … }\n *\n * @internal\n */\n@Directive({\n selector: '[libClampProbe]',\n exportAs: 'libClampProbe',\n})\nexport class ClampProbeDirective {\n readonly #host = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly #destroyRef = inject(DestroyRef);\n readonly #clamped = signal(false);\n\n /** True while the host's content overflows its clamped box, i.e. part of the text is hidden. */\n readonly clamped = this.#clamped.asReadonly();\n\n constructor() {\n afterNextRender(() => this.#observe());\n }\n\n /** Starts measuring through the window's shared observers; the host is released on destroy. */\n #observe(): void {\n const element = this.#host.nativeElement;\n const view = element.ownerDocument.defaultView;\n if (!view || typeof view.ResizeObserver === 'undefined' || typeof view.MutationObserver === 'undefined') {\n return;\n }\n\n const measure = (): void => {\n // A one-pixel tolerance absorbs sub-pixel rounding of the line box.\n this.#clamped.set(element.scrollHeight - element.clientHeight > 1);\n };\n\n const shared = sharedObserversFor(view);\n shared.measures.set(element, measure);\n shared.resize.observe(element);\n // The text can change without the clamped box changing size (two lines stay two lines).\n shared.mutation.observe(element, { childList: true, characterData: true, subtree: true });\n measure();\n\n this.#destroyRef.onDestroy(() => {\n shared.resize.unobserve(element);\n shared.measures.delete(element);\n // MutationObserver has no per-target unobserve; a detached host stops producing\n // records, and the WeakMap entry is gone, so a late record is a no-op.\n });\n }\n}\n"],"names":[],"mappings":";;;AAgBA,MAAM,cAAc,GAAG,IAAI,OAAO,EAA2B;AAE7D,SAAS,kBAAkB,CAAC,IAAgC,EAAA;IAC1D,MAAM,QAAQ,GAAG,cAAc,CAAC,GAAG,CAA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AC;;;AAGjC,QAAA,CAAC,CAAC;IACJ;+GAtCW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAAnB,mBAAmB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAAnB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AAC1B,iBAAA;;;;;"}
@@ -14,7 +14,7 @@ import { MatCardModule } from '@angular/material/card';
14
14
  import * as i5 from '@angular/material/tooltip';
15
15
  import { MatTooltipModule } from '@angular/material/tooltip';
16
16
  import { Subject } from 'rxjs';
17
- import { P as PREDICATE_OPERATORS, r as referencedTokens, i as evaluatePredicate, h as parseConditions, j as emptyCondition, s as serializeConditions, k as deriveObservedInputs } from './ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs';
17
+ import { P as PREDICATE_OPERATORS, r as referencedTokens, l as evaluatePredicate, k as parseConditions, m as emptyCondition, s as serializeConditions, n as deriveObservedInputs } from './ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs';
18
18
 
19
19
  /**
20
20
  * Internal editor implementing `MatFormFieldControl<ConditionalInputRule[]>` for
@@ -510,4 +510,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
510
510
  }], mapToData: [{ type: i0.Input, args: [{ isSignal: true, alias: "mapToData", required: false }] }], formInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "formInputs", required: false }] }], valueChanged: [{ type: i0.Output, args: ["valueChanged"] }] } });
511
511
 
512
512
  export { ConditionalDisplayConfigComponent };
513
- //# sourceMappingURL=ngx-t-forms-conditional-display-config.component-zauBVptA.mjs.map
513
+ //# sourceMappingURL=ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-t-forms-conditional-display-config.component-zauBVptA.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/conditional-display-config/conditional-display-config.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/conditional-display-config/conditional-display-config.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n type OnChanges,\n type OnDestroy,\n type SimpleChanges,\n ViewEncapsulation,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport type { ConditionalInputRule, FormColumnInputs } from 'ngx-t-forms-types';\nimport { CalculationFunctions, InputDataTypes, InputTypes } from 'ngx-t-forms-types';\n\nimport { CommonModule } from '@angular/common';\nimport { NgControl } from '@angular/forms';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { MatCardModule } from '@angular/material/card';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { Subject } from 'rxjs';\n\nimport { evaluatePredicate } from '../../../../shared/functions/array-access/predicate-dsl';\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\nimport {\n type FieldBinding,\n PREDICATE_OPERATORS,\n type ValidatorCondition,\n type ValidatorConditionGroup,\n deriveObservedInputs,\n emptyCondition,\n parseConditions,\n referencedTokens,\n serializeConditions,\n} from '../validators-config/validator-condition';\n\n/** A selectable field in the condition builder's field/value dropdowns. */\ninterface FieldOption {\n readonly variable: string;\n readonly label: string;\n readonly isSelf: boolean;\n /** A multiple-input column (lives inside a repeatable group). */\n readonly isMultiple: boolean;\n /** Whether the field holds a numeric value (gates numeric aggregates). */\n readonly numeric: boolean;\n /** The input read at runtime: a primary input id, or a list sub-item id. */\n readonly inputId: string;\n /** Row-array container id, for multiple-input columns. */\n readonly parentInputId?: string;\n}\n\n/** A friendly aggregate choice shown for a referenced list field. */\ninterface AggregateOption {\n readonly value: CalculationFunctions;\n readonly label: string;\n}\n\n/**\n * Internal editor implementing `MatFormFieldControl<ConditionalInputRule[]>` for\n * authoring a form input's **conditional display** rule.\n *\n * ### Relationship to `validators-config`\n *\n * This is `validators-config` minus `message` and `canOverride`, and minus the\n * multi-rule chip list. It reuses that editor's condition model verbatim —\n * `parseConditions` / `serializeConditions` / `emptyCondition` /\n * `deriveObservedInputs` / `PREDICATE_OPERATORS` — so an author who has written\n * a validator already knows how to write a display rule, and the engine reads\n * both through the same `readDep` dependency model.\n *\n * The one thing that differs is **polarity**, and the copy in the template leans\n * on it hard because getting it backwards is the obvious authoring mistake:\n *\n * | | Expression `true` means |\n * |---|---|\n * | a validator | the entry is **invalid** |\n * | a display rule | the field is **shown** |\n *\n * ### Why exactly one rule\n *\n * `conditionalInputConfig` is an array, and the engine combines multiple rules\n * with AND. This editor deliberately authors a **single** rule: the guided\n * builder already composes many conditions with All/Any inside one expression,\n * so a second rule would add a second, less visible combination layer that means\n * something subtly different. Keeping it to one makes the AND-across-rules\n * semantics unreachable through the UI — it exists only for hand-authored\n * configuration.\n *\n * ### Committing\n *\n * Unlike the validator editor there is no draft/Save cycle: with one rule and no\n * message to compose, every change commits immediately. A half-built condition\n * serialises to an empty expression, which the engine treats as *no rule* — so\n * an incomplete edit leaves the field visible rather than making it vanish\n * mid-authoring.\n *\n * NOTE: `MatFormFieldControl<T>` mandates plain mutable `value` / `disabled` /\n * `required` / `placeholder` / `id` members, `@Input()` decorators, the\n * `focused` / `touched` / `stateChanges` members, and the `useExisting`\n * provider. These are framework wiring, not defects — the CLAUDE.md bans on\n * `@Input()` / `useExisting` do not apply to MatFormFieldControl integration.\n */\n@Component({\n selector: 'lib-conditional-display-config',\n templateUrl: './conditional-display-config.component.html',\n styleUrls: ['./conditional-display-config.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n imports: [\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatButtonToggleModule,\n MatCardModule,\n MatTooltipModule,\n ],\n providers: [{ provide: MatFormFieldControl, useExisting: ConditionalDisplayConfigComponent }],\n host: {\n 'class': 'lib-conditional-display-config',\n '[attr.id]': 'id',\n },\n})\nexport class ConditionalDisplayConfigComponent\n implements MatFormFieldControl<ConditionalInputRule[]>, OnChanges, OnDestroy {\n static nextId = 0;\n\n /** Emits whenever a piece of `MatFormFieldControl` state changes. */\n readonly stateChanges = new Subject<void>();\n readonly controlType = 'lib-conditional-display-config';\n\n id = `lib-conditional-display-config-${ConditionalDisplayConfigComponent.nextId++}`;\n placeholder = '';\n focused = false;\n touched = false;\n required = false;\n describedBy = '';\n autofilled: boolean | undefined = undefined;\n userAriaDescribedBy: string | undefined = undefined;\n disableAutomaticLabeling: boolean | undefined = undefined;\n\n /** Whether the editor is inert. Kept as `@Input()` for the MFC contract. */\n @Input() disabled = false;\n /** Current rule list. Kept as `@Input()` for the MFC contract. */\n @Input() value: ConditionalInputRule[] = [];\n /** Validation errors surfaced by the parent for error-state derivation. */\n @Input() errors: IConfigElementError[] | undefined = [];\n\n /** The input that owns this rule (for multiple-input scopes + self-labelling). */\n readonly mapToData = input<FormColumnInputs | undefined>(undefined);\n /** Available form inputs offered as variables. */\n readonly formInputs = input<Array<FormColumnInputs>>([]);\n\n /** Emits the full rule list whenever it changes. */\n readonly valueChanged = output<ConditionalInputRule[]>();\n\n /** Operator choices shared with the validator + array-access builders. */\n protected readonly operators = PREDICATE_OPERATORS;\n\n /** Aggregate choices for a list field, with non-technical labels. */\n protected readonly aggregates: readonly AggregateOption[] = [\n { value: CalculationFunctions.Sum, label: 'total' },\n { value: CalculationFunctions.Avg, label: 'average' },\n { value: CalculationFunctions.Min, label: 'lowest' },\n { value: CalculationFunctions.Max, label: 'highest' },\n { value: CalculationFunctions.Count, label: 'count' },\n ];\n\n readonly #elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n /** Guided builder model mirroring the current expression. */\n readonly #group = signal<ValidatorConditionGroup>({ connector: '&&', conditions: [] });\n protected readonly group = this.#group.asReadonly();\n\n /** Whether the rule is being edited as a raw expression instead of guided rows. */\n readonly #raw = signal(false);\n protected readonly raw = this.#raw.asReadonly();\n\n /** The live expression text. Mirrors `value[0].expression`. */\n readonly #expression = signal('');\n protected readonly expression = this.#expression.asReadonly();\n\n /** Chosen aggregate per referenced list variable (keyed by variable name). */\n readonly #functions = signal<Record<string, CalculationFunctions>>({});\n\n /**\n * The list this editor last emitted. Used to tell an incoming `value` binding\n * that is genuinely new (a different input opened for editing) from the echo\n * of our own commit — re-seeding on the echo would rebuild the guided model\n * from the serialised text on every keystroke and fight the user's edit.\n */\n #lastCommitted: ConditionalInputRule[] | undefined;\n\n /**\n * Fields the builder can reference: every primary input plus every\n * multiple-input column. `inputId` resolves to the composite id for a sub-row\n * field, which is exactly the key the engine's visibility map uses — the same\n * resolution the validator editor already relies on.\n */\n protected readonly fieldOptions = computed<readonly FieldOption[]>(() => {\n const self = this.mapToData();\n const selfId = self?.id;\n const options: FieldOption[] = [];\n for (const input of this.formInputs()) {\n if (!input.formControlName) continue;\n const group = input.multipleInputInEditId;\n options.push({\n variable: input.formControlName,\n label: input.label || input.formControlName,\n isSelf: input.id === selfId,\n isMultiple: !!group,\n numeric: this.#isNumeric(input),\n inputId: group ? input.id : (input.originalId ?? input.id),\n parentInputId: group,\n });\n }\n return options;\n });\n\n /**\n * Primary (scalar) fields, minus this input itself.\n *\n * A display rule that references its own field can never fire: the engine's\n * self-edge guard resolves the owning input to `undefined` BEFORE the\n * visibility gate (it has to, or evaluating `vis(X)` would recurse into\n * `vis(X)`). Offering it would let an author build a rule that silently never\n * matches, so it is not offered.\n */\n protected readonly directFields = computed<readonly FieldOption[]>(() =>\n this.fieldOptions().filter((f) => !f.isMultiple && !f.isSelf),\n );\n\n /** Multiple-input columns, for the second dropdown group. */\n protected readonly listFields = computed<readonly FieldOption[]>(() =>\n this.fieldOptions().filter((f) => f.isMultiple && !f.isSelf),\n );\n\n /** Field option keyed by its expression variable, for operand lookups. */\n readonly #fieldByVariable = computed<ReadonlyMap<string, FieldOption>>(\n () => new Map(this.fieldOptions().map((f) => [f.variable, f])),\n );\n\n /** Multiple-input columns actually referenced by the current expression. */\n protected readonly referencedListFields = computed<readonly FieldOption[]>(() => {\n const tokens = referencedTokens(this.#expression());\n return this.listFields().filter((f) => tokens.has(f.variable));\n });\n\n /**\n * Multiple-input variables that MUST be aggregated: a list column compared\n * against a non-list operand has to be reduced to a single value. In raw mode\n * operand pairing cannot be analysed, so every referenced list column counts.\n */\n protected readonly requiredAggregateVariables = computed<ReadonlySet<string>>(() => {\n if (this.#raw()) {\n return new Set(this.referencedListFields().map((f) => f.variable));\n }\n const byVariable = this.#fieldByVariable();\n const required = new Set<string>();\n for (const cond of this.#group().conditions) {\n const left = byVariable.get(cond.field);\n const right = cond.compareTo === 'field' ? byVariable.get(cond.value) : undefined;\n const leftMultiple = !!left?.isMultiple;\n const rightMultiple = !!right?.isMultiple;\n if (leftMultiple && !rightMultiple) required.add(cond.field);\n if (rightMultiple && !leftMultiple && right) required.add(right.variable);\n }\n return required;\n });\n\n /** Aggregates offered for a field: numeric columns get all, others only count. */\n protected aggregatesFor(field: FieldOption): readonly AggregateOption[] {\n return field.numeric\n ? this.aggregates\n : this.aggregates.filter((a) => a.value === CalculationFunctions.Count);\n }\n\n /** Whether a referenced list column is required to have an aggregate. */\n protected isAggregateRequired(variable: string): boolean {\n return this.requiredAggregateVariables().has(variable);\n }\n\n /** Human-readable syntax error for the raw editor, or `null` when valid/empty. */\n protected readonly syntaxError = computed<string | null>(() => {\n const expression = this.#expression();\n if (expression.trim() === '') return null;\n try {\n evaluatePredicate(expression, {});\n return null;\n } catch (error: unknown) {\n return error instanceof Error ? error.message : 'The expression syntax is invalid.';\n }\n });\n\n /** Whether the current expression can be edited in the guided builder. */\n protected readonly canUseGuided = computed<boolean>(\n () => parseConditions(this.#expression(), this.#fieldNameSet()) !== null,\n );\n\n /** Whether a rule is in force right now. */\n protected readonly hasRule = computed<boolean>(() => this.#expression().trim() !== '');\n\n /**\n * Whether the guided builder currently holds a condition that will be DROPPED\n * on serialisation — no field chosen, or a field-vs-field comparison with no\n * right-hand field. The template surfaces this as a one-line pending hint,\n * because the alternative is a silently inert rule: the author adds a row,\n * assumes the field is now conditional, and nothing tells them it is not.\n *\n * A typed value of `''` is NOT incomplete — `x === \"\"` is the legitimate\n * \"while the field is empty\" rule.\n */\n protected readonly hasIncompleteCondition = computed<boolean>(() => {\n if (this.#raw()) return false;\n return this.#group().conditions.some(\n (cond) =>\n cond.field.trim() === '' ||\n (cond.compareTo === 'field' && cond.value.trim() === ''),\n );\n });\n\n // MatFormFieldControl reads these as plain getters during its own change\n // detection, so they stay getters rather than `computed()` signals.\n\n get empty(): boolean {\n return !this.#currentRule();\n }\n\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n get errorState(): boolean {\n const ngControlError = this.ngControl?.errors != null;\n const externalError = (this.errors?.length ?? 0) > 0 && this.touched;\n return ngControlError || externalError;\n }\n\n setDescribedByIds(ids: string[]): void {\n this.describedBy = ids.join(' ');\n const el = this.#elementRef.nativeElement;\n const controlElement = el.querySelector('.lib-conditional-display-config__body');\n controlElement?.setAttribute('aria-describedby', this.describedBy);\n this.stateChanges.next();\n }\n\n onContainerClick(): void {\n this.markAsTouched();\n this.stateChanges.next();\n }\n\n onTouched: () => void = () => { };\n\n markAsTouched(): void {\n if (!this.touched) {\n this.touched = true;\n this.onTouched();\n this.stateChanges.next();\n }\n }\n\n /** Tear down the MFC state stream so subscribers do not leak. */\n ngOnDestroy(): void {\n this.stateChanges.complete();\n }\n\n /**\n * Seeds the guided builder from the bound `value`.\n *\n * Runs in `ngOnChanges`, not from the template and not from a `value` setter,\n * for two reasons:\n *\n * - **Signal writes.** Seeding writes `#group` / `#raw` / `#expression`.\n * Doing that from a template getter throws NG0600 (writing to signals while\n * Angular renders).\n * - **Binding order.** The host template binds `[value]` *before*\n * `[formInputs]`, and parsing an expression into guided rows needs the field\n * list to recognise its variable names. A `value` setter would parse against\n * an empty field set and drop every rule into Advanced mode. `ngOnChanges`\n * runs after the whole binding pass, so both are present.\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (!changes['value']) return;\n if (this.value === this.#lastCommitted) return; // our own echo\n this.#seed();\n }\n\n #seed(): void {\n const rule = this.#currentRule();\n const expression = rule?.expression ?? '';\n this.#expression.set(expression);\n this.#functions.set(this.#functionsFromRule(rule));\n const parsed = parseConditions(expression, this.#fieldNameSet());\n if (parsed) {\n this.#group.set(parsed);\n this.#raw.set(false);\n } else if (expression.trim() !== '') {\n // An expression the guided builder cannot represent (grouping, mixed\n // connectors, negation) opens in Advanced and round-trips unchanged.\n this.#raw.set(true);\n } else {\n this.#group.set({ connector: '&&', conditions: [] });\n this.#raw.set(false);\n }\n }\n\n // ---- guided condition builder ------------------------------------------\n\n /** Switch the All/Any connector joining the conditions. */\n protected setConnector(connector: '&&' | '||'): void {\n this.#applyGroup({ ...this.#group(), connector });\n }\n\n /**\n * Append a fresh, **field-less** condition.\n *\n * The validator editor defaults the field to the input being validated, which\n * is nearly always what its author wants. Here the owning field is explicitly\n * excluded (a rule cannot observe itself), so any default would be an\n * arbitrary pick — and it would not be inert. `serializeConditions` treats a\n * typed value of `''` as complete, because `x === \"\"` is a legitimate \"is\n * empty\" rule, so a pre-filled field would turn a single click on \"Add\n * condition\" into a live rule that starts hiding the field. Leaving the field\n * unset serialises to nothing, so the rule only exists once the author has\n * actually said what it is about.\n */\n protected addCondition(): void {\n const group = this.#group();\n this.#applyGroup({\n ...group,\n conditions: [...group.conditions, emptyCondition('')],\n });\n }\n\n /** Apply a partial change to the condition at `index`. */\n protected updateCondition(index: number, patch: Partial<ValidatorCondition>): void {\n const group = this.#group();\n const conditions = group.conditions.map((c, i) => (i === index ? { ...c, ...patch } : c));\n this.#applyGroup({ ...group, conditions });\n }\n\n /** Flip a condition between comparing to a typed value and another field. */\n protected toggleCompareTo(index: number): void {\n const condition = this.#group().conditions[index];\n if (!condition) return;\n if (condition.compareTo === 'value') {\n const field = this.fieldOptions().find((f) => f.variable !== condition.field && !f.isSelf);\n this.updateCondition(index, { compareTo: 'field', value: field?.variable ?? '' });\n } else {\n this.updateCondition(index, { compareTo: 'value', value: '' });\n }\n }\n\n /** Remove the condition at `index`. */\n protected removeCondition(index: number): void {\n const group = this.#group();\n this.#applyGroup({ ...group, conditions: group.conditions.filter((_, i) => i !== index) });\n }\n\n /**\n * Choose (or clear, by re-clicking) the aggregate that reduces a referenced\n * list field to a single value.\n */\n protected setFunction(variable: string, fn: CalculationFunctions): void {\n this.#functions.update((current) => {\n const next = { ...current };\n if (next[variable] === fn) {\n delete next[variable];\n } else {\n next[variable] = fn;\n }\n return next;\n });\n // The expression text is unchanged, but the observed deps now carry the\n // aggregate — re-commit so inputsObservedForChanges reflects the choice.\n this.#commitExpression(this.#expression());\n }\n\n /** The aggregate currently chosen for a list variable, if any. */\n protected currentFunction(variable: string): CalculationFunctions | undefined {\n return this.#functions()[variable];\n }\n\n /** Replace the raw expression as the user types. */\n protected onExpressionInput(event: Event): void {\n this.#commitExpression((event.target as HTMLTextAreaElement).value);\n }\n\n /** Switch to the raw expression editor. */\n protected useRaw(): void {\n this.#raw.set(true);\n }\n\n /** Switch back to the guided builder, reparsing the current expression. */\n protected useGuided(): void {\n const parsed = parseConditions(this.#expression(), this.#fieldNameSet());\n if (!parsed) return;\n this.#group.set(parsed);\n this.#raw.set(false);\n }\n\n /**\n * Remove the rule entirely — the field becomes unconditionally visible again.\n *\n * Commits an empty array rather than a rule with a blank expression, so the\n * engine builds no visibility signal at all for this input and the form pays\n * nothing for a rule that no longer exists.\n */\n protected clearRule(): void {\n this.#group.set({ connector: '&&', conditions: [] });\n this.#functions.set({});\n this.#expression.set('');\n this.#raw.set(false);\n this.#commit([]);\n }\n\n /** Read the value-event target as a string. */\n protected inputValue(event: Event): string {\n return (event.target as HTMLInputElement | HTMLSelectElement).value;\n }\n\n // ---- internal ----------------------------------------------------------\n\n /** The single rule this editor owns, if one is bound. */\n #currentRule(): ConditionalInputRule | undefined {\n return this.value?.[0];\n }\n\n /** Set of field variable names the builder recognises (for parsing). */\n #fieldNameSet(): ReadonlySet<string> {\n return new Set(this.fieldOptions().map((f) => f.variable));\n }\n\n /** Whether an input carries a numeric data type. */\n #isNumeric(input: FormColumnInputs): boolean {\n return input.dataType === InputDataTypes.Number || input.type === InputTypes.Number;\n }\n\n /** Recover the per-variable aggregate choices from a rule's observed inputs. */\n #functionsFromRule(rule: ConditionalInputRule | undefined): Record<string, CalculationFunctions> {\n const map: Record<string, CalculationFunctions> = {};\n for (const observed of rule?.inputsObservedForChanges ?? []) {\n if (observed.function) map[observed.variable] = observed.function;\n }\n return map;\n }\n\n /** Store a builder change: update the model, then serialise + commit. */\n #applyGroup(next: ValidatorConditionGroup): void {\n this.#group.set(next);\n this.#commitExpression(serializeConditions(next));\n }\n\n /**\n * Write an expression onto the rule, re-deriving its observed-input deps.\n *\n * An expression that serialises to nothing means the author has not finished —\n * commit an empty list so the engine treats the input as unconditional. A\n * half-built rule must never hide the field it is being written on.\n */\n #commitExpression(expression: string): void {\n this.#expression.set(expression);\n if (expression.trim() === '') {\n this.#commit([]);\n return;\n }\n const fields: readonly FieldBinding[] = this.fieldOptions();\n const existing = this.#currentRule();\n const rule: ConditionalInputRule = {\n // Preserve every legacy descriptive field an older form may carry; the\n // engine ignores them, but an external consumer still renders them.\n ...existing,\n id: existing?.id ?? uuidv4(),\n expression,\n inputsObservedForChanges: deriveObservedInputs(expression, fields, this.#functions()),\n };\n this.#commit([rule]);\n }\n\n /** Single mutation path: store the new list and notify the parent. */\n #commit(next: ConditionalInputRule[]): void {\n this.#lastCommitted = next;\n this.value = next;\n this.markAsTouched();\n this.stateChanges.next();\n this.valueChanged.emit([...next]);\n }\n}\n","<section class=\"lib-conditional-display-config__body\">\n @if (!hasRule()) {\n <p class=\"lib-conditional-display-config__hint\">\n Appears only while a condition you define is true. Leave empty to always show.\n </p>\n }\n\n <div class=\"lib-conditional-display-config__condition-head\">\n <span class=\"lib-conditional-display-config__f-label\">Show this field when</span>\n @if (!raw() && group().conditions.length > 1) {\n <mat-button-toggle-group\n class=\"lib-conditional-display-config__seg\"\n [value]=\"group().connector\"\n hideSingleSelectionIndicator\n (change)=\"setConnector($event.value)\"\n aria-label=\"Combine conditions\"\n >\n <mat-button-toggle value=\"&&\">All</mat-button-toggle>\n <mat-button-toggle value=\"||\">Any</mat-button-toggle>\n </mat-button-toggle-group>\n }\n </div>\n\n @if (raw()) {\n <textarea\n class=\"lib-conditional-display-config__control lib-conditional-display-config__textarea lib-conditional-display-config__mono\"\n rows=\"2\"\n [value]=\"expression()\"\n [disabled]=\"disabled\"\n (input)=\"onExpressionInput($event)\"\n aria-label=\"Visibility expression\"\n placeholder='e.g. contactMethod === \"phone\"'\n ></textarea>\n @if (syntaxError(); as error) {\n <p class=\"lib-conditional-display-config__error\">\n <mat-icon class=\"lib-conditional-display-config__error-icon\">error_outline</mat-icon>\n <span>{{ error }}</span>\n </p>\n } @else {\n <p class=\"lib-conditional-display-config__sub-hint\">\n True = shown. Use field names with <code>===</code>, <code>&gt;</code>, <code>includes</code> …\n </p>\n }\n } @else {\n\n @if (fieldOptions().length === 0) {\n <p class=\"lib-conditional-display-config__sub-hint\">\n No other fields available yet — switch to Advanced to type an expression.\n </p>\n }\n\n @for (cond of group().conditions; track $index; let first = $first) {\n @if (!first) {\n <span class=\"lib-conditional-display-config__connector\" aria-hidden=\"true\">\n {{ group().connector === '&&' ? 'and' : 'or' }}\n </span>\n }\n <div class=\"lib-conditional-display-config__cond\">\n <label class=\"lib-conditional-display-config__field\">\n <span class=\"lib-conditional-display-config__f-label\">Field</span>\n <select\n class=\"lib-conditional-display-config__control\"\n [class.lib-conditional-display-config__control--invalid]=\"!cond.field\"\n [disabled]=\"disabled\"\n (change)=\"updateCondition($index, { field: inputValue($event) })\"\n >\n <option value=\"\" disabled [selected]=\"!cond.field\">Choose…</option>\n @if (directFields().length) {\n <optgroup label=\"Fields\">\n @for (f of directFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.field\">{{ f.label }}</option>\n }\n </optgroup>\n }\n @if (listFields().length) {\n <optgroup label=\"List fields\">\n @for (f of listFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.field\">{{ f.label }}</option>\n }\n </optgroup>\n }\n </select>\n </label>\n\n <label class=\"lib-conditional-display-config__field\">\n <span class=\"lib-conditional-display-config__f-label\">Condition</span>\n <select\n class=\"lib-conditional-display-config__control\"\n [disabled]=\"disabled\"\n (change)=\"updateCondition($index, { operator: inputValue($event) })\"\n >\n @for (op of operators; track op.value) {\n <option [value]=\"op.value\" [selected]=\"op.value === cond.operator\">{{ op.label }}</option>\n }\n </select>\n </label>\n\n <div class=\"lib-conditional-display-config__field lib-conditional-display-config__field--value\">\n <span class=\"lib-conditional-display-config__f-label\">\n {{ cond.compareTo === 'field' ? 'Other field' : 'Value' }}\n </span>\n <div class=\"lib-conditional-display-config__value\">\n @if (cond.compareTo === 'field') {\n <select\n class=\"lib-conditional-display-config__control\"\n [class.lib-conditional-display-config__control--invalid]=\"!cond.value\"\n [disabled]=\"disabled\"\n (change)=\"updateCondition($index, { value: inputValue($event) })\"\n >\n <option value=\"\" disabled [selected]=\"!cond.value\">Choose…</option>\n @if (directFields().length) {\n <optgroup label=\"Fields\">\n @for (f of directFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.value\">{{ f.label }}</option>\n }\n </optgroup>\n }\n @if (listFields().length) {\n <optgroup label=\"List fields\">\n @for (f of listFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.value\">{{ f.label }}</option>\n }\n </optgroup>\n }\n </select>\n } @else {\n <input\n class=\"lib-conditional-display-config__control\"\n [value]=\"cond.value\"\n [disabled]=\"disabled\"\n (input)=\"updateCondition($index, { value: inputValue($event) })\"\n placeholder=\"leave empty for “is empty”\"\n />\n }\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__icon-btn\"\n [disabled]=\"disabled\"\n (click)=\"toggleCompareTo($index)\"\n [attr.aria-label]=\"\n cond.compareTo === 'field' ? 'Compare to a typed value' : 'Compare to another field'\n \"\n [matTooltip]=\"\n cond.compareTo === 'field' ? 'Compare to a typed value' : 'Compare to another field'\n \"\n >\n <mat-icon>{{ cond.compareTo === 'field' ? 'edit' : 'link' }}</mat-icon>\n </button>\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__icon-btn\"\n [disabled]=\"disabled\"\n (click)=\"removeCondition($index)\"\n matTooltip=\"Remove condition\"\n aria-label=\"Remove condition\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </div>\n </div>\n }\n\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__link\"\n [disabled]=\"disabled\"\n (click)=\"addCondition()\"\n >\n <mat-icon>add</mat-icon> Add condition\n </button>\n }\n\n @if (hasIncompleteCondition()) {\n <p class=\"lib-conditional-display-config__sub-hint lib-conditional-display-config__sub-hint--pending\">\n <mat-icon class=\"lib-conditional-display-config__pending-icon\">pending</mat-icon>\n <span>Unfinished conditions are ignored — pick a field to activate the rule.</span>\n </p>\n }\n\n @if (referencedListFields().length) {\n <div class=\"lib-conditional-display-config__lists\">\n <span class=\"lib-conditional-display-config__f-label\">Combine each list</span>\n @for (f of referencedListFields(); track f.variable) {\n <div\n class=\"lib-conditional-display-config__list-row\"\n [class.lib-conditional-display-config__list-row--unset]=\"\n isAggregateRequired(f.variable) && !currentFunction(f.variable)\n \"\n >\n <span class=\"lib-conditional-display-config__list-name\">{{ f.label }}</span>\n <div class=\"lib-conditional-display-config__agg\" role=\"group\" [attr.aria-label]=\"'Combine ' + f.label\">\n @for (agg of aggregatesFor(f); track agg.value) {\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__agg-chip\"\n [class.lib-conditional-display-config__agg-chip--on]=\"currentFunction(f.variable) === agg.value\"\n [disabled]=\"disabled\"\n (click)=\"setFunction(f.variable, agg.value)\"\n >\n {{ agg.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n }\n\n @if (hasRule()) {\n <p class=\"lib-conditional-display-config__summary\">\n While hidden, this field is removed from the form — nothing is submitted and\n its validation cannot block.\n </p>\n\n @if (!raw()) {\n <details class=\"lib-conditional-display-config__preview\">\n <summary class=\"lib-conditional-display-config__preview-summary\">Expression</summary>\n <code>{{ expression() }}</code>\n </details>\n }\n }\n\n <div class=\"lib-conditional-display-config__foot\">\n @if (raw()) {\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__link\"\n [disabled]=\"!canUseGuided()\"\n [matTooltip]=\"canUseGuided() ? '' : 'This expression is too advanced for the guided builder'\"\n (click)=\"useGuided()\"\n >\n <mat-icon>view_module</mat-icon> Guided\n </button>\n } @else {\n <button type=\"button\" class=\"lib-conditional-display-config__link\" (click)=\"useRaw()\">\n <mat-icon>code</mat-icon> Advanced\n </button>\n }\n\n @if (hasRule()) {\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__link lib-conditional-display-config__link--danger\"\n [disabled]=\"disabled\"\n matTooltip=\"Remove the rule — the field becomes always visible\"\n (click)=\"clearRule()\"\n >\n <mat-icon>visibility</mat-icon> Always show\n </button>\n }\n </div>\n</section>\n"],"names":["uuidv4","i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;AAkEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;MAqBU,iCAAiC,CAAA;AApB9C,IAAA,WAAA,GAAA;;AAyBW,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QAClC,IAAA,CAAA,WAAW,GAAG,gCAAgC;AAEvD,QAAA,I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A,IAAA,EACrB,aAAa,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACb,gBAAgB,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAC,EAAA,CAAA,UAAA,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,oBAAA,EAAA,4BAAA,EAAA,oBAAA,EAAA,qBAAA,EAAA,qBAAA,EAAA,yBAAA,EAAA,YAAA,EAAA,iBAAA,CAAA,EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAQP,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBApB7C,SAAS;+BACE,gCAAgC,EAAA,eAAA,EAGzB,uBAAuB,CAAC,MAAM,iBAChC,iBAAiB,CAAC,QAAQ,EAAA,OAAA,EAChC;wBACP,YAAY;wBACZ,aAAa;wBACb,eAAe;wBACf,qBAAqB;wBACrB,aAAa;wBACb,gBAAgB;qBACjB,EAAA,SAAA,EACU,CAAC,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAA,iCAAmC,EAAE,CAAC,EAAA,IAAA,EACvF;AACJ,wBAAA,OAAO,EAAE,gCAAgC;AACzC,wBAAA,WAAW,EAAE,IAAI;AAClB,qBAAA,EAAA,QAAA,EAAA,44SAAA,EAAA,MAAA,EAAA,CAAA,igNAAA,CAAA,EAAA;;sBAqBA;;sBAEA;;sBAEA;;;;;"}
1
+ {"version":3,"file":"ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/conditional-display-config/conditional-display-config.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/conditional-display-config/conditional-display-config.component.html"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n type OnChanges,\n type OnDestroy,\n type SimpleChanges,\n ViewEncapsulation,\n computed,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\n\nimport { v4 as uuidv4 } from 'uuid';\n\nimport type { ConditionalInputRule, FormColumnInputs } from 'ngx-t-forms-types';\nimport { CalculationFunctions, InputDataTypes, InputTypes } from 'ngx-t-forms-types';\n\nimport { CommonModule } from '@angular/common';\nimport { NgControl } from '@angular/forms';\nimport { MatFormFieldControl } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { MatCardModule } from '@angular/material/card';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { Subject } from 'rxjs';\n\nimport { evaluatePredicate } from '../../../../shared/functions/array-access/predicate-dsl';\nimport type { IConfigElementError } from '../../t-dynamic-data-edit.component';\nimport {\n type FieldBinding,\n PREDICATE_OPERATORS,\n type ValidatorCondition,\n type ValidatorConditionGroup,\n deriveObservedInputs,\n emptyCondition,\n parseConditions,\n referencedTokens,\n serializeConditions,\n} from '../validators-config/validator-condition';\n\n/** A selectable field in the condition builder's field/value dropdowns. */\ninterface FieldOption {\n readonly variable: string;\n readonly label: string;\n readonly isSelf: boolean;\n /** A multiple-input column (lives inside a repeatable group). */\n readonly isMultiple: boolean;\n /** Whether the field holds a numeric value (gates numeric aggregates). */\n readonly numeric: boolean;\n /** The input read at runtime: a primary input id, or a list sub-item id. */\n readonly inputId: string;\n /** Row-array container id, for multiple-input columns. */\n readonly parentInputId?: string;\n}\n\n/** A friendly aggregate choice shown for a referenced list field. */\ninterface AggregateOption {\n readonly value: CalculationFunctions;\n readonly label: string;\n}\n\n/**\n * Internal editor implementing `MatFormFieldControl<ConditionalInputRule[]>` for\n * authoring a form input's **conditional display** rule.\n *\n * ### Relationship to `validators-config`\n *\n * This is `validators-config` minus `message` and `canOverride`, and minus the\n * multi-rule chip list. It reuses that editor's condition model verbatim —\n * `parseConditions` / `serializeConditions` / `emptyCondition` /\n * `deriveObservedInputs` / `PREDICATE_OPERATORS` — so an author who has written\n * a validator already knows how to write a display rule, and the engine reads\n * both through the same `readDep` dependency model.\n *\n * The one thing that differs is **polarity**, and the copy in the template leans\n * on it hard because getting it backwards is the obvious authoring mistake:\n *\n * | | Expression `true` means |\n * |---|---|\n * | a validator | the entry is **invalid** |\n * | a display rule | the field is **shown** |\n *\n * ### Why exactly one rule\n *\n * `conditionalInputConfig` is an array, and the engine combines multiple rules\n * with AND. This editor deliberately authors a **single** rule: the guided\n * builder already composes many conditions with All/Any inside one expression,\n * so a second rule would add a second, less visible combination layer that means\n * something subtly different. Keeping it to one makes the AND-across-rules\n * semantics unreachable through the UI — it exists only for hand-authored\n * configuration.\n *\n * ### Committing\n *\n * Unlike the validator editor there is no draft/Save cycle: with one rule and no\n * message to compose, every change commits immediately. A half-built condition\n * serialises to an empty expression, which the engine treats as *no rule* — so\n * an incomplete edit leaves the field visible rather than making it vanish\n * mid-authoring.\n *\n * NOTE: `MatFormFieldControl<T>` mandates plain mutable `value` / `disabled` /\n * `required` / `placeholder` / `id` members, `@Input()` decorators, the\n * `focused` / `touched` / `stateChanges` members, and the `useExisting`\n * provider. These are framework wiring, not defects — the CLAUDE.md bans on\n * `@Input()` / `useExisting` do not apply to MatFormFieldControl integration.\n */\n@Component({\n selector: 'lib-conditional-display-config',\n templateUrl: './conditional-display-config.component.html',\n styleUrls: ['./conditional-display-config.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n imports: [\n CommonModule,\n MatIconModule,\n MatButtonModule,\n MatButtonToggleModule,\n MatCardModule,\n MatTooltipModule,\n ],\n providers: [{ provide: MatFormFieldControl, useExisting: ConditionalDisplayConfigComponent }],\n host: {\n 'class': 'lib-conditional-display-config',\n '[attr.id]': 'id',\n },\n})\nexport class ConditionalDisplayConfigComponent\n implements MatFormFieldControl<ConditionalInputRule[]>, OnChanges, OnDestroy {\n static nextId = 0;\n\n /** Emits whenever a piece of `MatFormFieldControl` state changes. */\n readonly stateChanges = new Subject<void>();\n readonly controlType = 'lib-conditional-display-config';\n\n id = `lib-conditional-display-config-${ConditionalDisplayConfigComponent.nextId++}`;\n placeholder = '';\n focused = false;\n touched = false;\n required = false;\n describedBy = '';\n autofilled: boolean | undefined = undefined;\n userAriaDescribedBy: string | undefined = undefined;\n disableAutomaticLabeling: boolean | undefined = undefined;\n\n /** Whether the editor is inert. Kept as `@Input()` for the MFC contract. */\n @Input() disabled = false;\n /** Current rule list. Kept as `@Input()` for the MFC contract. */\n @Input() value: ConditionalInputRule[] = [];\n /** Validation errors surfaced by the parent for error-state derivation. */\n @Input() errors: IConfigElementError[] | undefined = [];\n\n /** The input that owns this rule (for multiple-input scopes + self-labelling). */\n readonly mapToData = input<FormColumnInputs | undefined>(undefined);\n /** Available form inputs offered as variables. */\n readonly formInputs = input<Array<FormColumnInputs>>([]);\n\n /** Emits the full rule list whenever it changes. */\n readonly valueChanged = output<ConditionalInputRule[]>();\n\n /** Operator choices shared with the validator + array-access builders. */\n protected readonly operators = PREDICATE_OPERATORS;\n\n /** Aggregate choices for a list field, with non-technical labels. */\n protected readonly aggregates: readonly AggregateOption[] = [\n { value: CalculationFunctions.Sum, label: 'total' },\n { value: CalculationFunctions.Avg, label: 'average' },\n { value: CalculationFunctions.Min, label: 'lowest' },\n { value: CalculationFunctions.Max, label: 'highest' },\n { value: CalculationFunctions.Count, label: 'count' },\n ];\n\n readonly #elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n readonly ngControl = inject(NgControl, { self: true, optional: true });\n\n /** Guided builder model mirroring the current expression. */\n readonly #group = signal<ValidatorConditionGroup>({ connector: '&&', conditions: [] });\n protected readonly group = this.#group.asReadonly();\n\n /** Whether the rule is being edited as a raw expression instead of guided rows. */\n readonly #raw = signal(false);\n protected readonly raw = this.#raw.asReadonly();\n\n /** The live expression text. Mirrors `value[0].expression`. */\n readonly #expression = signal('');\n protected readonly expression = this.#expression.asReadonly();\n\n /** Chosen aggregate per referenced list variable (keyed by variable name). */\n readonly #functions = signal<Record<string, CalculationFunctions>>({});\n\n /**\n * The list this editor last emitted. Used to tell an incoming `value` binding\n * that is genuinely new (a different input opened for editing) from the echo\n * of our own commit — re-seeding on the echo would rebuild the guided model\n * from the serialised text on every keystroke and fight the user's edit.\n */\n #lastCommitted: ConditionalInputRule[] | undefined;\n\n /**\n * Fields the builder can reference: every primary input plus every\n * multiple-input column. `inputId` resolves to the composite id for a sub-row\n * field, which is exactly the key the engine's visibility map uses — the same\n * resolution the validator editor already relies on.\n */\n protected readonly fieldOptions = computed<readonly FieldOption[]>(() => {\n const self = this.mapToData();\n const selfId = self?.id;\n const options: FieldOption[] = [];\n for (const input of this.formInputs()) {\n if (!input.formControlName) continue;\n const group = input.multipleInputInEditId;\n options.push({\n variable: input.formControlName,\n label: input.label || input.formControlName,\n isSelf: input.id === selfId,\n isMultiple: !!group,\n numeric: this.#isNumeric(input),\n inputId: group ? input.id : (input.originalId ?? input.id),\n parentInputId: group,\n });\n }\n return options;\n });\n\n /**\n * Primary (scalar) fields, minus this input itself.\n *\n * A display rule that references its own field can never fire: the engine's\n * self-edge guard resolves the owning input to `undefined` BEFORE the\n * visibility gate (it has to, or evaluating `vis(X)` would recurse into\n * `vis(X)`). Offering it would let an author build a rule that silently never\n * matches, so it is not offered.\n */\n protected readonly directFields = computed<readonly FieldOption[]>(() =>\n this.fieldOptions().filter((f) => !f.isMultiple && !f.isSelf),\n );\n\n /** Multiple-input columns, for the second dropdown group. */\n protected readonly listFields = computed<readonly FieldOption[]>(() =>\n this.fieldOptions().filter((f) => f.isMultiple && !f.isSelf),\n );\n\n /** Field option keyed by its expression variable, for operand lookups. */\n readonly #fieldByVariable = computed<ReadonlyMap<string, FieldOption>>(\n () => new Map(this.fieldOptions().map((f) => [f.variable, f])),\n );\n\n /** Multiple-input columns actually referenced by the current expression. */\n protected readonly referencedListFields = computed<readonly FieldOption[]>(() => {\n const tokens = referencedTokens(this.#expression());\n return this.listFields().filter((f) => tokens.has(f.variable));\n });\n\n /**\n * Multiple-input variables that MUST be aggregated: a list column compared\n * against a non-list operand has to be reduced to a single value. In raw mode\n * operand pairing cannot be analysed, so every referenced list column counts.\n */\n protected readonly requiredAggregateVariables = computed<ReadonlySet<string>>(() => {\n if (this.#raw()) {\n return new Set(this.referencedListFields().map((f) => f.variable));\n }\n const byVariable = this.#fieldByVariable();\n const required = new Set<string>();\n for (const cond of this.#group().conditions) {\n const left = byVariable.get(cond.field);\n const right = cond.compareTo === 'field' ? byVariable.get(cond.value) : undefined;\n const leftMultiple = !!left?.isMultiple;\n const rightMultiple = !!right?.isMultiple;\n if (leftMultiple && !rightMultiple) required.add(cond.field);\n if (rightMultiple && !leftMultiple && right) required.add(right.variable);\n }\n return required;\n });\n\n /** Aggregates offered for a field: numeric columns get all, others only count. */\n protected aggregatesFor(field: FieldOption): readonly AggregateOption[] {\n return field.numeric\n ? this.aggregates\n : this.aggregates.filter((a) => a.value === CalculationFunctions.Count);\n }\n\n /** Whether a referenced list column is required to have an aggregate. */\n protected isAggregateRequired(variable: string): boolean {\n return this.requiredAggregateVariables().has(variable);\n }\n\n /** Human-readable syntax error for the raw editor, or `null` when valid/empty. */\n protected readonly syntaxError = computed<string | null>(() => {\n const expression = this.#expression();\n if (expression.trim() === '') return null;\n try {\n evaluatePredicate(expression, {});\n return null;\n } catch (error: unknown) {\n return error instanceof Error ? error.message : 'The expression syntax is invalid.';\n }\n });\n\n /** Whether the current expression can be edited in the guided builder. */\n protected readonly canUseGuided = computed<boolean>(\n () => parseConditions(this.#expression(), this.#fieldNameSet()) !== null,\n );\n\n /** Whether a rule is in force right now. */\n protected readonly hasRule = computed<boolean>(() => this.#expression().trim() !== '');\n\n /**\n * Whether the guided builder currently holds a condition that will be DROPPED\n * on serialisation — no field chosen, or a field-vs-field comparison with no\n * right-hand field. The template surfaces this as a one-line pending hint,\n * because the alternative is a silently inert rule: the author adds a row,\n * assumes the field is now conditional, and nothing tells them it is not.\n *\n * A typed value of `''` is NOT incomplete — `x === \"\"` is the legitimate\n * \"while the field is empty\" rule.\n */\n protected readonly hasIncompleteCondition = computed<boolean>(() => {\n if (this.#raw()) return false;\n return this.#group().conditions.some(\n (cond) =>\n cond.field.trim() === '' ||\n (cond.compareTo === 'field' && cond.value.trim() === ''),\n );\n });\n\n // MatFormFieldControl reads these as plain getters during its own change\n // detection, so they stay getters rather than `computed()` signals.\n\n get empty(): boolean {\n return !this.#currentRule();\n }\n\n get shouldLabelFloat(): boolean {\n return this.focused || !this.empty;\n }\n\n get errorState(): boolean {\n const ngControlError = this.ngControl?.errors != null;\n const externalError = (this.errors?.length ?? 0) > 0 && this.touched;\n return ngControlError || externalError;\n }\n\n setDescribedByIds(ids: string[]): void {\n this.describedBy = ids.join(' ');\n const el = this.#elementRef.nativeElement;\n const controlElement = el.querySelector('.lib-conditional-display-config__body');\n controlElement?.setAttribute('aria-describedby', this.describedBy);\n this.stateChanges.next();\n }\n\n onContainerClick(): void {\n this.markAsTouched();\n this.stateChanges.next();\n }\n\n onTouched: () => void = () => { };\n\n markAsTouched(): void {\n if (!this.touched) {\n this.touched = true;\n this.onTouched();\n this.stateChanges.next();\n }\n }\n\n /** Tear down the MFC state stream so subscribers do not leak. */\n ngOnDestroy(): void {\n this.stateChanges.complete();\n }\n\n /**\n * Seeds the guided builder from the bound `value`.\n *\n * Runs in `ngOnChanges`, not from the template and not from a `value` setter,\n * for two reasons:\n *\n * - **Signal writes.** Seeding writes `#group` / `#raw` / `#expression`.\n * Doing that from a template getter throws NG0600 (writing to signals while\n * Angular renders).\n * - **Binding order.** The host template binds `[value]` *before*\n * `[formInputs]`, and parsing an expression into guided rows needs the field\n * list to recognise its variable names. A `value` setter would parse against\n * an empty field set and drop every rule into Advanced mode. `ngOnChanges`\n * runs after the whole binding pass, so both are present.\n */\n ngOnChanges(changes: SimpleChanges): void {\n if (!changes['value']) return;\n if (this.value === this.#lastCommitted) return; // our own echo\n this.#seed();\n }\n\n #seed(): void {\n const rule = this.#currentRule();\n const expression = rule?.expression ?? '';\n this.#expression.set(expression);\n this.#functions.set(this.#functionsFromRule(rule));\n const parsed = parseConditions(expression, this.#fieldNameSet());\n if (parsed) {\n this.#group.set(parsed);\n this.#raw.set(false);\n } else if (expression.trim() !== '') {\n // An expression the guided builder cannot represent (grouping, mixed\n // connectors, negation) opens in Advanced and round-trips unchanged.\n this.#raw.set(true);\n } else {\n this.#group.set({ connector: '&&', conditions: [] });\n this.#raw.set(false);\n }\n }\n\n // ---- guided condition builder ------------------------------------------\n\n /** Switch the All/Any connector joining the conditions. */\n protected setConnector(connector: '&&' | '||'): void {\n this.#applyGroup({ ...this.#group(), connector });\n }\n\n /**\n * Append a fresh, **field-less** condition.\n *\n * The validator editor defaults the field to the input being validated, which\n * is nearly always what its author wants. Here the owning field is explicitly\n * excluded (a rule cannot observe itself), so any default would be an\n * arbitrary pick — and it would not be inert. `serializeConditions` treats a\n * typed value of `''` as complete, because `x === \"\"` is a legitimate \"is\n * empty\" rule, so a pre-filled field would turn a single click on \"Add\n * condition\" into a live rule that starts hiding the field. Leaving the field\n * unset serialises to nothing, so the rule only exists once the author has\n * actually said what it is about.\n */\n protected addCondition(): void {\n const group = this.#group();\n this.#applyGroup({\n ...group,\n conditions: [...group.conditions, emptyCondition('')],\n });\n }\n\n /** Apply a partial change to the condition at `index`. */\n protected updateCondition(index: number, patch: Partial<ValidatorCondition>): void {\n const group = this.#group();\n const conditions = group.conditions.map((c, i) => (i === index ? { ...c, ...patch } : c));\n this.#applyGroup({ ...group, conditions });\n }\n\n /** Flip a condition between comparing to a typed value and another field. */\n protected toggleCompareTo(index: number): void {\n const condition = this.#group().conditions[index];\n if (!condition) return;\n if (condition.compareTo === 'value') {\n const field = this.fieldOptions().find((f) => f.variable !== condition.field && !f.isSelf);\n this.updateCondition(index, { compareTo: 'field', value: field?.variable ?? '' });\n } else {\n this.updateCondition(index, { compareTo: 'value', value: '' });\n }\n }\n\n /** Remove the condition at `index`. */\n protected removeCondition(index: number): void {\n const group = this.#group();\n this.#applyGroup({ ...group, conditions: group.conditions.filter((_, i) => i !== index) });\n }\n\n /**\n * Choose (or clear, by re-clicking) the aggregate that reduces a referenced\n * list field to a single value.\n */\n protected setFunction(variable: string, fn: CalculationFunctions): void {\n this.#functions.update((current) => {\n const next = { ...current };\n if (next[variable] === fn) {\n delete next[variable];\n } else {\n next[variable] = fn;\n }\n return next;\n });\n // The expression text is unchanged, but the observed deps now carry the\n // aggregate — re-commit so inputsObservedForChanges reflects the choice.\n this.#commitExpression(this.#expression());\n }\n\n /** The aggregate currently chosen for a list variable, if any. */\n protected currentFunction(variable: string): CalculationFunctions | undefined {\n return this.#functions()[variable];\n }\n\n /** Replace the raw expression as the user types. */\n protected onExpressionInput(event: Event): void {\n this.#commitExpression((event.target as HTMLTextAreaElement).value);\n }\n\n /** Switch to the raw expression editor. */\n protected useRaw(): void {\n this.#raw.set(true);\n }\n\n /** Switch back to the guided builder, reparsing the current expression. */\n protected useGuided(): void {\n const parsed = parseConditions(this.#expression(), this.#fieldNameSet());\n if (!parsed) return;\n this.#group.set(parsed);\n this.#raw.set(false);\n }\n\n /**\n * Remove the rule entirely — the field becomes unconditionally visible again.\n *\n * Commits an empty array rather than a rule with a blank expression, so the\n * engine builds no visibility signal at all for this input and the form pays\n * nothing for a rule that no longer exists.\n */\n protected clearRule(): void {\n this.#group.set({ connector: '&&', conditions: [] });\n this.#functions.set({});\n this.#expression.set('');\n this.#raw.set(false);\n this.#commit([]);\n }\n\n /** Read the value-event target as a string. */\n protected inputValue(event: Event): string {\n return (event.target as HTMLInputElement | HTMLSelectElement).value;\n }\n\n // ---- internal ----------------------------------------------------------\n\n /** The single rule this editor owns, if one is bound. */\n #currentRule(): ConditionalInputRule | undefined {\n return this.value?.[0];\n }\n\n /** Set of field variable names the builder recognises (for parsing). */\n #fieldNameSet(): ReadonlySet<string> {\n return new Set(this.fieldOptions().map((f) => f.variable));\n }\n\n /** Whether an input carries a numeric data type. */\n #isNumeric(input: FormColumnInputs): boolean {\n return input.dataType === InputDataTypes.Number || input.type === InputTypes.Number;\n }\n\n /** Recover the per-variable aggregate choices from a rule's observed inputs. */\n #functionsFromRule(rule: ConditionalInputRule | undefined): Record<string, CalculationFunctions> {\n const map: Record<string, CalculationFunctions> = {};\n for (const observed of rule?.inputsObservedForChanges ?? []) {\n if (observed.function) map[observed.variable] = observed.function;\n }\n return map;\n }\n\n /** Store a builder change: update the model, then serialise + commit. */\n #applyGroup(next: ValidatorConditionGroup): void {\n this.#group.set(next);\n this.#commitExpression(serializeConditions(next));\n }\n\n /**\n * Write an expression onto the rule, re-deriving its observed-input deps.\n *\n * An expression that serialises to nothing means the author has not finished —\n * commit an empty list so the engine treats the input as unconditional. A\n * half-built rule must never hide the field it is being written on.\n */\n #commitExpression(expression: string): void {\n this.#expression.set(expression);\n if (expression.trim() === '') {\n this.#commit([]);\n return;\n }\n const fields: readonly FieldBinding[] = this.fieldOptions();\n const existing = this.#currentRule();\n const rule: ConditionalInputRule = {\n // Preserve every legacy descriptive field an older form may carry; the\n // engine ignores them, but an external consumer still renders them.\n ...existing,\n id: existing?.id ?? uuidv4(),\n expression,\n inputsObservedForChanges: deriveObservedInputs(expression, fields, this.#functions()),\n };\n this.#commit([rule]);\n }\n\n /** Single mutation path: store the new list and notify the parent. */\n #commit(next: ConditionalInputRule[]): void {\n this.#lastCommitted = next;\n this.value = next;\n this.markAsTouched();\n this.stateChanges.next();\n this.valueChanged.emit([...next]);\n }\n}\n","<section class=\"lib-conditional-display-config__body\">\n @if (!hasRule()) {\n <p class=\"lib-conditional-display-config__hint\">\n Appears only while a condition you define is true. Leave empty to always show.\n </p>\n }\n\n <div class=\"lib-conditional-display-config__condition-head\">\n <span class=\"lib-conditional-display-config__f-label\">Show this field when</span>\n @if (!raw() && group().conditions.length > 1) {\n <mat-button-toggle-group\n class=\"lib-conditional-display-config__seg\"\n [value]=\"group().connector\"\n hideSingleSelectionIndicator\n (change)=\"setConnector($event.value)\"\n aria-label=\"Combine conditions\"\n >\n <mat-button-toggle value=\"&&\">All</mat-button-toggle>\n <mat-button-toggle value=\"||\">Any</mat-button-toggle>\n </mat-button-toggle-group>\n }\n </div>\n\n @if (raw()) {\n <textarea\n class=\"lib-conditional-display-config__control lib-conditional-display-config__textarea lib-conditional-display-config__mono\"\n rows=\"2\"\n [value]=\"expression()\"\n [disabled]=\"disabled\"\n (input)=\"onExpressionInput($event)\"\n aria-label=\"Visibility expression\"\n placeholder='e.g. contactMethod === \"phone\"'\n ></textarea>\n @if (syntaxError(); as error) {\n <p class=\"lib-conditional-display-config__error\">\n <mat-icon class=\"lib-conditional-display-config__error-icon\">error_outline</mat-icon>\n <span>{{ error }}</span>\n </p>\n } @else {\n <p class=\"lib-conditional-display-config__sub-hint\">\n True = shown. Use field names with <code>===</code>, <code>&gt;</code>, <code>includes</code> …\n </p>\n }\n } @else {\n\n @if (fieldOptions().length === 0) {\n <p class=\"lib-conditional-display-config__sub-hint\">\n No other fields available yet — switch to Advanced to type an expression.\n </p>\n }\n\n @for (cond of group().conditions; track $index; let first = $first) {\n @if (!first) {\n <span class=\"lib-conditional-display-config__connector\" aria-hidden=\"true\">\n {{ group().connector === '&&' ? 'and' : 'or' }}\n </span>\n }\n <div class=\"lib-conditional-display-config__cond\">\n <label class=\"lib-conditional-display-config__field\">\n <span class=\"lib-conditional-display-config__f-label\">Field</span>\n <select\n class=\"lib-conditional-display-config__control\"\n [class.lib-conditional-display-config__control--invalid]=\"!cond.field\"\n [disabled]=\"disabled\"\n (change)=\"updateCondition($index, { field: inputValue($event) })\"\n >\n <option value=\"\" disabled [selected]=\"!cond.field\">Choose…</option>\n @if (directFields().length) {\n <optgroup label=\"Fields\">\n @for (f of directFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.field\">{{ f.label }}</option>\n }\n </optgroup>\n }\n @if (listFields().length) {\n <optgroup label=\"List fields\">\n @for (f of listFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.field\">{{ f.label }}</option>\n }\n </optgroup>\n }\n </select>\n </label>\n\n <label class=\"lib-conditional-display-config__field\">\n <span class=\"lib-conditional-display-config__f-label\">Condition</span>\n <select\n class=\"lib-conditional-display-config__control\"\n [disabled]=\"disabled\"\n (change)=\"updateCondition($index, { operator: inputValue($event) })\"\n >\n @for (op of operators; track op.value) {\n <option [value]=\"op.value\" [selected]=\"op.value === cond.operator\">{{ op.label }}</option>\n }\n </select>\n </label>\n\n <div class=\"lib-conditional-display-config__field lib-conditional-display-config__field--value\">\n <span class=\"lib-conditional-display-config__f-label\">\n {{ cond.compareTo === 'field' ? 'Other field' : 'Value' }}\n </span>\n <div class=\"lib-conditional-display-config__value\">\n @if (cond.compareTo === 'field') {\n <select\n class=\"lib-conditional-display-config__control\"\n [class.lib-conditional-display-config__control--invalid]=\"!cond.value\"\n [disabled]=\"disabled\"\n (change)=\"updateCondition($index, { value: inputValue($event) })\"\n >\n <option value=\"\" disabled [selected]=\"!cond.value\">Choose…</option>\n @if (directFields().length) {\n <optgroup label=\"Fields\">\n @for (f of directFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.value\">{{ f.label }}</option>\n }\n </optgroup>\n }\n @if (listFields().length) {\n <optgroup label=\"List fields\">\n @for (f of listFields(); track f.variable) {\n <option [value]=\"f.variable\" [selected]=\"f.variable === cond.value\">{{ f.label }}</option>\n }\n </optgroup>\n }\n </select>\n } @else {\n <input\n class=\"lib-conditional-display-config__control\"\n [value]=\"cond.value\"\n [disabled]=\"disabled\"\n (input)=\"updateCondition($index, { value: inputValue($event) })\"\n placeholder=\"leave empty for “is empty”\"\n />\n }\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__icon-btn\"\n [disabled]=\"disabled\"\n (click)=\"toggleCompareTo($index)\"\n [attr.aria-label]=\"\n cond.compareTo === 'field' ? 'Compare to a typed value' : 'Compare to another field'\n \"\n [matTooltip]=\"\n cond.compareTo === 'field' ? 'Compare to a typed value' : 'Compare to another field'\n \"\n >\n <mat-icon>{{ cond.compareTo === 'field' ? 'edit' : 'link' }}</mat-icon>\n </button>\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__icon-btn\"\n [disabled]=\"disabled\"\n (click)=\"removeCondition($index)\"\n matTooltip=\"Remove condition\"\n aria-label=\"Remove condition\"\n >\n <mat-icon>close</mat-icon>\n </button>\n </div>\n </div>\n </div>\n }\n\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__link\"\n [disabled]=\"disabled\"\n (click)=\"addCondition()\"\n >\n <mat-icon>add</mat-icon> Add condition\n </button>\n }\n\n @if (hasIncompleteCondition()) {\n <p class=\"lib-conditional-display-config__sub-hint lib-conditional-display-config__sub-hint--pending\">\n <mat-icon class=\"lib-conditional-display-config__pending-icon\">pending</mat-icon>\n <span>Unfinished conditions are ignored — pick a field to activate the rule.</span>\n </p>\n }\n\n @if (referencedListFields().length) {\n <div class=\"lib-conditional-display-config__lists\">\n <span class=\"lib-conditional-display-config__f-label\">Combine each list</span>\n @for (f of referencedListFields(); track f.variable) {\n <div\n class=\"lib-conditional-display-config__list-row\"\n [class.lib-conditional-display-config__list-row--unset]=\"\n isAggregateRequired(f.variable) && !currentFunction(f.variable)\n \"\n >\n <span class=\"lib-conditional-display-config__list-name\">{{ f.label }}</span>\n <div class=\"lib-conditional-display-config__agg\" role=\"group\" [attr.aria-label]=\"'Combine ' + f.label\">\n @for (agg of aggregatesFor(f); track agg.value) {\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__agg-chip\"\n [class.lib-conditional-display-config__agg-chip--on]=\"currentFunction(f.variable) === agg.value\"\n [disabled]=\"disabled\"\n (click)=\"setFunction(f.variable, agg.value)\"\n >\n {{ agg.label }}\n </button>\n }\n </div>\n </div>\n }\n </div>\n }\n\n @if (hasRule()) {\n <p class=\"lib-conditional-display-config__summary\">\n While hidden, this field is removed from the form — nothing is submitted and\n its validation cannot block.\n </p>\n\n @if (!raw()) {\n <details class=\"lib-conditional-display-config__preview\">\n <summary class=\"lib-conditional-display-config__preview-summary\">Expression</summary>\n <code>{{ expression() }}</code>\n </details>\n }\n }\n\n <div class=\"lib-conditional-display-config__foot\">\n @if (raw()) {\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__link\"\n [disabled]=\"!canUseGuided()\"\n [matTooltip]=\"canUseGuided() ? '' : 'This expression is too advanced for the guided builder'\"\n (click)=\"useGuided()\"\n >\n <mat-icon>view_module</mat-icon> Guided\n </button>\n } @else {\n <button type=\"button\" class=\"lib-conditional-display-config__link\" (click)=\"useRaw()\">\n <mat-icon>code</mat-icon> Advanced\n </button>\n }\n\n @if (hasRule()) {\n <button\n type=\"button\"\n class=\"lib-conditional-display-config__link lib-conditional-display-config__link--danger\"\n [disabled]=\"disabled\"\n matTooltip=\"Remove the rule — the field becomes always visible\"\n (click)=\"clearRule()\"\n >\n <mat-icon>visibility</mat-icon> Always show\n </button>\n }\n </div>\n</section>\n"],"names":["uuidv4","i1","i2","i3"],"mappings":";;;;;;;;;;;;;;;;;;AAkEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CG;MAqBU,iCAAiC,CAAA;AApB9C,IAAA,WAAA,GAAA;;AAyBW,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,OAAO,EAAQ;QAClC,IAAA,CAAA,WAAW,GAAG,gCAAgC;AAEvD,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,+BAAA,EAAkC,iCAAiC,CAAC,MAAM,EAAE,EAAE;QACnF,IAAA,CAAA,WAAW,GAAG,EAAE;QAChB,IAAA,CAAA,OAAO,GAAG,KAAK;QACf,IAAA,CAAA,OAAO,GAAG,KAAK;QACf,IAAA,CAAA,QAAQ,GAAG,KAAK;QAChB,IAAA,CAAA,WAAW,GAAG,EAAE;QAChB,IAAA,CAAA,UAAU,GAAwB,SAAS;QAC3C,IAAA,CAAA,mBAAmB,GAAuB,SAAS;QACnD,IAAA,CAAA,wBAAwB,GAAwB,SAAS;;QAG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