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.
- package/fesm2022/{ngx-t-forms-api-endpoint-config.component-CCwUtGOH.mjs → ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs} +10 -10
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-BbS1dY0l.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-auto-complete-input-element.component-BUCFidjW.mjs → ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs} +9 -9
- 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
- package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs +189 -0
- package/fesm2022/ngx-t-forms-autofillToken-D-BYfzxR.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-basic-input-input-element.component-C92Y7CW_.mjs → ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs} +16 -8
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs +603 -0
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-Cn_rxXMX.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-chip-options-creator-editor.component-CWJMjBoK.mjs → ngx-t-forms-chip-options-creator-editor.component-CGm5tgsp.mjs} +2 -2
- 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
- package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs +99 -0
- package/fesm2022/ngx-t-forms-clamp-probe.directive-DMUdeVrM.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-zauBVptA.mjs → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-conditional-display-config.component-zauBVptA.mjs.map → ngx-t-forms-conditional-display-config.component-DIMIWTKj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-C096Ib2V.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-DKb3E9gA.mjs} +4 -4
- 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
- package/fesm2022/{ngx-t-forms-data-source-picker.component-WkSQqjd-.mjs → ngx-t-forms-data-source-picker.component-BG_sr5VH.mjs} +8 -8
- 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
- package/fesm2022/{ngx-t-forms-date-picker-input-element.component-Dtzq25sw.mjs → ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs} +10 -10
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-vUlUuzJ0.mjs.map +1 -0
- 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
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-YVE_s-7Y.mjs.map +1 -0
- 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
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-BlOS8NdF.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs +623 -0
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-u2UUPdAo.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-document-picker.component-CvATcveO.mjs → ngx-t-forms-document-picker.component-DOYyRgh4.mjs} +44 -262
- package/fesm2022/ngx-t-forms-document-picker.component-DOYyRgh4.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-editor-input-element.component-BqofP5-4.mjs → ngx-t-forms-editor-input-element.component-BvZPNjQX.mjs} +6 -6
- 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
- package/fesm2022/{ngx-t-forms-file-upload-input-element.component-BAQx2BLX.mjs → ngx-t-forms-file-upload-input-element.component-CONELqoi.mjs} +10 -10
- 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
- package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs +248 -0
- package/fesm2022/ngx-t-forms-form-copy-lint.component-TCSe-27-.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-form-input-selector.component-M6O7-j2Q.mjs → ngx-t-forms-form-input-selector.component-Bdkuzw0R.mjs} +2 -2
- 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
- package/fesm2022/{ngx-t-forms-form-json-view.component-Dd-EMosV.mjs → ngx-t-forms-form-json-view.component-CDcbgWgN.mjs} +2 -2
- 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
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-B1dYMlCC.mjs → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-form-section-stepper.component-B1dYMlCC.mjs.map → ngx-t-forms-form-section-stepper.component-CqLSI8zP.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-forms-builder-menu.component-S2qfSAT-.mjs → ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs} +185 -15
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-DFCVe_Fq.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs +187 -0
- package/fesm2022/ngx-t-forms-forms-native-date-adapter-h6fClNMS.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-geo-location.component-whY7YIMk.mjs → ngx-t-forms-geo-location.component-DA3ATrvw.mjs} +8 -8
- package/fesm2022/{ngx-t-forms-geo-location.component-whY7YIMk.mjs.map → ngx-t-forms-geo-location.component-DA3ATrvw.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-header-template-editor.component-BLn_-jPM.mjs → ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs} +13 -5
- package/fesm2022/ngx-t-forms-header-template-editor.component-B9Cj8dOI.mjs.map +1 -0
- 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
- 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
- package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs +2 -0
- package/fesm2022/ngx-t-forms-index-CSXX8RTm.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-custom.component-CGz6j56m.mjs → ngx-t-forms-input-custom.component-CqIr5wpy.mjs} +148 -27
- package/fesm2022/ngx-t-forms-input-custom.component-CqIr5wpy.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-input-editor.component-DxrkUbed.mjs → ngx-t-forms-input-editor.component-DU2sgo4i.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-input-editor.component-DxrkUbed.mjs.map → ngx-t-forms-input-editor.component-DU2sgo4i.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-map-mat-options-keys-Cu_L5CRA.mjs → ngx-t-forms-map-mat-options-keys-WfFq_0tS.mjs} +2 -2
- 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
- package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-B98Hv4M1.mjs → ngx-t-forms-mat-chip-list-editor.component-CKnvqeix.mjs} +2 -2
- 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
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CSnHK6ZR.mjs → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-missing-form-configs.component-CSnHK6ZR.mjs.map → ngx-t-forms-missing-form-configs.component-B5dDbmpj.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs +37 -0
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-97tHCSyK.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-mscoa-config.component-CBqzX9H7.mjs → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs} +10 -10
- package/fesm2022/{ngx-t-forms-mscoa-config.component-CBqzX9H7.mjs.map → ngx-t-forms-mscoa-config.component-BtLd7F2n.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-mscoa-error-display.component-BDPi6w2E.mjs.map → ngx-t-forms-mscoa-error-display.component-Bmt1vboD.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-Cr1HXTjG.mjs → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs} +9 -9
- package/fesm2022/{ngx-t-forms-mscoa-segment-config.component-Cr1HXTjG.mjs.map → ngx-t-forms-mscoa-segment-config.component-DrzpixbK.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-mscoa-temporary-hint.component-g7DosiVb.mjs → ngx-t-forms-mscoa-temporary-hint.component-B1Z-IXSL.mjs} +3 -3
- 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
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs +3592 -0
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-ddpips7E.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs → ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs} +17432 -6875
- package/fesm2022/ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs +596 -0
- package/fesm2022/ngx-t-forms-paginated-selection-table-B7TyhJnh.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-payload-template-editor.component-Dx0pI0A1.mjs → ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs} +13 -5
- package/fesm2022/ngx-t-forms-payload-template-editor.component-DVL4aBuG.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-VySkMHQI.mjs → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs} +15 -15
- package/fesm2022/{ngx-t-forms-pipeline-generator.component-VySkMHQI.mjs.map → ngx-t-forms-pipeline-generator.component-DpqipW6G.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-quill-input.component-BLaPFcJE.mjs → ngx-t-forms-quill-input.component-x9CHGOJy.mjs} +2 -2
- package/fesm2022/{ngx-t-forms-quill-input.component-BLaPFcJE.mjs.map → ngx-t-forms-quill-input.component-x9CHGOJy.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-record-list-manager.component-qlizX9F4.mjs → ngx-t-forms-record-list-manager.component-BGg86NER.mjs} +7 -7
- package/fesm2022/{ngx-t-forms-record-list-manager.component-qlizX9F4.mjs.map → ngx-t-forms-record-list-manager.component-BGg86NER.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs +281 -0
- package/fesm2022/ngx-t-forms-required-inputs.component-CI9nLVXe.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-CLYe2Lf_.mjs → ngx-t-forms-rest-api-call-setup.component-B4LzPwxg.mjs} +5 -5
- 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
- package/fesm2022/{ngx-t-forms-section-report.component-foLHlD-I.mjs → ngx-t-forms-section-report.component-BS2CV_xl.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-section-report.component-foLHlD-I.mjs.map → ngx-t-forms-section-report.component-BS2CV_xl.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs +281 -0
- package/fesm2022/ngx-t-forms-select-input-element.component-C5qjqCXW.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-D4luMX5c.mjs → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs} +6 -6
- package/fesm2022/{ngx-t-forms-selection-options-editor.component-D4luMX5c.mjs.map → ngx-t-forms-selection-options-editor.component-B6sYvtcj.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs} +3 -3
- package/fesm2022/{ngx-t-forms-t-workflow-picker.component-D0ttyEex.mjs.map → ngx-t-forms-t-workflow-picker.component-xDbl63v1.mjs.map} +1 -1
- package/fesm2022/ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs +161 -0
- package/fesm2022/ngx-t-forms-textarea-input-element.component-ri0r0ujE.mjs.map +1 -0
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs +124 -0
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CXUqCipx.mjs.map +1 -0
- package/fesm2022/{ngx-t-forms-token-text-input.component-BAjGepTM.mjs → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs} +4 -4
- package/fesm2022/{ngx-t-forms-token-text-input.component-BAjGepTM.mjs.map → ngx-t-forms-token-text-input.component-BWmoGQfi.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-validators-config.component-DVB88bgW.mjs → ngx-t-forms-validators-config.component-DEm9M5s9.mjs} +5 -5
- package/fesm2022/{ngx-t-forms-validators-config.component-DVB88bgW.mjs.map → ngx-t-forms-validators-config.component-DEm9M5s9.mjs.map} +1 -1
- package/fesm2022/{ngx-t-forms-workflow-adjudication.component-LoF_fpHu.mjs → ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs} +96 -35
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-BOC9Z40E.mjs.map +1 -0
- package/fesm2022/ngx-t-forms.mjs +1 -1
- package/package.json +2 -2
- package/types/ngx-t-forms.d.ts +2864 -168
- package/fesm2022/ngx-t-forms-api-endpoint-config.component-CCwUtGOH.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-basic-input-input-element.component-C92Y7CW_.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-33ZARq4R.mjs +0 -603
- package/fesm2022/ngx-t-forms-calculated-field-rules.component-33ZARq4R.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-picker-input-element.component-Dtzq25sw.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-range-picker-input-element.component-W8KV-zoC.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-date-time-picker-input-element.component-CQXZDwAo.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-3LcpNBQI.mjs +0 -373
- package/fesm2022/ngx-t-forms-document-list-label-config-editor.component-3LcpNBQI.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-document-picker.component-CvATcveO.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-forms-builder-menu.component-S2qfSAT-.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-header-template-editor.component-BLn_-jPM.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-index-BnK4nGDh.mjs +0 -2
- package/fesm2022/ngx-t-forms-index-BnK4nGDh.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-input-custom.component-CGz6j56m.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-BUj7wGyx.mjs +0 -38
- package/fesm2022/ngx-t-forms-mscoa-chart-toolbar.component-BUj7wGyx.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CfZLcuuu.mjs +0 -2336
- package/fesm2022/ngx-t-forms-multiple-input-input-element.component-CfZLcuuu.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-ngx-t-forms-Dt4iPwb-.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-paginated-selection-table-lMTD1N6B.mjs +0 -555
- package/fesm2022/ngx-t-forms-paginated-selection-table-lMTD1N6B.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-payload-template-editor.component-Dx0pI0A1.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-required-inputs.component-DY37Qrnj.mjs +0 -271
- package/fesm2022/ngx-t-forms-required-inputs.component-DY37Qrnj.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-select-input-element.component-CvrNfvXa.mjs +0 -160
- package/fesm2022/ngx-t-forms-select-input-element.component-CvrNfvXa.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-textarea-input-element.component-BWyxWDvp.mjs +0 -95
- package/fesm2022/ngx-t-forms-textarea-input-element.component-BWyxWDvp.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CpYC2ivQ.mjs +0 -93
- package/fesm2022/ngx-t-forms-toggle-input-element.component-CpYC2ivQ.mjs.map +0 -1
- package/fesm2022/ngx-t-forms-workflow-adjudication.component-LoF_fpHu.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-t-forms-auto-complete-input-element.component-BUCFidjW.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/core/auto-complet-reactive-input/auto-complet-reactive-input.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/core/auto-complet-reactive-input/auto-complet-reactive-input.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n OnInit,\r\n ViewEncapsulation,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { NgControl, ReactiveFormsModule } from '@angular/forms';\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\nimport { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { MatAutocomplete, MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { Subject, delay, map, merge, of, switchMap } from 'rxjs';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n controlType: 'lib-auto-complet-reactive-input',\r\n nextId: 0,\r\n};\r\n\r\ntype PendingValue = { readonly value: string | number | Date; readonly debounce: boolean };\r\n\r\n@Component({\r\n selector: 'lib-auto-complet-reactive-input',\r\n imports: [\r\n ReactiveFormsModule,\r\n MatAutocompleteModule,\r\n MatInputModule,\r\n ],\r\n host: {\r\n '[class.floating]': 'shouldLabelFloat',\r\n '[id]': 'id',\r\n },\r\n providers: [{ provide: MatFormFieldControl, useExisting: AutoCompletReactiveInputComponent }],\r\n templateUrl: './auto-complet-reactive-input.component.html',\r\n styleUrl: './auto-complet-reactive-input.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n})\r\nexport class AutoCompletReactiveInputComponent extends BaseCustomInput<string | number | Date> implements OnInit {\r\n override get empty(): boolean {\r\n return !this.value;\r\n }\r\n override get shouldLabelFloat(): boolean {\r\n return true;\r\n }\r\n\r\n readonly auto = input.required<MatAutocomplete>();\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n\r\n readonly #destroyRef = inject(DestroyRef);\r\n readonly #debounceTime = 300;\r\n readonly #typedValue = new Subject<string>();\r\n readonly #selectedValue = new Subject<string | number | Date>();\r\n\r\n constructor() {\r\n super(\r\n inject(NgControl, { self: true, optional: true })!,\r\n inject(ElementRef),\r\n customInputConfig,\r\n );\r\n }\r\n\r\n ngOnInit(): void {\r\n // The trigger lives on the inner <input>, which carries no NgControl, so its\r\n // own ControlValueAccessor hook is a no-op and it writes the DOM value\r\n // directly (no `input` event). Bridge `optionSelected` into the same write\r\n // path the keystrokes use, otherwise picking an option never reaches the\r\n // form control.\r\n merge(\r\n this.#typedValue.pipe(map((value): PendingValue => ({ value, debounce: true }))),\r\n this.#selectedValue.pipe(map((value): PendingValue => ({ value, debounce: false }))),\r\n )\r\n .pipe(\r\n // `switchMap` cancels a still-pending keystroke when an option is picked,\r\n // so a selection made inside the debounce window is not overwritten by\r\n // the partially typed text that opened the panel.\r\n switchMap(({ value, debounce }) =>\r\n debounce ? of(value).pipe(delay(this.#debounceTime)) : of(value),\r\n ),\r\n takeUntilDestroyed(this.#destroyRef),\r\n )\r\n .subscribe(value => {\r\n this.value = value;\r\n this.stateChanges.next();\r\n this.onChange(this.value);\r\n });\r\n\r\n this.auto()\r\n .optionSelected.pipe(takeUntilDestroyed(this.#destroyRef))\r\n .subscribe(event => {\r\n this.markAsTouched();\r\n this.#selectedValue.next(event.option.value);\r\n });\r\n }\r\n\r\n protected onInputChange($event: Event): void {\r\n const target = $event.target as HTMLInputElement | null;\r\n this.#typedValue.next(target?.value ?? '');\r\n }\r\n}\r\n","<input [readonly]=\"inputConfig().readonly || inputConfig().disabled\" [pattern]=\"inputConfig().pattern || ''\"\r\n [required]=\"!!inputConfig().required\" [attr.maxlength]=\"inputConfig().maxLength\"\r\n [attr.minlength]=\"inputConfig().minLength\"\r\n [type]=\"inputConfig().type || 'text'\"\r\n (input)=\"onInputChange($event)\"\r\n [value]=\"value\"\r\n\r\n [min]=\"inputConfig().min\" [max]=\"inputConfig().max\" autocomplete=\"on\"\r\n [matAutocomplete]=\"auto()\"\r\n matInput />\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatOptionModule } from '@angular/material/core';\r\nimport type { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { AutoCompletReactiveInputComponent } from './core/auto-complet-reactive-input/auto-complet-reactive-input.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/** Wraps a reactive auto-complete control inside a `mat-form-field`. */\r\n@Component({\r\n selector: 'lib-auto-complete-input-element',\r\n templateUrl: './auto-complete-input-element.component.html',\r\n styleUrl: './auto-complete-input-element.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n MatAutocompleteModule,\r\n MatOptionModule,\r\n AutoCompletReactiveInputComponent,\r\n TFormInputStatusComponent,\r\n ],\r\n})\r\nexport class AutoCompleteInputElementComponent {\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly reload = output<void>();\r\n\r\n protected readonly errorMessage = computed(() =>\r\n getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n\r\n // Internal `any[]` mirrors the legacy getter shape; the upstream\r\n // `matOptions.options` is a (FormInputBasicOptionInterface | DynamicObjectInterface)[]\r\n // union that resolves to `{ id; value; label }` at runtime. Phase 4 will tighten.\r\n protected readonly options = computed<any[]>(\r\n () => this.inputConfig().matOptions?.options ?? [],\r\n );\r\n}\r\n","<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-auto-complet-reactive-input\r\n [inputConfig]=\"inputConfig\"\r\n [required]=\"inputConfig.required\"\r\n [formControlName]=\"inputConfig.id\"\r\n [auto]=\"auto\"\r\n ></lib-auto-complet-reactive-input>\r\n\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n @for (option of options(); track option.id) {\r\n <mat-option [value]=\"option.value\">{{ option.label }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint [matTooltip]=\"inputConfig.hintLabel || ''\" class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"top: 0\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding-left: 5px\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</form>\r\n"],"names":["i4","i6","i7"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,iBAAiB,GAA0B;AAC/C,IAAA,WAAW,EAAE,iCAAiC;AAC9C,IAAA,MAAM,EAAE,CAAC;CACV;AAqBK,MAAO,iCAAkC,SAAQ,eAAuC,CAAA;AAC5F,IAAA,IAAa,KAAK,GAAA;AAChB,QAAA,OAAO,CAAC,IAAI,CAAC,KAAK;IACpB;AACA,IAAA,IAAa,gBAAgB,GAAA;AAC3B,QAAA,OAAO,IAAI;IACb;AAKS,IAAA,WAAW;AACX,IAAA,aAAa;AACb,IAAA,WAAW;AACX,IAAA,cAAc;AAEvB,IAAA,WAAA,GAAA;QACE,KAAK,CACH,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAE,EAClD,MAAM,CA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;kBAjB7C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iCAAiC,EAAA,eAAA,EAG1B,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,mBAAmB;wBACnB,kBAAkB;wBAClB,aAAa;wBACb,eAAe;wBACf,gBAAgB;wBAChB,qBAAqB;wBACrB,eAAe;wBACf,iCAAiC;wBACjC,yBAAyB;AAC1B,qBAAA,EAAA,QAAA,EAAA,yhFAAA,EAAA,MAAA,EAAA,CAAA,oJAAA,CAAA,EAAA;;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-auto-complete-input-element.component-B8eluIrh.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/core/auto-complet-reactive-input/auto-complet-reactive-input.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/core/auto-complet-reactive-input/auto-complet-reactive-input.component.html","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/auto-complete-input-element/auto-complete-input-element.component.html"],"sourcesContent":["import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n OnInit,\r\n ViewEncapsulation,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { NgControl, ReactiveFormsModule } from '@angular/forms';\r\nimport { BaseCustomInput, BaseCustomInputConfig } from '../../../../../../services/core/t-input-controller/functions/baseCustomInput';\r\nimport { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { MatFormFieldControl } from '@angular/material/form-field';\r\nimport { MatAutocomplete, MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { Subject, delay, map, merge, of, switchMap } from 'rxjs';\r\n\r\nconst customInputConfig: BaseCustomInputConfig = {\r\n controlType: 'lib-auto-complet-reactive-input',\r\n nextId: 0,\r\n};\r\n\r\ntype PendingValue = { readonly value: string | number | Date; readonly debounce: boolean };\r\n\r\n@Component({\r\n selector: 'lib-auto-complet-reactive-input',\r\n imports: [\r\n ReactiveFormsModule,\r\n MatAutocompleteModule,\r\n MatInputModule,\r\n ],\r\n host: {\r\n '[class.floating]': 'shouldLabelFloat',\r\n '[id]': 'id',\r\n },\r\n providers: [{ provide: MatFormFieldControl, useExisting: AutoCompletReactiveInputComponent }],\r\n templateUrl: './auto-complet-reactive-input.component.html',\r\n styleUrl: './auto-complet-reactive-input.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.Emulated,\r\n})\r\nexport class AutoCompletReactiveInputComponent extends BaseCustomInput<string | number | Date> implements OnInit {\r\n override get empty(): boolean {\r\n return !this.value;\r\n }\r\n override get shouldLabelFloat(): boolean {\r\n return true;\r\n }\r\n\r\n readonly auto = input.required<MatAutocomplete>();\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n\r\n readonly #destroyRef = inject(DestroyRef);\r\n readonly #debounceTime = 300;\r\n readonly #typedValue = new Subject<string>();\r\n readonly #selectedValue = new Subject<string | number | Date>();\r\n\r\n constructor() {\r\n super(\r\n inject(NgControl, { self: true, optional: true })!,\r\n inject(ElementRef),\r\n customInputConfig,\r\n );\r\n }\r\n\r\n ngOnInit(): void {\r\n // The trigger lives on the inner <input>, which carries no NgControl, so its\r\n // own ControlValueAccessor hook is a no-op and it writes the DOM value\r\n // directly (no `input` event). Bridge `optionSelected` into the same write\r\n // path the keystrokes use, otherwise picking an option never reaches the\r\n // form control.\r\n merge(\r\n this.#typedValue.pipe(map((value): PendingValue => ({ value, debounce: true }))),\r\n this.#selectedValue.pipe(map((value): PendingValue => ({ value, debounce: false }))),\r\n )\r\n .pipe(\r\n // `switchMap` cancels a still-pending keystroke when an option is picked,\r\n // so a selection made inside the debounce window is not overwritten by\r\n // the partially typed text that opened the panel.\r\n switchMap(({ value, debounce }) =>\r\n debounce ? of(value).pipe(delay(this.#debounceTime)) : of(value),\r\n ),\r\n takeUntilDestroyed(this.#destroyRef),\r\n )\r\n .subscribe(value => {\r\n this.value = value;\r\n this.stateChanges.next();\r\n this.onChange(this.value);\r\n });\r\n\r\n this.auto()\r\n .optionSelected.pipe(takeUntilDestroyed(this.#destroyRef))\r\n .subscribe(event => {\r\n this.markAsTouched();\r\n this.#selectedValue.next(event.option.value);\r\n });\r\n }\r\n\r\n protected onInputChange($event: Event): void {\r\n const target = $event.target as HTMLInputElement | null;\r\n this.#typedValue.next(target?.value ?? '');\r\n }\r\n}\r\n","<input [readonly]=\"inputConfig().readonly || inputConfig().disabled\" [pattern]=\"inputConfig().pattern || ''\"\r\n [required]=\"!!inputConfig().required\" [attr.maxlength]=\"inputConfig().maxLength\"\r\n [attr.minlength]=\"inputConfig().minLength\"\r\n [type]=\"inputConfig().type || 'text'\"\r\n (input)=\"onInputChange($event)\"\r\n [value]=\"value\"\r\n\r\n [min]=\"inputConfig().min\" [max]=\"inputConfig().max\" autocomplete=\"on\"\r\n [matAutocomplete]=\"auto()\"\r\n matInput />\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\nimport { MatAutocompleteModule } from '@angular/material/autocomplete';\r\nimport { MatOptionModule } from '@angular/material/core';\r\nimport type { ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { AutoCompletReactiveInputComponent } from './core/auto-complet-reactive-input/auto-complet-reactive-input.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\n\r\n/** Wraps a reactive auto-complete control inside a `mat-form-field`. */\r\n@Component({\r\n selector: 'lib-auto-complete-input-element',\r\n templateUrl: './auto-complete-input-element.component.html',\r\n styleUrl: './auto-complete-input-element.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [\r\n ReactiveFormsModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n MatAutocompleteModule,\r\n MatOptionModule,\r\n AutoCompletReactiveInputComponent,\r\n TFormInputStatusComponent,\r\n ],\r\n})\r\nexport class AutoCompleteInputElementComponent {\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n readonly reload = output<void>();\r\n\r\n protected readonly errorMessage = computed(() =>\r\n getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n\r\n // Internal `any[]` mirrors the legacy getter shape; the upstream\r\n // `matOptions.options` is a (FormInputBasicOptionInterface | DynamicObjectInterface)[]\r\n // union that resolves to `{ id; value; label }` at runtime. Phase 4 will tighten.\r\n protected readonly options = computed<any[]>(\r\n () => this.inputConfig().matOptions?.options ?? [],\r\n );\r\n}\r\n","<form [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as inputConfig) {\r\n <mat-form-field [appearance]=\"inputConfig.appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig.label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig\"></lib-t-form-input-status>\r\n </mat-label>\r\n\r\n <lib-auto-complet-reactive-input\r\n [inputConfig]=\"inputConfig\"\r\n [required]=\"inputConfig.required\"\r\n [formControlName]=\"inputConfig.id\"\r\n [auto]=\"auto\"\r\n ></lib-auto-complet-reactive-input>\r\n\r\n <mat-autocomplete autoActiveFirstOption #auto=\"matAutocomplete\">\r\n @for (option of options(); track option.id) {\r\n <mat-option [value]=\"option.value\">{{ option.label }}</mat-option>\r\n }\r\n </mat-autocomplete>\r\n\r\n @if (inputConfig.hintLabel || inputConfig.temporaryHint) {\r\n <mat-hint [matTooltip]=\"inputConfig.hintLabel || ''\" class=\"inputHint\">\r\n {{ inputConfig.temporaryHint || inputConfig.hintLabel }}\r\n </mat-hint>\r\n }\r\n\r\n @if (inputConfig.canReload?.canReload) {\r\n <button\r\n mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig.canReload.emit()\"\r\n matSuffix\r\n >\r\n <mat-icon style=\"color: var(--mat-sys-primary)\">sync</mat-icon>\r\n </button>\r\n }\r\n\r\n @if (!!errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{ errorMessage() }}</mat-error>\r\n }\r\n\r\n @if (inputConfig.prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig.prefixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.suffixIcon && inputConfig.id !== 'password') {\r\n <mat-icon matSuffix>{{ inputConfig.suffixIcon }}</mat-icon>\r\n }\r\n\r\n @if (inputConfig.prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig.prefixText }}</span>\r\n }\r\n @if (inputConfig.suffixText) {\r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig.suffixText }}</span>\r\n }\r\n\r\n @if (inputConfig.maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig.id]?.value?.length || 0) + '/' + inputConfig.maxLength }}\r\n </mat-hint>\r\n }\r\n </mat-form-field>\r\n }\r\n</form>\r\n"],"names":["i2","i4","i6","i7"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAM,iBAAiB,GAA0B;AAC/C,IAAA,WAAW,EAAE,iCAAiC;AAC9C,IAAA,MAAM,EAAE,CAAC;CACV;AAqBK,MAAO,iCAAkC,SAAQ,eAAuC,CAAA;AAC5F,IAAA,IAAa,KAAK,GAAA;AAChB,QAAA,OA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AAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACrB,eAAe,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACf,iCAAiC,6GACjC,yBAAyB,EAAA,QAAA,EAAA,yBAAA,EAAA,MAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;4FAGhB,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAjB7C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iCAAiC,EAAA,eAAA,EAG1B,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC;wBACP,mBAAmB;wBACnB,kBAAkB;wBAClB,aAAa;wBACb,eAAe;wBACf,gBAAgB;wBAChB,qBAAqB;wBACrB,eAAe;wBACf,iCAAiC;wBACjC,yBAAyB;AAC1B,qBAAA,EAAA,QAAA,EAAA,kiFAAA,EAAA,MAAA,EAAA,CAAA,oJAAA,CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { AutocompleteOptions, InputTypes } from 'ngx-t-forms-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The browser-autofill half of what a column declares.
|
|
5
|
+
*
|
|
6
|
+
* **The gap this closes.** Every column reached the DOM with `autocomplete="on"`
|
|
7
|
+
* or `"off"` — the only two values the authoring model offers — so a browser or
|
|
8
|
+
* password manager had nothing but its own guesswork to decide what, if
|
|
9
|
+
* anything, a field could be filled with. `on` means "you may"; it never says
|
|
10
|
+
* "with what". The HTML standard's autofill field names (`email`, `given-name`,
|
|
11
|
+
* `postal-code`, …) do say, and a browser given one skips its heuristics and
|
|
12
|
+
* fills from that slot of the saved profile — on the first field of a form as
|
|
13
|
+
* readily as on the fifth, where the heuristics would not even start.
|
|
14
|
+
*
|
|
15
|
+
* This file derives that field name from what the author already wrote: the
|
|
16
|
+
* column's `type` first (an `email` column is an email), then the words of its
|
|
17
|
+
* `formControlName` and `label`. It only ever sharpens a permissive `on`; an
|
|
18
|
+
* author's `off` is final, because the one thing worse than a field the browser
|
|
19
|
+
* cannot fill is a reference number or a one-time code it fills wrongly.
|
|
20
|
+
*
|
|
21
|
+
* **Precision over coverage.** A token is emitted only on a confident signal.
|
|
22
|
+
* "Project name" is not a person's name, "Supplier number" is not an
|
|
23
|
+
* organisation, and both are left at `on` — a wrong suggestion is noise the
|
|
24
|
+
* user has to dismiss on every visit, whereas no suggestion costs nothing.
|
|
25
|
+
*
|
|
26
|
+
* Pure functions with no Angular or DOM dependency, so they are equally usable
|
|
27
|
+
* from a component, a renderer, or a test.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* The `autocomplete` attribute a column should carry.
|
|
31
|
+
*
|
|
32
|
+
* `off` is honoured as written. Otherwise the declared `type` decides where it
|
|
33
|
+
* can (`email`, `tel`, `url`, `password`), and the words of `formControlName`
|
|
34
|
+
* and `label` decide where it cannot — a `text` column labelled "Postal code" is
|
|
35
|
+
* a postal code. Anything unrecognised is `on`, which is what every column
|
|
36
|
+
* carried before.
|
|
37
|
+
*
|
|
38
|
+
* @param column - The column, or nothing (which resolves to `on`).
|
|
39
|
+
* @returns A value for the `autocomplete` attribute.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* resolveAutocompleteToken({ type: 'email' }); // 'email'
|
|
43
|
+
* resolveAutocompleteToken({ formControlName: 'firstName' }); // 'given-name'
|
|
44
|
+
* resolveAutocompleteToken({ label: 'Supplier number' }); // 'on'
|
|
45
|
+
* resolveAutocompleteToken({ label: 'Email', autocomplete: 'off' }); // 'off'
|
|
46
|
+
*/
|
|
47
|
+
function resolveAutocompleteToken(column) {
|
|
48
|
+
if (!column)
|
|
49
|
+
return 'on';
|
|
50
|
+
if (column.autocomplete === AutocompleteOptions.Off)
|
|
51
|
+
return 'off';
|
|
52
|
+
const words = wordsOf(column.formControlName, column.label);
|
|
53
|
+
return tokenForType(column.type, words) ?? tokenForWords(words) ?? 'on';
|
|
54
|
+
}
|
|
55
|
+
function wordsOf(...sources) {
|
|
56
|
+
const phrases = sources
|
|
57
|
+
.filter((s) => typeof s === 'string' && s.trim() !== '')
|
|
58
|
+
.map(splitWords)
|
|
59
|
+
.filter((p) => p.length > 0);
|
|
60
|
+
return { phrases, set: new Set(phrases.flat()) };
|
|
61
|
+
}
|
|
62
|
+
function splitWords(text) {
|
|
63
|
+
return text
|
|
64
|
+
.replace(/([a-z0-9])([A-Z])/g, '$1 $2')
|
|
65
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')
|
|
66
|
+
.replace(/([a-zA-Z])([0-9])/g, '$1 $2')
|
|
67
|
+
.toLowerCase()
|
|
68
|
+
.split(/[^a-z0-9]+/)
|
|
69
|
+
.filter((w) => w !== '');
|
|
70
|
+
}
|
|
71
|
+
function has(w, word) {
|
|
72
|
+
return w.set.has(word);
|
|
73
|
+
}
|
|
74
|
+
function hasAny(w, words) {
|
|
75
|
+
return words.some((word) => w.set.has(word));
|
|
76
|
+
}
|
|
77
|
+
/** Whether the wording is nothing but this one word: `name` / "Name" is, "Project name" is not. */
|
|
78
|
+
function only(w, word) {
|
|
79
|
+
return w.set.size === 1 && w.set.has(word);
|
|
80
|
+
}
|
|
81
|
+
/** Whether these words appear consecutively, in order, within one source. */
|
|
82
|
+
function seq(w, ...words) {
|
|
83
|
+
return w.phrases.some((phrase) => {
|
|
84
|
+
for (let start = 0; start + words.length <= phrase.length; start++) {
|
|
85
|
+
if (words.every((word, offset) => phrase[start + offset] === word))
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
return false;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
// ---------------------------------------------------------------------------
|
|
92
|
+
// From the declared type
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
/** Wording that makes a password field the one being set rather than the one being checked. */
|
|
95
|
+
const NEW_PASSWORD_WORDS = [
|
|
96
|
+
'new', 'confirm', 'confirmation', 'create', 'repeat', 'retype', 'reenter', 'verify', 'again',
|
|
97
|
+
];
|
|
98
|
+
const BIRTH_WORDS = ['dob', 'birthday', 'birthdate'];
|
|
99
|
+
function isBirthDate(w) {
|
|
100
|
+
return hasAny(w, BIRTH_WORDS) || seq(w, 'date', 'of', 'birth') || seq(w, 'birth', 'date');
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* The token a declared type settles on its own. A `date` is only a birthday
|
|
104
|
+
* when its wording says so; every other temporal and the plain types decide
|
|
105
|
+
* nothing here and fall through to the wording.
|
|
106
|
+
*/
|
|
107
|
+
function tokenForType(type, w) {
|
|
108
|
+
switch (typeof type === 'string' ? type.toLowerCase() : '') {
|
|
109
|
+
case InputTypes.Email:
|
|
110
|
+
return 'email';
|
|
111
|
+
case InputTypes.Tel:
|
|
112
|
+
return 'tel';
|
|
113
|
+
case InputTypes.Url:
|
|
114
|
+
return 'url';
|
|
115
|
+
case InputTypes.Password:
|
|
116
|
+
return hasAny(w, NEW_PASSWORD_WORDS) ? 'new-password' : 'current-password';
|
|
117
|
+
case InputTypes.Date:
|
|
118
|
+
return isBirthDate(w) ? 'bday' : null;
|
|
119
|
+
default:
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
// From the wording
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
const TEL_WORDS = [
|
|
127
|
+
'phone', 'telephone', 'mobile', 'cell', 'cellphone', 'cellular', 'tel', 'whatsapp',
|
|
128
|
+
];
|
|
129
|
+
const URL_WORDS = ['website', 'url', 'homepage'];
|
|
130
|
+
const POSTAL_WORDS = ['postcode', 'postalcode', 'zip', 'zipcode'];
|
|
131
|
+
/** An "address" that is not a place, and so never a street address. */
|
|
132
|
+
const NOT_A_PLACE = ['email', 'ip', 'mac', 'web', 'url', 'wallet'];
|
|
133
|
+
/** Wording that, alone or before "name", names an organisation. */
|
|
134
|
+
const ORGANIZATION_WORDS = [
|
|
135
|
+
'company', 'organisation', 'organization', 'employer', 'supplier', 'vendor', 'business',
|
|
136
|
+
'firm', 'institution', 'enterprise', 'municipality',
|
|
137
|
+
];
|
|
138
|
+
/** Qualifiers that make a "… name" an organisation's: "Trading name", "Registered name". */
|
|
139
|
+
const ORGANIZATION_NAME_QUALIFIERS = ['trading', 'registered', 'legal', 'entity'];
|
|
140
|
+
/** Owners that make a "… name" a person's: "Contact name", "Applicant name", "Full name". */
|
|
141
|
+
const PERSON_NAME_OWNERS = [
|
|
142
|
+
'full', 'contact', 'applicant', 'customer', 'client', 'person', 'your', 'employee', 'candidate',
|
|
143
|
+
'beneficiary', 'representative', 'signatory', 'requester', 'requestor', 'authorised', 'authorized',
|
|
144
|
+
];
|
|
145
|
+
function isPlace(w) {
|
|
146
|
+
return has(w, 'address') && !hasAny(w, NOT_A_PLACE);
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* The wording rules, first match wins. Ordered so that the more specific reading
|
|
150
|
+
* is tried first: a contact detail before a place, a place's parts before the
|
|
151
|
+
* whole, an organisation's name before a person's, and a person's parts before
|
|
152
|
+
* the full name.
|
|
153
|
+
*/
|
|
154
|
+
const WORD_RULES = [
|
|
155
|
+
['email', (w) => has(w, 'email') || seq(w, 'e', 'mail')],
|
|
156
|
+
['tel', (w) => hasAny(w, TEL_WORDS) || seq(w, 'contact', 'number') || seq(w, 'contact', 'no')],
|
|
157
|
+
['url', (w) => hasAny(w, URL_WORDS) || seq(w, 'web', 'site') || seq(w, 'web', 'address')],
|
|
158
|
+
['one-time-code', (w) => has(w, 'otp') || seq(w, 'one', 'time') || seq(w, 'verification', 'code') || seq(w, 'sms', 'code')],
|
|
159
|
+
['username', (w) => hasAny(w, ['username', 'login']) || seq(w, 'user', 'name')],
|
|
160
|
+
['bday', isBirthDate],
|
|
161
|
+
// "Name and surname" is one full name, not a surname — read before the parts.
|
|
162
|
+
['name', (w) => seq(w, 'name', 'and', 'surname') || seq(w, 'names', 'and', 'surname') || seq(w, 'initials', 'and', 'surname')],
|
|
163
|
+
['given-name', (w) => hasAny(w, ['firstname', 'forename', 'forenames'])
|
|
164
|
+
|| seq(w, 'first', 'name') || seq(w, 'first', 'names')
|
|
165
|
+
|| seq(w, 'given', 'name') || seq(w, 'given', 'names')],
|
|
166
|
+
['family-name', (w) => hasAny(w, ['lastname', 'surname']) || seq(w, 'last', 'name') || seq(w, 'family', 'name')],
|
|
167
|
+
['additional-name', (w) => has(w, 'middlename') || seq(w, 'middle', 'name') || seq(w, 'middle', 'names')],
|
|
168
|
+
['postal-code', (w) => hasAny(w, POSTAL_WORDS) || seq(w, 'postal', 'code') || seq(w, 'post', 'code') || seq(w, 'zip', 'code')],
|
|
169
|
+
['country-name', (w) => has(w, 'country')],
|
|
170
|
+
['address-level1', (w) => has(w, 'province') || only(w, 'state')],
|
|
171
|
+
['address-level2', (w) => hasAny(w, ['city', 'town'])],
|
|
172
|
+
['address-level3', (w) => has(w, 'suburb')],
|
|
173
|
+
['address-line2', (w) => isPlace(w) && (has(w, '2') || has(w, 'two'))],
|
|
174
|
+
['address-line1', (w) => has(w, 'street') || (isPlace(w) && (has(w, '1') || has(w, 'one')))],
|
|
175
|
+
['street-address', isPlace],
|
|
176
|
+
['organization-title', (w) => hasAny(w, ['jobtitle', 'designation', 'occupation']) || seq(w, 'job', 'title')],
|
|
177
|
+
['organization', (w) => ORGANIZATION_WORDS.some((o) => only(w, o) || seq(w, o, 'name') || seq(w, 'name', 'of', o) || seq(w, 'name', 'of', 'the', o))
|
|
178
|
+
|| ORGANIZATION_NAME_QUALIFIERS.some((q) => seq(w, q, 'name'))],
|
|
179
|
+
['name', (w) => only(w, 'name') || only(w, 'names') || has(w, 'fullname')
|
|
180
|
+
|| PERSON_NAME_OWNERS.some((o) => seq(w, o, 'name') || seq(w, o, 'names') || seq(w, o, 'person')
|
|
181
|
+
|| seq(w, 'name', 'of', o) || seq(w, 'name', 'of', 'the', o))],
|
|
182
|
+
];
|
|
183
|
+
function tokenForWords(w) {
|
|
184
|
+
const hit = WORD_RULES.find(([, matches]) => matches(w));
|
|
185
|
+
return hit ? hit[0] : null;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { resolveAutocompleteToken as r };
|
|
189
|
+
//# sourceMappingURL=ngx-t-forms-autofillToken-D-BYfzxR.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-autofillToken-D-BYfzxR.mjs","sources":["../../../projects/ngx-t-forms/src/lib/shared/functions/autofillToken.ts"],"sourcesContent":["/**\n * @file The browser-autofill half of what a column declares.\n *\n * **The gap this closes.** Every column reached the DOM with `autocomplete=\"on\"`\n * or `\"off\"` — the only two values the authoring model offers — so a browser or\n * password manager had nothing but its own guesswork to decide what, if\n * anything, a field could be filled with. `on` means \"you may\"; it never says\n * \"with what\". The HTML standard's autofill field names (`email`, `given-name`,\n * `postal-code`, …) do say, and a browser given one skips its heuristics and\n * fills from that slot of the saved profile — on the first field of a form as\n * readily as on the fifth, where the heuristics would not even start.\n *\n * This file derives that field name from what the author already wrote: the\n * column's `type` first (an `email` column is an email), then the words of its\n * `formControlName` and `label`. It only ever sharpens a permissive `on`; an\n * author's `off` is final, because the one thing worse than a field the browser\n * cannot fill is a reference number or a one-time code it fills wrongly.\n *\n * **Precision over coverage.** A token is emitted only on a confident signal.\n * \"Project name\" is not a person's name, \"Supplier number\" is not an\n * organisation, and both are left at `on` — a wrong suggestion is noise the\n * user has to dismiss on every visit, whereas no suggestion costs nothing.\n *\n * Pure functions with no Angular or DOM dependency, so they are equally usable\n * from a component, a renderer, or a test.\n */\nimport { AutocompleteOptions, InputTypes } from 'ngx-t-forms-types';\n\n/** The members of a column the resolver reads. Structural, so any column shape qualifies. */\nexport interface AutofillColumn {\n /** The declared input type, in any casing. */\n readonly type?: string;\n /** The author's `on` / `off`. Anything but `off` is read as permission. */\n readonly autocomplete?: string;\n /** The author's key for the value — usually the most deliberate wording available. */\n readonly formControlName?: string;\n /** What the person filling the form reads. */\n readonly label?: string;\n}\n\n/**\n * The HTML autofill field names this resolver can emit: the subset of the\n * standard's list a column's type or wording can signal with confidence, plus\n * the standard's own `on` (\"fill it if you can work out what it is\") and `off`.\n */\nexport type AutocompleteToken =\n | 'on'\n | 'off'\n | 'email'\n | 'tel'\n | 'url'\n | 'username'\n | 'current-password'\n | 'new-password'\n | 'one-time-code'\n | 'name'\n | 'given-name'\n | 'additional-name'\n | 'family-name'\n | 'organization'\n | 'organization-title'\n | 'street-address'\n | 'address-line1'\n | 'address-line2'\n | 'address-level1'\n | 'address-level2'\n | 'address-level3'\n | 'postal-code'\n | 'country-name'\n | 'bday';\n\n/**\n * The `autocomplete` attribute a column should carry.\n *\n * `off` is honoured as written. Otherwise the declared `type` decides where it\n * can (`email`, `tel`, `url`, `password`), and the words of `formControlName`\n * and `label` decide where it cannot — a `text` column labelled \"Postal code\" is\n * a postal code. Anything unrecognised is `on`, which is what every column\n * carried before.\n *\n * @param column - The column, or nothing (which resolves to `on`).\n * @returns A value for the `autocomplete` attribute.\n *\n * @example\n * resolveAutocompleteToken({ type: 'email' }); // 'email'\n * resolveAutocompleteToken({ formControlName: 'firstName' }); // 'given-name'\n * resolveAutocompleteToken({ label: 'Supplier number' }); // 'on'\n * resolveAutocompleteToken({ label: 'Email', autocomplete: 'off' }); // 'off'\n */\nexport function resolveAutocompleteToken(\n column: AutofillColumn | undefined | null,\n): AutocompleteToken {\n if (!column) return 'on';\n if (column.autocomplete === AutocompleteOptions.Off) return 'off';\n\n const words = wordsOf(column.formControlName, column.label);\n return tokenForType(column.type, words) ?? tokenForWords(words) ?? 'on';\n}\n\n// ---------------------------------------------------------------------------\n// Words\n// ---------------------------------------------------------------------------\n\n/**\n * The words of a column's wording, lower-cased and split on case, digits and\n * punctuation (`supplierEmail` → `supplier email`, `address1` → `address 1`),\n * kept per source so a phrase is never read across the join between the key\n * and the label: a key of `first` and a label of \"Name\" are not a first name.\n */\ninterface WordBag {\n readonly phrases: ReadonlyArray<readonly string[]>;\n readonly set: ReadonlySet<string>;\n}\n\nfunction wordsOf(...sources: ReadonlyArray<string | undefined>): WordBag {\n const phrases = sources\n .filter((s): s is string => typeof s === 'string' && s.trim() !== '')\n .map(splitWords)\n .filter((p) => p.length > 0);\n return { phrases, set: new Set(phrases.flat()) };\n}\n\nfunction splitWords(text: string): string[] {\n return text\n .replace(/([a-z0-9])([A-Z])/g, '$1 $2')\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1 $2')\n .replace(/([a-zA-Z])([0-9])/g, '$1 $2')\n .toLowerCase()\n .split(/[^a-z0-9]+/)\n .filter((w) => w !== '');\n}\n\nfunction has(w: WordBag, word: string): boolean {\n return w.set.has(word);\n}\n\nfunction hasAny(w: WordBag, words: readonly string[]): boolean {\n return words.some((word) => w.set.has(word));\n}\n\n/** Whether the wording is nothing but this one word: `name` / \"Name\" is, \"Project name\" is not. */\nfunction only(w: WordBag, word: string): boolean {\n return w.set.size === 1 && w.set.has(word);\n}\n\n/** Whether these words appear consecutively, in order, within one source. */\nfunction seq(w: WordBag, ...words: readonly string[]): boolean {\n return w.phrases.some((phrase) => {\n for (let start = 0; start + words.length <= phrase.length; start++) {\n if (words.every((word, offset) => phrase[start + offset] === word)) return true;\n }\n return false;\n });\n}\n\n// ---------------------------------------------------------------------------\n// From the declared type\n// ---------------------------------------------------------------------------\n\n/** Wording that makes a password field the one being set rather than the one being checked. */\nconst NEW_PASSWORD_WORDS: readonly string[] = [\n 'new', 'confirm', 'confirmation', 'create', 'repeat', 'retype', 'reenter', 'verify', 'again',\n];\n\nconst BIRTH_WORDS: readonly string[] = ['dob', 'birthday', 'birthdate'];\n\nfunction isBirthDate(w: WordBag): boolean {\n return hasAny(w, BIRTH_WORDS) || seq(w, 'date', 'of', 'birth') || seq(w, 'birth', 'date');\n}\n\n/**\n * The token a declared type settles on its own. A `date` is only a birthday\n * when its wording says so; every other temporal and the plain types decide\n * nothing here and fall through to the wording.\n */\nfunction tokenForType(type: string | undefined, w: WordBag): AutocompleteToken | null {\n switch (typeof type === 'string' ? type.toLowerCase() : '') {\n case InputTypes.Email:\n return 'email';\n case InputTypes.Tel:\n return 'tel';\n case InputTypes.Url:\n return 'url';\n case InputTypes.Password:\n return hasAny(w, NEW_PASSWORD_WORDS) ? 'new-password' : 'current-password';\n case InputTypes.Date:\n return isBirthDate(w) ? 'bday' : null;\n default:\n return null;\n }\n}\n\n// ---------------------------------------------------------------------------\n// From the wording\n// ---------------------------------------------------------------------------\n\nconst TEL_WORDS: readonly string[] = [\n 'phone', 'telephone', 'mobile', 'cell', 'cellphone', 'cellular', 'tel', 'whatsapp',\n];\nconst URL_WORDS: readonly string[] = ['website', 'url', 'homepage'];\nconst POSTAL_WORDS: readonly string[] = ['postcode', 'postalcode', 'zip', 'zipcode'];\n\n/** An \"address\" that is not a place, and so never a street address. */\nconst NOT_A_PLACE: readonly string[] = ['email', 'ip', 'mac', 'web', 'url', 'wallet'];\n\n/** Wording that, alone or before \"name\", names an organisation. */\nconst ORGANIZATION_WORDS: readonly string[] = [\n 'company', 'organisation', 'organization', 'employer', 'supplier', 'vendor', 'business',\n 'firm', 'institution', 'enterprise', 'municipality',\n];\n/** Qualifiers that make a \"… name\" an organisation's: \"Trading name\", \"Registered name\". */\nconst ORGANIZATION_NAME_QUALIFIERS: readonly string[] = ['trading', 'registered', 'legal', 'entity'];\n\n/** Owners that make a \"… name\" a person's: \"Contact name\", \"Applicant name\", \"Full name\". */\nconst PERSON_NAME_OWNERS: readonly string[] = [\n 'full', 'contact', 'applicant', 'customer', 'client', 'person', 'your', 'employee', 'candidate',\n 'beneficiary', 'representative', 'signatory', 'requester', 'requestor', 'authorised', 'authorized',\n];\n\nfunction isPlace(w: WordBag): boolean {\n return has(w, 'address') && !hasAny(w, NOT_A_PLACE);\n}\n\n/**\n * The wording rules, first match wins. Ordered so that the more specific reading\n * is tried first: a contact detail before a place, a place's parts before the\n * whole, an organisation's name before a person's, and a person's parts before\n * the full name.\n */\nconst WORD_RULES: ReadonlyArray<readonly [AutocompleteToken, (w: WordBag) => boolean]> = [\n ['email', (w) => has(w, 'email') || seq(w, 'e', 'mail')],\n ['tel', (w) => hasAny(w, TEL_WORDS) || seq(w, 'contact', 'number') || seq(w, 'contact', 'no')],\n ['url', (w) => hasAny(w, URL_WORDS) || seq(w, 'web', 'site') || seq(w, 'web', 'address')],\n ['one-time-code', (w) =>\n has(w, 'otp') || seq(w, 'one', 'time') || seq(w, 'verification', 'code') || seq(w, 'sms', 'code')],\n ['username', (w) => hasAny(w, ['username', 'login']) || seq(w, 'user', 'name')],\n ['bday', isBirthDate],\n // \"Name and surname\" is one full name, not a surname — read before the parts.\n ['name', (w) =>\n seq(w, 'name', 'and', 'surname') || seq(w, 'names', 'and', 'surname') || seq(w, 'initials', 'and', 'surname')],\n ['given-name', (w) =>\n hasAny(w, ['firstname', 'forename', 'forenames'])\n || seq(w, 'first', 'name') || seq(w, 'first', 'names')\n || seq(w, 'given', 'name') || seq(w, 'given', 'names')],\n ['family-name', (w) =>\n hasAny(w, ['lastname', 'surname']) || seq(w, 'last', 'name') || seq(w, 'family', 'name')],\n ['additional-name', (w) => has(w, 'middlename') || seq(w, 'middle', 'name') || seq(w, 'middle', 'names')],\n ['postal-code', (w) =>\n hasAny(w, POSTAL_WORDS) || seq(w, 'postal', 'code') || seq(w, 'post', 'code') || seq(w, 'zip', 'code')],\n ['country-name', (w) => has(w, 'country')],\n ['address-level1', (w) => has(w, 'province') || only(w, 'state')],\n ['address-level2', (w) => hasAny(w, ['city', 'town'])],\n ['address-level3', (w) => has(w, 'suburb')],\n ['address-line2', (w) => isPlace(w) && (has(w, '2') || has(w, 'two'))],\n ['address-line1', (w) => has(w, 'street') || (isPlace(w) && (has(w, '1') || has(w, 'one')))],\n ['street-address', isPlace],\n ['organization-title', (w) =>\n hasAny(w, ['jobtitle', 'designation', 'occupation']) || seq(w, 'job', 'title')],\n ['organization', (w) =>\n ORGANIZATION_WORDS.some((o) =>\n only(w, o) || seq(w, o, 'name') || seq(w, 'name', 'of', o) || seq(w, 'name', 'of', 'the', o))\n || ORGANIZATION_NAME_QUALIFIERS.some((q) => seq(w, q, 'name'))],\n ['name', (w) =>\n only(w, 'name') || only(w, 'names') || has(w, 'fullname')\n || PERSON_NAME_OWNERS.some((o) =>\n seq(w, o, 'name') || seq(w, o, 'names') || seq(w, o, 'person')\n || seq(w, 'name', 'of', o) || seq(w, 'name', 'of', 'the', o))],\n];\n\nfunction tokenForWords(w: WordBag): AutocompleteToken | null {\n const hit = WORD_RULES.find(([, matches]) => matches(w));\n return hit ? hit[0] : null;\n}\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AA8CH;;;;;;;;;;;;;;;;;AAiBG;AACG,SAAU,wBAAwB,CACtC,MAAyC,EAAA;AAEzC,IAAA,IAAI,CAAC,MAAM;AAAE,QAAA,OAAO,IAAI;AACxB,IAAA,IAAI,MAAM,CAAC,YAAY,KAAK,mBAAmB,CAAC,GAAG;AAAE,QAAA,OAAO,KAAK;AAEjE,IAAA,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,KAAK,CAAC;AAC3D,IAAA,OAAO,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,IAAI,IAAI;AACzE;AAiBA,SAAS,OAAO,CAAC,GAAG,OAA0C,EAAA;IAC5D,MAAM,OAAO,GAAG;AACb,SAAA,MAAM,CAAC,CAAC,CAAC,KAAkB,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;SACnE,GAAG,CAAC,UAAU;AACd,SAAA,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC9B,IAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,GAAG,CAAC,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AG,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ;mBAC1D,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;CACnE;AAED,SAAS,aAAa,CAAC,CAAU,EAAA;AAC/B,IAAA,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,CAAC;AACxD,IAAA,OAAO,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI;AAC5B;;;;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { input, output, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/forms';
|
|
3
|
+
import * as i1$1 from '@angular/forms';
|
|
4
4
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
5
5
|
import * as i2 from '@angular/material/form-field';
|
|
6
6
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
7
7
|
import { MatInputModule } from '@angular/material/input';
|
|
8
8
|
import * as i3 from '@angular/material/icon';
|
|
9
9
|
import { MatIconModule } from '@angular/material/icon';
|
|
10
|
-
import * as
|
|
10
|
+
import * as i1 from '@angular/material/button';
|
|
11
11
|
import { MatButtonModule } from '@angular/material/button';
|
|
12
12
|
import * as i5 from '@angular/material/tooltip';
|
|
13
13
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
14
|
-
import {
|
|
14
|
+
import { a9 as getInputErrorMessage, ah as injectFormsLocalization, aa as TFormInputStatusComponent } from './ngx-t-forms-ngx-t-forms-C1kZpYIM.mjs';
|
|
15
15
|
import { InputPipeTypes } from 'ngx-t-forms-types';
|
|
16
|
-
import { InputCustomComponent } from './ngx-t-forms-input-custom.component-
|
|
16
|
+
import { InputCustomComponent } from './ngx-t-forms-input-custom.component-CqIr5wpy.mjs';
|
|
17
17
|
|
|
18
18
|
class BasicInputInputElementComponent {
|
|
19
19
|
constructor() {
|
|
@@ -27,13 +27,21 @@ class BasicInputInputElementComponent {
|
|
|
27
27
|
const control = this.formGroup().get(this.inputConfig().id);
|
|
28
28
|
return control?.invalid && (control?.touched || control?.dirty);
|
|
29
29
|
}, ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
30
|
+
/** The consumer's localization: the currency a currency column without a code is in. */
|
|
31
|
+
this.#localization = injectFormsLocalization();
|
|
32
|
+
/**
|
|
33
|
+
* The currency code shown before a currency-formatted number: the column's own
|
|
34
|
+
* when the author picked one, otherwise the organisation's.
|
|
35
|
+
*/
|
|
30
36
|
this.currencyPrefix = computed(() => {
|
|
31
37
|
const hasPipe = this.inputConfig().pipe?.pipeType === InputPipeTypes.Currency;
|
|
32
38
|
if (!hasPipe)
|
|
33
39
|
return undefined;
|
|
34
|
-
return this.inputConfig().pipe?.param;
|
|
40
|
+
return this.inputConfig().pipe?.param || this.#localization().currency.code;
|
|
35
41
|
}, ...(ngDevMode ? [{ debugName: "currencyPrefix" }] : /* istanbul ignore next */ []));
|
|
36
42
|
}
|
|
43
|
+
/** The consumer's localization: the currency a currency column without a code is in. */
|
|
44
|
+
#localization;
|
|
37
45
|
passwordStrengthColor(formControlName) {
|
|
38
46
|
const form = this.formGroup();
|
|
39
47
|
const value = form?.value[formControlName];
|
|
@@ -65,7 +73,7 @@ class BasicInputInputElementComponent {
|
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: BasicInputInputElementComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
68
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: BasicInputInputElementComponent, isStandalone: true, selector: "lib-basic-input-input-element", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as classInput) {\r\n <mat-form-field [appearance]=\"inputConfig().appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig().label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig()\"></lib-t-form-input-status>\r\n </mat-label>\r\n @if(currencyPrefix()){\r\n <span style=\"color: var(--mat-sys-primary);padding-right: 4px;\" matTextPrefix>{{currencyPrefix()}} </span>\r\n }\r\n\r\n <lib-input-custom [inputConfig]=\"inputConfig()\" [required]=\"inputConfig().required\"\r\n [formControlName]=\"inputConfig().id\"></lib-input-custom>\r\n\r\n @if(errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{errorMessage()}}</mat-error>\r\n }\r\n <!-- [type]=\"this.inputConfig.showPassword ? 'text' : this.inputConfig.type||'text'\"-->\r\n <!-- @if(classInput.canRefresh){\r\n <button\r\n (click)=\"classInput.refresh()\"\r\n style=\" min-width: 1%;\"\r\n [matTooltip]=\"'Click to refresh this field. This will update any calculated values, fetch latest data from services, or reload available options'\"\r\n color=\"primary\" matSuffix mat-icon-button>\r\n <mat-icon>\r\n sync\r\n </mat-icon>\r\n </button>\r\n } -->\r\n\r\n\r\n @if(inputConfig().hintLabel || classInput.temporaryHint ){\r\n <mat-hint class=\"inputHint\">\r\n {{ classInput.temporaryHint || inputConfig().hintLabel}}\r\n </mat-hint>\r\n }\r\n @if(inputConfig().canReload?.canReload){\r\n <button mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig().canReload?.emit()\" matSuffix>\r\n <mat-icon\r\n style=\"color:var(--mat-sys-primary)\"\r\n >sync</mat-icon>\r\n </button>\r\n }\r\n\r\n\r\n <!-- Prefix Icon -->\r\n @if (inputConfig().prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig().prefixIcon }}</mat-icon>\r\n }\r\n\r\n <!-- Suffix Icon or Password Visibility Toggle -->\r\n <!-- <ng-container *ngIf=\"inputConfig.suffixIcon\">\r\n <mat-icon *ngIf=\"inputConfig.id !== 'password'\" matSuffix>{{ inputConfig.suffixIcon\r\n }}</mat-icon>\r\n <button *ngIf=\"inputConfig.id === 'password'\" (click)=\"classInput.togglePasswordVisibility()\"\r\n mat-icon-button matSuffix>\r\n <mat-icon>{{ classInput.showPassword ? 'remove_red_eye' : 'eye_off' }}</mat-icon>\r\n </button>\r\n </ng-container> -->\r\n\r\n <!-- Prefix & Suffix Text -->\r\n @if (inputConfig().prefixText) {\r\n <span matPrefix style=\"
|
|
76
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.12", type: BasicInputInputElementComponent, isStandalone: true, selector: "lib-basic-input-input-element", inputs: { inputConfig: { classPropertyName: "inputConfig", publicName: "inputConfig", isSignal: true, isRequired: true, transformFunction: null }, formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { reload: "reload" }, ngImport: i0, template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as classInput) {\r\n <mat-form-field [appearance]=\"inputConfig().appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig().label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig()\"></lib-t-form-input-status>\r\n </mat-label>\r\n @if(currencyPrefix()){\r\n <span style=\"color: var(--mat-sys-primary);padding-right: 4px;\" matTextPrefix>{{currencyPrefix()}} </span>\r\n }\r\n\r\n <lib-input-custom [inputConfig]=\"inputConfig()\" [required]=\"inputConfig().required\"\r\n [formControlName]=\"inputConfig().id\"></lib-input-custom>\r\n\r\n @if(errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{errorMessage()}}</mat-error>\r\n }\r\n <!-- [type]=\"this.inputConfig.showPassword ? 'text' : this.inputConfig.type||'text'\"-->\r\n <!-- @if(classInput.canRefresh){\r\n <button\r\n (click)=\"classInput.refresh()\"\r\n style=\" min-width: 1%;\"\r\n [matTooltip]=\"'Click to refresh this field. This will update any calculated values, fetch latest data from services, or reload available options'\"\r\n color=\"primary\" matSuffix mat-icon-button>\r\n <mat-icon>\r\n sync\r\n </mat-icon>\r\n </button>\r\n } -->\r\n\r\n\r\n @if(inputConfig().hintLabel || classInput.temporaryHint ){\r\n <mat-hint class=\"inputHint\">\r\n {{ classInput.temporaryHint || inputConfig().hintLabel}}\r\n </mat-hint>\r\n }\r\n @if(inputConfig().canReload?.canReload){\r\n <button mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig().canReload?.emit()\" matSuffix>\r\n <mat-icon\r\n style=\"color:var(--mat-sys-primary)\"\r\n >sync</mat-icon>\r\n </button>\r\n }\r\n\r\n\r\n <!-- Prefix Icon -->\r\n @if (inputConfig().prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig().prefixIcon }}</mat-icon>\r\n }\r\n\r\n <!-- Suffix Icon or Password Visibility Toggle -->\r\n <!-- <ng-container *ngIf=\"inputConfig.suffixIcon\">\r\n <mat-icon *ngIf=\"inputConfig.id !== 'password'\" matSuffix>{{ inputConfig.suffixIcon\r\n }}</mat-icon>\r\n <button *ngIf=\"inputConfig.id === 'password'\" (click)=\"classInput.togglePasswordVisibility()\"\r\n mat-icon-button matSuffix>\r\n <mat-icon>{{ classInput.showPassword ? 'remove_red_eye' : 'eye_off' }}</mat-icon>\r\n </button>\r\n </ng-container> -->\r\n\r\n <!-- Prefix & Suffix Text -->\r\n @if (inputConfig().prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig().prefixText }}</span>\r\n }\r\n @if (inputConfig().suffixText) {\r\n \r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig().suffixText }}</span>\r\n }\r\n\r\n <!-- Character Count Hint -->\r\n @if (inputConfig().maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig().id]?.value?.length || 0) + '/' + inputConfig().maxLength }}\r\n </mat-hint>\r\n }\r\n\r\n <!-- Password Strength Hint -->\r\n @if (inputConfig().type === 'password') {\r\n <mat-hint [style.color]=\"passwordStrengthColor(inputConfig().id)\"\r\n matTooltip=\"The password should be at least 8 characters long. Have at least one uppercase letter, one lowercase, one digit, one special character.\"\r\n align=\"end\">\r\n {{ checkPasswordStrength(inputConfig().id) }} password\r\n </mat-hint>\r\n }\r\n <!-- @if(inputConfig?.canReload){\r\n <mat-hint align=\"end\">\r\n\r\n <button click=\" canReload.emit()\" style=\" height: 28px;\r\n width: 28px;\r\n padding: 0px;\r\n font-size: 1em;\" [matTooltip]=\"'Reload ' + inputConfig.label +' resources'\" mat-icon-button>\r\n <mat-icon>\r\n sync\r\n </mat-icon>\r\n\r\n </button>\r\n </mat-hint>\r\n\r\n\r\n } -->\r\n </mat-form-field>\r\n }\r\n\r\n\r\n\r\n\r\n</ng-container>\r\n", styles: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"], dependencies: [{ kind: "ngmodule", type: MatFormFieldModule }, { kind: "component", type: i2.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i2.MatLabel, selector: "mat-label" }, { kind: "directive", type: i2.MatHint, selector: "mat-hint", inputs: ["align", "id"] }, { kind: "directive", type: i2.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i2.MatPrefix, selector: "[matPrefix], [matIconPrefix], [matTextPrefix]", inputs: ["matTextPrefix"] }, { kind: "directive", type: i2.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i1.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i5.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: TFormInputStatusComponent, selector: "lib-t-form-input-status", inputs: ["inputConfig"] }, { kind: "component", type: InputCustomComponent, selector: "lib-input-custom", inputs: ["inputConfig"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
69
77
|
}
|
|
70
78
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImport: i0, type: BasicInputInputElementComponent, decorators: [{
|
|
71
79
|
type: Component,
|
|
@@ -78,8 +86,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.12", ngImpo
|
|
|
78
86
|
ReactiveFormsModule,
|
|
79
87
|
TFormInputStatusComponent,
|
|
80
88
|
InputCustomComponent,
|
|
81
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as classInput) {\r\n <mat-form-field [appearance]=\"inputConfig().appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig().label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig()\"></lib-t-form-input-status>\r\n </mat-label>\r\n @if(currencyPrefix()){\r\n <span style=\"color: var(--mat-sys-primary);padding-right: 4px;\" matTextPrefix>{{currencyPrefix()}} </span>\r\n }\r\n\r\n <lib-input-custom [inputConfig]=\"inputConfig()\" [required]=\"inputConfig().required\"\r\n [formControlName]=\"inputConfig().id\"></lib-input-custom>\r\n\r\n @if(errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{errorMessage()}}</mat-error>\r\n }\r\n <!-- [type]=\"this.inputConfig.showPassword ? 'text' : this.inputConfig.type||'text'\"-->\r\n <!-- @if(classInput.canRefresh){\r\n <button\r\n (click)=\"classInput.refresh()\"\r\n style=\" min-width: 1%;\"\r\n [matTooltip]=\"'Click to refresh this field. This will update any calculated values, fetch latest data from services, or reload available options'\"\r\n color=\"primary\" matSuffix mat-icon-button>\r\n <mat-icon>\r\n sync\r\n </mat-icon>\r\n </button>\r\n } -->\r\n\r\n\r\n @if(inputConfig().hintLabel || classInput.temporaryHint ){\r\n <mat-hint class=\"inputHint\">\r\n {{ classInput.temporaryHint || inputConfig().hintLabel}}\r\n </mat-hint>\r\n }\r\n @if(inputConfig().canReload?.canReload){\r\n <button mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig().canReload?.emit()\" matSuffix>\r\n <mat-icon\r\n style=\"color:var(--mat-sys-primary)\"\r\n >sync</mat-icon>\r\n </button>\r\n }\r\n\r\n\r\n <!-- Prefix Icon -->\r\n @if (inputConfig().prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig().prefixIcon }}</mat-icon>\r\n }\r\n\r\n <!-- Suffix Icon or Password Visibility Toggle -->\r\n <!-- <ng-container *ngIf=\"inputConfig.suffixIcon\">\r\n <mat-icon *ngIf=\"inputConfig.id !== 'password'\" matSuffix>{{ inputConfig.suffixIcon\r\n }}</mat-icon>\r\n <button *ngIf=\"inputConfig.id === 'password'\" (click)=\"classInput.togglePasswordVisibility()\"\r\n mat-icon-button matSuffix>\r\n <mat-icon>{{ classInput.showPassword ? 'remove_red_eye' : 'eye_off' }}</mat-icon>\r\n </button>\r\n </ng-container> -->\r\n\r\n <!-- Prefix & Suffix Text -->\r\n @if (inputConfig().prefixText) {\r\n <span matPrefix style=\"
|
|
89
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as classInput) {\r\n <mat-form-field [appearance]=\"inputConfig().appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig().label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig()\"></lib-t-form-input-status>\r\n </mat-label>\r\n @if(currencyPrefix()){\r\n <span style=\"color: var(--mat-sys-primary);padding-right: 4px;\" matTextPrefix>{{currencyPrefix()}} </span>\r\n }\r\n\r\n <lib-input-custom [inputConfig]=\"inputConfig()\" [required]=\"inputConfig().required\"\r\n [formControlName]=\"inputConfig().id\"></lib-input-custom>\r\n\r\n @if(errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{errorMessage()}}</mat-error>\r\n }\r\n <!-- [type]=\"this.inputConfig.showPassword ? 'text' : this.inputConfig.type||'text'\"-->\r\n <!-- @if(classInput.canRefresh){\r\n <button\r\n (click)=\"classInput.refresh()\"\r\n style=\" min-width: 1%;\"\r\n [matTooltip]=\"'Click to refresh this field. This will update any calculated values, fetch latest data from services, or reload available options'\"\r\n color=\"primary\" matSuffix mat-icon-button>\r\n <mat-icon>\r\n sync\r\n </mat-icon>\r\n </button>\r\n } -->\r\n\r\n\r\n @if(inputConfig().hintLabel || classInput.temporaryHint ){\r\n <mat-hint class=\"inputHint\">\r\n {{ classInput.temporaryHint || inputConfig().hintLabel}}\r\n </mat-hint>\r\n }\r\n @if(inputConfig().canReload?.canReload){\r\n <button mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig().canReload?.emit()\" matSuffix>\r\n <mat-icon\r\n style=\"color:var(--mat-sys-primary)\"\r\n >sync</mat-icon>\r\n </button>\r\n }\r\n\r\n\r\n <!-- Prefix Icon -->\r\n @if (inputConfig().prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig().prefixIcon }}</mat-icon>\r\n }\r\n\r\n <!-- Suffix Icon or Password Visibility Toggle -->\r\n <!-- <ng-container *ngIf=\"inputConfig.suffixIcon\">\r\n <mat-icon *ngIf=\"inputConfig.id !== 'password'\" matSuffix>{{ inputConfig.suffixIcon\r\n }}</mat-icon>\r\n <button *ngIf=\"inputConfig.id === 'password'\" (click)=\"classInput.togglePasswordVisibility()\"\r\n mat-icon-button matSuffix>\r\n <mat-icon>{{ classInput.showPassword ? 'remove_red_eye' : 'eye_off' }}</mat-icon>\r\n </button>\r\n </ng-container> -->\r\n\r\n <!-- Prefix & Suffix Text -->\r\n @if (inputConfig().prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig().prefixText }}</span>\r\n }\r\n @if (inputConfig().suffixText) {\r\n \r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig().suffixText }}</span>\r\n }\r\n\r\n <!-- Character Count Hint -->\r\n @if (inputConfig().maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig().id]?.value?.length || 0) + '/' + inputConfig().maxLength }}\r\n </mat-hint>\r\n }\r\n\r\n <!-- Password Strength Hint -->\r\n @if (inputConfig().type === 'password') {\r\n <mat-hint [style.color]=\"passwordStrengthColor(inputConfig().id)\"\r\n matTooltip=\"The password should be at least 8 characters long. Have at least one uppercase letter, one lowercase, one digit, one special character.\"\r\n align=\"end\">\r\n {{ checkPasswordStrength(inputConfig().id) }} password\r\n </mat-hint>\r\n }\r\n <!-- @if(inputConfig?.canReload){\r\n <mat-hint align=\"end\">\r\n\r\n <button click=\" canReload.emit()\" style=\" height: 28px;\r\n width: 28px;\r\n padding: 0px;\r\n font-size: 1em;\" [matTooltip]=\"'Reload ' + inputConfig.label +' resources'\" mat-icon-button>\r\n <mat-icon>\r\n sync\r\n </mat-icon>\r\n\r\n </button>\r\n </mat-hint>\r\n\r\n\r\n } -->\r\n </mat-form-field>\r\n }\r\n\r\n\r\n\r\n\r\n</ng-container>\r\n", styles: ["mat-form-field{width:100%!important}mat-form-field .input-sync-button{display:none}mat-form-field:hover .input-sync-button{display:inline-block}\n"] }]
|
|
82
90
|
}], propDecorators: { inputConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "inputConfig", required: true }] }], formGroup: [{ type: i0.Input, args: [{ isSignal: true, alias: "formGroup", required: true }] }], reload: [{ type: i0.Output, args: ["reload"] }] } });
|
|
83
91
|
|
|
84
92
|
export { BasicInputInputElementComponent };
|
|
85
|
-
//# sourceMappingURL=ngx-t-forms-basic-input-input-element.component-
|
|
93
|
+
//# sourceMappingURL=ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-t-forms-basic-input-input-element.component-SSLXyCz9.mjs","sources":["../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/basic-input-input-element/basic-input-input-element.component.ts","../../../projects/ngx-t-forms/src/lib/components/t-form-input/elements/basic-input-input-element/basic-input-input-element.component.html"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { ReactiveFormsModule, FormGroup, FormControl } from '@angular/forms';\r\n\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatTooltipModule } from '@angular/material/tooltip';\r\n\r\nimport { TFormInputStatusComponent } from '../../../t-form-input-status/t-form-input-status.component';\r\nimport { getInputErrorMessage } from '../../../../services/core/t-input-controller/functions/inputErrorMessage';\r\nimport { InputPipeTypes, ITowerStepColumn } from 'ngx-t-forms-types';\r\nimport { InputCustomComponent } from './core/input-custom/input-custom.component';\r\nimport { injectFormsLocalization } from '../../../../services/core/t-form-localization/inject-forms-localization';\r\n\r\n@Component({\r\n selector: 'lib-basic-input-input-element',\r\n imports: [\r\n MatFormFieldModule,\r\n MatInputModule,\r\n MatIconModule,\r\n MatButtonModule,\r\n MatTooltipModule,\r\n ReactiveFormsModule,\r\n TFormInputStatusComponent,\r\n InputCustomComponent,\r\n ],\r\n templateUrl: './basic-input-input-element.component.html',\r\n styleUrl: './basic-input-input-element.component.css',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class BasicInputInputElementComponent {\r\n\r\n readonly inputConfig = input.required<ITowerStepColumn>();\r\n readonly formGroup = input.required<FormGroup>();\r\n\r\n readonly reload = output<void>();\r\n\r\n protected readonly formControl = computed(\r\n () => this.formGroup().controls[this.inputConfig().id] as FormControl<unknown>,\r\n );\r\n\r\n protected readonly errorMessage = computed(\r\n () => getInputErrorMessage(this.inputConfig(), this.formGroup()),\r\n );\r\n\r\n protected readonly hasError = computed(() => {\r\n // Correctly access the control within the form group\r\n const control = this.formGroup().get(this.inputConfig().id);\r\n return control?.invalid && (control?.touched || control?.dirty);\r\n });\r\n\r\n /** The consumer's localization: the currency a currency column without a code is in. */\r\n readonly #localization = injectFormsLocalization();\r\n\r\n /**\r\n * The currency code shown before a currency-formatted number: the column's own\r\n * when the author picked one, otherwise the organisation's.\r\n */\r\n protected readonly currencyPrefix = computed(() => {\r\n const hasPipe = this.inputConfig().pipe?.pipeType === InputPipeTypes.Currency;\r\n if (!hasPipe) return undefined;\r\n return this.inputConfig().pipe?.param || this.#localization().currency.code;\r\n });\r\n\r\n protected passwordStrengthColor(formControlName: string) {\r\n const form = this.formGroup();\r\n const value: string = form?.value[formControlName];\r\n let strongPassword = new RegExp(\r\n '(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{8,})'\r\n );\r\n let mediumPassword = new RegExp(\r\n '((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{6,}))|((?=.*[a-z])(?=.*[A-Z])(?=.*[^A-Za-z0-9])(?=.{8,}))'\r\n );\r\n if (strongPassword.test(value)) {\r\n return 'var(--ion-color-success)';\r\n } else if (mediumPassword.test(value)) {\r\n return 'var(--ion-color-warning)';\r\n } else {\r\n return 'var(--ion-color-danger)';\r\n }\r\n }\r\n\r\n protected checkPasswordStrength(formControlName: string) {\r\n const form = this.formGroup();\r\n\r\n const value: string = form?.value[formControlName];\r\n let strongPassword = new RegExp(\r\n '(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{8,})'\r\n );\r\n let mediumPassword = new RegExp(\r\n '((?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[^A-Za-z0-9])(?=.{6,}))|((?=.*[a-z])(?=.*[A-Z])(?=.*[^A-Za-z0-9])(?=.{8,}))'\r\n );\r\n if (strongPassword.test(value)) {\r\n return 'strong';\r\n } else if (mediumPassword.test(value)) {\r\n return 'medium';\r\n } else {\r\n return 'weak';\r\n }\r\n\r\n }\r\n}\r\n","<ng-container [formGroup]=\"formGroup()\">\r\n @if (inputConfig(); as classInput) {\r\n <mat-form-field [appearance]=\"inputConfig().appearance || 'fill'\" subscriptSizing=\"dynamic\">\r\n <mat-label>\r\n {{ inputConfig().label }}\r\n <lib-t-form-input-status [inputConfig]=\"inputConfig()\"></lib-t-form-input-status>\r\n </mat-label>\r\n @if(currencyPrefix()){\r\n <span style=\"color: var(--mat-sys-primary);padding-right: 4px;\" matTextPrefix>{{currencyPrefix()}} </span>\r\n }\r\n\r\n <lib-input-custom [inputConfig]=\"inputConfig()\" [required]=\"inputConfig().required\"\r\n [formControlName]=\"inputConfig().id\"></lib-input-custom>\r\n\r\n @if(errorMessage()) {\r\n <mat-error class=\"oneLineTextEllipsis\" matTooltipClass=\"errorToolTip\">{{errorMessage()}}</mat-error>\r\n }\r\n <!-- [type]=\"this.inputConfig.showPassword ? 'text' : this.inputConfig.type||'text'\"-->\r\n <!-- @if(classInput.canRefresh){\r\n <button\r\n (click)=\"classInput.refresh()\"\r\n style=\" min-width: 1%;\"\r\n [matTooltip]=\"'Click to refresh this field. This will update any calculated values, fetch latest data from services, or reload available options'\"\r\n color=\"primary\" matSuffix mat-icon-button>\r\n <mat-icon>\r\n sync\r\n </mat-icon>\r\n </button>\r\n } -->\r\n\r\n\r\n @if(inputConfig().hintLabel || classInput.temporaryHint ){\r\n <mat-hint class=\"inputHint\">\r\n {{ classInput.temporaryHint || inputConfig().hintLabel}}\r\n </mat-hint>\r\n }\r\n @if(inputConfig().canReload?.canReload){\r\n <button mat-icon-button\r\n style=\"margin-right: 4px;\"\r\n matTooltip=\"Click to refresh this field.\"\r\n class=\"input-sync-button\"\r\n (click)=\"inputConfig().canReload?.emit()\" matSuffix>\r\n <mat-icon\r\n style=\"color:var(--mat-sys-primary)\"\r\n >sync</mat-icon>\r\n </button>\r\n }\r\n\r\n\r\n <!-- Prefix Icon -->\r\n @if (inputConfig().prefixIcon) {\r\n <mat-icon matPrefix>{{ inputConfig().prefixIcon }}</mat-icon>\r\n }\r\n\r\n <!-- Suffix Icon or Password Visibility Toggle -->\r\n <!-- <ng-container *ngIf=\"inputConfig.suffixIcon\">\r\n <mat-icon *ngIf=\"inputConfig.id !== 'password'\" matSuffix>{{ inputConfig.suffixIcon\r\n }}</mat-icon>\r\n <button *ngIf=\"inputConfig.id === 'password'\" (click)=\"classInput.togglePasswordVisibility()\"\r\n mat-icon-button matSuffix>\r\n <mat-icon>{{ classInput.showPassword ? 'remove_red_eye' : 'eye_off' }}</mat-icon>\r\n </button>\r\n </ng-container> -->\r\n\r\n <!-- Prefix & Suffix Text -->\r\n @if (inputConfig().prefixText) {\r\n <span matPrefix style=\"padding: 0 12px;\">{{ inputConfig().prefixText }}</span>\r\n }\r\n @if (inputConfig().suffixText) {\r\n \r\n <span matSuffix style=\"padding: 0 12px;\">{{ inputConfig().suffixText }}</span>\r\n }\r\n\r\n <!-- Character Count Hint -->\r\n @if (inputConfig().maxLength && formGroup()) {\r\n <mat-hint align=\"end\">\r\n {{ (formGroup().controls[inputConfig().id]?.value?.length || 0) + '/' + inputConfig().maxLength }}\r\n </mat-hint>\r\n }\r\n\r\n <!-- Password Strength Hint -->\r\n @if (inputConfig().type === 'password') {\r\n <mat-hint [style.color]=\"passwordStrengthColor(inputConfig().id)\"\r\n matTooltip=\"The password should be at least 8 characters long. Have at least one uppercase letter, one lowercase, one digit, one special character.\"\r\n align=\"end\">\r\n {{ checkPasswordStrength(inputConfig().id) }} password\r\n </mat-hint>\r\n }\r\n <!-- @if(inputConfig?.canReload){\r\n <mat-hint align=\"end\">\r\n\r\n <button click=\" canReload.emit()\" style=\" height: 28px;\r\n width: 28px;\r\n padding: 0px;\r\n font-size: 1em;\" [matTooltip]=\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