ngx-t-forms 2.0.31 → 2.0.32

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 (96) hide show
  1. package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs → ngx-t-forms-auto-complete-input-element.component-CaXs4561.mjs} +2 -2
  2. package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-DCKuXHAW.mjs.map → ngx-t-forms-auto-complete-input-element.component-CaXs4561.mjs.map} +1 -1
  3. package/fesm2022/{ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs → ngx-t-forms-basic-input-input-element.component-Dotyd-Qs.mjs} +3 -3
  4. package/fesm2022/{ngx-t-forms-basic-input-input-element.component-Ce4ipSUc.mjs.map → ngx-t-forms-basic-input-input-element.component-Dotyd-Qs.mjs.map} +1 -1
  5. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs → ngx-t-forms-calculated-field-rules.component-BhxT6tRq.mjs} +4 -4
  6. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C5TPddVe.mjs.map → ngx-t-forms-calculated-field-rules.component-BhxT6tRq.mjs.map} +1 -1
  7. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs → ngx-t-forms-chip-options-creator-editor.component-d4QeVhsp.mjs} +4 -4
  8. package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CICQaqz6.mjs.map → ngx-t-forms-chip-options-creator-editor.component-d4QeVhsp.mjs.map} +1 -1
  9. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-Gn8exJ9a.mjs} +2 -2
  10. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-CzisLSIP.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-Gn8exJ9a.mjs.map} +1 -1
  11. package/fesm2022/{ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs → ngx-t-forms-data-source-picker.component-Ebf_if9j.mjs} +6 -6
  12. package/fesm2022/{ngx-t-forms-data-source-picker.component-Dzz_o6fJ.mjs.map → ngx-t-forms-data-source-picker.component-Ebf_if9j.mjs.map} +1 -1
  13. package/fesm2022/{ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs → ngx-t-forms-date-picker-input-element.component-kdinBGRA.mjs} +2 -2
  14. package/fesm2022/{ngx-t-forms-date-picker-input-element.component-CYUbVyzP.mjs.map → ngx-t-forms-date-picker-input-element.component-kdinBGRA.mjs.map} +1 -1
  15. package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs → ngx-t-forms-date-range-picker-input-element.component-4W6uvrDU.mjs} +2 -2
  16. package/fesm2022/{ngx-t-forms-date-range-picker-input-element.component-CmoquQGV.mjs.map → ngx-t-forms-date-range-picker-input-element.component-4W6uvrDU.mjs.map} +1 -1
  17. package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs → ngx-t-forms-document-list-label-config-editor.component-CR6EvgJO.mjs} +3 -3
  18. package/fesm2022/{ngx-t-forms-document-list-label-config-editor.component-CLUOXreG.mjs.map → ngx-t-forms-document-list-label-config-editor.component-CR6EvgJO.mjs.map} +1 -1
  19. package/fesm2022/{ngx-t-forms-document-picker.component-qObjcqhE.mjs → ngx-t-forms-document-picker.component-BThdRFec.mjs} +2 -2
  20. package/fesm2022/{ngx-t-forms-document-picker.component-qObjcqhE.mjs.map → ngx-t-forms-document-picker.component-BThdRFec.mjs.map} +1 -1
  21. package/fesm2022/{ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs → ngx-t-forms-editor-input-element.component-1X6uAPeZ.mjs} +3 -3
  22. package/fesm2022/{ngx-t-forms-editor-input-element.component-BLXlfb6F.mjs.map → ngx-t-forms-editor-input-element.component-1X6uAPeZ.mjs.map} +1 -1
  23. package/fesm2022/{ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs → ngx-t-forms-editor-js-input.component-5MD8wRj0.mjs} +2 -2
  24. package/fesm2022/{ngx-t-forms-editor-js-input.component-BQL0AH7H.mjs.map → ngx-t-forms-editor-js-input.component-5MD8wRj0.mjs.map} +1 -1
  25. package/fesm2022/{ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs → ngx-t-forms-file-upload-input-element.component-BAtuymMY.mjs} +2 -2
  26. package/fesm2022/{ngx-t-forms-file-upload-input-element.component-C7mMeEjF.mjs.map → ngx-t-forms-file-upload-input-element.component-BAtuymMY.mjs.map} +1 -1
  27. package/fesm2022/{ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs → ngx-t-forms-form-input-selector.component-B42xP3jh.mjs} +2 -2
  28. package/fesm2022/{ngx-t-forms-form-input-selector.component-C9u8zq9B.mjs.map → ngx-t-forms-form-input-selector.component-B42xP3jh.mjs.map} +1 -1
  29. package/fesm2022/{ngx-t-forms-form-json-view.component-856Hx1Bg.mjs → ngx-t-forms-form-json-view.component-DnnLXqR0.mjs} +2 -2
  30. package/fesm2022/{ngx-t-forms-form-json-view.component-856Hx1Bg.mjs.map → ngx-t-forms-form-json-view.component-DnnLXqR0.mjs.map} +1 -1
  31. package/fesm2022/{ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs → ngx-t-forms-form-payload-projection.component-Ip9ewB18.mjs} +4 -4
  32. package/fesm2022/{ngx-t-forms-form-payload-projection.component-CDkTuX9S.mjs.map → ngx-t-forms-form-payload-projection.component-Ip9ewB18.mjs.map} +1 -1
  33. package/fesm2022/{ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs → ngx-t-forms-form-section-stepper.component-BPgPfZSy.mjs} +4 -4
  34. package/fesm2022/{ngx-t-forms-form-section-stepper.component-Bs50-nEB.mjs.map → ngx-t-forms-form-section-stepper.component-BPgPfZSy.mjs.map} +1 -1
  35. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs → ngx-t-forms-forms-builder-menu.component-Dv0Dfw79.mjs} +5 -5
  36. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-qrhM0jGL.mjs.map → ngx-t-forms-forms-builder-menu.component-Dv0Dfw79.mjs.map} +1 -1
  37. package/fesm2022/{ngx-t-forms-geo-location.component-Bosp1UzR.mjs → ngx-t-forms-geo-location.component-Bmd84Gcb.mjs} +2 -2
  38. package/fesm2022/{ngx-t-forms-geo-location.component-Bosp1UzR.mjs.map → ngx-t-forms-geo-location.component-Bmd84Gcb.mjs.map} +1 -1
  39. package/fesm2022/{ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs → ngx-t-forms-image-capture-input-element.component-CUd04Ghl.mjs} +2 -2
  40. package/fesm2022/{ngx-t-forms-image-capture-input-element.component-C1g7Z0cK.mjs.map → ngx-t-forms-image-capture-input-element.component-CUd04Ghl.mjs.map} +1 -1
  41. package/fesm2022/ngx-t-forms-index-BcrQ01DQ.mjs +2 -0
  42. package/fesm2022/ngx-t-forms-index-BcrQ01DQ.mjs.map +1 -0
  43. package/fesm2022/{ngx-t-forms-input-custom.component-BkbHFAyR.mjs → ngx-t-forms-input-custom.component-Cn-KH0Lb.mjs} +2 -2
  44. package/fesm2022/{ngx-t-forms-input-custom.component-BkbHFAyR.mjs.map → ngx-t-forms-input-custom.component-Cn-KH0Lb.mjs.map} +1 -1
  45. package/fesm2022/{ngx-t-forms-input-editor.component-BPUOM9kQ.mjs → ngx-t-forms-input-editor.component-DLru1Ezu.mjs} +17 -5
  46. package/fesm2022/ngx-t-forms-input-editor.component-DLru1Ezu.mjs.map +1 -0
  47. package/fesm2022/{ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs → ngx-t-forms-map-mat-options-keys-CVlPdrCO.mjs} +2 -2
  48. package/fesm2022/{ngx-t-forms-map-mat-options-keys-B6hJ7Io5.mjs.map → ngx-t-forms-map-mat-options-keys-CVlPdrCO.mjs.map} +1 -1
  49. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs → ngx-t-forms-mat-chip-list-editor.component-BWisS3Em.mjs} +4 -4
  50. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-c7uZT1sr.mjs.map → ngx-t-forms-mat-chip-list-editor.component-BWisS3Em.mjs.map} +1 -1
  51. package/fesm2022/{ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs → ngx-t-forms-missing-form-configs.component-DxdynZY6.mjs} +2 -2
  52. package/fesm2022/{ngx-t-forms-missing-form-configs.component-DrnH8qdG.mjs.map → ngx-t-forms-missing-form-configs.component-DxdynZY6.mjs.map} +1 -1
  53. package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs → ngx-t-forms-mscoa-chart-toolbar.component-D4Xa_Yi0.mjs} +2 -2
  54. package/fesm2022/{ngx-t-forms-mscoa-chart-toolbar.component-C_abEBQ5.mjs.map → ngx-t-forms-mscoa-chart-toolbar.component-D4Xa_Yi0.mjs.map} +1 -1
  55. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Bo0aDEMy.mjs +447 -0
  56. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-Bo0aDEMy.mjs.map +1 -0
  57. package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs → ngx-t-forms-multiple-input-input-element.component-C8JP3D6r.mjs} +16 -16
  58. package/fesm2022/{ngx-t-forms-multiple-input-input-element.component-C7y1OGPx.mjs.map → ngx-t-forms-multiple-input-input-element.component-C8JP3D6r.mjs.map} +1 -1
  59. package/fesm2022/{ngx-t-forms-ngx-t-forms-u_kigDid.mjs → ngx-t-forms-ngx-t-forms-C2G8_WQk.mjs} +931 -82
  60. package/fesm2022/ngx-t-forms-ngx-t-forms-C2G8_WQk.mjs.map +1 -0
  61. package/fesm2022/{ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs → ngx-t-forms-paginated-selection-table-0OI1ikWW.mjs} +2 -2
  62. package/fesm2022/{ngx-t-forms-paginated-selection-table-AQZSMmhr.mjs.map → ngx-t-forms-paginated-selection-table-0OI1ikWW.mjs.map} +1 -1
  63. package/fesm2022/{ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs → ngx-t-forms-pipeline-generator.component-CZ21sd77.mjs} +3 -3
  64. package/fesm2022/{ngx-t-forms-pipeline-generator.component-DmNSc5aw.mjs.map → ngx-t-forms-pipeline-generator.component-CZ21sd77.mjs.map} +1 -1
  65. package/fesm2022/{ngx-t-forms-record-list-manager.component-CUMMvMch.mjs → ngx-t-forms-record-list-manager.component-CykBq_nW.mjs} +2 -2
  66. package/fesm2022/{ngx-t-forms-record-list-manager.component-CUMMvMch.mjs.map → ngx-t-forms-record-list-manager.component-CykBq_nW.mjs.map} +1 -1
  67. package/fesm2022/{ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs → ngx-t-forms-required-inputs.component-ONbhxVSH.mjs} +2 -2
  68. package/fesm2022/{ngx-t-forms-required-inputs.component-Ch2yNcIS.mjs.map → ngx-t-forms-required-inputs.component-ONbhxVSH.mjs.map} +1 -1
  69. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs → ngx-t-forms-rest-api-call-setup.component-WPUxtY7Q.mjs} +2 -2
  70. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-C_aFtdvW.mjs.map → ngx-t-forms-rest-api-call-setup.component-WPUxtY7Q.mjs.map} +1 -1
  71. package/fesm2022/{ngx-t-forms-section-report.component-BxOhR6C0.mjs → ngx-t-forms-section-report.component-C1w16LYm.mjs} +4 -4
  72. package/fesm2022/{ngx-t-forms-section-report.component-BxOhR6C0.mjs.map → ngx-t-forms-section-report.component-C1w16LYm.mjs.map} +1 -1
  73. package/fesm2022/{ngx-t-forms-select-input-element.component-DbgZdNoe.mjs → ngx-t-forms-select-input-element.component-CWcywuS6.mjs} +8 -8
  74. package/fesm2022/{ngx-t-forms-select-input-element.component-DbgZdNoe.mjs.map → ngx-t-forms-select-input-element.component-CWcywuS6.mjs.map} +1 -1
  75. package/fesm2022/{ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs → ngx-t-forms-selection-options-editor.component-KjbZhc2u.mjs} +4 -4
  76. package/fesm2022/{ngx-t-forms-selection-options-editor.component-Dhln81DL.mjs.map → ngx-t-forms-selection-options-editor.component-KjbZhc2u.mjs.map} +1 -1
  77. package/fesm2022/{ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs → ngx-t-forms-t-workflow-picker.component-CtavFAUq.mjs} +3 -3
  78. package/fesm2022/{ngx-t-forms-t-workflow-picker.component-leBokXvM.mjs.map → ngx-t-forms-t-workflow-picker.component-CtavFAUq.mjs.map} +1 -1
  79. package/fesm2022/{ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs → ngx-t-forms-textarea-input-element.component-DkJkBQif.mjs} +2 -2
  80. package/fesm2022/{ngx-t-forms-textarea-input-element.component-BEbXJjFA.mjs.map → ngx-t-forms-textarea-input-element.component-DkJkBQif.mjs.map} +1 -1
  81. package/fesm2022/{ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs → ngx-t-forms-toggle-input-element.component-Dr7MNli8.mjs} +2 -2
  82. package/fesm2022/{ngx-t-forms-toggle-input-element.component-DDErRUJd.mjs.map → ngx-t-forms-toggle-input-element.component-Dr7MNli8.mjs.map} +1 -1
  83. package/fesm2022/{ngx-t-forms-validators-config.component-oGjQVGE2.mjs → ngx-t-forms-validators-config.component-BknyAmV_.mjs} +8 -167
  84. package/fesm2022/ngx-t-forms-validators-config.component-BknyAmV_.mjs.map +1 -0
  85. package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs → ngx-t-forms-workflow-adjudication.component-CPvwm7f4.mjs} +3 -3
  86. package/fesm2022/{ngx-t-forms-workflow-adjudication.component-CtU8dECN.mjs.map → ngx-t-forms-workflow-adjudication.component-CPvwm7f4.mjs.map} +1 -1
  87. package/fesm2022/ngx-t-forms.mjs +1 -1
  88. package/package.json +2 -2
  89. package/types/ngx-t-forms.d.ts +191 -4
  90. package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs +0 -2
  91. package/fesm2022/ngx-t-forms-index-dDSobs6A.mjs.map +0 -1
  92. package/fesm2022/ngx-t-forms-input-editor.component-BPUOM9kQ.mjs.map +0 -1
  93. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs +0 -336
  94. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-C0qsMfsq.mjs.map +0 -1
  95. package/fesm2022/ngx-t-forms-ngx-t-forms-u_kigDid.mjs.map +0 -1
  96. package/fesm2022/ngx-t-forms-validators-config.component-oGjQVGE2.mjs.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"ngx-t-forms-validators-config.component-oGjQVGE2.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/validators-config/validator-condition.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-dynamic-data-edit/elements/validators-config/validators-config.component.html"],"sourcesContent":["/**\n * @file Round-trip bridge between the guided condition builder in\n * `lib-validators-config` and a custom validator's `expression` **string** plus\n * its `inputsObservedForChanges` dependency list — both part of the frozen\n * {@link FormControlCustomValidatorsInterface} contract.\n *\n * The validator engine evaluates `expression` with the shared predicate DSL\n * ({@link evaluatePredicate}) where **`true` means the field is INVALID**. The\n * scope it evaluates against is `{ [variable]: <whole value of inputId> }` for\n * every entry in `inputsObservedForChanges` (see `build-manual-validation.ts`).\n *\n * Because the grammar is identical to the array-access predicate builder, this\n * module reuses {@link PREDICATE_OPERATORS} so the operator labels stay in lock\n * step with `lib-data-tree`. The model differs in one validator-specific way:\n * the right-hand side of a comparison may be **another field** (e.g. an\n * \"end date is before start date\" rule), not only a typed literal — so the\n * serializer must emit a bare variable token rather than a quoted string in\n * that case.\n *\n * {@link parseConditions} best-effort parses an expression into the structured\n * model; when it cannot (parentheses, mixed `&&`/`||`, unary `!`, an unknown\n * operator), it returns `null` and the UI falls back to the raw editor — power\n * users and legacy expressions are never locked out.\n *\n * @internal\n */\nimport type { CalculationFunctions, InputObservedForChange } from 'ngx-t-forms-types';\n\nimport { PREDICATE_OPERATORS } from '../api-value-access-rules/functions/pipeline-expression';\n\nexport { PREDICATE_OPERATORS };\n\n/**\n * A field the expression can reference, resolved to the dependency it observes.\n * `parentInputId` is the row-array container for a multiple-input column; when\n * an aggregate is chosen for it the binding is emitted as a reduced list value,\n * otherwise it resolves directly (a scalar / per-row read).\n */\nexport interface FieldBinding {\n readonly variable: string;\n readonly inputId: string;\n readonly parentInputId?: string;\n}\n\n/** A single guided comparison: `field operator (value | field)`. */\nexport interface ValidatorCondition {\n /** Left operand — always a referenced field's variable name. */\n field: string;\n /** One of the {@link PREDICATE_OPERATORS} values (`===`, `>`, `includes`, …). */\n operator: string;\n /** Whether the right operand is a typed literal or another field. */\n compareTo: 'value' | 'field';\n /** Literal text, or the variable name of the compared field. */\n value: string;\n}\n\n/** A flat list of conditions joined by a single connector. */\nexport interface ValidatorConditionGroup {\n connector: '&&' | '||';\n conditions: ValidatorCondition[];\n}\n\n/** Canonical operator value keyed by its lower-cased spelling (for parse normalisation). */\nconst OPERATOR_BY_KEY: ReadonlyMap<string, string> = new Map(\n PREDICATE_OPERATORS.map((op) => [op.value.toLowerCase(), op.value]),\n);\n\n/** Symbolic operators, longest-match first so `===` wins over `==`. */\nconst SYMBOLIC_OPS = ['===', '!==', '>=', '<=', '==', '!=', '>', '<'] as const;\n/** Keyword operators (matched case-insensitively, surrounded by whitespace). */\nconst KEYWORD_OPS = ['includes', 'startsWith', 'endsWith', 'matches', 'in'] as const;\n\n/** An empty condition seeded with the given field and a sensible default operator. */\nexport function emptyCondition(field = ''): ValidatorCondition {\n return { field, operator: '===', compareTo: 'value', value: '' };\n}\n\nconst isBareLiteral = (v: string): boolean =>\n v === 'true' || v === 'false' || v === 'null' || (v.trim() !== '' && !Number.isNaN(Number(v)));\n\nconst isQuoted = (v: string): boolean => {\n const t = v.trim();\n if (t.length < 2) return false;\n const a = t[0];\n const b = t[t.length - 1];\n return (a === '\"' && b === '\"') || (a === \"'\" && b === \"'\");\n};\n\nconst unquote = (v: string): string => (isQuoted(v) ? v.trim().slice(1, -1) : v.trim());\n\n/** Formats a literal: bare for numbers/booleans/null, otherwise a quoted, escaped string. */\nfunction formatLiteral(value: string): string {\n const t = value.trim();\n if (t === '') return '\"\"';\n if (isBareLiteral(t)) return t;\n return `\"${t.replace(/\"/g, '\\\\\"')}\"`;\n}\n\n/** The expression token for a condition's right operand. */\nfunction rightToken(condition: ValidatorCondition): string {\n return condition.compareTo === 'field' ? condition.value.trim() : formatLiteral(condition.value);\n}\n\n/** Whether a condition is complete enough to contribute to the expression. */\nfunction isComplete(condition: ValidatorCondition): boolean {\n if (condition.field.trim() === '') return false;\n if (condition.compareTo === 'field') return condition.value.trim() !== '';\n return true;\n}\n\n/**\n * Serialises a condition group into a predicate expression string. Incomplete\n * conditions are dropped, so an empty/half-built group yields `''` (which the\n * editor treats as \"nothing to save yet\").\n */\nexport function serializeConditions(group: ValidatorConditionGroup): string {\n return group.conditions\n .filter(isComplete)\n .map((c) => `${c.field.trim()} ${c.operator} ${rightToken(c)}`)\n .join(` ${group.connector} `);\n}\n\n/** Resolves a raw operator spelling to its canonical {@link PREDICATE_OPERATORS} value, or `null`. */\nfunction canonicalOperator(raw: string): string | null {\n return OPERATOR_BY_KEY.get(raw.toLowerCase()) ?? null;\n}\n\n/** Classifies a raw right-hand operand as a field reference or a literal value. */\nfunction classifyRight(\n raw: string,\n fieldNames: ReadonlySet<string>,\n): Pick<ValidatorCondition, 'compareTo' | 'value'> {\n const t = raw.trim();\n if (isQuoted(t)) return { compareTo: 'value', value: unquote(t) };\n if (fieldNames.has(t)) return { compareTo: 'field', value: t };\n return { compareTo: 'value', value: t };\n}\n\n/** Parses a single `left op right` comparison, or `null` if it is not representable. */\nfunction parseCondition(part: string, fieldNames: ReadonlySet<string>): ValidatorCondition | null {\n const p = part.trim();\n\n for (const op of SYMBOLIC_OPS) {\n const idx = p.indexOf(op);\n if (idx > 0) {\n const operator = canonicalOperator(op);\n if (!operator) return null;\n const field = p.slice(0, idx).trim();\n const right = p.slice(idx + op.length).trim();\n if (field === '' || right === '') return null;\n return { field, operator, ...classifyRight(right, fieldNames) };\n }\n }\n\n for (const kw of KEYWORD_OPS) {\n const m = p.match(new RegExp(`^(.+?)\\\\s+${kw}\\\\s+(.+)$`, 'i'));\n if (m && m[1] && m[2]) {\n const operator = canonicalOperator(kw);\n if (!operator) return null;\n return { field: m[1].trim(), operator, ...classifyRight(m[2], fieldNames) };\n }\n }\n\n return null;\n}\n\n/**\n * Best-effort parse of an expression into a guided condition group. Returns\n * `null` (→ raw editor) for anything the builder cannot represent losslessly:\n * grouping `()`, mixed `&&`/`||`, unary `!`, or an unknown operator.\n */\nexport function parseConditions(\n expression: string,\n fieldNames: ReadonlySet<string>,\n): ValidatorConditionGroup | null {\n const e = expression.trim();\n if (e === '') return { connector: '&&', conditions: [] };\n if (/[()]/.test(e)) return null; // grouping → raw\n if (/!(?!=)/.test(e)) return null; // unary negation (`!field`) → raw\n\n const hasAnd = e.includes('&&');\n const hasOr = e.includes('||');\n if (hasAnd && hasOr) return null; // mixed connectors → raw\n\n const connector: '&&' | '||' = hasOr ? '||' : '&&';\n const parts = hasOr ? e.split('||') : hasAnd ? e.split('&&') : [e];\n\n const conditions: ValidatorCondition[] = [];\n for (const part of parts) {\n const condition = parseCondition(part, fieldNames);\n if (!condition) return null;\n conditions.push(condition);\n }\n return { connector, conditions };\n}\n\n/** Returns the unique identifier tokens referenced in an expression. */\nexport function referencedTokens(expression: string): ReadonlySet<string> {\n return new Set(expression.match(/[A-Za-z_][A-Za-z0-9_]*/g) ?? []);\n}\n\n/**\n * Derives the `inputsObservedForChanges` dependency list from an expression by\n * matching identifier tokens against the editor's resolved {@link FieldBinding}s.\n * Works for both guided and raw expressions, so observed inputs always reflect\n * what the expression actually references — no manual add/remove, no orphans.\n *\n * When an aggregate has been chosen for a field (only possible for a\n * multiple-input column), the binding carries `parentInputId` + `function` so\n * the engine reduces its row array to a scalar. Otherwise it resolves directly\n * (a scalar primary input, or a per-row list value).\n */\nexport function deriveObservedInputs(\n expression: string,\n fields: ReadonlyArray<FieldBinding>,\n functions: Readonly<Record<string, CalculationFunctions>>,\n): InputObservedForChange[] {\n const tokens = referencedTokens(expression);\n const observed: InputObservedForChange[] = [];\n const seen = new Set<string>();\n for (const field of fields) {\n if (!tokens.has(field.variable) || seen.has(field.variable)) continue;\n seen.add(field.variable);\n const aggregate = functions[field.variable];\n if (aggregate && field.parentInputId) {\n observed.push({\n inputId: field.inputId,\n variable: field.variable,\n parentInputId: field.parentInputId,\n function: aggregate,\n });\n } else {\n observed.push({ inputId: field.inputId, variable: field.variable });\n }\n }\n return observed;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n Input,\n type OnDestroy,\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 {\n DraftFormControlCustomValidator,\n FormColumnInputs,\n FormControlCustomValidatorsInterface,\n} 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 { MatChipsModule } from '@angular/material/chips';\nimport { MatCardModule } from '@angular/material/card';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\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 './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<FormControlCustomValidatorsInterface[]>`\n * for authoring a form input's custom validators.\n *\n * Rendered by `t-dynamic-data-edit` inside its `<mat-form-field>`, which supplies\n * the surrounding field label, hint, and validation errors — so this component\n * owns only the validator chip list and the inline draft editor.\n *\n * ### Authoring model\n * A validator's `expression` is evaluated by the shared predicate DSL where\n * **`true` means the field is invalid** (the error message is then shown). The\n * editor captures that condition through a **guided builder** — `field operator\n * value` rows joined by All/Any — that serialises to the expression string and\n * auto-derives `inputsObservedForChanges` from the fields it references. An\n * **Advanced** raw editor is the escape hatch for expressions the builder cannot\n * represent (grouping, mixed connectors, negation); these round-trip unchanged.\n *\n * The bound `value` may contain both string entries (legacy validator-name\n * references such as `'required'`, which are read-only) and object entries\n * ({@link FormControlCustomValidatorsInterface}, which are editable). Only object\n * entries open the draft editor.\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-validators-config',\n templateUrl: './validators-config.component.html',\n styleUrls: ['./validators-config.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.Emulated,\n imports: [\n CommonModule,\n MatIconModule,\n MatChipsModule,\n MatCardModule,\n MatToolbarModule,\n MatButtonModule,\n MatButtonToggleModule,\n MatSlideToggleModule,\n MatTooltipModule,\n ],\n providers: [{ provide: MatFormFieldControl, useExisting: ValidatorsConfigComponent }],\n host: {\n 'class': 'lib-validators-config',\n '[attr.id]': 'id',\n },\n})\nexport class ValidatorsConfigComponent\n implements MatFormFieldControl<FormControlCustomValidatorsInterface[]>, OnDestroy\n{\n static nextId = 0;\n\n /** Emits whenever a piece of `MatFormFieldControl` state changes. */\n readonly stateChanges = new Subject<void>();\n readonly controlType = 'lib-validators-config';\n\n id = `lib-validators-config-${ValidatorsConfigComponent.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 validator list. Kept as `@Input()` for the MFC contract. */\n @Input() value: FormControlCustomValidatorsInterface[] = [];\n /** Validation errors surfaced by the parent for error-state derivation. */\n @Input() errors: IConfigElementError[] | undefined = [];\n\n /** Source input that owns this validator config (for multiple-input scopes). */\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 validator list whenever it changes. */\n readonly valueChanged = output<FormControlCustomValidatorsInterface[]>();\n\n /** Operator choices shared with the array-access predicate builder. */\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 /** Draft currently open in the inline editor, or `null` when closed. */\n readonly #edit = signal<DraftFormControlCustomValidator | null>(null);\n /** Read-only view of the open draft for the template. */\n protected readonly edit = this.#edit.asReadonly();\n\n /** Guided builder model mirroring the open draft's expression. */\n readonly #group = signal<ValidatorConditionGroup>({ connector: '&&', conditions: [] });\n protected readonly group = this.#group.asReadonly();\n\n /** Whether the draft 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 /** Chosen aggregate per referenced list variable (keyed by variable name). */\n readonly #functions = signal<Record<string, CalculationFunctions>>({});\n\n /** Whether the validator being authored lives on a multiple-input sub-item. */\n protected readonly validatorOnList = computed<boolean>(\n () => !!this.mapToData()?.multipleInputInEditId,\n );\n\n /**\n * Fields the builder can reference: every primary input plus every\n * multiple-input column. A multiple column carries its row-array container\n * (`parentInputId`); whether it must be aggregated is decided per condition\n * (see {@link requiredAggregateVariables}), not by the field itself.\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 /** Primary (scalar) fields, for the first dropdown group. */\n protected readonly directFields = computed<readonly FieldOption[]>(() =>\n this.fieldOptions().filter((f) => !f.isMultiple),\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),\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.#edit()?.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 (a primary field or a typed value) has to be\n * reduced to a single value. A list-vs-list comparison leaves the aggregate\n * optional (the columns are row-aligned). In raw mode operand pairing cannot\n * be analysed, so every referenced list column is treated as required.\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 /** Whether every list column that MUST be aggregated has an aggregate chosen. */\n protected readonly aggregatesResolved = computed<boolean>(() => {\n const functions = this.#functions();\n const required = this.requiredAggregateVariables();\n return [...required].every((variable) => !!functions[variable]);\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 /**\n * Whether a guided condition is fully specified (field, operator and a value\n * all set). Incomplete conditions are otherwise silently dropped on save, so\n * this gates {@link canSave}.\n */\n protected isConditionComplete(condition: ValidatorCondition): boolean {\n return (\n condition.field.trim() !== '' &&\n condition.operator.trim() !== '' &&\n condition.value.trim() !== ''\n );\n }\n\n /** Whether the guided builder has at least one condition and all are complete. */\n protected readonly conditionsComplete = computed<boolean>(() => {\n if (this.#raw()) return true; // raw mode is gated by syntaxError + non-empty\n const conditions = this.#group().conditions;\n return conditions.length > 0 && conditions.every((c) => this.isConditionComplete(c));\n });\n\n /** Whether the current draft expression can be edited in the guided builder. */\n protected readonly canUseGuided = computed<boolean>(\n () => parseConditions(this.#edit()?.expression ?? '', this.#fieldNameSet()) !== null,\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.#edit()?.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 open draft can be saved (message, a complete/valid rule, aggregates chosen). */\n protected readonly canSave = computed<boolean>(() => {\n const draft = this.#edit();\n return (\n !!draft &&\n !!draft.message &&\n !!draft.expression &&\n this.syntaxError() === null &&\n this.conditionsComplete() &&\n this.aggregatesResolved()\n );\n });\n\n /** A one-line reason the rule cannot be saved yet, or `null` when it can. */\n protected readonly saveHint = computed<string | null>(() => {\n const draft = this.#edit();\n if (!draft) return null;\n if (!draft.message) return 'Add an error message.';\n if (!this.#raw() && !this.conditionsComplete()) {\n return 'Finish every condition — choose a field, a condition and a value.';\n }\n if (!draft.expression) return 'Add at least one condition.';\n if (this.#raw() && this.syntaxError() !== null) return this.syntaxError();\n if (!this.aggregatesResolved()) return 'Choose how to combine each list field.';\n return null;\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.value.length === 0;\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 const requiredUnset = this.empty && this.required;\n return requiredUnset || 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-validators-config__list');\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 /** `@for` track key: object validators by id, string validators by value. */\n protected trackValidator(\n validator: string | FormControlCustomValidatorsInterface,\n ): string {\n return typeof validator === 'string' ? validator : validator.id;\n }\n\n /** Resolve the label shown on a validator chip. */\n protected validatorLabel(validator: string | FormControlCustomValidatorsInterface): string {\n return typeof validator === 'string' ? validator : validator.message;\n }\n\n /** Whether a validator chip is the one currently being edited. */\n protected isEditing(validator: string | FormControlCustomValidatorsInterface): boolean {\n if (typeof validator === 'string') {\n return false;\n }\n return this.#edit()?.id === validator.id;\n }\n\n /**\n * Open a validator for editing. String entries are read-only legacy\n * references and are ignored. Editing the open validator again closes it.\n * The draft is a clone, so edits only land in `value` on Save.\n *\n * DEFECT FIX (discard semantics): the editor is an inline panel with an\n * explicit Close/Save toolbar, not a transient overlay that vanishes on an\n * outside click. Opening a different validator (or {@link addValidator})\n * deliberately replaces the open draft — an explicit, documented discard,\n * never a silent loss mid-edit.\n */\n protected editV(validator: string | FormControlCustomValidatorsInterface): void {\n if (typeof validator === 'string') {\n return;\n }\n if (this.#edit()?.id === validator.id) {\n this.#edit.set(null);\n return;\n }\n this.#edit.set(this.#cloneValidator(validator));\n this.#initBuilderFromDraft();\n }\n\n /** Begin a brand-new validator draft (id assigned on save). */\n protected addValidator(): void {\n this.#edit.set(this.#emptyDraft());\n this.#initBuilderFromDraft();\n }\n\n /** Discard the open draft without persisting it. */\n protected closeEditor(): void {\n this.#edit.set(null);\n }\n\n /** Remove a validator (string or object) from the list and emit. */\n protected remove(validator: string | FormControlCustomValidatorsInterface): void {\n const next = this.value.filter((item) => !this.#sameValidator(item, validator));\n this.#commit(next);\n if (this.isEditing(validator)) {\n this.#edit.set(null);\n }\n }\n\n /** Update the draft's message, or replace its raw expression as the user types. */\n protected onTextChange(event: Event, key: 'message' | 'expression'): void {\n const value = (event.target as HTMLInputElement).value;\n if (key === 'expression') {\n this.#syncExpression(value);\n return;\n }\n this.#edit.update((draft) => {\n const base = draft ?? this.#emptyDraft();\n return { ...base, message: value };\n });\n }\n\n /** Toggle whether users may override (warn instead of block) this validator. */\n protected setCanOverride(checked: boolean): void {\n this.#edit.update((draft) => (draft ? { ...draft, canOverride: checked } : draft));\n }\n\n /**\n * Persist the open draft. A new draft (no id) is appended with a fresh uuid;\n * an existing draft (has id) replaces the matching entry. Emits the new list.\n */\n protected saveVariable(): void {\n const draft = this.#edit();\n if (!draft || !draft.message || !draft.expression) {\n return;\n }\n if (draft.id !== undefined) {\n const id = draft.id;\n const saved: FormControlCustomValidatorsInterface = { ...draft, id };\n this.#commit(\n this.value.map((item) =>\n typeof item !== 'string' && item.id === id ? saved : item,\n ),\n );\n } else {\n const saved: FormControlCustomValidatorsInterface = { ...draft, id: uuidv4() };\n this.#commit([...this.value, saved]);\n }\n this.#edit.set(null);\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 /** Append a fresh condition, defaulting its field to the owning input. */\n protected addCondition(): void {\n const fallback =\n this.directFields().find((f) => f.isSelf) ??\n this.directFields()[0] ??\n this.fieldOptions()[0];\n const group = this.#group();\n this.#applyGroup({\n ...group,\n conditions: [...group.conditions, emptyCondition(fallback?.variable ?? '')],\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);\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-sync so inputsObservedForChanges reflects the choice.\n this.#syncExpression(this.#edit()?.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 /** 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 if (!this.canUseGuided()) return;\n this.#initGroupFromExpression();\n this.#raw.set(false);\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 #emptyDraft(): DraftFormControlCustomValidator {\n return {\n message: '',\n expression: '',\n canOverride: false,\n inputsObservedForChanges: [],\n };\n }\n\n #cloneValidator(\n validator: FormControlCustomValidatorsInterface,\n ): DraftFormControlCustomValidator {\n return {\n ...validator,\n inputsObservedForChanges: validator.inputsObservedForChanges.map((i) => ({ ...i })),\n };\n }\n\n #sameValidator(\n item: string | FormControlCustomValidatorsInterface,\n target: string | FormControlCustomValidatorsInterface,\n ): boolean {\n if (typeof item === 'string' || typeof target === 'string') {\n return item === target;\n }\n return item.id === target.id;\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 draft's observed inputs. */\n #functionsFromDraft(): Record<string, CalculationFunctions> {\n const map: Record<string, CalculationFunctions> = {};\n for (const observed of this.#edit()?.inputsObservedForChanges ?? []) {\n if (observed.function) map[observed.variable] = observed.function;\n }\n return map;\n }\n\n /** Seed the builder state when a draft opens: guided if parseable, else raw. */\n #initBuilderFromDraft(): void {\n this.#functions.set(this.#functionsFromDraft());\n const parsed = parseConditions(this.#edit()?.expression ?? '', this.#fieldNameSet());\n if (parsed) {\n this.#group.set(parsed);\n this.#raw.set(false);\n } else {\n this.#raw.set(true);\n }\n }\n\n /** Reparse the current draft expression into the guided model. */\n #initGroupFromExpression(): void {\n const parsed = parseConditions(this.#edit()?.expression ?? '', this.#fieldNameSet());\n if (parsed) {\n this.#group.set(parsed);\n }\n }\n\n /** Store a builder change: update the model, then serialise into the draft. */\n #applyGroup(next: ValidatorConditionGroup): void {\n this.#group.set(next);\n this.#syncExpression(serializeConditions(next));\n }\n\n /** Write an expression onto the draft and re-derive its observed-input deps. */\n #syncExpression(expression: string): void {\n const fields: readonly FieldBinding[] = this.fieldOptions();\n const functions = this.#functions();\n this.#edit.update((draft) => {\n const base = draft ?? this.#emptyDraft();\n return {\n ...base,\n expression,\n inputsObservedForChanges: deriveObservedInputs(expression, fields, functions),\n };\n });\n }\n\n /** Single mutation path: store the new list and notify the parent. */\n #commit(next: FormControlCustomValidatorsInterface[]): void {\n this.value = next;\n this.markAsTouched();\n this.stateChanges.next();\n this.valueChanged.emit([...next]);\n }\n}\n","<section class=\"lib-validators-config__list\">\n <h5 class=\"lib-validators-config__title\">Validation rules</h5>\n\n <p class=\"lib-validators-config__hint\">\n <mat-icon class=\"lib-validators-config__hint-icon\">lightbulb</mat-icon>\n <span>Each rule shows its message when its condition is true — describe when the entry is\n <strong>wrong</strong>.</span>\n </p>\n\n <mat-chip-listbox [disabled]=\"disabled\" aria-label=\"Validation rules\">\n @for (validator of value; track trackValidator(validator)) {\n <mat-chip-option\n class=\"lib-validators-config__chip\"\n [selected]=\"isEditing(validator)\"\n (click)=\"editV(validator)\"\n >\n <span class=\"lib-validators-config__chip-label\">\n {{ validatorLabel(validator) | titlecase }}\n </span>\n\n @if (isEditing(validator)) {\n <mat-icon matChipTrailingIcon>check_circle</mat-icon>\n } @else {\n <button matChipRemove [attr.aria-label]=\"'remove validator'\" (click)=\"remove(validator)\">\n <mat-icon>cancel</mat-icon>\n </button>\n }\n </mat-chip-option>\n }\n\n @if (!edit()) {\n <mat-chip-option\n class=\"lib-validators-config__add\"\n matTooltip=\"Add a new validation rule\"\n [selectable]=\"false\"\n [disabled]=\"disabled\"\n (click)=\"addValidator()\"\n >\n Add rule\n <mat-icon matChipTrailingIcon>add</mat-icon>\n </mat-chip-option>\n }\n </mat-chip-listbox>\n</section>\n\n@if (edit(); as draft) {\n<mat-card class=\"lib-validators-config__editor\" (click)=\"$event.stopPropagation()\">\n <label class=\"lib-validators-config__field\">\n <span class=\"lib-validators-config__f-label\">Error message</span>\n <textarea\n class=\"lib-validators-config__control lib-validators-config__textarea\"\n rows=\"2\"\n [value]=\"draft.message\"\n (input)=\"onTextChange($event, 'message')\"\n placeholder=\"e.g. End date must be after the start date\"\n ></textarea>\n </label>\n\n <div class=\"lib-validators-config__condition-head\">\n <span class=\"lib-validators-config__f-label\">Show this error when</span>\n @if (!raw() && group().conditions.length > 1) {\n <div class=\"lib-validators-config__match\">\n <mat-button-toggle-group\n class=\"lib-validators-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 <span class=\"lib-validators-config__muted\">of these match</span>\n </div>\n }\n </div>\n\n @if (raw()) {\n <label class=\"lib-validators-config__field\">\n <span class=\"lib-validators-config__f-label\">Expression</span>\n <textarea\n class=\"lib-validators-config__control lib-validators-config__textarea lib-validators-config__mono\"\n rows=\"2\"\n [value]=\"draft.expression\"\n (input)=\"onTextChange($event, 'expression')\"\n placeholder='e.g. endDate < startDate'\n ></textarea>\n </label>\n @if (syntaxError(); as error) {\n <p class=\"lib-validators-config__error\">\n <mat-icon class=\"lib-validators-config__error-icon\">error_outline</mat-icon>\n <span>{{ error }}</span>\n </p>\n } @else {\n <p class=\"lib-validators-config__sub-hint\">\n True means the entry is invalid. Reference a field by its name; comparisons use\n <code>===</code>, <code>&gt;</code>, <code>includes</code> …\n </p>\n }\n } @else {\n @if (fieldOptions().length === 0) {\n <p class=\"lib-validators-config__sub-hint\">\n No fields available yet — switch to Advanced to type an expression.\n </p>\n }\n @for (cond of group().conditions; track $index; let first = $first) {\n @if (!first) {\n <div class=\"lib-validators-config__connector\" aria-hidden=\"true\">\n <span>{{ group().connector === '&&' ? 'AND' : 'OR' }}</span>\n </div>\n }\n <div class=\"lib-validators-config__cond\">\n <div class=\"lib-validators-config__cond-body\">\n <label class=\"lib-validators-config__field\">\n <span class=\"lib-validators-config__f-label\">Field</span>\n <select\n class=\"lib-validators-config__control\"\n [class.lib-validators-config__control--invalid]=\"!cond.field\"\n (change)=\"updateCondition($index, { field: inputValue($event) })\"\n >\n <option value=\"\" disabled [selected]=\"!cond.field\">Choose a field</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\">\n {{ f.label }}{{ f.isSelf ? ' (this field)' : '' }}\n </option>\n }\n </optgroup>\n }\n @if (listFields().length) {\n <optgroup label=\"List fields (totalled)\">\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 <div class=\"lib-validators-config__cond-pair\">\n <label class=\"lib-validators-config__field\">\n <span class=\"lib-validators-config__f-label\">Condition</span>\n <select\n class=\"lib-validators-config__control\"\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-validators-config__field\">\n <span class=\"lib-validators-config__f-label\">\n {{ cond.compareTo === 'field' ? 'Other field' : 'Value' }}\n </span>\n <div class=\"lib-validators-config__value\">\n @if (cond.compareTo === 'field') {\n <select\n class=\"lib-validators-config__control\"\n [class.lib-validators-config__control--invalid]=\"!cond.value\"\n (change)=\"updateCondition($index, { value: inputValue($event) })\"\n >\n <option value=\"\" disabled [selected]=\"!cond.value\">Choose a field</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\">\n {{ f.label }}{{ f.isSelf ? ' (this field)' : '' }}\n </option>\n }\n </optgroup>\n }\n @if (listFields().length) {\n <optgroup label=\"List fields (totalled)\">\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-validators-config__control\"\n [class.lib-validators-config__control--invalid]=\"!cond.value\"\n [value]=\"cond.value\"\n (input)=\"updateCondition($index, { value: inputValue($event) })\"\n placeholder=\"e.g. 18\"\n />\n }\n <button\n type=\"button\"\n class=\"lib-validators-config__value-toggle\"\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 </div>\n </div>\n </div>\n </div>\n\n <button\n type=\"button\"\n class=\"lib-validators-config__cond-remove\"\n mat-icon-button\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 }\n\n <button type=\"button\" class=\"lib-validators-config__link\" (click)=\"addCondition()\">\n <mat-icon>add</mat-icon> Add condition\n </button>\n }\n\n @if (referencedListFields().length) {\n <div class=\"lib-validators-config__lists\">\n <span class=\"lib-validators-config__f-label\">Combine each list</span>\n <p class=\"lib-validators-config__sub-hint\">\n A list field has many rows. Choose how to reduce it to one value when comparing against a\n single field or value — optional when comparing two lists.\n </p>\n @for (f of referencedListFields(); track f.variable) {\n <div\n class=\"lib-validators-config__list-row\"\n [class.lib-validators-config__list-row--unset]=\"\n isAggregateRequired(f.variable) && !currentFunction(f.variable)\n \"\n >\n <span class=\"lib-validators-config__list-name\">\n {{ f.label }}\n @if (!isAggregateRequired(f.variable)) {\n <span class=\"lib-validators-config__list-optional\">optional</span>\n }\n </span>\n <div class=\"lib-validators-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-validators-config__agg-chip\"\n [class.lib-validators-config__agg-chip--on]=\"currentFunction(f.variable) === agg.value\"\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 (draft.expression) {\n <div class=\"lib-validators-config__preview\">\n <span class=\"lib-validators-config__f-label\">Generated</span>\n <code>{{ draft.expression }}</code>\n </div>\n }\n\n <div class=\"lib-validators-config__override\">\n <mat-slide-toggle\n name=\"canOverride\"\n [checked]=\"draft.canOverride\"\n (change)=\"setCanOverride($event.checked)\"\n >\n <span class=\"lib-validators-config__toggle-label\">Users can override this rule</span>\n </mat-slide-toggle>\n <span class=\"lib-validators-config__sub-hint\">\n @if (draft.canOverride) { Shown as a warning — the form can still be submitted. } @else { Blocks\n submission until the entry is fixed. }\n </span>\n </div>\n\n <div class=\"lib-validators-config__foot\">\n @if (raw()) {\n <button\n type=\"button\"\n class=\"lib-validators-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-validators-config__link\" (click)=\"useRaw()\">\n <mat-icon>code</mat-icon> Advanced\n </button>\n }\n </div>\n\n @if (saveHint(); as hint) {\n <p class=\"lib-validators-config__save-hint\">\n <mat-icon class=\"lib-validators-config__save-hint-icon\">info</mat-icon>\n <span>{{ hint }}</span>\n </p>\n }\n\n <mat-toolbar class=\"lib-validators-config__toolbar\">\n <span class=\"lib-validators-config__spacer\"></span>\n <button mat-button (click)=\"closeEditor()\">Close</button>\n <button mat-raised-button color=\"accent\" [disabled]=\"!canSave()\" (click)=\"saveVariable()\">\n Save rule\n </button>\n </mat-toolbar>\n</mat-card>\n}\n"],"names":["uuidv4","i1","i2","i3","i4","i5","i6","i8","i9"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA;AACA,MAAM,eAAe,GAAgC,IAAI,GAAG,CAC1D,mBAAmB,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,WA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